spina 0.9.0 → 0.10.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of spina might be problematic. Click here for more details.

Files changed (99) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +6 -2
  3. data/app/assets/javascripts/spina/admin/account.js.coffee +1 -1
  4. data/app/assets/javascripts/spina/admin/pages.js.coffee.erb +1 -1
  5. data/app/assets/javascripts/spina/admin/spina.infinite_scroll.coffee +6 -2
  6. data/app/assets/javascripts/spina/admin/spina.scaffold.coffee +2 -2
  7. data/app/assets/javascripts/spina/admin/{spina.trix.js.coffee → spina.trix.js.coffee.erb} +1 -1
  8. data/app/assets/stylesheets/spina/admin/application.sass +3 -0
  9. data/app/controllers/spina/admin/accounts_controller.rb +0 -2
  10. data/app/controllers/spina/admin/admin_controller.rb +0 -2
  11. data/app/controllers/spina/admin/attachments_controller.rb +5 -3
  12. data/app/controllers/spina/admin/pages_controller.rb +1 -2
  13. data/app/controllers/spina/admin/photos_controller.rb +9 -6
  14. data/app/controllers/spina/admin/users_controller.rb +0 -2
  15. data/app/controllers/spina/pages_controller.rb +17 -6
  16. data/app/helpers/spina/admin/pages_helper.rb +15 -0
  17. data/app/models/spina/account.rb +8 -7
  18. data/app/models/spina/application_record.rb +5 -0
  19. data/app/models/spina/attachment.rb +6 -1
  20. data/app/models/spina/attachment_collection.rb +1 -1
  21. data/app/models/spina/color.rb +1 -1
  22. data/app/models/spina/layout_part.rb +1 -1
  23. data/app/models/spina/line.rb +1 -1
  24. data/app/models/spina/page.rb +10 -2
  25. data/app/models/spina/page_part.rb +1 -1
  26. data/app/models/spina/photo.rb +2 -2
  27. data/app/models/spina/photo_collection.rb +1 -1
  28. data/app/models/spina/photo_collections_photo.rb +1 -1
  29. data/app/models/spina/rewrite_rule.rb +1 -1
  30. data/app/models/spina/structure.rb +1 -1
  31. data/app/models/spina/structure_item.rb +9 -4
  32. data/app/models/spina/structure_part.rb +1 -1
  33. data/app/models/spina/text.rb +1 -1
  34. data/app/models/spina/user.rb +1 -1
  35. data/app/presenters/spina/pages/breadcrumb.rb +102 -0
  36. data/app/presenters/spina/pages/menu_presenter.rb +16 -5
  37. data/app/views/layouts/spina/admin/admin.html.haml +31 -0
  38. data/app/views/layouts/spina/admin/media_library.html.haml +11 -9
  39. data/app/views/spina/admin/accounts/_form.html.haml +29 -23
  40. data/app/views/spina/admin/accounts/analytics.html.haml +19 -15
  41. data/app/views/spina/admin/accounts/social.html.haml +19 -15
  42. data/app/views/spina/admin/accounts/style.html.haml +19 -15
  43. data/app/views/spina/admin/attachments/_select.html.haml +1 -1
  44. data/app/views/spina/admin/attachments/_select_collection.html.haml +1 -1
  45. data/app/views/spina/admin/attachments/insert.js.coffee +5 -0
  46. data/app/views/spina/admin/attachments/insert_collection.js.coffee +7 -0
  47. data/app/views/spina/admin/page_partables/attachment_collections/_form.html.haml +8 -9
  48. data/app/views/spina/admin/page_partables/attachments/_form.html.haml +7 -8
  49. data/app/views/spina/admin/page_partables/photo_collections/_form.html.haml +2 -2
  50. data/app/views/spina/admin/page_partables/photos/_form.html.haml +6 -10
  51. data/app/views/spina/admin/pages/_form.html.haml +25 -6
  52. data/app/views/spina/admin/pages/_form_advanced.html.haml +45 -45
  53. data/app/views/spina/admin/pages/_form_page_content.html.haml +1 -1
  54. data/app/views/spina/admin/pages/_form_page_seo.html.haml +1 -1
  55. data/app/views/spina/admin/pages/edit.html.haml +0 -19
  56. data/app/views/spina/admin/pages/index.html.haml +36 -29
  57. data/app/views/spina/admin/pages/new.html.haml +0 -10
  58. data/app/views/spina/admin/photos/_photo_collection_select.html.haml +4 -4
  59. data/app/views/spina/admin/photos/_photo_multi_picker.html.haml +2 -2
  60. data/app/views/spina/admin/photos/_photo_select.html.haml +4 -1
  61. data/app/views/spina/admin/photos/_photo_single_picker.html.haml +2 -2
  62. data/app/views/spina/admin/photos/index.html.haml +3 -2
  63. data/app/views/spina/admin/photos/insert_photo.js.erb +4 -4
  64. data/app/views/spina/admin/photos/insert_photo_collection.js.erb +6 -3
  65. data/app/views/spina/admin/photos/multi_picker_infinite_scroll.js.erb +1 -1
  66. data/app/views/spina/admin/photos/single_picker_infinite_scroll.js.erb +1 -1
  67. data/app/views/spina/admin/shared/_breadcrumbs.html.haml +1 -0
  68. data/app/views/spina/admin/shared/_notifications.html.haml +23 -12
  69. data/app/views/spina/admin/shared/_primary_navigation.html.haml +43 -3
  70. data/app/views/spina/admin/structure_partables/photos/_form.html.haml +3 -6
  71. data/app/views/spina/admin/users/_form.html.haml +37 -33
  72. data/app/views/spina/admin/users/index.html.haml +27 -23
  73. data/config/initializers/assets.rb +1 -1
  74. data/config/locales/de.yml +4 -0
  75. data/config/locales/en.yml +6 -1
  76. data/config/locales/es.yml +4 -0
  77. data/config/locales/fr.yml +4 -0
  78. data/config/locales/it.yml +4 -0
  79. data/config/locales/nl.yml +8 -0
  80. data/config/locales/pt-BR.yml +4 -0
  81. data/config/locales/ru.yml +16 -4
  82. data/config/locales/tr.yml +4 -0
  83. data/config/locales/zh-CN.yml +4 -0
  84. data/config/routes.rb +3 -3
  85. data/lib/generators/spina/install_generator.rb +31 -11
  86. data/lib/generators/spina/templates/app/views/default/pages/homepage.html.haml +1 -1
  87. data/lib/generators/spina/templates/app/views/default/pages/show.html.haml +1 -1
  88. data/lib/generators/spina/templates/app/views/demo/pages/homepage.html.haml +1 -1
  89. data/lib/generators/spina/templates/app/views/demo/pages/show.html.haml +1 -1
  90. data/lib/generators/spina/templates/config/initializers/spina.rb +1 -0
  91. data/lib/spina.rb +2 -1
  92. data/lib/spina/version.rb +1 -1
  93. data/lib/tasks/spina_tasks.rake +9 -1
  94. metadata +33 -18
  95. data/app/views/layouts/spina/admin/application.html.haml +0 -40
  96. data/app/views/layouts/spina/admin/settings.html.haml +0 -45
  97. data/app/views/layouts/spina/admin/website.html.haml +0 -26
  98. data/app/views/spina/admin/attachments/insert.js.erb +0 -5
  99. data/app/views/spina/admin/attachments/insert_collection.js.erb +0 -7
@@ -1,32 +1,36 @@
1
1
  = form_for [spina, :admin, current_account] do |f|
2
- .table-container
3
- %table.table.table-form
4
- %tr
5
- %td
2
+ %header#header
3
+ = render partial: 'spina/admin/shared/breadcrumbs'
4
+
5
+ #header_actions
6
+ %button.button.button-primary{type: 'submit', data: {icon: 'o'}}
7
+ = icon('check')
8
+ = t('spina.preferences.style_save')
9
+
10
+ .well
11
+ .horizontal-form
12
+ .horizontal-form-group
13
+ .horizontal-form-label
6
14
  = Spina::Account.human_attribute_name(:theme)
7
- %td
15
+ .horizontal-form-content
8
16
  .select-dropdown.account-theme{data: {layout_parts: current_theme.layout_parts.map{|layout_part| layout_part[:name]}}}
9
17
  - options = options_for_select(::Spina::Theme.all.map { |theme| [theme.name, theme.name, {'data-layout-parts' => theme.layout_parts.map{|layout_part| layout_part[:name] }}] }, current_account.theme)
10
18
  = f.select :theme, options
11
- %tr
12
- %td
19
+ .horizontal-form-group
20
+ .horizontal-form-label
13
21
  = Spina::Account.human_attribute_name(:logo)
14
- %td
22
+ .horizontal-form-content
15
23
  = image_tag current_account.logo
16
24
  = f.file_field :logo
17
25
 
18
26
  = f.fields_for :layout_parts do |ff|
19
- %tr.layout-part{data: {name: ff.object.name}}
20
- %td
27
+ .horizontal-form-group.layout-part{data: {name: ff.object.name}}
28
+ .horizontal-form-label
21
29
  = ff.object.title
22
- %td
30
+ .horizontal-form-content
23
31
  = ff.hidden_field :id
24
32
  = ff.hidden_field :title
25
33
  = ff.hidden_field :layout_partable_type
26
34
  = ff.hidden_field :name
27
35
 
28
36
  = render "spina/admin/layout_partables/#{ partable_type_partial_namespace(ff.object.layout_partable_type) }/form", f: ff
29
-
30
- %button.button.button-primary{type: 'submit', data: {icon: 'o'}}
31
- = icon('check')
32
- = t('spina.preferences.style_save')
@@ -17,7 +17,7 @@
17
17
  %tbody
18
18
  - @attachments.each do |attachment|
19
19
  %tr
20
- %td= radio_button_tag :attachment_id, attachment.id
20
+ %td= radio_button_tag :attachment_id, attachment.id, attachment.id == @selected_attachment_id
21
21
  %td= attachment.name
22
22
 
23
23
  %footer
@@ -17,7 +17,7 @@
17
17
  %tbody
18
18
  - @attachments.each do |attachment|
19
19
  %tr
20
- %td= check_box_tag 'attachment_ids[]', attachment.id
20
+ %td= check_box_tag 'attachment_ids[]', attachment.id, attachment.id.in?(@selected_attachment_ids)
21
21
  %td= attachment.name
22
22
 
23
23
  %footer
@@ -0,0 +1,5 @@
1
+ hidden_input = $("input[name='<%= j params[:page_part_id] %>[page_partable_id]']")
2
+ hidden_input.parents('.media_picker').find('.attachment').remove()
3
+ hidden_input.parents('.media_picker').append("<div class='attachment'><%= @attachment.name %></div>")
4
+ hidden_input.val("<%= @attachment.id %>")
5
+ $.hideModal()
@@ -0,0 +1,7 @@
1
+ hidden_input = $("input[name='<%= j params[:page_part_id] %>[attachment_tokens]']")
2
+ attachment_collection = $("<%= j render partial: 'attachment_collection', locals: {attachments: @attachments} %>")
3
+
4
+ hidden_input.parents('.media_picker').find('.attachment').remove()
5
+ hidden_input.parents('.media_picker').append(attachment_collection)
6
+ hidden_input.val("<%= @attachments.map(&:id).join(',') %>")
7
+ $.hideModal()
@@ -2,14 +2,13 @@
2
2
  = f.object.title
3
3
  .horizontal-form-content
4
4
  = f.fields_for :page_partable, f.object.page_partable do |ff|
5
- = link_to select_collection_admin_attachments_path(ff.object_name), remote: true, class: "media_picker" do
6
- .clearfix
7
- .placeholder.pull-right
8
- %span.button.button-small.button-round
9
- %i.icon.icon-dots
10
- = t('spina.choose_from_library')
11
- - if ff.object.attachments.any?
12
- - ff.object.attachments.each do |attachment|
13
- .attachment= attachment.name
5
+ = link_to select_collection_admin_attachments_path(ff.object_name, selected_attachment_ids: ff.object.attachment_ids), remote: true, class: 'media_picker clearfix' do
6
+ .placeholder.pull-right
7
+ %span.button.button-small.button-round
8
+ %i.icon.icon-dots
9
+ = t('spina.choose_from_library')
10
+ - if ff.object.attachments.any?
11
+ - ff.object.attachments.each do |attachment|
12
+ .attachment= attachment.name
14
13
 
15
14
  = ff.hidden_field :attachment_tokens, value: ff.object.attachment_ids.join(",")
@@ -1,14 +1,13 @@
1
1
  .horizontal-form-label
2
2
  = f.object.title
3
3
  .horizontal-form-content
4
- = link_to select_admin_attachments_path(f.object_name), remote: true, class: "media_picker" do
5
- .clearfix
6
- .placeholder.pull-right
7
- %span.button.button-small.button-round
8
- %i.icon.icon-dots
9
- = t('spina.choose_from_library')
4
+ = link_to select_admin_attachments_path(f.object_name, selected_attachment_id: f.object.page_partable.try(:id)), remote: true, class: 'media_picker clearfix' do
5
+ .placeholder.pull-right
6
+ %span.button.button-small.button-round
7
+ %i.icon.icon-dots
8
+ = t('spina.choose_from_library')
10
9
 
11
- - if f.object.page_partable && f.object.page_partable.file.present?
12
- .attachment= f.object.page_partable.name
10
+ - if f.object.page_partable && f.object.page_partable.file.present?
11
+ .attachment= f.object.page_partable.name
13
12
 
14
13
  = f.hidden_field :page_partable_id
@@ -2,8 +2,8 @@
2
2
  = f.object.title
3
3
  .horizontal-form-content
4
4
  = f.fields_for :page_partable, f.object.page_partable do |ff|
5
- = link_to spina.photo_collection_select_admin_photos_path(ff.object_name, selected_photo_ids: (ff.object.photo_ids if ff.object.photos.any?)), remote: true, class: "media_picker" do
6
- .placeholder{class: ('pull-right' if ff.object.photos.any?)}
5
+ = link_to spina.photo_collection_select_admin_photos_path(ff.object_name, selected_photo_ids: ff.object.photo_ids), remote: true, class: 'media_picker clearfix' do
6
+ .placeholder.pull-right
7
7
  %span.button.button-small.button-round
8
8
  %i.icon.icon-dots
9
9
  =t 'spina.pages.photos_picker'
@@ -1,18 +1,14 @@
1
1
  .horizontal-form-label
2
2
  = f.object.title
3
3
  .horizontal-form-content
4
- = link_to spina.photo_select_admin_photos_path(f.object_name, selected_photo_id: (f.object.page_partable.id if f.object.page_partable.present?)), remote: true, class: "media_picker" do
4
+ = link_to spina.photo_select_admin_photos_path(f.object_name, selected_photo_id: f.object.page_partable.try(:id)), remote: true, class: 'media_picker clearfix' do
5
+ .placeholder.pull-right
6
+ %span.button.button-small.button-round
7
+ %i.icon.icon-dots
8
+ =t 'spina.pages.photo_picker'
9
+
5
10
  - if f.object.page_partable && f.object.page_partable.file.present?
6
- .placeholder.pull-right
7
- %span.button.button-small.button-round
8
- %i.icon.icon-dots
9
- =t 'spina.pages.photo_picker'
10
11
  .image
11
12
  = image_tag f.object.page_partable.file.thumb
12
- - else
13
- .placeholder
14
- %span.button.button-small.button-round
15
- %i.icon.icon-dots
16
- =t 'spina.pages.photo_picker'
17
13
 
18
14
  = f.hidden_field :page_partable_id
@@ -1,4 +1,29 @@
1
1
  = form_for [spina, :admin, @page], multipart: true, html: {autocomplete: "off"} do |f|
2
+ %header#header
3
+ .breadcrumbs= render_breadcrumbs separator: '<div class="divider"></div>'
4
+ - unless @page.new_record?
5
+ - if Spina.config.locales.size > 1
6
+ %div{style: 'display: inline-block; margin-left: 12px; top: -4px', data: {dropdown: true}}
7
+ = link_to '#', class: 'button button-link button-round button-small', data: {trigger: 'dropdown', target: '#locales'} do
8
+ = icon('comment')
9
+ = @locale.upcase
10
+
11
+ %ul#locales
12
+ - Spina.config.locales.each do |locale|
13
+ %li
14
+ = link_to t("languages.#{locale}"), "?locale=#{locale}", style: ('font-weight: 600' if @locale.to_s == locale.to_s)
15
+
16
+ #header_actions
17
+ %button.button.button-primary{type: 'submit', style: 'margin-right: 0'}
18
+ = icon('check')
19
+ =t 'spina.pages.save'
20
+
21
+ %nav#secondary.tabs
22
+ %ul
23
+ - @tabs.each_with_index do |tab, i|
24
+ %li{class: (i==0 ? 'active' : '')}
25
+ = link_to t("spina.pages.#{tab}"), "##{tab}"
26
+
2
27
  = hidden_field_tag :locale, @locale
3
28
 
4
29
  - content_for :notification_alert do
@@ -8,11 +33,5 @@
8
33
  - @tabs.each do |tab|
9
34
  = render "spina/admin/pages/form_#{tab}", f: f
10
35
 
11
- %button.button.button-primary{type: 'submit'}
12
- = icon('check')
13
- =t 'spina.pages.save'
14
-
15
- = link_to t('spina.cancel'), spina.admin_pages_path, class: 'button button-link'
16
-
17
36
  - unless @page.new_record? || !@page.deletable
18
37
  .pull-right= link_to t('spina.permanently_delete'), spina.admin_page_path(@page), method: :delete, data: {confirm: t('spina.pages.delete_confirmation', subject: @page.menu_title)}, class: 'button button-link button-danger'
@@ -1,47 +1,47 @@
1
- #advanced.tab-content
2
- .table-container
3
- %table.table.table-form
4
- %tr
5
- %td
6
- = Spina::Page.human_attribute_name :draft
7
- %small= Spina::Page.human_attribute_name :draft_description
8
- %td
9
- = f.check_box :draft, data: {switch: true}
10
- %tr
11
- %td
12
- = Spina::Page.human_attribute_name :skip_to_first_child
13
- %small= Spina::Page.human_attribute_name :skip_to_first_child_description
14
- %td
15
- = f.check_box :skip_to_first_child, data: {switch: true}
16
- %tr
17
- %td
18
- = Spina::Page.human_attribute_name :link_url
19
- %small= Spina::Page.human_attribute_name :link_url_description
20
- %td
21
- = f.text_field :link_url, placeholder: Spina::Page.human_attribute_name(:link_url_placeholder)
22
- %tr
23
- %td
24
- = Spina::Page.human_attribute_name :show_in_menu
25
- %small= Spina::Page.human_attribute_name :show_in_menu_description
26
- %td
27
- = f.check_box :show_in_menu, data: {switch: true}
28
- %tr{style: ('border-bottom: none' if @page.custom_page?)}
29
- %td
30
- = Spina::Page.human_attribute_name :menu_title
31
- %td
32
- = f.text_field :menu_title, placeholder: Spina::Page.human_attribute_name(:show_in_menu_placeholder), value: f.object.read_attribute(:menu_title)
1
+ #advanced.tab-content.well
2
+ .horizontal-form
3
+ .horizontal-form-group
4
+ .horizontal-form-label
5
+ = Spina::Page.human_attribute_name :draft
6
+ %small= Spina::Page.human_attribute_name :draft_description
7
+ .horizontal-form-content
8
+ = f.check_box :draft, data: {switch: true}
33
9
 
34
- %tr{style: ('display: none' if @page.custom_page?)}
35
- %td
36
- = Spina::Page.human_attribute_name :view_template
37
- %td
38
- .select-dropdown.page-template{data: {page_parts: @page.view_template_config(current_theme)[:page_parts]}}
39
- - options = options_for_select(current_theme.view_templates.map { |template| [template[:title], template[:name], {'data-page-parts' => template[:page_parts]}] }, @page.view_template)
40
- = f.select :view_template, options
10
+ .horizontal-form-group
11
+ .horizontal-form-label
12
+ = Spina::Page.human_attribute_name :skip_to_first_child
13
+ %small= Spina::Page.human_attribute_name :skip_to_first_child_description
14
+ .horizontal-form-content
15
+ = f.check_box :skip_to_first_child, data: {switch: true}
16
+ .horizontal-form-group
17
+ .horizontal-form-label
18
+ = Spina::Page.human_attribute_name :link_url
19
+ %small= Spina::Page.human_attribute_name :link_url_description
20
+ .horizontal-form-content
21
+ = f.text_field :link_url, placeholder: Spina::Page.human_attribute_name(:link_url_placeholder)
22
+ .horizontal-form-group
23
+ .horizontal-form-label
24
+ = Spina::Page.human_attribute_name :show_in_menu
25
+ %small= Spina::Page.human_attribute_name :show_in_menu_description
26
+ .horizontal-form-content
27
+ = f.check_box :show_in_menu, data: {switch: true}
28
+ .horizontal-form-group
29
+ .horizontal-form-label
30
+ = Spina::Page.human_attribute_name :menu_title
31
+ .horizontal-form-content
32
+ = f.text_field :menu_title, placeholder: Spina::Page.human_attribute_name(:show_in_menu_placeholder), value: f.object.read_attribute(:menu_title)
41
33
 
42
- %tr{style: ('display: none' if @page.custom_page?)}
43
- %td
44
- = Spina::Page.human_attribute_name :ancestry
45
- %td
46
- .select-dropdown.ancestry
47
- = f.select :ancestry, options_from_collection_for_select(Spina::Page.active.sorted.roots, 'id', 'menu_title', @page.ancestry.to_i), include_blank: Spina::Page.human_attribute_name(:no_parent)
34
+ .horizontal-form-group{style: ('display: none' if @page.custom_page?)}
35
+ .horizontal-form-label
36
+ = Spina::Page.human_attribute_name :view_template
37
+ .horizontal-form-content
38
+ .select-dropdown.page-template{data: {page_parts: @page.view_template_config(current_theme)[:page_parts]}}
39
+ - options = options_for_select(current_theme.view_templates.map { |template| [template[:title], template[:name], {'data-page-parts' => template[:page_parts]}] }, @page.view_template)
40
+ = f.select :view_template, options
41
+
42
+ .horizontal-form-group{style: ('display: none' if @page.custom_page?)}
43
+ .horizontal-form-label
44
+ = Spina::Page.human_attribute_name :ancestry
45
+ .horizontal-form-content
46
+ .select-dropdown.ancestry
47
+ = f.select :parent_id, page_ancestry_options(f.object), include_blank: Spina::Page.human_attribute_name(:no_parent)
@@ -1,4 +1,4 @@
1
- #page_content.tab-content.active
1
+ #page_content.tab-content.active.well
2
2
  .horizontal-form
3
3
  .horizontal-form-group
4
4
  .horizontal-form-label
@@ -1,4 +1,4 @@
1
- #page_seo.tab-content
1
+ #page_seo.tab-content.well
2
2
  .horizontal-form
3
3
  .horizontal-form-group
4
4
  .horizontal-form-label
@@ -1,20 +1 @@
1
- - content_for :header_actions do
2
- - if Spina.config.locales.size > 1
3
- .pull-right{data: {dropdown: true}}
4
- = link_to '#', class: 'button button-round button-hollow button-small', data: {trigger: 'dropdown', target: '#locales'} do
5
- = icon('comment')
6
- = @locale.upcase
7
-
8
- %ul#locales
9
- - Spina.config.locales.each do |locale|
10
- %li
11
- = link_to t("languages.#{locale}"), "?locale=#{locale}", style: ('font-weight: 600' if @locale.to_s == locale.to_s)
12
-
13
- - content_for :tertiary_navigation do
14
- %nav.tabs
15
- %ul
16
- - @tabs.each_with_index do |tab, i|
17
- %li{class: (i==0 ? 'active' : '')}
18
- = link_to t("spina.pages.#{tab}"), "##{tab}"
19
-
20
1
  = render 'form'
@@ -6,41 +6,48 @@
6
6
  =t 'spina.pages.invisible_to_search_engines'
7
7
  %small=t 'spina.pages.invisible_to_search_engines_description'
8
8
 
9
- .filters
10
- %span{data: {dropdown: true}}
11
- = link_to spina.new_admin_page_path(params: {view_template: 'show'}), class: 'button button-primary', data: {trigger: ('dropdown' if current_theme.new_page_templates.size > 1), target: '#create_page_dropdown'} do
12
- = icon('plus')
13
- = t('spina.pages.new')
9
+ %header#header
10
+ #header_actions
11
+ = link_to '#pages_list', class: 'button sort-switch', data: {change_order: t('spina.pages.change_order'), done_changing_order: t('spina.pages.done_changing_order')} do
12
+ = icon('random')
13
+ = t('spina.pages.change_order')
14
14
 
15
- .sliding-dropdown#create_page_dropdown
16
- .slide-controls
17
- %a.previous.muted.icon-only{href: '#'}
18
- = icon('chevron-left')
15
+ %span{data: {dropdown: true}}
16
+ = link_to spina.new_admin_page_path(params: {view_template: 'show'}), class: 'button button-primary', style: 'margin-right: 0', data: {trigger: ('dropdown' if current_theme.new_page_templates.size > 1), target: '#create_page_dropdown'} do
17
+ = icon('plus')
18
+ = t('spina.pages.new')
19
19
 
20
- - current_theme.new_page_templates.each_with_index do |template, index|
21
- .slide-title{class: ('active' if index == 0), data: {target: "#slide-#{template[1].parameterize}"}}= template[1]
20
+ .sliding-dropdown#create_page_dropdown.align-right
21
+ .slide-controls
22
+ %a.previous.muted.icon-only{href: '#'}
23
+ = icon('chevron-left')
24
+
25
+ - current_theme.new_page_templates.each_with_index do |template, index|
26
+ .slide-title{class: ('active' if index == 0), data: {target: "#slide-#{template[1].parameterize}"}}= template[1]
22
27
 
23
- %a.next.icon-only{href: '#'}
24
- = icon('chevron-right')
28
+ %a.next.icon-only{href: '#'}
29
+ = icon('chevron-right')
25
30
 
26
- - current_theme.new_page_templates.each_with_index do |template, index|
27
- .slide{class: ('active' if index == 0), id: "slide-#{template[1].parameterize}"}
28
- %p= template[2]
31
+ - current_theme.new_page_templates.each_with_index do |template, index|
32
+ .slide{class: ('active' if index == 0), id: "slide-#{template[1].parameterize}"}
33
+ %p= template[2]
34
+
35
+ %p.muted= template[3]
29
36
 
30
- %p.muted= template[3]
37
+ .slide-dots
38
+ - current_theme.new_page_templates.each_with_index do |template2, index2|
39
+ .slide-dot{class: ('active' if index2 == index)}
31
40
 
32
- .slide-dots
33
- - current_theme.new_page_templates.each_with_index do |template2, index2|
34
- .slide-dot{class: ('active' if index2 == index)}
41
+ = link_to spina.new_admin_page_path(params: {view_template: template[0]}), class: 'button button-primary' do
42
+ = icon('pencil-outline')
43
+ = t('spina.pages.create_page', template: template[1])
35
44
 
36
- = link_to spina.new_admin_page_path(params: {view_template: template[0]}), class: 'button button-primary' do
37
- = icon('pencil-outline')
38
- = t('spina.pages.create_page', template: template[1])
45
+ .breadcrumbs= render_breadcrumbs seperator: '<div class="divider"></div>'
39
46
 
40
- = link_to '#pages_list', class: 'button sort-switch', data: {change_order: t('spina.pages.change_order'), done_changing_order: t('spina.pages.done_changing_order')} do
41
- = icon('random')
42
- = t('spina.pages.change_order')
47
+ .filters
48
+
43
49
 
44
- .dd#pages_list{data: {:"sort-url" => spina.sort_admin_pages_url }}
45
- %ol.dd-list
46
- = render partial: 'page', collection: @pages.roots
50
+ .well
51
+ .dd#pages_list{data: {:"sort-url" => spina.sort_admin_pages_url }}
52
+ %ol.dd-list
53
+ = render partial: 'page', collection: @pages.roots
@@ -1,11 +1 @@
1
- - content_for :tertiary_navigation do
2
- %nav.tabs
3
- %ul
4
- %li.active
5
- = link_to t('spina.pages.page_content'), "#page_content"
6
- %li
7
- = link_to t('spina.pages.page_seo'), "#page_seo"
8
- %li
9
- = link_to t('spina.pages.advanced'), "#advanced"
10
-
11
1
  = render 'form'
@@ -5,12 +5,12 @@
5
5
  = form_for [spina, :admin, @photo], html: {multipart: true} do |f|
6
6
  = f.label :file, t('spina.photos.upload_image')
7
7
  = f.file_field :file, data: {customfileinput: true}
8
-
8
+
9
9
  = form_tag spina.insert_photo_collection_admin_photos_path(params[:page_part_id]), remote: true, class: 'gallery-prepend-image' do
10
10
  .infinite-scroll
11
11
  = render partial: 'spina/admin/photos/photo_multi_picker', collection: @photos
12
12
 
13
- .infinite-pagination= link_to_next_page @photos, 'Next', params: {selected_photo_ids: @selected_photos.ids}, remote: true
13
+ .infinite-pagination= link_to_next_page @photos, 'Next', params: params.slice(:selected_photo_ids), remote: true
14
14
 
15
15
  .gallery-select-action-bar
16
16
  .pull-right
@@ -19,5 +19,5 @@
19
19
  = icon('plus')
20
20
  = t('spina.photos.choose_images')
21
21
  %span.gallery-select-counter
22
- - if @selected_photos.any?
23
- (#{@selected_photos.count})
22
+ - if @selected_photo_ids.any?
23
+ (#{ @selected_photo_ids.count })