locomotive_cms 2.0.0.rc9 → 2.0.0.rc10
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.
- data/Gemfile +6 -5
- data/app/assets/javascripts/locomotive/inline_editor.js.coffee +1 -1
- data/app/assets/javascripts/locomotive/models/custom_field_select_option.js.coffee +3 -0
- data/app/assets/javascripts/locomotive/models/site.js.coffee +2 -1
- data/app/assets/javascripts/locomotive/views/content_entries/_form_view.js.coffee +27 -0
- data/app/assets/javascripts/locomotive/views/content_entries/_popup_form_view.js.coffee +7 -1
- data/app/assets/javascripts/locomotive/views/content_types/_form_view.js.coffee +4 -1
- data/app/assets/javascripts/locomotive/views/content_types/select_options_view.js.coffee +5 -1
- data/app/assets/javascripts/locomotive/views/inline_editor/toolbar_view.js.coffee +0 -2
- data/app/assets/javascripts/locomotive/views/pages/edit_view.js.coffee +3 -0
- data/app/assets/javascripts/locomotive/views/shared/fields/select_view.js.coffee +83 -0
- data/app/assets/stylesheets/locomotive/backoffice/application.css.scss +13 -0
- data/app/assets/stylesheets/locomotive/backoffice/formtastic_changes.css.scss +25 -95
- data/app/assets/stylesheets/locomotive/inline_editor/toolbar.css.scss +1 -1
- data/app/assets/stylesheets/locomotive/shared/_helpers.css.scss +98 -0
- data/app/assets/stylesheets/locomotive/shared/common.css.scss +1 -1
- data/app/controllers/locomotive/current_site_controller.rb +6 -0
- data/app/helpers/locomotive/base_helper.rb +14 -0
- data/app/models/locomotive/content_entry.rb +42 -3
- data/app/models/locomotive/content_type.rb +6 -1
- data/app/models/locomotive/editable_element.rb +9 -0
- data/app/models/locomotive/editable_short_text.rb +9 -0
- data/app/models/locomotive/extensions/page/tree.rb +3 -4
- data/app/presenters/locomotive/content_entry_presenter.rb +4 -2
- data/app/views/locomotive/content_entries/_form.html.haml +2 -1
- data/app/views/locomotive/custom_fields/_form.html.haml +4 -18
- data/app/views/locomotive/custom_fields/_select_templates.html.haml +16 -0
- data/app/views/locomotive/custom_fields/types/_has_many.html.haml +3 -3
- data/app/views/locomotive/custom_fields/types/_select.html.haml +30 -1
- data/app/views/locomotive/notifications/new_content_entry.html.haml +3 -1
- data/app/views/locomotive/public/pages/show_toolbar.html.haml +4 -1
- data/config/locales/admin_ui.de.yml +3 -4
- data/config/locales/admin_ui.en.yml +1 -1
- data/config/locales/admin_ui.fr.yml +4 -4
- data/config/locales/admin_ui.nb.yml +0 -1
- data/config/locales/admin_ui.ru.yml +0 -1
- data/lib/locomotive/custom_fields.rb +12 -0
- data/lib/locomotive/liquid/drops/content_entry.rb +2 -2
- data/lib/locomotive/liquid/drops/content_types.rb +2 -0
- data/lib/locomotive/liquid/tags/editable/short_text.rb +4 -0
- data/lib/locomotive/liquid/tags/inline_editor.rb +14 -12
- data/lib/locomotive/middlewares/inline_editor.rb +20 -15
- data/lib/locomotive/render.rb +94 -40
- data/lib/locomotive/version.rb +1 -1
- data/vendor/assets/javascripts/locomotive/form_submit_notification.js +1 -1
- data/vendor/assets/javascripts/locomotive/toggle.js +9 -8
- data/vendor/assets/stylesheets/locomotive/liquid_mode.css +3 -5
- data/vendor/assets/stylesheets/locomotive/toggle.css.scss +33 -10
- metadata +13 -12
- data/app/assets/stylesheets/locomotive/backoffice/formtastic_changes.css.css +0 -0
@@ -34,6 +34,7 @@
|
|
34
34
|
}
|
35
35
|
|
36
36
|
settings = $.extend({
|
37
|
+
toggle_width: 28,
|
37
38
|
on_label : 'Yes',
|
38
39
|
on_label_color : '#333333',
|
39
40
|
on_bg_color : '#8FE38D',
|
@@ -48,22 +49,22 @@
|
|
48
49
|
}, settings);
|
49
50
|
|
50
51
|
// FIXME (Didier Lafforgue) it works but it doesn't scale if we handle another locale
|
51
|
-
if (typeof
|
52
|
+
if (typeof window.locale != 'undefined' && window.locale == 'fr') {
|
52
53
|
settings.on_label = 'Oui';
|
53
54
|
settings.off_label = 'Non';
|
54
55
|
}
|
55
56
|
|
56
57
|
function showUncheckedState(element) {
|
57
|
-
element.parent().prev().css("color",settings.off_label_color);
|
58
|
-
element.parent().next().css("color",settings.on_label_color);
|
58
|
+
element.parent().prev().css("color",settings.off_label_color).removeClass('on');
|
59
|
+
element.parent().next().css("color",settings.on_label_color).addClass('on');
|
59
60
|
element.parent().css("background-color", settings.off_bg_color).removeClass('on');
|
60
61
|
element.parent().parent().prev().removeAttr("checked").trigger('change');
|
61
62
|
element.removeClass("left").addClass("right");
|
62
63
|
}
|
63
64
|
|
64
65
|
function showCheckedState(element) {
|
65
|
-
element.parent().prev().css("color",settings.on_label_color);
|
66
|
-
element.parent().next().css("color",settings.off_label_color);
|
66
|
+
element.parent().prev().css("color",settings.on_label_color).addClass('on');
|
67
|
+
element.parent().next().css("color",settings.off_label_color).removeClass('on');
|
67
68
|
element.parent().css("background-color", settings.on_bg_color).addClass('on');
|
68
69
|
element.parent().parent().prev().attr("checked", "checked").trigger('change');
|
69
70
|
element.removeClass("right").addClass("left");
|
@@ -88,7 +89,7 @@
|
|
88
89
|
});
|
89
90
|
|
90
91
|
} else {
|
91
|
-
$(element).animate({marginLeft: '
|
92
|
+
$(element).animate({marginLeft: settings.toggle_width + 'px'}, 100,
|
92
93
|
|
93
94
|
// callback function
|
94
95
|
function(){
|
@@ -114,9 +115,9 @@
|
|
114
115
|
|
115
116
|
// insert the new toggle markup
|
116
117
|
if($(this).attr("checked") == "checked" || $(this).attr("checked") == true){
|
117
|
-
$(this).after('<div class="toggleSwitch"><span class="leftLabel">'+settings.on_label+'<\/span><div class="switchArea on" style="background-color: '+settings.on_bg_color+'"><span class="switchHandle left" style="margin-left:
|
118
|
+
$(this).after('<div class="toggleSwitch"><span class="leftLabel on">'+settings.on_label+'<\/span><div class="switchArea on" style="background-color: '+settings.on_bg_color+'"><span class="switchHandle left" style="margin-left: ' + settings.toggle_width + 'px;"><\/span><\/div><span class="rightLabel" style="color:#cccccc">'+settings.off_label+'<\/span><\/div>');
|
118
119
|
}else{
|
119
|
-
$(this).after('<div class="toggleSwitch"><span class="leftLabel" style="color:#cccccc;">'+settings.on_label+'<\/span><div class="switchArea" style="background-color: '+settings.off_bg_color+'"><span class="switchHandle right" style="margin-left:0px"><\/span><\/div><span class="rightLabel">'+settings.off_label+'<\/span><\/div>');
|
120
|
+
$(this).after('<div class="toggleSwitch"><span class="leftLabel" style="color:#cccccc;">'+settings.on_label+'<\/span><div class="switchArea" style="background-color: '+settings.off_bg_color+'"><span class="switchHandle right" style="margin-left:0px"><\/span><\/div><span class="rightLabel on">'+settings.off_label+'<\/span><\/div>');
|
120
121
|
}
|
121
122
|
|
122
123
|
// Bind the switchHandle click events to the internal toggle function
|
@@ -1,25 +1,48 @@
|
|
1
1
|
@import "compass/css3";
|
2
2
|
|
3
3
|
.toggleSwitch {
|
4
|
+
display: inline-block;
|
4
5
|
position: relative;
|
5
|
-
top:
|
6
|
-
line-height:
|
6
|
+
top: 0px;
|
7
|
+
line-height: 18px;
|
7
8
|
|
8
|
-
span.leftLabel {
|
9
|
-
|
9
|
+
span.leftLabel.on {
|
10
|
+
width: 29px;
|
11
|
+
left: 0px;
|
12
|
+
padding-left: 1px;
|
13
|
+
color: #fff !important;
|
14
|
+
@include single-text-shadow(rgba(0, 0, 0, 0.3), 0, -1px, 0px);
|
15
|
+
}
|
16
|
+
|
17
|
+
span.rightLabel.on {
|
18
|
+
width: 27px;
|
19
|
+
right: 0px;
|
20
|
+
padding-right: 1px;
|
21
|
+
color: #888 !important;
|
10
22
|
}
|
11
23
|
|
12
24
|
span.leftLabel, span.rightLabel {
|
13
|
-
|
14
|
-
|
15
|
-
|
25
|
+
position: absolute;
|
26
|
+
top: 0px;
|
27
|
+
width: 27px;
|
28
|
+
|
29
|
+
line-height: 18px;
|
30
|
+
font-size: 10px;
|
16
31
|
font-weight: bold;
|
32
|
+
text-align: center;
|
33
|
+
text-transform: uppercase;
|
34
|
+
|
35
|
+
display: none;
|
36
|
+
|
37
|
+
&.on {
|
38
|
+
display: inline;
|
39
|
+
}
|
17
40
|
}
|
18
41
|
|
19
42
|
div.switchArea {
|
20
43
|
float: left;
|
21
|
-
width:
|
22
|
-
height:
|
44
|
+
width: 54px;
|
45
|
+
height: 16px;
|
23
46
|
cursor: pointer;
|
24
47
|
|
25
48
|
border: 1px solid #a3a3a3;
|
@@ -37,7 +60,7 @@
|
|
37
60
|
position: relative;
|
38
61
|
top: -1px;
|
39
62
|
display: block;
|
40
|
-
width:
|
63
|
+
width: 25px;
|
41
64
|
height: 100%;
|
42
65
|
cursor: pointer;
|
43
66
|
cursor: hand;
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: locomotive_cms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.0.
|
4
|
+
version: 2.0.0.rc10
|
5
5
|
prerelease: 6
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-08-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
@@ -130,7 +130,7 @@ dependencies:
|
|
130
130
|
requirements:
|
131
131
|
- - ~>
|
132
132
|
- !ruby/object:Gem::Version
|
133
|
-
version: 2.4.
|
133
|
+
version: 2.4.12
|
134
134
|
type: :runtime
|
135
135
|
prerelease: false
|
136
136
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -138,7 +138,7 @@ dependencies:
|
|
138
138
|
requirements:
|
139
139
|
- - ~>
|
140
140
|
- !ruby/object:Gem::Version
|
141
|
-
version: 2.4.
|
141
|
+
version: 2.4.12
|
142
142
|
- !ruby/object:Gem::Dependency
|
143
143
|
name: locomotive-mongoid-tree
|
144
144
|
requirement: !ruby/object:Gem::Requirement
|
@@ -162,7 +162,7 @@ dependencies:
|
|
162
162
|
requirements:
|
163
163
|
- - ~>
|
164
164
|
- !ruby/object:Gem::Version
|
165
|
-
version: 2.0.0.
|
165
|
+
version: 2.0.0.rc13
|
166
166
|
type: :runtime
|
167
167
|
prerelease: false
|
168
168
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -170,7 +170,7 @@ dependencies:
|
|
170
170
|
requirements:
|
171
171
|
- - ~>
|
172
172
|
- !ruby/object:Gem::Version
|
173
|
-
version: 2.0.0.
|
173
|
+
version: 2.0.0.rc13
|
174
174
|
- !ruby/object:Gem::Dependency
|
175
175
|
name: kaminari
|
176
176
|
requirement: !ruby/object:Gem::Requirement
|
@@ -304,17 +304,17 @@ dependencies:
|
|
304
304
|
requirement: !ruby/object:Gem::Requirement
|
305
305
|
none: false
|
306
306
|
requirements:
|
307
|
-
- -
|
307
|
+
- - ~>
|
308
308
|
- !ruby/object:Gem::Version
|
309
|
-
version: 2.2.
|
309
|
+
version: 2.2.3
|
310
310
|
type: :runtime
|
311
311
|
prerelease: false
|
312
312
|
version_requirements: !ruby/object:Gem::Requirement
|
313
313
|
none: false
|
314
314
|
requirements:
|
315
|
-
- -
|
315
|
+
- - ~>
|
316
316
|
- !ruby/object:Gem::Version
|
317
|
-
version: 2.2.
|
317
|
+
version: 2.2.3
|
318
318
|
- !ruby/object:Gem::Dependency
|
319
319
|
name: formtastic
|
320
320
|
requirement: !ruby/object:Gem::Requirement
|
@@ -705,6 +705,7 @@ files:
|
|
705
705
|
- app/assets/javascripts/locomotive/views/shared/fields/file_view.js.coffee
|
706
706
|
- app/assets/javascripts/locomotive/views/shared/fields/has_many_view.js.coffee
|
707
707
|
- app/assets/javascripts/locomotive/views/shared/fields/many_to_many_view.js.coffee
|
708
|
+
- app/assets/javascripts/locomotive/views/shared/fields/select_view.js.coffee
|
708
709
|
- app/assets/javascripts/locomotive/views/shared/form_view.js.coffee
|
709
710
|
- app/assets/javascripts/locomotive/views/shared/list_item_view.js.coffee
|
710
711
|
- app/assets/javascripts/locomotive/views/shared/list_view.js.coffee
|
@@ -751,7 +752,6 @@ files:
|
|
751
752
|
- app/assets/stylesheets/locomotive/backoffice/datepicker.css.scss
|
752
753
|
- app/assets/stylesheets/locomotive/backoffice/dialog_changes.css.scss
|
753
754
|
- app/assets/stylesheets/locomotive/backoffice/editable_elements.css.scss
|
754
|
-
- app/assets/stylesheets/locomotive/backoffice/formtastic_changes.css.css
|
755
755
|
- app/assets/stylesheets/locomotive/backoffice/formtastic_changes.css.scss
|
756
756
|
- app/assets/stylesheets/locomotive/backoffice/layout.css.scss
|
757
757
|
- app/assets/stylesheets/locomotive/backoffice/menu/_colors.css.scss
|
@@ -901,6 +901,7 @@ files:
|
|
901
901
|
- app/views/locomotive/current_site/_form.html.haml
|
902
902
|
- app/views/locomotive/current_site/edit.html.haml
|
903
903
|
- app/views/locomotive/custom_fields/_form.html.haml
|
904
|
+
- app/views/locomotive/custom_fields/_select_templates.html.haml
|
904
905
|
- app/views/locomotive/custom_fields/types/_belongs_to.html.haml
|
905
906
|
- app/views/locomotive/custom_fields/types/_boolean.html.haml
|
906
907
|
- app/views/locomotive/custom_fields/types/_date.html.haml
|
@@ -1163,7 +1164,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
1163
1164
|
version: '0'
|
1164
1165
|
segments:
|
1165
1166
|
- 0
|
1166
|
-
hash:
|
1167
|
+
hash: 874381137118230470
|
1167
1168
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
1168
1169
|
none: false
|
1169
1170
|
requirements:
|
File without changes
|