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.
Files changed (52) hide show
  1. checksums.yaml +4 -4
  2. data/app/api/locomotive/api/entities/site_entity.rb +4 -0
  3. data/app/api/locomotive/api/forms/site_form.rb +1 -1
  4. data/app/api/locomotive/api/resources/site_resource.rb +2 -0
  5. data/app/assets/javascripts/locomotive/utils/notify.js.coffee +13 -0
  6. data/app/assets/javascripts/locomotive/views/application_view.js.coffee +1 -1
  7. data/app/assets/javascripts/locomotive/views/content_assets/dropzone_view.js.coffee +1 -1
  8. data/app/assets/javascripts/locomotive/views/content_assets/edit_image_view.js.coffee +4 -2
  9. data/app/assets/javascripts/locomotive/views/pages/_form_view.js.coffee +14 -4
  10. data/app/assets/javascripts/locomotive/views/pages/edit_view.js.coffee +1 -1
  11. data/app/assets/javascripts/locomotive/views/pages/list_view.js.coffee +2 -4
  12. data/app/assets/stylesheets/locomotive/components/_misc.scss +2 -1
  13. data/app/assets/stylesheets/locomotive/components/misc/_notify.scss +27 -0
  14. data/app/assets/stylesheets/locomotive/components/sidebar/_pages_tree.scss +1 -1
  15. data/app/controllers/locomotive/pages_controller.rb +6 -8
  16. data/app/helpers/locomotive/base_helper.rb +2 -3
  17. data/app/helpers/locomotive/custom_fields_helper.rb +2 -2
  18. data/app/helpers/locomotive/pages_helper.rb +17 -16
  19. data/app/helpers/locomotive/shared/pages_helper.rb +2 -2
  20. data/app/models/locomotive/concerns/page/layout.rb +4 -0
  21. data/app/models/locomotive/page.rb +2 -3
  22. data/app/models/locomotive/site.rb +0 -4
  23. data/app/services/locomotive/content_entry_service.rb +1 -0
  24. data/app/services/locomotive/page_service.rb +23 -51
  25. data/app/services/locomotive/page_tree_service.rb +64 -0
  26. data/app/views/locomotive/accounts/new.html.haml +2 -1
  27. data/app/views/locomotive/current_site/form/_main.html.haml +1 -1
  28. data/app/views/locomotive/custom_fields/select_options/edit.html.haml +1 -1
  29. data/app/views/locomotive/memberships/new.html.haml +1 -1
  30. data/app/views/locomotive/my_account/form/_actions.html.haml +1 -6
  31. data/app/views/locomotive/my_account/form/_main.html.haml +1 -1
  32. data/app/views/locomotive/pages/form/_main.html.haml +17 -3
  33. data/app/views/locomotive/pages/form/_tabs.html.haml +3 -5
  34. data/app/views/locomotive/pages/new.html.haml +8 -11
  35. data/app/views/locomotive/shared/_sidebar.html.haml +3 -0
  36. data/app/views/locomotive/shared/_sidebar_without_site.html.haml +2 -0
  37. data/app/views/locomotive/shared/header/_account_menu.html.haml +1 -1
  38. data/app/views/locomotive/shared/sidebar/_link.html.haml +1 -1
  39. data/app/views/locomotive/shared/sidebar/_my_account.html.haml +1 -1
  40. data/app/views/locomotive/shared/sidebar/_page.html.haml +6 -1
  41. data/app/views/locomotive/shared/sidebar/_pages.html.haml +1 -1
  42. data/app/views/locomotive/sites/new.html.haml +1 -1
  43. data/config/locales/admin_ui.en.yml +6 -16
  44. data/lib/locomotive/simple_form.rb +2 -2
  45. data/lib/locomotive/version.rb +4 -1
  46. data/spec/models/locomotive/concerns/page/layout_spec.rb +26 -0
  47. data/vendor/assets/javascripts/locomotive/bootstrap-notify.js +2 -0
  48. data/vendor/assets/javascripts/locomotive/resizeImage.js +0 -2
  49. metadata +10 -9
  50. data/app/views/locomotive/pages/_form.html.haml +0 -66
  51. data/app/views/locomotive/pages/_page.html.haml +0 -44
  52. data/vendor/assets/javascripts/locomotive/bootstrap-growl.js +0 -312
@@ -0,0 +1,64 @@
1
+ module Locomotive
2
+
3
+ class PageTreeService < Struct.new(:site)
4
+
5
+ # Returns the tree of pages from the site with the most minimal amount of queries.
6
+ # This method should only be used for read-only purpose since
7
+ # the mongodb returns the minimal set of required attributes to build
8
+ # the tree.
9
+ #
10
+ # @return [ Array ] The first array of pages (index + page not found + pages with depth == 1)
11
+ #
12
+ def build_tree
13
+ pages, page_not_found = pages_with_minimun_attributes, nil
14
+
15
+ [].tap do |tree|
16
+ while page = pages.shift
17
+ if page.not_found?
18
+ # move the "page not found" (404) at the end of the array
19
+ page_not_found = page
20
+ elsif page.index?
21
+ # make the index page without children
22
+ tree << [page, nil]
23
+ elsif !page.is_layout_or_related?
24
+ tree << _build_tree(page, pages)
25
+ end
26
+ end
27
+
28
+ tree << [page_not_found, nil]
29
+ end
30
+ end
31
+
32
+ protected
33
+
34
+ #:nodoc:
35
+ def pages_with_minimun_attributes
36
+ site.pages.unscoped.
37
+ minimal_attributes.
38
+ order_by_depth_and_position.
39
+ to_a
40
+ end
41
+
42
+ #:nodoc:
43
+ def _build_tree(current_page, pages)
44
+ i, children = 0, []
45
+
46
+ while !pages.empty?
47
+ page = pages[i]
48
+
49
+ break if page.nil? # end of the array
50
+
51
+ if page.parent_id == current_page.id
52
+ page = pages.delete_at(i)
53
+
54
+ children << _build_tree(page, pages)
55
+ else
56
+ i += 1
57
+ end
58
+ end
59
+
60
+ [current_page, children]
61
+ end
62
+
63
+ end
64
+ end
@@ -5,7 +5,8 @@
5
5
  = locomotive_form_for @account, url: accounts_path(current_site) do |f|
6
6
 
7
7
  = f.inputs :information do
8
- = f.input :name
8
+ = f.input :name, input_html: { class: 'input-lg' }
9
+
9
10
  - unless f.object.respond_to?(:password)
10
11
  = f.input :email
11
12
 
@@ -1,5 +1,5 @@
1
1
  = f.inputs :information do
2
- = f.input :name
2
+ = f.input :name, input_html: { class: 'input-lg' }
3
3
  = f.input :picture, as: :file
4
4
  = f.input :memberships, as: :array, template: :membership, new_item: policy(Locomotive::Membership).create? ? { label: t('.new_membership'), url: new_membership_path(current_site) } : nil, wrapper_html: { class: 'memberships' }
5
5
 
@@ -11,4 +11,4 @@
11
11
  template: :option,
12
12
  template_url: new_option_custom_fields_select_options_path(current_site, @content_type.slug, @custom_field.name)
13
13
 
14
- = f.actions back_url: content_entries_path(current_site, @content_type.slug),use_stored_location: true
14
+ = f.actions back_url: content_entries_path(current_site, @content_type.slug), use_stored_location: true
@@ -5,7 +5,7 @@
5
5
  = locomotive_form_for @membership, url: memberships_path(current_site) do |f|
6
6
 
7
7
  = f.inputs :membership_email, class: 'inputs email' do
8
- = f.input :email
8
+ = f.input :email, input_html: { class: 'input-lg' }
9
9
 
10
10
  = f.actions do
11
11
  .row
@@ -1,6 +1 @@
1
- = f.actions do
2
- .row
3
- .col-xs-6.text-left.visible-xs-block
4
- = link_to t(:logout, scope: 'locomotive.shared.header'), destroy_locomotive_account_session_path, data: { confirm: t('locomotive.messages.confirm') }, class:'btn btn-sm btn-danger'
5
- .col-xs-6.col-sm-12.text-right
6
- = f.action
1
+ = f.actions back_url: params[:_location] || sites_path, use_stored_location: true
@@ -1,5 +1,5 @@
1
1
  = f.inputs :information do
2
- = f.input :name
2
+ = f.input :name, input_html: { class: 'input-lg' }
3
3
  = f.input :avatar, as: :file
4
4
  = f.input :locale, as: :select, collection: options_for_locale, include_blank: false, wrapper_html: { class: 'select2' }
5
5
 
@@ -1,12 +1,26 @@
1
1
  = f.inputs :information do
2
2
 
3
- = f.input :title
3
+ = f.input :title, input_html: { class: 'input-lg' }
4
+
5
+ - if display_page_layouts?
6
+ = f.input :layout, as: :select, collection: options_for_page_layouts, include_blank: false
7
+
8
+ - if !@page.index? && !@page.not_found? && !@page.templatized?
9
+
10
+ = f.input :slug
4
11
 
5
- - if not @page.index? and not @page.not_found?
6
12
  = f.input :parent_id, as: :select, collection: parent_pages_options, include_blank: false
7
13
 
14
+ = f.input :redirect, as: :toggle
15
+
16
+ = f.input :redirect_url, as: :string, wrapper_html: { class: "#{'hide' unless @page.redirect?}" }
17
+
18
+ = f.input :redirect_type, as: :select, collection: options_for_page_redirect_type, include_blank: false, wrapper_html: {class: "#{'hide' unless @page.redirect?}" }
19
+
8
20
  = f.input :published, as: :toggle
9
21
 
10
- = f.input :listed, as: :toggle
22
+ - unless @page.not_found? || @page.templatized?
23
+
24
+ = f.input :listed, as: :toggle
11
25
 
12
26
  = render 'locomotive/pages/form/actions', f: f
@@ -1,12 +1,10 @@
1
1
  %ul.nav.nav-tabs{ role: 'tablist' }
2
- = form_nav_tab :content do
3
- = link_to t('simple_form.titles.locomotive.content'), editable_elements_path(current_site, @page)
2
+ - unless @page.templatized?
3
+ = form_nav_tab :content do
4
+ = link_to t('simple_form.titles.locomotive.content'), editable_elements_path(current_site, @page)
4
5
 
5
6
  = form_nav_tab :main, true do
6
7
  = link_to t('simple_form.titles.locomotive.information'), '#main', role: 'tab', data: { toggle: 'tab' }
7
8
 
8
9
  = form_nav_tab :seo do
9
10
  = link_to t('simple_form.titles.locomotive.seo'), '#seo', role: 'tab', data: { toggle: 'tab' }
10
-
11
- / = form_nav_tab :advanced do
12
- / = link_to t('simple_form.titles.locomotive.advanced'), '#advanced', role: 'tab', data: { toggle: 'tab' }
@@ -1,19 +1,16 @@
1
1
  - title t('.title')
2
2
 
3
- .alert.alert-danger
4
- Under development
3
+ = help t('.help', default: '')
5
4
 
5
+ = locomotive_form_for @page, url: pages_path(current_site), html: { multipart: true } do |f|
6
6
 
7
- / - content_for :submenu do
8
- / = render 'locomotive/shared/menu/contents'
7
+ = f.inputs :information do
9
8
 
10
- / - content_for :actions do
11
- / = render 'locomotive/shared/actions/contents'
9
+ = f.input :title, input_html: { class: 'input-lg' }
12
10
 
13
- / %p!= t('.help')
11
+ = f.input :parent_id, as: :select, collection: parent_pages_options, include_blank: false
14
12
 
15
- / = semantic_form_for @page, url: pages_path do |form|
13
+ = f.input :layout, as: :select, collection: options_for_page_layouts, include_blank: false
16
14
 
17
- / = render 'form', f: form
18
-
19
- / = render 'locomotive/shared/form_actions', back_url: pages_path, button_label: :create
15
+ = f.actions do
16
+ = f.action
@@ -11,3 +11,6 @@
11
11
  = render 'locomotive/shared/sidebar/link', icon: 'fa-gear', label: t('.settings'), url: edit_current_site_path(current_site)
12
12
 
13
13
  = render 'locomotive/shared/sidebar/link', icon: 'fa-suitcase', label: t(:sites, scope: 'locomotive.shared.header'), url: sites_path, section_class: 'visible-xs-block'
14
+
15
+ = render 'locomotive/shared/sidebar/link', icon: 'fa-sign-out', label: t(:logout, scope: 'locomotive.shared.header'), url: destroy_locomotive_account_session_path, data: { confirm: t('locomotive.messages.confirm') }, section_class: 'visible-xs-block'
16
+
@@ -1,3 +1,5 @@
1
1
  = render 'locomotive/shared/sidebar/my_account'
2
2
 
3
3
  = render 'locomotive/shared/sidebar/link', icon: 'fa-suitcase', label: t(:sites, scope: 'locomotive.shared.header'), url: sites_path
4
+
5
+ = render 'locomotive/shared/sidebar/link', icon: 'fa-sign-out', label: t(:logout, scope: 'locomotive.shared.header'), url: destroy_locomotive_account_session_path, data: { confirm: t('locomotive.messages.confirm') }
@@ -1,5 +1,5 @@
1
1
  %li= link_to t(:sites, scope: 'locomotive.shared.header'), sites_path
2
- %li= link_to t(:account, scope: 'locomotive.shared.header'), edit_my_account_path
2
+ %li= link_to t(:account, scope: 'locomotive.shared.header'), edit_my_account_path(_location: request.fullpath)
3
3
  %li= link_to t(:help, scope: 'locomotive.shared.header'), 'http://doc.locomotivecms.com'
4
4
  %li.divider
5
5
  %li= link_to t(:logout, scope: 'locomotive.shared.header'), destroy_locomotive_account_session_path, data: { confirm: t('locomotive.messages.confirm') }
@@ -1,6 +1,6 @@
1
1
  %section.link{ class: defined?(section_class) ? section_class : nil }
2
2
 
3
- = link_to url do
3
+ = link_to url, data: defined?(data) ? data : {} do
4
4
 
5
5
  %span.arrow
6
6
  %i.fa.fa-angle-right
@@ -1,6 +1,6 @@
1
1
  %section.link.my-account.visible-xs-block
2
2
 
3
- = link_to edit_my_account_url do
3
+ = link_to edit_my_account_url(_location: request.fullpath) do
4
4
 
5
5
  = image_tag account_avatar_url(current_locomotive_account, '60x60#'), class: 'img-circle', alt: @current_locomotive_account.name_was
6
6
 
@@ -19,7 +19,12 @@
19
19
  = render partial: 'locomotive/shared/sidebar/page', collection: page.nodes
20
20
 
21
21
  - if page.content_type
22
- %li.new-content
22
+ %li.list-entries
23
+ %i.fa.fa-list-ul.icon
24
+ = link_to content_entries_path(current_site, page.templatized_page.content_type.slug) do
25
+ %span.text= t(:list_content_entries, name: page.content_type.name.pluralize, scope: 'locomotive.pages.index')
26
+
27
+ %li.new-entry
23
28
  %i.fa.fa-plus.icon
24
29
  = link_to new_content_entry_path(current_site, page.templatized_page.content_type.slug) do
25
30
  %span.text= t(:new_content_entry, name: page.content_type.name.singularize, scope: 'locomotive.pages.index')
@@ -5,7 +5,7 @@
5
5
 
6
6
  = render partial: 'locomotive/shared/sidebar/page', collection: nodes
7
7
 
8
- %li.new-content
8
+ %li.new-page
9
9
  %i.fa.fa-plus.icon
10
10
  = link_to new_page_path(current_site) do
11
11
  %span.text= t(:new, scope: 'locomotive.pages.index')
@@ -6,7 +6,7 @@
6
6
  = locomotive_form_for @site, url: sites_path, html: { multipart: true } do |f|
7
7
 
8
8
  = f.inputs :information do
9
- = f.input :name
9
+ = f.input :name, input_html: { class: 'input-lg' }
10
10
  = f.input :handle
11
11
 
12
12
  = f.actions back_url: sites_path
@@ -181,8 +181,8 @@ en:
181
181
  help: "Pages are organized as a tree. You can order pages as well as folders"
182
182
  no_items: "There are no pages for now. Just click <a href=\"%{url}\">here</a> to create the first one."
183
183
  new: new page
184
+ list_content_entries: "List %{name}"
184
185
  new_content_entry: "New %{name}"
185
- latest_entries: Latest pages
186
186
  new:
187
187
  title: New page
188
188
  help: "Please fill in the below form to create your page. Be careful, by default, the page is not published."
@@ -191,21 +191,11 @@ en:
191
191
  edit:
192
192
  title: "%{title} &mdash; <small>%{fullpath}</small>"
193
193
  form:
194
- change_file: change
195
- delete_file: delete
196
- cancel: cancel
197
- default_block: Default
198
- no_layout: Do not use a layout
199
- cache_strategy:
200
- none: None
201
- simple: Simple
202
- hour: 1 hour
203
- day: 1 day
204
- week: 1 week
205
- month: 1 month
206
- redirect_type:
207
- permanent: "Permanent (301)"
208
- temporary: "Temporary (302)"
194
+ no_layout: Use the layout of the parent page
195
+ main:
196
+ redirect_type:
197
+ permanent: "Permanent (301)"
198
+ temporary: "Temporary (302)"
209
199
 
210
200
  sites:
211
201
  index:
@@ -58,8 +58,8 @@ module Locomotive
58
58
  back_button = back_button_action(options)
59
59
 
60
60
  template.content_tag(:div,
61
- template.content_tag(:div, back_button, class: 'col-md-6 text-left') +
62
- template.content_tag(:div, action, class: 'col-md-6 text-right'),
61
+ template.content_tag(:div, back_button, class: 'col-xs-6 text-left') +
62
+ template.content_tag(:div, action, class: 'col-xs-6 text-right'),
63
63
  class: 'row')
64
64
  end
65
65
 
@@ -1,3 +1,6 @@
1
+ # http://semver.org/
2
+ # MAJOR.MINOR.PATCH format.
3
+ # 1.0.0-alpha < 1.0.0-alpha.1 < 1.0.0-alpha.beta < 1.0.0-beta < 1.0.0-beta.2 < 1.0.0-beta.11 < 1.0.0-rc.1 < 1.0.0
1
4
  module Locomotive #:nodoc
2
- VERSION = '3.0.0-alpha'
5
+ VERSION = '3.0.0-alpha.2'
3
6
  end
@@ -47,4 +47,30 @@ describe Locomotive::Concerns::Page::Layout do
47
47
 
48
48
  end
49
49
 
50
+ describe '#is_layout_or_related?' do
51
+
52
+ let(:fullpath) { 'foo' }
53
+
54
+ before { allow(page).to receive(:fullpath).and_return(fullpath) }
55
+
56
+ subject { page.is_layout_or_related? }
57
+
58
+ it { is_expected.to eq false }
59
+
60
+ context 'page is the layouts folder' do
61
+
62
+ let(:fullpath) { 'layouts' }
63
+ it { is_expected.to eq true }
64
+
65
+ end
66
+
67
+ context 'page under layouts' do
68
+
69
+ let(:fullpath) { 'layouts/foo' }
70
+ it { is_expected.to eq true }
71
+
72
+ end
73
+
74
+ end
75
+
50
76
  end
@@ -0,0 +1,2 @@
1
+ /* Project: Bootstrap Growl = v3.1.3 | Description: Turns standard Bootstrap alerts into "Growl-like" notifications. | Author: Mouse0270 aka Robert McIntosh | License: MIT License | Website: https://github.com/mouse0270/bootstrap-growl */
2
+ !function(t){"function"==typeof define&&define.amd?define(["jquery"],t):t("object"==typeof exports?require("jquery"):jQuery)}(function(t){function e(e,i,n){var i={content:{message:"object"==typeof i?i.message:i,title:i.title?i.title:"",icon:i.icon?i.icon:"",url:i.url?i.url:"#",target:i.target?i.target:"-"}};n=t.extend(!0,{},i,n),this.settings=t.extend(!0,{},s,n),this._defaults=s,"-"==this.settings.content.target&&(this.settings.content.target=this.settings.url_target),this.animations={start:"webkitAnimationStart oanimationstart MSAnimationStart animationstart",end:"webkitAnimationEnd oanimationend MSAnimationEnd animationend"},"number"==typeof this.settings.offset&&(this.settings.offset={x:this.settings.offset,y:this.settings.offset}),this.init()}var s={element:"body",position:null,type:"info",allow_dismiss:!0,newest_on_top:!1,showProgressbar:!1,placement:{from:"top",align:"right"},offset:20,spacing:10,z_index:1031,delay:5e3,timer:1e3,url_target:"_blank",mouse_over:null,animate:{enter:"animated fadeInDown",exit:"animated fadeOutUp"},onShow:null,onShown:null,onClose:null,onClosed:null,icon_type:"class",template:'<div data-notify="container" class="col-xs-11 col-sm-4 alert alert-{0}" role="alert"><button type="button" aria-hidden="true" class="close" data-notify="dismiss">&times;</button><span data-notify="icon"></span> <span data-notify="title">{1}</span> <span data-notify="message">{2}</span><div class="progress" data-notify="progressbar"><div class="progress-bar progress-bar-{0}" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 0%;"></div></div><a href="{3}" target="{4}" data-notify="url"></a></div>'};String.format=function(){for(var t=arguments[0],e=1;e<arguments.length;e++)t=t.replace(RegExp("\\{"+(e-1)+"\\}","gm"),arguments[e]);return t},t.extend(e.prototype,{init:function(){var t=this;this.buildNotify(),this.settings.content.icon&&this.setIcon(),"#"!=this.settings.content.url&&this.styleURL(),this.placement(),this.bind(),this.notify={$ele:this.$ele,update:function(e,s){var i={};"string"==typeof e?i[e]=s:i=e;for(var e in i)switch(e){case"type":this.$ele.removeClass("alert-"+t.settings.type),this.$ele.find('[data-notify="progressbar"] > .progress-bar').removeClass("progress-bar-"+t.settings.type),t.settings.type=i[e],this.$ele.addClass("alert-"+i[e]).find('[data-notify="progressbar"] > .progress-bar').addClass("progress-bar-"+i[e]);break;case"icon":var n=this.$ele.find('[data-notify="icon"]');"class"==t.settings.icon_type.toLowerCase()?n.removeClass(t.settings.content.icon).addClass(i[e]):(n.is("img")||n.find("img"),n.attr("src",i[e]));break;case"progress":var a=t.settings.delay-t.settings.delay*(i[e]/100);this.$ele.data("notify-delay",a),this.$ele.find('[data-notify="progressbar"] > div').attr("aria-valuenow",i[e]).css("width",i[e]+"%");break;case"url":this.$ele.find('[data-notify="url"]').attr("href",i[e]);break;case"target":this.$ele.find('[data-notify="url"]').attr("target",i[e]);break;default:this.$ele.find('[data-notify="'+e+'"]').html(i[e])}var o=this.$ele.outerHeight()+parseInt(t.settings.spacing)+parseInt(t.settings.offset.y);t.reposition(o)},close:function(){t.close()}}},buildNotify:function(){var e=this.settings.content;this.$ele=t(String.format(this.settings.template,this.settings.type,e.title,e.message,e.url,e.target)),this.$ele.attr("data-notify-position",this.settings.placement.from+"-"+this.settings.placement.align),this.settings.allow_dismiss||this.$ele.find('[data-notify="dismiss"]').css("display","none"),(this.settings.delay<=0&&!this.settings.showProgressbar||!this.settings.showProgressbar)&&this.$ele.find('[data-notify="progressbar"]').remove()},setIcon:function(){"class"==this.settings.icon_type.toLowerCase()?this.$ele.find('[data-notify="icon"]').addClass(this.settings.content.icon):this.$ele.find('[data-notify="icon"]').is("img")?this.$ele.find('[data-notify="icon"]').attr("src",this.settings.content.icon):this.$ele.find('[data-notify="icon"]').append('<img src="'+this.settings.content.icon+'" alt="Notify Icon" />')},styleURL:function(){this.$ele.find('[data-notify="url"]').css({backgroundImage:"url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)",height:"100%",left:"0px",position:"absolute",top:"0px",width:"100%",zIndex:this.settings.z_index+1}),this.$ele.find('[data-notify="dismiss"]').css({position:"absolute",right:"10px",top:"5px",zIndex:this.settings.z_index+2})},placement:function(){var e=this,s=this.settings.offset.y,i={display:"inline-block",margin:"0px auto",position:this.settings.position?this.settings.position:"body"===this.settings.element?"fixed":"absolute",transition:"all .5s ease-in-out",zIndex:this.settings.z_index},n=!1,a=this.settings;switch(t('[data-notify-position="'+this.settings.placement.from+"-"+this.settings.placement.align+'"]:not([data-closing="true"])').each(function(){return s=Math.max(s,parseInt(t(this).css(a.placement.from))+parseInt(t(this).outerHeight())+parseInt(a.spacing))}),1==this.settings.newest_on_top&&(s=this.settings.offset.y),i[this.settings.placement.from]=s+"px",this.settings.placement.align){case"left":case"right":i[this.settings.placement.align]=this.settings.offset.x+"px";break;case"center":i.left=0,i.right=0}this.$ele.css(i).addClass(this.settings.animate.enter),t.each(Array("webkit","moz","o","ms",""),function(t,s){e.$ele[0].style[s+"AnimationIterationCount"]=1}),t(this.settings.element).append(this.$ele),1==this.settings.newest_on_top&&(s=parseInt(s)+parseInt(this.settings.spacing)+this.$ele.outerHeight(),this.reposition(s)),t.isFunction(e.settings.onShow)&&e.settings.onShow.call(this.$ele),this.$ele.one(this.animations.start,function(){n=!0}).one(this.animations.end,function(){t.isFunction(e.settings.onShown)&&e.settings.onShown.call(this)}),setTimeout(function(){n||t.isFunction(e.settings.onShown)&&e.settings.onShown.call(this)},600)},bind:function(){var e=this;if(this.$ele.find('[data-notify="dismiss"]').on("click",function(){e.close()}),this.$ele.mouseover(function(){t(this).data("data-hover","true")}).mouseout(function(){t(this).data("data-hover","false")}),this.$ele.data("data-hover","false"),this.settings.delay>0){e.$ele.data("notify-delay",e.settings.delay);var s=setInterval(function(){var t=parseInt(e.$ele.data("notify-delay"))-e.settings.timer;if("false"===e.$ele.data("data-hover")&&"pause"==e.settings.mouse_over||"pause"!=e.settings.mouse_over){var i=(e.settings.delay-t)/e.settings.delay*100;e.$ele.data("notify-delay",t),e.$ele.find('[data-notify="progressbar"] > div').attr("aria-valuenow",i).css("width",i+"%")}t<=-e.settings.timer&&(clearInterval(s),e.close())},e.settings.timer)}},close:function(){var e=this,s=parseInt(this.$ele.css(this.settings.placement.from)),i=!1;this.$ele.data("closing","true").addClass(this.settings.animate.exit),e.reposition(s),t.isFunction(e.settings.onClose)&&e.settings.onClose.call(this.$ele),this.$ele.one(this.animations.start,function(){i=!0}).one(this.animations.end,function(){t(this).remove(),t.isFunction(e.settings.onClosed)&&e.settings.onClosed.call(this)}),setTimeout(function(){i||(e.$ele.remove(),e.settings.onClosed&&e.settings.onClosed(e.$ele))},600)},reposition:function(e){var s=this,i='[data-notify-position="'+this.settings.placement.from+"-"+this.settings.placement.align+'"]:not([data-closing="true"])',n=this.$ele.nextAll(i);1==this.settings.newest_on_top&&(n=this.$ele.prevAll(i)),n.each(function(){t(this).css(s.settings.placement.from,e),e=parseInt(e)+parseInt(s.settings.spacing)+t(this).outerHeight()})}}),t.notify=function(t,s){var i=new e(this,t,s);return i.notify},t.notifyDefaults=function(e){return s=t.extend(!0,{},s,e)},t.notifyClose=function(e){"undefined"==typeof e||"all"==e?t("[data-notify]").find('[data-notify="dismiss"]').trigger("click"):t('[data-notify-position="'+e+'"]').find('[data-notify="dismiss"]').trigger("click")}});
@@ -23,7 +23,6 @@
23
23
  self.ctx.imageSmoothingEnabled = true
24
24
  self.ctx.mozImageSmoothingEnabled = true
25
25
  self.ctx.oImageSmoothingEnabled = true
26
- self.ctx.webkitImageSmoothingEnabled = true
27
26
 
28
27
  if (img.naturalWidth <= width || img.naturalHeight <= height) {
29
28
  console.log("FAST resizing image", img.naturalWidth, img.naturalHeight, "=>", width, height)
@@ -215,7 +214,6 @@
215
214
  context.imageSmoothingEnabled = true
216
215
  context.mozImageSmoothingEnabled = true
217
216
  context.oImageSmoothingEnabled = true
218
- context.webkitImageSmoothingEnabled = true
219
217
 
220
218
  return context
221
219
  }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: locomotivecms
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0.pre.alpha
4
+ version: 3.0.0.pre.alpha.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Didier Lafforgue
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-19 00:00:00.000000000 Z
11
+ date: 2015-05-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 3.4.1
47
+ version: 3.5.1
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 3.4.1
54
+ version: 3.5.1
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: devise-encryptable
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -170,14 +170,14 @@ dependencies:
170
170
  requirements:
171
171
  - - "~>"
172
172
  - !ruby/object:Gem::Version
173
- version: 1.0.0.pre.alpha.1
173
+ version: 1.0.0.pre.alpha.2
174
174
  type: :runtime
175
175
  prerelease: false
176
176
  version_requirements: !ruby/object:Gem::Requirement
177
177
  requirements:
178
178
  - - "~>"
179
179
  - !ruby/object:Gem::Version
180
- version: 1.0.0.pre.alpha.1
180
+ version: 1.0.0.pre.alpha.2
181
181
  - !ruby/object:Gem::Dependency
182
182
  name: haml
183
183
  requirement: !ruby/object:Gem::Requirement
@@ -686,6 +686,7 @@ files:
686
686
  - app/assets/javascripts/locomotive/utils/backbone_patches.js.coffee
687
687
  - app/assets/javascripts/locomotive/utils/core_ext.js
688
688
  - app/assets/javascripts/locomotive/utils/layout_utils.js.coffee
689
+ - app/assets/javascripts/locomotive/utils/notify.js.coffee
689
690
  - app/assets/javascripts/locomotive/utils/rails_ujs.js.coffee
690
691
  - app/assets/javascripts/locomotive/utils/select2.js.coffee
691
692
  - app/assets/javascripts/locomotive/utils/wysihtml5.js.coffee
@@ -760,6 +761,7 @@ files:
760
761
  - app/assets/stylesheets/locomotive/components/header/_base.scss
761
762
  - app/assets/stylesheets/locomotive/components/header/_responsive.scss
762
763
  - app/assets/stylesheets/locomotive/components/misc/_nav.scss
764
+ - app/assets/stylesheets/locomotive/components/misc/_notify.scss
763
765
  - app/assets/stylesheets/locomotive/components/not_logged_in/_passwords.scss
764
766
  - app/assets/stylesheets/locomotive/components/not_logged_in/_sign_in_and_up.scss
765
767
  - app/assets/stylesheets/locomotive/components/sidebar/_base.scss
@@ -931,6 +933,7 @@ files:
931
933
  - app/services/locomotive/membership_service.rb
932
934
  - app/services/locomotive/page_parsing_service.rb
933
935
  - app/services/locomotive/page_service.rb
936
+ - app/services/locomotive/page_tree_service.rb
934
937
  - app/services/locomotive/site_service.rb
935
938
  - app/uploaders/locomotive/content_asset_uploader.rb
936
939
  - app/uploaders/locomotive/editable_file_uploader.rb
@@ -990,8 +993,6 @@ files:
990
993
  - app/views/locomotive/my_account/form/_tabs.html.haml
991
994
  - app/views/locomotive/notifications/new_content_entry.html.haml
992
995
  - app/views/locomotive/pages/_editable_elements.html.haml
993
- - app/views/locomotive/pages/_form.html.haml
994
- - app/views/locomotive/pages/_page.html.haml
995
996
  - app/views/locomotive/pages/edit.html.haml
996
997
  - app/views/locomotive/pages/form/_actions.html.haml
997
998
  - app/views/locomotive/pages/form/_main.html.haml
@@ -1456,7 +1457,7 @@ files:
1456
1457
  - vendor/assets/images/select2.png
1457
1458
  - vendor/assets/images/select2x2.png
1458
1459
  - vendor/assets/javascripts/locomotive/bootstrap-datetimepicker.js
1459
- - vendor/assets/javascripts/locomotive/bootstrap-growl.js
1460
+ - vendor/assets/javascripts/locomotive/bootstrap-notify.js
1460
1461
  - vendor/assets/javascripts/locomotive/bootstrap-switch.js
1461
1462
  - vendor/assets/javascripts/locomotive/bootstrap-tagsinput.min.js
1462
1463
  - vendor/assets/javascripts/locomotive/canvas-to-blob.min.js