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 +1 -1
- data/app/views/components/lolita/field/_select.html.erb +1 -1
- data/app/views/components/lolita/field/_text.html.erb +6 -4
- data/app/views/components/lolita/tab/_default.html.erb +1 -7
- data/app/views/components/lolita/tab/_fields.html.erb +7 -0
- data/app/views/lolita/layouts/application.html.erb +7 -7
- data/lib/lolita/configuration/field/collection.rb +9 -3
- data/lib/lolita/configuration/tab.rb +1 -8
- data/lib/lolita/configuration/tab/content.rb +5 -0
- data/lolita.gemspec +2 -1
- data/public/javascripts/lolita/tab.js +0 -1
- metadata +3 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.0.
|
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
|
-
|
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
|
14
|
-
@options_for_select=
|
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.
|
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
|
data/lolita.gemspec
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{lolita}
|
8
|
-
s.version = "3.0.
|
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",
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: lolita
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 3.0.
|
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:
|
465
|
+
hash: 85335663
|
465
466
|
segments:
|
466
467
|
- 0
|
467
468
|
version: "0"
|