inline_forms 1.6.42 → 1.6.43

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NDI4YThkNTYxYWU2YTI5MWIxNTYxM2Y4ZDU3YWViMjZkZDlhNjdjYw==
4
+ OTRlNjAzNDQ2YjYxY2YxNTBiMDgyN2M1ZWRkNGQ2N2E0ODhkOGMyOA==
5
5
  data.tar.gz: !binary |-
6
- YzgxNjNmYzc5MDdhMTkxYzhhYzA3NmI3YzVmYWZjOWJmMDZhNjg0Nw==
6
+ MGE5MjJiYWU1YzQ2MzI0NWNkYmNiNjA3MDA5NjY4ODllNDBjYzA0OA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- OWNmNDAzNzMwMWViMjAyOWIzZDY5ZDE2ZDkyZGIxZmUwMWFlMmZiYjJjNmVm
10
- ODUxNDFiZWM0MTAzMWZmNGNkYzMxM2VjYWRjNGIzMDk1Mzc1NDc3N2YyMzhh
11
- NDEzYWEzMGUzYWJjMzg0YTZiOTYxNGYxMzZmNTBlMTYzNzYxOTg=
9
+ Y2FhODZhMDFkZjY0ODk5NTU5NmI5NmEzMzY1OWI0ZWNiNDczNjg0ZmQ2ODA1
10
+ ODUyODg0ZGYyNjhhZGM1MGEwZTVkMDJlNjFmYzQzNjZiNDY2MzljZDA2YTky
11
+ Y2Q4ZDg4NjZjNTE4NDg0NjcwYmFmNjAzZDBmOThiYzQyNGMzNDI=
12
12
  data.tar.gz: !binary |-
13
- YzQ0MmQ5MGNlNTcxMDdkNzgyYzI4N2Y1MTI4YTAzY2Y1ODIyZDc2ZjYyOGIy
14
- YzNhMjQyZTk3NTQwYmVmNmNhNDNlZjdkMmI0MDFkOGZiODY2NjE0ZWM4ZDJk
15
- YzJiZTY1OWZiNWRhMGI4ODZiMGZlNmI0NjFiODdhMGEwMmRlY2Y=
13
+ MTQwYWFjNGViOTcwYWY1Y2I0NTk1N2IzM2RhMGUzNTQ1YmFmNjI0NzMxMWNj
14
+ ZjUxMjY0OWQ0ZTU5ZWY3ZWMxMWI1OGQ1ZDUwNGI4NTFjNjJjNmQ3MGU3MDZk
15
+ ZmRkYjU3ZWE0ZTM2ZGRlYWRlYmUyY2E2ZGNmNjUyNGE4NGE3Njg=
@@ -6,7 +6,7 @@ def text_field_show(object, attribute)
6
6
  end
7
7
 
8
8
  def text_field_edit(object, attribute)
9
- text_field_tag attribute, (object.send attribute.to_sym), :class => 'input_text_field'
9
+ text_field_tag attribute, (object.send attribute.to_sym), :class => 'input_text_field', :required => true
10
10
  end
11
11
 
12
12
  def text_field_update(object, attribute)
@@ -45,15 +45,16 @@ module InlineFormsHelper
45
45
 
46
46
  # new link
47
47
  def link_to_new_record(model, path_to_new, update_span, parent_class = nil, parent_id = nil, html_class = 'button new_button')
48
- out = ""
49
- out << (link_to "<i class='fi-plus'></i>".html_safe,
50
- send(path_to_new, :update => update_span,
51
- :parent_class => parent_class,
52
- :parent_id => parent_id,
53
- ),
54
- :remote => true,
55
- :class => html_class,
56
- :title => t('inline_forms.view.add_new', :model => model.model_name.human ) )
48
+ out = (link_to "<i class='fi-plus'></i>".html_safe,
49
+ send(path_to_new,
50
+ :update => update_span,
51
+ :parent_class => parent_class,
52
+ :parent_id => parent_id,
53
+ ),
54
+ :remote => true,
55
+ :class => html_class,
56
+ :title => t('inline_forms.view.add_new', :model => model.model_name.human )
57
+ )
57
58
  if cancan_enabled?
58
59
  if can? :create, model.to_s.pluralize.underscore.to_sym
59
60
  if parent_class.nil?
@@ -5,6 +5,7 @@
5
5
  :method => :put, # this is going to the update method!
6
6
  :multipart => true,
7
7
  :class => "edit_form",
8
+ :abide => true,
8
9
  :remote => true do -%>
9
10
  <div class="row collapse">
10
11
  <div class="small-9 columns">
@@ -43,7 +43,7 @@
43
43
  <% objects = objects.paginate :page => params[:page], :per_page => @PER_PAGE || 5, :conditions => conditions %>
44
44
  <% end %>
45
45
 
46
- <%= raw "<div id=\"#{update_span}\">" if ul_needed -%>
46
+ <%= raw "<div class=\"list_container\" id=\"#{update_span}\">" if ul_needed -%>
47
47
  <!-- # list of objects -->
48
48
  <% for object in objects %>
49
49
  <% if parent_class.nil? %>
@@ -1,4 +1,4 @@
1
- <li id="newnew">
1
+ <div class="new_record">
2
2
  <% flash.each do |key, value| %>
3
3
  <div id="flash" class="flash <%= key %>">
4
4
  <ul>
@@ -15,32 +15,31 @@
15
15
  $("#flash").delay(1000).fadeTo('slow', 0.33);
16
16
  });
17
17
  </script>
18
- <%= form_tag send(@Klass.to_s.underscore.pluralize + '_path', :update => @update_span,
19
- :parent_class => @parent_class,
20
- :parent_id => @parent_id ),
21
- :multipart => true, :remote => true, :class => "edit_form" do -%>
22
- <div class="edit_form_field">
23
18
  <div class="row" >
24
19
  <div class="large-12 column object_presentation" >
25
20
  <%= t('inline_forms.view.add_new', :model => @Klass.model_name.human ) -%>
26
21
  </div>
27
22
  </div>
23
+ <%= form_tag send(@Klass.to_s.underscore.pluralize + '_path', :update => @update_span,
24
+ :parent_class => @parent_class,
25
+ :parent_id => @parent_id ),
26
+ :multipart => true, :remote => true, :class => "edit_form" do -%>
28
27
  <% attributes = @inline_forms_attribute_list || @object.inline_forms_attribute_list -%>
29
28
  <% attributes.each do | attribute, name, form_element | -%>
30
29
  <% unless form_element.to_sym == :associated || (cancan_enabled? && cannot?(:read, @Klass.to_s.underscore.pluralize.to_sym, attribute)) -%>
31
30
  <% css_class_id = "attribute_#{attribute}_#{@object.id}" -%>
32
31
  <% if form_element == :header %>
33
- <div class="row" >
32
+ <div class="row form_element_header" >
34
33
  <div class='large-12 column<%= " attribute_name attribute_#{attribute} form_element_#{form_element}" -%>' >
35
34
  <%= @object.class.human_attribute_name(attribute) -%>
36
35
  </div>
37
36
  </div>
38
37
  <% else %>
39
- <div class="row <%= 'has_validations ' if @object.has_validations_for?(attribute) -%>" validation-hint="<%= validation_hints_as_list_for(@object, attribute) -%>">
40
- <div class='large-4 column<%= " attribute_name attribute_#{attribute} form_element_#{form_element}" -%>' >
38
+ <div class="row <%= cycle('odd', 'even') %><%= ' has_validations ' if @object.has_validations_for?(attribute) -%>" validation-hint="<%= validation_hints_as_list_for(@object, attribute) -%>">
39
+ <div class='medium-3 large-3 column<%= " attribute_name attribute_#{attribute} form_element_#{form_element}" -%>' >
41
40
  <%= @object.class.human_attribute_name(attribute) -%>
42
41
  </div>
43
- <div class='large-8 column<%= " attribute_value attribute_#{attribute} form_element_#{form_element}" -%>' >
42
+ <div class='medium-9 large-9 column<%= " attribute_value attribute_#{attribute} form_element_#{form_element}" -%>' >
44
43
  <span id="<%= css_class_id -%>" > <%= send("#{form_element}_edit", @object, attribute) -%> </span>
45
44
  </div>
46
45
  </div>
@@ -49,17 +48,19 @@
49
48
  <% end -%>
50
49
  <%= link_to( send(@Klass.to_s.underscore.pluralize + '_path', :update => @update_span,
51
50
  :parent_class => @parent_class,
52
- :parent_id => @parent_id ),
51
+ :parent_id => @parent_id,
52
+ :ul_needed => true ),
53
53
  :remote => true,
54
- :class => "edit_form_cancel" ) do -%>
55
- <input type="button" name="cancel" value="cancel" />
54
+ ) do -%>
55
+ <input type="button" name="cancel" value="cancel" class="button alert" />
56
56
  <% end %>
57
- <%= submit_tag "ok", :class => "edit_form_submit"-%>
57
+ <%= submit_tag "ok", :class => "button "-%>
58
58
  <div style="clear: both;"></div>
59
59
  <% end %>
60
- </li>
60
+
61
61
  <script type="text/javascript">
62
62
  $(function() {
63
63
  $("#newnew").slideDown(4000);
64
64
  });
65
65
  </script>
66
+ </div>
@@ -1,5 +1,5 @@
1
1
  <% unless @skip %>
2
- <div class="row">
2
+ <div class="row object_presentation">
3
3
  <div class="small-11 column object_presentation">
4
4
  <%= h(@object._presentation) -%>
5
5
  </div>
@@ -14,30 +14,46 @@
14
14
  <% css_class_id = "#{@object.class.name.underscore}_#{@object.id}_#{attribute}" -%>
15
15
  <% if form_element == :header %>
16
16
  <div class="row form_element_header">
17
- <div class='large-12 column<%= " attribute_name attribute_#{attribute} form_element_#{form_element}" -%>' >
17
+ <div class='large-12 column' >
18
18
  <%= @object.class.human_attribute_name(attribute) -%>
19
19
  </div>
20
20
  </div>
21
21
  <% else %>
22
- <div class="row <%= cycle('odd', 'even') %><%= ' has_validations ' if @object.has_validations_for?(attribute) -%>" validation-hint="">
23
- <div class='medium-3 large-3 column<%= " attribute_name attribute_#{attribute} form_element_#{form_element}" -%>' >
24
- <span data-tooltip class="has-tip tip-top" title="<%= validation_hints_as_list_for(@object, attribute) -%>">
25
- <%= @object.class.human_attribute_name(attribute) -%>
26
- </span>
27
- </div>
28
- <div class='medium-9 large-9 column<%= " attribute_value attribute_#{attribute} form_element_#{form_element}" -%>' >
29
- <span id="<%= css_class_id -%>" >
30
- <% if form_element == :associated -%>
31
- <%= render :partial => "inline_forms/list",
32
- :locals => { :parent_class => @object.class,
33
- :parent_id => @object.id,
34
- :attribute => attribute } %>
35
- <% else -%>
22
+ <% if form_element == :associated -%>
23
+ <div class="row form_element_header associated_auto_header">
24
+ <div class='medium-11 large-11 column' >
25
+ <%= @object.class.human_attribute_name(attribute) -%>
26
+ </div>
27
+ <div class='medium-1 large-1 column'>
28
+ <%= link_to_new_record(attribute.to_s.singularize.camelcase.constantize, "new_#{attribute.to_s.underscore.singularize}_path", css_class_id, @object.class, @object.id) -%>
29
+ </div>
30
+ </div>
31
+ <div class="row <%= cycle('odd', 'even') %>">
32
+ <div id="<%= css_class_id -%>" class='small-11 small-centered column' >
33
+ <%= render :partial => "inline_forms/list",
34
+ :locals => { :parent_class => @object.class,
35
+ :parent_id => @object.id,
36
+ :attribute => attribute } %>
37
+ </div>
38
+ </div>
39
+ <% else -%>
40
+ <div class="row <%= cycle('odd', 'even') %>">
41
+ <div class='medium-3 large-3 column' >
42
+ <% if @object.has_validations_for?(attribute) -%>
43
+ <span data-tooltip class="has-tip tip-top" title="<%= validation_hints_as_list_for(@object, attribute) -%>">
44
+ <%= @object.class.human_attribute_name(attribute) -%>
45
+ </span>
46
+ <% else %>
47
+ <%= @object.class.human_attribute_name(attribute) -%>
48
+ <% end %>
49
+ </div>
50
+ <div class='medium-9 large-9 column' >
51
+ <span id="<%= css_class_id -%>" >
36
52
  <%= send("#{form_element}_show", @object, attribute) -%>
37
- <% end -%>
38
- </span>
53
+ </span>
54
+ </div>
39
55
  </div>
40
- </div>
56
+ <% end -%>
41
57
  <% end -%>
42
58
  <% end -%>
43
59
  <% end -%>
@@ -1,4 +1,4 @@
1
1
  # -*- encoding : utf-8 -*-
2
2
  module InlineForms
3
- VERSION = "1.6.42"
3
+ VERSION = "1.6.43"
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: inline_forms
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.42
4
+ version: 1.6.43
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ace Suares
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-10 00:00:00.000000000 Z
11
+ date: 2014-01-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rvm