lolita 3.0.6 → 3.0.7

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.0.6
1
+ 3.0.7
@@ -1 +1 @@
1
- <%= select resource_name, field.name, field.association_values.respond_to?(:call) ? field.association_values.call(self) : field.association_values %>
1
+ <%= select resource_name, field.name, field.association_values.respond_to?(:call) ? field.association_values.call(self) : field.association_values, {:include_blank => field.include_blank} %>
@@ -16,10 +16,12 @@
16
16
  theme_advanced_resizing: true
17
17
  });
18
18
  }
19
- $(function(){
20
- load_tinymce();
21
- })
22
19
  </script>
23
20
  <% end %>
24
21
 
25
- <%= text_area resource_name, field.name %>
22
+ <%= text_area resource_name, field.name %>
23
+ <script type="text/javascript">
24
+ $(function(){
25
+ load_tinymce();
26
+ })
27
+ </script>
@@ -6,12 +6,6 @@
6
6
  <%= form_tag "#", :id=>"tab-form-#{tab.__id__}" do |form| %>
7
7
  <div class="tab-content">
8
8
  <%#= error_messages_for resource #TODO removed in Rails 3, now available as plugin .. %>
9
- <% tab.fields_with_field_set do |fields_or_field,field_set| %>
10
- <% if field_set %>
11
- <%= render_component :"lolita/field_set", :display, :fields=>fields_or_field,:field_set=>field_set %>
12
- <% else %>
13
- <%= render_component :"lolita/field", :display,:field=>fields_or_field %>
14
- <% end %>
15
- <% end %>
9
+ <%= render_component :"lolita/tab", :fields, :tab=>tab %>
16
10
  </div>
17
11
  <% end %>
@@ -0,0 +1,7 @@
1
+ <% tab.fields_with_field_set do |fields_or_field,field_set| %>
2
+ <% if field_set %>
3
+ <%= render_component :"lolita/field_set", :display, :fields=>fields_or_field,:field_set=>field_set %>
4
+ <% else %>
5
+ <%= render_component :"lolita/field", :display,:field=>fields_or_field %>
6
+ <% end %>
7
+ <% end %>
@@ -14,7 +14,14 @@
14
14
 
15
15
  <%= stylesheet_link_tag "lolita/default","lolita/style" %>
16
16
  <%= yield :style %>
17
+ <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.js">
18
+ </script>
19
+ <script>
20
+ window.jQuery || document.write('<script src="/javascripts/jquery-1.5.1.min.js">\x3C/script>')
21
+ </script>
17
22
  <%= javascript_include_tag "modernizr-1.7.min" %>
23
+ <%= javascript_include_tag "rails","lolita/tab","lolita/main" %>
24
+ <%= yield :script %>
18
25
  <%= raw csrf_meta_tag %>
19
26
  </head>
20
27
  <body>
@@ -30,12 +37,5 @@
30
37
  <footer>
31
38
  </footer>
32
39
  </div>
33
- <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.js">
34
- </script>
35
- <script>
36
- window.jQuery || document.write('<script src="/javascripts/jquery-1.5.1.min.js">\x3C/script>')
37
- </script>
38
- <%= javascript_include_tag "rails","lolita/tab","lolita/main" %>
39
- <%= content_for :script %>
40
40
  </body>
41
41
  </html>
@@ -1,17 +1,23 @@
1
1
  module Lolita
2
2
  module Configuration
3
3
  class CollectionField < Lolita::Configuration::Field
4
- lolita_accessor :conditions,:text_method,:value_method,:find_options,:association_type
4
+ lolita_accessor :conditions,:text_method,:value_method,:find_options,:association_type,:include_blank
5
5
 
6
6
 
7
7
  def initialize *args,&block
8
8
  @type="collection"
9
+ @association_type=:one
10
+ @include_blank=true
9
11
  super
10
12
  set_association_type
11
13
  end
12
14
 
13
- def options_for_select &block
14
- @options_for_select=block if block_given?
15
+ def options_for_select=(value=nil)
16
+ @options_for_select=value
17
+ end
18
+
19
+ def options_for_select value=nil, &block
20
+ @options_for_select=value || block if value || block_given?
15
21
  @options_for_select
16
22
  end
17
23
 
@@ -56,11 +56,8 @@ module Lolita
56
56
  field
57
57
  end
58
58
 
59
- # Return all fields in tab. If fields not defined then set default fields.
59
+ # Return all fields in tab.
60
60
  def fields
61
- if @fields.empty?
62
- set_default_fields
63
- end
64
61
  @fields
65
62
  end
66
63
 
@@ -153,10 +150,6 @@ module Lolita
153
150
 
154
151
  private
155
152
 
156
- def set_default_fields
157
- default_fields if @fields.empty?
158
- end
159
-
160
153
  def set_default_attributes
161
154
  @type=@@default_tab_type unless @type
162
155
  @name="tab_#{self.__id__}" unless @name
@@ -10,6 +10,11 @@ module Lolita
10
10
 
11
11
  private
12
12
 
13
+
14
+ def set_default_fields
15
+ default_fields if @fields.empty?
16
+ end
17
+
13
18
  end
14
19
  end
15
20
  end
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{lolita}
8
- s.version = "3.0.6"
8
+ s.version = "3.0.7"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["ITHouse", "Arturs Meisters"]
@@ -64,6 +64,7 @@ Gem::Specification.new do |s|
64
64
  "app/views/components/lolita/tab/_content.html.erb",
65
65
  "app/views/components/lolita/tab/_default.html.erb",
66
66
  "app/views/components/lolita/tab/_display.html.erb",
67
+ "app/views/components/lolita/tab/_fields.html.erb",
67
68
  "app/views/components/lolita/tabs/_display.html.erb",
68
69
  "app/views/lolita/layouts/application.html.erb",
69
70
  "app/views/lolita/layouts/application.html.erb_spec.rb",
@@ -13,7 +13,6 @@ $(function(){
13
13
  data:data,
14
14
  success:function(data){
15
15
  $("#content").html(data);
16
- load_tinymce();
17
16
  }
18
17
  })
19
18
  }
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: lolita
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 3.0.6
5
+ version: 3.0.7
6
6
  platform: ruby
7
7
  authors:
8
8
  - ITHouse
@@ -225,6 +225,7 @@ files:
225
225
  - app/views/components/lolita/tab/_content.html.erb
226
226
  - app/views/components/lolita/tab/_default.html.erb
227
227
  - app/views/components/lolita/tab/_display.html.erb
228
+ - app/views/components/lolita/tab/_fields.html.erb
228
229
  - app/views/components/lolita/tabs/_display.html.erb
229
230
  - app/views/lolita/layouts/application.html.erb
230
231
  - app/views/lolita/layouts/application.html.erb_spec.rb
@@ -461,7 +462,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
461
462
  requirements:
462
463
  - - ">="
463
464
  - !ruby/object:Gem::Version
464
- hash: -890800177
465
+ hash: 85335663
465
466
  segments:
466
467
  - 0
467
468
  version: "0"