locomotivecms 3.0.0.pre.alpha → 3.0.0.pre.alpha.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/api/locomotive/api/entities/site_entity.rb +4 -0
- data/app/api/locomotive/api/forms/site_form.rb +1 -1
- data/app/api/locomotive/api/resources/site_resource.rb +2 -0
- data/app/assets/javascripts/locomotive/utils/notify.js.coffee +13 -0
- data/app/assets/javascripts/locomotive/views/application_view.js.coffee +1 -1
- data/app/assets/javascripts/locomotive/views/content_assets/dropzone_view.js.coffee +1 -1
- data/app/assets/javascripts/locomotive/views/content_assets/edit_image_view.js.coffee +4 -2
- data/app/assets/javascripts/locomotive/views/pages/_form_view.js.coffee +14 -4
- data/app/assets/javascripts/locomotive/views/pages/edit_view.js.coffee +1 -1
- data/app/assets/javascripts/locomotive/views/pages/list_view.js.coffee +2 -4
- data/app/assets/stylesheets/locomotive/components/_misc.scss +2 -1
- data/app/assets/stylesheets/locomotive/components/misc/_notify.scss +27 -0
- data/app/assets/stylesheets/locomotive/components/sidebar/_pages_tree.scss +1 -1
- data/app/controllers/locomotive/pages_controller.rb +6 -8
- data/app/helpers/locomotive/base_helper.rb +2 -3
- data/app/helpers/locomotive/custom_fields_helper.rb +2 -2
- data/app/helpers/locomotive/pages_helper.rb +17 -16
- data/app/helpers/locomotive/shared/pages_helper.rb +2 -2
- data/app/models/locomotive/concerns/page/layout.rb +4 -0
- data/app/models/locomotive/page.rb +2 -3
- data/app/models/locomotive/site.rb +0 -4
- data/app/services/locomotive/content_entry_service.rb +1 -0
- data/app/services/locomotive/page_service.rb +23 -51
- data/app/services/locomotive/page_tree_service.rb +64 -0
- data/app/views/locomotive/accounts/new.html.haml +2 -1
- data/app/views/locomotive/current_site/form/_main.html.haml +1 -1
- data/app/views/locomotive/custom_fields/select_options/edit.html.haml +1 -1
- data/app/views/locomotive/memberships/new.html.haml +1 -1
- data/app/views/locomotive/my_account/form/_actions.html.haml +1 -6
- data/app/views/locomotive/my_account/form/_main.html.haml +1 -1
- data/app/views/locomotive/pages/form/_main.html.haml +17 -3
- data/app/views/locomotive/pages/form/_tabs.html.haml +3 -5
- data/app/views/locomotive/pages/new.html.haml +8 -11
- data/app/views/locomotive/shared/_sidebar.html.haml +3 -0
- data/app/views/locomotive/shared/_sidebar_without_site.html.haml +2 -0
- data/app/views/locomotive/shared/header/_account_menu.html.haml +1 -1
- data/app/views/locomotive/shared/sidebar/_link.html.haml +1 -1
- data/app/views/locomotive/shared/sidebar/_my_account.html.haml +1 -1
- data/app/views/locomotive/shared/sidebar/_page.html.haml +6 -1
- data/app/views/locomotive/shared/sidebar/_pages.html.haml +1 -1
- data/app/views/locomotive/sites/new.html.haml +1 -1
- data/config/locales/admin_ui.en.yml +6 -16
- data/lib/locomotive/simple_form.rb +2 -2
- data/lib/locomotive/version.rb +4 -1
- data/spec/models/locomotive/concerns/page/layout_spec.rb +26 -0
- data/vendor/assets/javascripts/locomotive/bootstrap-notify.js +2 -0
- data/vendor/assets/javascripts/locomotive/resizeImage.js +0 -2
- metadata +10 -9
- data/app/views/locomotive/pages/_form.html.haml +0 -66
- data/app/views/locomotive/pages/_page.html.haml +0 -44
- data/vendor/assets/javascripts/locomotive/bootstrap-growl.js +0 -312
@@ -1,66 +0,0 @@
|
|
1
|
-
- content_for :head do
|
2
|
-
= render '/locomotive/content_assets/picker'
|
3
|
-
= render '/locomotive/theme_assets/picker'
|
4
|
-
= render 'editable_elements'
|
5
|
-
|
6
|
-
- content_for :backbone_view_data do
|
7
|
-
:plain
|
8
|
-
page: #{escape_json to_json(@page)}
|
9
|
-
|
10
|
-
= f.inputs name: :information do
|
11
|
-
|
12
|
-
= f.input :title, wrapper_html: { class: 'highlighted' }
|
13
|
-
|
14
|
-
- if not @page.index? and not @page.not_found?
|
15
|
-
= f.input :parent_id, as: :select, collection: parent_pages_options, include_blank: false
|
16
|
-
|
17
|
-
= f.input :slug, required: false, hint: @page.slug.blank? ? t('.empty_slug') : public_page_url(@page, locale: current_content_locale), input_html: { :'data-url' => get_path_pages_path, disabled: @page.index? || @page.not_found? }, wrapper_html: { style: "#{'display: none' if @page.templatized? && !@page.templatized_from_parent?};", class: 'em-inline-hints' }
|
18
|
-
|
19
|
-
- if display_page_layouts?
|
20
|
-
= f.input :layout, as: :select, collection: options_for_page_layouts, include_blank: false
|
21
|
-
|
22
|
-
= f.inputs name: :seo, class: "inputs foldable #{'folded' if inputs_folded?(@page)}" do
|
23
|
-
|
24
|
-
= f.input :seo_title
|
25
|
-
|
26
|
-
= f.input :meta_keywords
|
27
|
-
|
28
|
-
= f.input :meta_description
|
29
|
-
|
30
|
-
= f.inputs name: :advanced_options, id: 'advanced-options', class: "inputs foldable #{'folded' if inputs_folded?(@page)}" do
|
31
|
-
|
32
|
-
- if can?(:customize, @page)
|
33
|
-
= f.input :handle
|
34
|
-
|
35
|
-
= f.input :is_layout, as: :'Locomotive::Toggle', input_html: { class: 'simple-toggle' }
|
36
|
-
|
37
|
-
= f.input :allow_layout, as: :'Locomotive::Toggle', input_html: { class: 'simple-toggle' }
|
38
|
-
|
39
|
-
= f.input :response_type, as: :select, collection: options_for_page_response_type, include_blank: false
|
40
|
-
|
41
|
-
= f.input :templatized, as: :'Locomotive::Toggle', style: "#{'display: none' if @page.redirect? || @page.templatized_from_parent?}"
|
42
|
-
|
43
|
-
= f.input :target_klass_name, as: :select, collection: options_for_target_klass_name, include_blank: false, wrapper_html: { style: "#{'display: none' if !@page.templatized? || @page.templatized_from_parent?}" }
|
44
|
-
|
45
|
-
= f.input :published, as: :'Locomotive::Toggle', input_html: { class: 'simple-toggle' }
|
46
|
-
|
47
|
-
= f.input :listed, as: :'Locomotive::Toggle', input_html: { class: 'simple-toggle' }
|
48
|
-
|
49
|
-
= f.input :redirect, as: :'Locomotive::Toggle', wrapper_html: { style: "#{'display: none' if @page.templatized? || !@page.default_response_type?}" }
|
50
|
-
|
51
|
-
= f.input :redirect_url, required: true, wrapper_html: { style: "#{'display: none' unless @page.redirect?}" }
|
52
|
-
|
53
|
-
= f.input :redirect_type, as: :select, collection: options_for_page_redirect_type, include_blank: false, wrapper_html: { style: "#{'display: none' unless @page.redirect?}" }
|
54
|
-
|
55
|
-
= render_cell 'locomotive/partials', :display, :page_form, g: f
|
56
|
-
|
57
|
-
- if can?(:customize, @page)
|
58
|
-
|
59
|
-
= f.input :cache_strategy, as: :select, collection: options_for_page_cache_strategy, include_blank: false, wrapper_html: { style: "#{'display: none' if @page.redirect?}" }
|
60
|
-
|
61
|
-
- if can?(:customize, @page) && @page.layout.nil?
|
62
|
-
= f.inputs name: :raw_template, class: "inputs foldable #{'folded' if inputs_folded?(@page)}" do
|
63
|
-
|
64
|
-
= f.input :raw_template, as: :'Locomotive::Code', main_locale_template_url: page_main_template_path(@page)
|
65
|
-
|
66
|
-
|
@@ -1,44 +0,0 @@
|
|
1
|
-
- if page.not_found?
|
2
|
-
%li.sep
|
3
|
-
|
4
|
-
%li{ id: "item-#{page.id}", class: "page #{css_for_page(page)}" }
|
5
|
-
|
6
|
-
- children = page.children
|
7
|
-
|
8
|
-
- with_children = !children.empty?
|
9
|
-
|
10
|
-
- if not page.index? and with_children
|
11
|
-
= page_toggler(page)
|
12
|
-
|
13
|
-
.inner
|
14
|
-
|
15
|
-
- unless page.index_or_not_found?
|
16
|
-
%em
|
17
|
-
|
18
|
-
= link_to truncate(page.title, length: 80), edit_page_url(page)
|
19
|
-
|
20
|
-
- if page.templatized?
|
21
|
-
%i.icon-cog
|
22
|
-
|
23
|
-
%span.content-type= page.content_type.try(:name)
|
24
|
-
|
25
|
-
- if page.redirect?
|
26
|
-
%i.icon-share-alt
|
27
|
-
|
28
|
-
- unless page.default_response_type?
|
29
|
-
%span.response-type= page_response_type_to_string(page)
|
30
|
-
|
31
|
-
- unless page.translated?
|
32
|
-
%span.untranslated= t('locomotive.shared.list.untranslated')
|
33
|
-
|
34
|
-
.more
|
35
|
-
%span!= t('.updated_at')
|
36
|
-
= l page.updated_at, format: :short
|
37
|
-
|
38
|
-
- if !page.index_or_not_found? && can?(:destroy, page)
|
39
|
-
= link_to_icon :trash, page_url(page), class: 'remove', data: { confirm: t('locomotive.messages.confirm') }, method: :delete
|
40
|
-
|
41
|
-
- if with_children
|
42
|
-
%ul{ id: "folder-#{page._id}", class: "page folder depth-#{(page.depth || 0) + 1}", :'data-url' => sort_page_url(page), style: "display: #{cookies["folder-#{page._id}"] || 'block'}" }
|
43
|
-
|
44
|
-
= render children
|
@@ -1,312 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* Project: Bootstrap Growl - v2.0.0
|
3
|
-
* Description: Turns standard Bootstrap alerts into "Growl-like" notifications.
|
4
|
-
* Author: Mouse0270 aka Robert McIntosh
|
5
|
-
* License: MIT License
|
6
|
-
* Website: https://github.com/mouse0270/bootstrap-growl
|
7
|
-
*/
|
8
|
-
;(function ( $, window, document, undefined ) {
|
9
|
-
// Create the defaults once
|
10
|
-
var pluginName = "growl",
|
11
|
-
dataKey = "plugin_" + pluginName,
|
12
|
-
defaults = {
|
13
|
-
element: 'body',
|
14
|
-
type: "info",
|
15
|
-
allow_dismiss: true,
|
16
|
-
placement: {
|
17
|
-
from: "top",
|
18
|
-
align: "right"
|
19
|
-
},
|
20
|
-
offset: 20,
|
21
|
-
spacing: 10,
|
22
|
-
z_index: 1031,
|
23
|
-
delay: 5000,
|
24
|
-
timer: 1000,
|
25
|
-
url_target: '_blank',
|
26
|
-
mouse_over: false,
|
27
|
-
animate: {
|
28
|
-
enter: 'animated fadeInDown',
|
29
|
-
exit: 'animated fadeOutUp'
|
30
|
-
},
|
31
|
-
onShow: null,
|
32
|
-
onShown: null,
|
33
|
-
onHide: null,
|
34
|
-
onHidden: null,
|
35
|
-
icon_type: 'class',
|
36
|
-
template: '<div data-growl="container" class="alert" role="alert"><button type="button" class="close" data-growl="dismiss"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button><span data-growl="icon"></span><span data-growl="title"></span><span data-growl="message"></span><a href="#" data-growl="url"></a></div>'
|
37
|
-
};
|
38
|
-
|
39
|
-
// The actual plugin constructor
|
40
|
-
var setDefaults = function(element, options) {
|
41
|
-
defaults = $.extend(true, {}, defaults, options);
|
42
|
-
},
|
43
|
-
closeAll = function(options) {
|
44
|
-
if (!options) {
|
45
|
-
$('[data-growl="container"]').find('[data-growl="dismiss"]').trigger('click');
|
46
|
-
}else{
|
47
|
-
$('[data-growl="container"][data-growl-position="'+options+'"]').find('[data-growl="dismiss"]').trigger('click');
|
48
|
-
}
|
49
|
-
},
|
50
|
-
Plugin = function (element, content, options) {
|
51
|
-
var content = {
|
52
|
-
content: {
|
53
|
-
message: typeof content == 'object' ? content.message : content,
|
54
|
-
title: content.title ? content.title : null,
|
55
|
-
icon: content.icon ? content.icon : null,
|
56
|
-
url: content.url ? content.url : null
|
57
|
-
}
|
58
|
-
};
|
59
|
-
|
60
|
-
options = $.extend(true, {}, content, options);
|
61
|
-
this.settings = $.extend(true, {}, defaults, options);
|
62
|
-
plugin = this;
|
63
|
-
init(options, this.settings, plugin);
|
64
|
-
this.$template = $template;
|
65
|
-
},
|
66
|
-
init = function (options, settings, plugin) {
|
67
|
-
|
68
|
-
var base = {
|
69
|
-
settings: settings,
|
70
|
-
$element: $(settings.element),
|
71
|
-
template: settings.template
|
72
|
-
};
|
73
|
-
|
74
|
-
if (typeof settings.offset == 'number') {
|
75
|
-
settings.offset = {
|
76
|
-
x: settings.offset,
|
77
|
-
y: settings.offset
|
78
|
-
};
|
79
|
-
}
|
80
|
-
|
81
|
-
$template = buildGrowl(base);
|
82
|
-
addContent($template, base.settings);
|
83
|
-
placement($template, base.settings);
|
84
|
-
bindControls($template, base.settings,plugin);
|
85
|
-
},
|
86
|
-
buildGrowl = function(base) {
|
87
|
-
|
88
|
-
var $template = $(base.settings.template);
|
89
|
-
|
90
|
-
$template.addClass('alert-' + base.settings.type);
|
91
|
-
$template.attr('data-growl-position', base.settings.placement.from + '-' + base.settings.placement.align);
|
92
|
-
|
93
|
-
$template.find('[data-growl="dismiss"]').css('display', 'none');
|
94
|
-
if (base.settings.allow_dismiss) {
|
95
|
-
$template.find('[data-growl="dismiss"]').css('display', 'inline-block');
|
96
|
-
}
|
97
|
-
|
98
|
-
return $template;
|
99
|
-
},
|
100
|
-
addContent = function($template, settings) {
|
101
|
-
|
102
|
-
$template.find('[data-growl="dismiss"]').css({
|
103
|
-
'position': 'absolute',
|
104
|
-
'top': '5px',
|
105
|
-
'right': '10px',
|
106
|
-
'z-index': ((settings.z_index-1) >= 1 ? (settings.z_index-1) : 1)
|
107
|
-
});
|
108
|
-
|
109
|
-
if (settings.content.icon) {
|
110
|
-
if (settings.icon_type.toLowerCase() == 'class') {
|
111
|
-
$template.find('[data-growl="icon"]').addClass(settings.content.icon);
|
112
|
-
}else{
|
113
|
-
if ($template.find('[data-growl="icon"]').is('img')) {
|
114
|
-
$template.find('[data-growl="icon"]').attr('src', settings.content.icon);
|
115
|
-
}else{
|
116
|
-
$template.find('[data-growl="icon"]').append('<img src="'+settings.content.icon+'" />');
|
117
|
-
}
|
118
|
-
}
|
119
|
-
}
|
120
|
-
|
121
|
-
if (settings.content.title) {
|
122
|
-
$template.find('[data-growl="title"]').html(settings.content.title);
|
123
|
-
}
|
124
|
-
|
125
|
-
if (settings.content.message) {
|
126
|
-
$template.find('[data-growl="message"]').html(settings.content.message);
|
127
|
-
}
|
128
|
-
|
129
|
-
if (settings.content.url) {
|
130
|
-
$template.find('[data-growl="url"]').attr('href', settings.content.url).attr('target', settings.url_target);
|
131
|
-
$template.find('[data-growl="url"]').css({
|
132
|
-
'position': 'absolute',
|
133
|
-
'top': '0px',
|
134
|
-
'left': '0px',
|
135
|
-
'width': '100%',
|
136
|
-
'height': '100%',
|
137
|
-
'z-index': ((settings.z_index-2) >= 1 ? (settings.z_index-2) : 1)
|
138
|
-
});
|
139
|
-
}
|
140
|
-
},
|
141
|
-
placement = function($template, settings) {
|
142
|
-
var offsetAmt = settings.offset.y,
|
143
|
-
gCSS = {
|
144
|
-
'position': (settings.element === 'body' ? 'fixed' : 'absolute'),
|
145
|
-
'margin': 0,
|
146
|
-
'z-index': settings.z_index,
|
147
|
-
'display': 'inline-block'
|
148
|
-
},
|
149
|
-
hasAnimation = false;
|
150
|
-
|
151
|
-
$('[data-growl-position="' + settings.placement.from + '-' + settings.placement.align + '"]').each(function() {
|
152
|
-
return offsetAmt = Math.max(offsetAmt, parseInt($(this).css(settings.placement.from)) + $(this).outerHeight() + settings.spacing);
|
153
|
-
});
|
154
|
-
|
155
|
-
gCSS[settings.placement.from] = offsetAmt + "px";
|
156
|
-
$template.css(gCSS);
|
157
|
-
|
158
|
-
if (settings.onShow) {
|
159
|
-
settings.onShow(event);
|
160
|
-
}
|
161
|
-
|
162
|
-
$(settings.element).append($template);
|
163
|
-
|
164
|
-
switch (settings.placement.align) {
|
165
|
-
case 'center':
|
166
|
-
$template.css({
|
167
|
-
'left': '50%',
|
168
|
-
'marginLeft': -($template.outerWidth() / 2) + 'px'
|
169
|
-
});
|
170
|
-
break;
|
171
|
-
case 'left':
|
172
|
-
$template.css('left', settings.offset.x + 'px');
|
173
|
-
break;
|
174
|
-
case 'right':
|
175
|
-
$template.css('right', settings.offset.x + 'px');
|
176
|
-
break;
|
177
|
-
}
|
178
|
-
$template.addClass('growl-animated');
|
179
|
-
|
180
|
-
$template.one('webkitAnimationStart oanimationstart MSAnimationStart animationstart', function(event) {
|
181
|
-
hasAnimation = true;
|
182
|
-
});
|
183
|
-
|
184
|
-
$template.one('webkitAnimationEnd oanimationend MSAnimationEnd animationend', function(event) {
|
185
|
-
if (settings.onShown) {
|
186
|
-
settings.onShown(event);
|
187
|
-
}
|
188
|
-
});
|
189
|
-
|
190
|
-
setTimeout(function() {
|
191
|
-
if (!hasAnimation) {
|
192
|
-
if (settings.onShown) {
|
193
|
-
settings.onShown(event);
|
194
|
-
}
|
195
|
-
}
|
196
|
-
}, 600);
|
197
|
-
},
|
198
|
-
bindControls = function($template, settings, plugin) {
|
199
|
-
$template.addClass(settings.animate.enter);
|
200
|
-
|
201
|
-
$template.find('[data-growl="dismiss"]').on('click', function() {
|
202
|
-
plugin.close();
|
203
|
-
});
|
204
|
-
|
205
|
-
$template.on('mouseover', function(e) {
|
206
|
-
$template.addClass('hovering');
|
207
|
-
}).on('mouseout', function() {
|
208
|
-
$template.removeClass('hovering');
|
209
|
-
});
|
210
|
-
|
211
|
-
if (settings.delay >= 1) {
|
212
|
-
$template.data('growl-delay', settings.delay);
|
213
|
-
var timer = setInterval(function() {
|
214
|
-
|
215
|
-
var delay = parseInt($template.data('growl-delay')) - settings.timer;
|
216
|
-
if ((!$template.hasClass('hovering') && settings.mouse_over == 'pause') || settings.mouse_over != 'pause') {
|
217
|
-
$template.data('growl-delay', delay);
|
218
|
-
}
|
219
|
-
|
220
|
-
if (delay <= 0) {
|
221
|
-
clearInterval(timer);
|
222
|
-
plugin.close();
|
223
|
-
}
|
224
|
-
}, settings.timer);
|
225
|
-
}
|
226
|
-
};
|
227
|
-
|
228
|
-
// Avoid Plugin.prototype conflicts
|
229
|
-
Plugin.prototype = {
|
230
|
-
update: function(command, update) {
|
231
|
-
switch (command) {
|
232
|
-
case 'icon':
|
233
|
-
if (this.settings.icon_type.toLowerCase() == 'class') {
|
234
|
-
this.$template.find('[data-growl="icon"]').removeClass(this.settings.content.icon);
|
235
|
-
this.$template.find('[data-growl="icon"]').addClass(update);
|
236
|
-
}else{
|
237
|
-
if (this.$template.find('[data-growl="icon"]').is('img')) {
|
238
|
-
this.$template.find('[data-growl="icon"]')
|
239
|
-
}else{
|
240
|
-
this.$template.find('[data-growl="icon"]').find('img').attr().attr('src', update);
|
241
|
-
}
|
242
|
-
}
|
243
|
-
break;
|
244
|
-
case 'url':
|
245
|
-
this.$template.find('[data-growl="url"]').attr('href', update);
|
246
|
-
break;
|
247
|
-
case 'type':
|
248
|
-
this.$template.removeClass('alert-' + this.settings.type);
|
249
|
-
this.$template.addClass('alert-' + update);
|
250
|
-
break;
|
251
|
-
default:
|
252
|
-
this.$template.find('[data-growl="' + command +'"]').html(update);
|
253
|
-
}
|
254
|
-
|
255
|
-
return this;
|
256
|
-
},
|
257
|
-
close: function() {
|
258
|
-
var base = this.$template,
|
259
|
-
settings = this.settings,
|
260
|
-
posX = base.css(settings.placement.from),
|
261
|
-
hasAnimation = false;
|
262
|
-
|
263
|
-
if (settings.onHide) {
|
264
|
-
settings.onHide(event);
|
265
|
-
}
|
266
|
-
|
267
|
-
base.addClass(this.settings.animate.exit);
|
268
|
-
|
269
|
-
base.nextAll('[data-growl-position="' + this.settings.placement.from + '-' + this.settings.placement.align + '"]').each(function() {
|
270
|
-
$(this).css(settings.placement.from, posX);
|
271
|
-
posX = (parseInt(posX)+(settings.spacing)) + $(this).outerHeight();
|
272
|
-
});
|
273
|
-
|
274
|
-
base.one('webkitAnimationStart oanimationstart MSAnimationStart animationstart', function(event) {
|
275
|
-
hasAnimation = true;
|
276
|
-
});
|
277
|
-
|
278
|
-
base.one('webkitAnimationEnd oanimationend MSAnimationEnd animationend', function(event) {
|
279
|
-
$(this).remove();
|
280
|
-
if (settings.onHidden) {
|
281
|
-
settings.onHidden(event);
|
282
|
-
}
|
283
|
-
});
|
284
|
-
|
285
|
-
setTimeout(function() {
|
286
|
-
if (!hasAnimation) {
|
287
|
-
base.remove();
|
288
|
-
if (settings.onHidden) {
|
289
|
-
settings.onHidden(event);
|
290
|
-
}
|
291
|
-
}
|
292
|
-
}, 100);
|
293
|
-
|
294
|
-
return this;
|
295
|
-
}
|
296
|
-
};
|
297
|
-
|
298
|
-
// A really lightweight plugin wrapper around the constructor,
|
299
|
-
// preventing against multiple instantiations
|
300
|
-
$.growl = function ( content, options ) {
|
301
|
-
if (content == false && options.command == "closeAll") {
|
302
|
-
closeAll(options.position);
|
303
|
-
return false;
|
304
|
-
}else if (content == false) {
|
305
|
-
setDefaults(this, options);
|
306
|
-
return false;
|
307
|
-
}
|
308
|
-
var plugin = new Plugin( this, content, options );
|
309
|
-
return plugin;
|
310
|
-
};
|
311
|
-
|
312
|
-
})( jQuery, window, document );
|