spina 0.8.3 → 0.9.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.
- checksums.yaml +4 -4
- data/README.md +63 -52
- data/app/assets/javascripts/spina/admin/application.js +0 -1
- data/app/controllers/spina/admin/accounts_controller.rb +11 -16
- data/app/controllers/spina/admin/admin_controller.rb +12 -23
- data/app/controllers/spina/admin/attachments_controller.rb +1 -1
- data/app/controllers/spina/admin/pages_controller.rb +14 -7
- data/app/controllers/spina/admin/photos_controller.rb +4 -2
- data/app/controllers/spina/admin/sessions_controller.rb +3 -3
- data/app/controllers/spina/admin/users_controller.rb +3 -3
- data/app/controllers/spina/application_controller.rb +7 -3
- data/app/controllers/spina/pages_controller.rb +13 -2
- data/app/controllers/spina/sitemaps_controller.rb +1 -0
- data/app/helpers/spina/admin/pages_helper.rb +12 -2
- data/app/helpers/spina/application_helper.rb +0 -9
- data/app/models/concerns/spina/part.rb +31 -0
- data/app/models/{spina → concerns/spina}/partable.rb +0 -0
- data/app/models/spina/ability.rb +0 -1
- data/app/models/spina/account.rb +6 -6
- data/app/models/spina/attachment.rb +1 -1
- data/app/models/spina/layout_part.rb +4 -27
- data/app/models/spina/line.rb +2 -0
- data/app/models/spina/page.rb +24 -5
- data/app/models/spina/page_part.rb +6 -30
- data/app/models/spina/structure_part.rb +7 -19
- data/app/models/spina/text.rb +2 -0
- data/app/views/layouts/spina/admin/application.html.haml +12 -14
- data/app/views/layouts/spina/admin/media_library.html.haml +4 -4
- data/app/views/layouts/spina/admin/settings.html.haml +7 -8
- data/app/views/layouts/spina/admin/website.html.haml +9 -16
- data/app/views/spina/admin/accounts/style.html.haml +10 -10
- data/app/views/spina/admin/attachments/_attachment.html.haml +1 -2
- data/app/views/spina/admin/{pages/_attachment_fields.html.haml → attachments/_fields.html.haml} +0 -0
- data/app/views/spina/admin/attachments/index.html.haml +2 -7
- data/app/views/spina/admin/layout_partables/colors/_form.html.haml +4 -0
- data/app/views/spina/admin/layout_partables/lines/_form.html.haml +2 -0
- data/app/views/spina/admin/page_partables/attachment_collections/_form.html.haml +15 -0
- data/app/views/spina/admin/page_partables/attachments/_form.html.haml +14 -0
- data/app/views/spina/admin/page_partables/colors/_form.html.haml +7 -0
- data/app/views/spina/admin/page_partables/lines/_form.html.haml +5 -0
- data/app/views/spina/admin/page_partables/photo_collections/_form.html.haml +17 -0
- data/app/views/spina/admin/page_partables/photos/_form.html.haml +18 -0
- data/app/views/spina/admin/page_partables/structures/_form.html.haml +22 -0
- data/app/views/spina/admin/page_partables/texts/_form.html.haml +5 -0
- data/app/views/spina/admin/pages/_form.html.haml +11 -8
- data/app/views/spina/admin/pages/_form_advanced.html.haml +3 -3
- data/app/views/spina/admin/pages/_form_page_content.html.haml +8 -3
- data/app/views/spina/admin/pages/_form_page_seo.html.haml +1 -1
- data/app/views/spina/admin/pages/edit.html.haml +13 -1
- data/app/views/spina/admin/photos/_photo.html.haml +1 -3
- data/app/views/spina/admin/photos/create.js.erb +1 -2
- data/app/views/spina/admin/photos/create_and_select.js.erb +7 -0
- data/app/views/spina/admin/photos/index.html.haml +7 -6
- data/app/views/spina/admin/shared/_primary_navigation.html.haml +19 -0
- data/app/views/spina/admin/shared/_rich_text_field.html.haml +2 -2
- data/app/views/spina/admin/structure_items/_fields.html.haml +16 -0
- data/app/views/spina/admin/structure_partables/lines/_form.html.haml +2 -0
- data/app/views/spina/admin/structure_partables/photos/_form.html.haml +11 -0
- data/app/views/spina/admin/structure_partables/texts/_form.html.haml +2 -0
- data/app/views/spina/sitemaps/show.xml.builder +12 -8
- data/{lib/spina/carrierwave.rb → config/initializers/spina.rb} +0 -0
- data/config/locales/de.yml +0 -26
- data/config/locales/en.yml +4 -26
- data/config/locales/es.yml +0 -26
- data/config/locales/fr.yml +4 -27
- data/config/locales/it.yml +0 -26
- data/config/locales/nl.yml +2 -28
- data/config/locales/pt-BR.yml +0 -26
- data/config/locales/ru.yml +0 -26
- data/config/locales/tr.yml +2 -28
- data/config/locales/zh-CN.yml +0 -3
- data/config/routes.rb +3 -19
- data/db/migrate/{20150507135428_create_spina_tables.rb → 1_create_spina_tables.rb} +0 -11
- data/db/migrate/2_create_spina_translation_tables.rb +13 -0
- data/lib/generators/spina/install_generator.rb +23 -9
- data/lib/generators/spina/templates/app/assets/stylesheets/demo/application.css.sass +3 -0
- data/lib/generators/spina/templates/app/views/demo/shared/_languages.html.haml +2 -0
- data/lib/generators/spina/templates/app/views/layouts/demo/application.html.haml +1 -0
- data/lib/generators/spina/templates/config/initializers/carrierwave.rb +17 -0
- data/lib/generators/spina/templates/config/initializers/spina.rb +2 -22
- data/lib/generators/spina/templates/config/initializers/themes/default.rb +29 -45
- data/lib/generators/spina/templates/config/initializers/themes/demo.rb +82 -92
- data/lib/spina.rb +24 -30
- data/lib/spina/engine.rb +2 -22
- data/lib/spina/plugin.rb +21 -3
- data/lib/spina/railtie.rb +9 -0
- data/lib/spina/theme.rb +34 -6
- data/lib/spina/version.rb +1 -1
- metadata +51 -124
- data/app/assets/javascripts/spina/admin/aviary.js.coffee +0 -25
- data/app/controllers/spina/admin/inquiries_controller.rb +0 -63
- data/app/controllers/spina/inquiries_controller.rb +0 -30
- data/app/mailers/spina/inquiry_mailer.rb +0 -19
- data/app/models/spina/inquiry.rb +0 -41
- data/app/views/layouts/spina/admin/messages.html.haml +0 -24
- data/app/views/spina/admin/accounts/aviary.html.haml +0 -26
- data/app/views/spina/admin/inquiries/inbox.html.haml +0 -30
- data/app/views/spina/admin/inquiries/index.html.haml +0 -36
- data/app/views/spina/admin/inquiries/show.html.haml +0 -23
- data/app/views/spina/admin/inquiries/spam.html.haml +0 -36
- data/app/views/spina/admin/layout_partables/_color_form.html.haml +0 -4
- data/app/views/spina/admin/layout_partables/_line_form.html.haml +0 -2
- data/app/views/spina/admin/page_partables/_attachment_collection_form.html.haml +0 -20
- data/app/views/spina/admin/page_partables/_attachment_form.html.haml +0 -19
- data/app/views/spina/admin/page_partables/_color_form.html.haml +0 -12
- data/app/views/spina/admin/page_partables/_line_form.html.haml +0 -10
- data/app/views/spina/admin/page_partables/_photo_collection_form.html.haml +0 -22
- data/app/views/spina/admin/page_partables/_photo_form.html.haml +0 -23
- data/app/views/spina/admin/page_partables/_structure_form.html.haml +0 -28
- data/app/views/spina/admin/page_partables/_text_form.html.haml +0 -10
- data/app/views/spina/admin/pages/_structure_item_fields.html.haml +0 -15
- data/app/views/spina/admin/shared/_navigation.html.haml +0 -21
- data/app/views/spina/admin/structure_partables/_line_form.html.haml +0 -2
- data/app/views/spina/admin/structure_partables/_photo_form.html.haml +0 -11
- data/app/views/spina/admin/structure_partables/_text_form.html.haml +0 -2
- data/app/views/spina/inquiries/create.html.haml +0 -2
- data/app/views/spina/inquiries/index.html.haml +0 -19
- data/app/views/spina/inquiry_mailer/inquiry.html.haml +0 -15
- data/test/dummy/README.rdoc +0 -261
- data/test/dummy/Rakefile +0 -7
- data/test/dummy/app/assets/javascripts/application.js +0 -15
- data/test/dummy/app/assets/stylesheets/default/application.css.sass +0 -0
- data/test/dummy/app/assets/stylesheets/demo/application.css.sass +0 -66
- data/test/dummy/app/assets/stylesheets/fonts.css.sass +0 -3
- data/test/dummy/app/controllers/application_controller.rb +0 -3
- data/test/dummy/app/helpers/application_helper.rb +0 -2
- data/test/dummy/app/views/default/pages/homepage.html.haml +0 -2
- data/test/dummy/app/views/default/pages/show.html.haml +0 -3
- data/test/dummy/app/views/default/shared/_navigation.html.haml +0 -5
- data/test/dummy/app/views/demo/pages/demo.html.haml +0 -30
- data/test/dummy/app/views/demo/pages/homepage.html.haml +0 -2
- data/test/dummy/app/views/demo/pages/show.html.haml +0 -3
- data/test/dummy/app/views/demo/shared/_navigation.html.haml +0 -5
- data/test/dummy/app/views/layouts/default/application.html.haml +0 -11
- data/test/dummy/app/views/layouts/demo/application.html.haml +0 -11
- data/test/dummy/config.ru +0 -4
- data/test/dummy/config/application.rb +0 -52
- data/test/dummy/config/application.yml +0 -2
- data/test/dummy/config/boot.rb +0 -10
- data/test/dummy/config/database.yml +0 -24
- data/test/dummy/config/environment.rb +0 -5
- data/test/dummy/config/environments/development.rb +0 -41
- data/test/dummy/config/environments/production.rb +0 -70
- data/test/dummy/config/environments/test.rb +0 -38
- data/test/dummy/config/initializers/backtrace_silencers.rb +0 -7
- data/test/dummy/config/initializers/inflections.rb +0 -15
- data/test/dummy/config/initializers/mime_types.rb +0 -5
- data/test/dummy/config/initializers/session_store.rb +0 -8
- data/test/dummy/config/initializers/spina.rb +0 -33
- data/test/dummy/config/initializers/themes/default.rb +0 -47
- data/test/dummy/config/initializers/themes/demo.rb +0 -103
- data/test/dummy/config/initializers/wrap_parameters.rb +0 -14
- data/test/dummy/config/locales/en.yml +0 -5
- data/test/dummy/config/locales/nl.yml +0 -214
- data/test/dummy/config/routes.rb +0 -4
- data/test/dummy/config/secrets.yml +0 -7
- data/test/dummy/db/migrate/20160114085213_create_spina_tables.spina.rb +0 -167
- data/test/dummy/db/schema.rb +0 -183
- data/test/dummy/db/seeds.rb +0 -1
- data/test/dummy/public/404.html +0 -26
- data/test/dummy/public/422.html +0 -26
- data/test/dummy/public/500.html +0 -25
- data/test/dummy/public/favicon.ico +0 -0
- data/test/dummy/script/rails +0 -6
- data/test/dummy/tmp/restart.txt +0 -0
- data/test/fixtures/spina/accounts.yml +0 -3
- data/test/fixtures/spina/pages.yml +0 -10
- data/test/fixtures/spina/users.yml +0 -5
- data/test/functional/spina/admin/admin_controller.rb +0 -36
- data/test/functional/spina/admin/sessions_controller_test.rb +0 -32
- data/test/functional/spina/pages_controller_test.rb +0 -16
- data/test/integration/navigation_test.rb +0 -8
- data/test/integration/spina/admin/login_test.rb +0 -31
- data/test/integration/spina/admin/logout_test.rb +0 -17
- data/test/integration/spina/admin/pages_test.rb +0 -34
- data/test/integration/spina/pages_test.rb +0 -19
- data/test/models/spina/line_test.rb +0 -9
- data/test/models/spina/text_test.rb +0 -9
- data/test/test_helper.rb +0 -23
- data/test/unit/helpers/spina/accounts_helper_test.rb +0 -6
- data/test/unit/helpers/spina/inquiries_helper_test.rb +0 -6
- data/test/unit/helpers/spina/page_parts_helper_test.rb +0 -6
- data/test/unit/helpers/spina/pages_helper_test.rb +0 -6
- data/test/unit/helpers/spina/photos_helper_test.rb +0 -6
- data/test/unit/helpers/spina/sessions_helper_test.rb +0 -6
- data/test/unit/helpers/spina/users_helper_test.rb +0 -6
- data/test/unit/spina/account_test.rb +0 -9
- data/test/unit/spina/file_collection_file_test.rb +0 -9
- data/test/unit/spina/gallery_test.rb +0 -9
- data/test/unit/spina/inquiry_test.rb +0 -9
- data/test/unit/spina/page_include_test.rb +0 -9
- data/test/unit/spina/page_part_test.rb +0 -9
- data/test/unit/spina/page_test.rb +0 -9
- data/test/unit/spina/photo_collection_file_test.rb +0 -9
- data/test/unit/spina/photo_collection_test.rb +0 -9
- data/test/unit/spina/photo_test.rb +0 -9
- data/test/unit/spina/user_test.rb +0 -9
@@ -1,33 +1,26 @@
|
|
1
1
|
- content_for :secondary_navigation do
|
2
2
|
%nav#secondary
|
3
3
|
%h1= t('spina.website.title')
|
4
|
-
|
5
4
|
%ul
|
6
|
-
%li{class: ('active' if
|
5
|
+
%li{class: ('active' if current_admin_path.start_with?('/pages'))}
|
7
6
|
= link_to spina.admin_pages_path do
|
8
7
|
= icon('pages')
|
9
8
|
= t('spina.website.pages')
|
10
9
|
%small= t('spina.website.pages_description')
|
11
10
|
|
12
|
-
%li{class: ('active' if
|
11
|
+
%li{class: ('active' if current_admin_path.start_with?('/photos', '/attachments'))}
|
13
12
|
= link_to spina.admin_photos_path do
|
14
13
|
= icon('image')
|
15
14
|
= t('spina.website.media_library')
|
16
15
|
%small= t('spina.website.media_library_description')
|
17
16
|
|
18
|
-
- Spina.
|
19
|
-
- if current_theme.
|
20
|
-
|
21
|
-
=
|
22
|
-
= icon(plugin.config.spina_icon)
|
23
|
-
= plugin.config.title
|
24
|
-
%small= plugin.config.description
|
17
|
+
- Spina::Plugin.all.each do |plugin|
|
18
|
+
- if current_theme.plugins.include? plugin.name
|
19
|
+
- if lookup_context.exists? "spina/admin/hooks/#{ plugin.namespace }/_website_secondary_navigation"
|
20
|
+
= render "spina/admin/hooks/#{ plugin.namespace }/website_secondary_navigation", plugin: plugin
|
25
21
|
|
26
|
-
- content_for(:
|
27
|
-
= content_for?(:
|
22
|
+
- content_for(:application) do
|
23
|
+
= content_for?(:website) ? yield(:website) : yield
|
28
24
|
|
29
|
-
= render template:
|
25
|
+
= render template: 'layouts/spina/admin/application'
|
30
26
|
|
31
|
-
- if content_for?(:plugin_stylesheets)
|
32
|
-
- content_for(:plugin_stylesheets) do
|
33
|
-
= yield(:plugin_stylesheets)
|
@@ -5,8 +5,8 @@
|
|
5
5
|
%td
|
6
6
|
= Spina::Account.human_attribute_name(:theme)
|
7
7
|
%td
|
8
|
-
.select-dropdown.account-theme{data: {layout_parts: current_theme.
|
9
|
-
- options = options_for_select(Spina.
|
8
|
+
.select-dropdown.account-theme{data: {layout_parts: current_theme.layout_parts.map{|layout_part| layout_part[:name]}}}
|
9
|
+
- 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
10
|
= f.select :theme, options
|
11
11
|
%tr
|
12
12
|
%td
|
@@ -15,17 +15,17 @@
|
|
15
15
|
= image_tag current_account.logo
|
16
16
|
= f.file_field :logo
|
17
17
|
|
18
|
-
= f.fields_for :layout_parts do |
|
19
|
-
%tr.layout-part{data: {name:
|
18
|
+
= f.fields_for :layout_parts do |ff|
|
19
|
+
%tr.layout-part{data: {name: ff.object.name}}
|
20
20
|
%td
|
21
|
-
=
|
21
|
+
= ff.object.title
|
22
22
|
%td
|
23
|
-
=
|
24
|
-
=
|
25
|
-
=
|
26
|
-
=
|
23
|
+
= ff.hidden_field :id
|
24
|
+
= ff.hidden_field :title
|
25
|
+
= ff.hidden_field :layout_partable_type
|
26
|
+
= ff.hidden_field :name
|
27
27
|
|
28
|
-
= render
|
28
|
+
= render "spina/admin/layout_partables/#{ partable_type_partial_namespace(ff.object.layout_partable_type) }/form", f: ff
|
29
29
|
|
30
30
|
%button.button.button-primary{type: 'submit', data: {icon: 'o'}}
|
31
31
|
= icon('check')
|
@@ -1,8 +1,7 @@
|
|
1
1
|
%tr
|
2
|
-
%td= attachment.name
|
2
|
+
%td= link_to attachment.name, attachment.file.try(:url), target: :blank
|
3
3
|
%td.nowrap= number_to_human_size(attachment.file.size)
|
4
4
|
%td.nowrap
|
5
5
|
%small= l attachment.created_at, format: '%d %B %Y %H:%M'
|
6
|
-
%td= attachment.file.try(:url)
|
7
6
|
%td.nowrap
|
8
7
|
= link_to t('spina.delete'), admin_attachment_path(attachment), method: :delete, class: 'button button-link button-danger button-small', data: {confirm: t('spina.delete_confirmation', subject: attachment.name)}
|
data/app/views/spina/admin/{pages/_attachment_fields.html.haml → attachments/_fields.html.haml}
RENAMED
File without changes
|
@@ -1,19 +1,14 @@
|
|
1
1
|
.table-container
|
2
|
-
.search-input.pull-right
|
3
|
-
= text_field_tag :search, nil, placeholder: t('spina.search'), class: 'input-search input-rounded'
|
4
|
-
.clear-input
|
5
|
-
= icon('times-circle')
|
6
|
-
|
7
2
|
%table.table
|
8
3
|
%thead
|
9
4
|
%tr
|
10
5
|
%th= Spina::Attachment.human_attribute_name(:name)
|
11
6
|
%th= Spina::Attachment.human_attribute_name(:size)
|
12
7
|
%th= Spina::Attachment.human_attribute_name(:created_at)
|
13
|
-
%th
|
8
|
+
%th
|
14
9
|
%tr
|
15
10
|
%td{colspan: 5}
|
16
|
-
= form_for [spina, :admin, @attachment], html: {multipart: true, class: "new_document"} do |f|
|
11
|
+
= form_for [spina, :admin, @attachment], html: {multipart: true, class: "new_document", style: 'margin-bottom: 0'} do |f|
|
17
12
|
= f.file_field :file, data: {customfileinput: true}
|
18
13
|
|
19
14
|
%tbody.table-prepend-document
|
@@ -0,0 +1,15 @@
|
|
1
|
+
.horizontal-form-label
|
2
|
+
= f.object.title
|
3
|
+
.horizontal-form-content
|
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
|
14
|
+
|
15
|
+
= ff.hidden_field :attachment_tokens, value: ff.object.attachment_ids.join(",")
|
@@ -0,0 +1,14 @@
|
|
1
|
+
.horizontal-form-label
|
2
|
+
= f.object.title
|
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')
|
10
|
+
|
11
|
+
- if f.object.page_partable && f.object.page_partable.file.present?
|
12
|
+
.attachment= f.object.page_partable.name
|
13
|
+
|
14
|
+
= f.hidden_field :page_partable_id
|
@@ -0,0 +1,17 @@
|
|
1
|
+
.horizontal-form-label
|
2
|
+
= f.object.title
|
3
|
+
.horizontal-form-content
|
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?)}
|
7
|
+
%span.button.button-small.button-round
|
8
|
+
%i.icon.icon-dots
|
9
|
+
=t 'spina.pages.photos_picker'
|
10
|
+
|
11
|
+
.photo-collection
|
12
|
+
- if ff.object.photos.sorted_by_photo_collection.any?
|
13
|
+
= render 'spina/admin/photos/photo_collection', photos: ff.object.photos.sorted_by_photo_collection
|
14
|
+
- elsif ff.object.photos.any?
|
15
|
+
= render 'spina/admin/photos/photo_collection', photos: ff.object.photos
|
16
|
+
= ff.hidden_field :photo_tokens, value: ff.object.photo_ids.join(",")
|
17
|
+
= ff.hidden_field :photo_positions, value: ff.object.photos.sorted_by_photo_collection.pluck(:photo_id).join(","), class: 'photo-positions'
|
@@ -0,0 +1,18 @@
|
|
1
|
+
.horizontal-form-label
|
2
|
+
= f.object.title
|
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
|
5
|
+
- 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
|
+
.image
|
11
|
+
= 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
|
+
|
18
|
+
= f.hidden_field :page_partable_id
|
@@ -0,0 +1,22 @@
|
|
1
|
+
.horizontal-form-content
|
2
|
+
.structure-form
|
3
|
+
.structure-form-menu
|
4
|
+
%label= f.object.title
|
5
|
+
|
6
|
+
%ul
|
7
|
+
- unless f.object.page_partable.nil?
|
8
|
+
- f.object.page_partable.structure_items.sorted_by_structure.each_with_index do |structure_item, index|
|
9
|
+
%li{class: ('active' if index == 0), data: {structure_item_id: structure_item.id}}
|
10
|
+
= link_to "#structure_form_pane_#{structure_item.id}" do
|
11
|
+
%i.icon.icon-bars.sortable-handle
|
12
|
+
= structure_item.structure_parts.first.try(:structure_partable).try(:content)
|
13
|
+
|
14
|
+
= f.fields_for :page_partable do |ff|
|
15
|
+
- ff.object.page_part = f.object
|
16
|
+
= link_to_add_fields ff, :structure_items do
|
17
|
+
= icon('plus')
|
18
|
+
|
19
|
+
.structure-form-content
|
20
|
+
= f.fields_for :page_partable do |ff|
|
21
|
+
= ff.fields_for :structure_items, ff.object.structure_items.sorted_by_structure do |fff|
|
22
|
+
= render 'spina/admin/structure_items/fields', f: fff
|
@@ -1,15 +1,18 @@
|
|
1
1
|
= form_for [spina, :admin, @page], multipart: true, html: {autocomplete: "off"} do |f|
|
2
|
+
= hidden_field_tag :locale, @locale
|
3
|
+
|
2
4
|
- content_for :notification_alert do
|
3
5
|
= error_explanation!(@page)
|
4
6
|
|
5
|
-
- @
|
6
|
-
|
7
|
+
- Globalize.with_locale(@locale) do
|
8
|
+
- @tabs.each do |tab|
|
9
|
+
= render "spina/admin/pages/form_#{tab}", f: f
|
7
10
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
+
%button.button.button-primary{type: 'submit'}
|
12
|
+
= icon('check')
|
13
|
+
=t 'spina.pages.save'
|
11
14
|
|
12
|
-
|
15
|
+
= link_to t('spina.cancel'), spina.admin_pages_path, class: 'button button-link'
|
13
16
|
|
14
|
-
|
15
|
-
|
17
|
+
- unless @page.new_record? || !@page.deletable
|
18
|
+
.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'
|
@@ -29,14 +29,14 @@
|
|
29
29
|
%td
|
30
30
|
= Spina::Page.human_attribute_name :menu_title
|
31
31
|
%td
|
32
|
-
= f.text_field :menu_title, placeholder: Spina::Page.human_attribute_name(:show_in_menu_placeholder)
|
32
|
+
= f.text_field :menu_title, placeholder: Spina::Page.human_attribute_name(:show_in_menu_placeholder), value: f.object.read_attribute(:menu_title)
|
33
33
|
|
34
34
|
%tr{style: ('display: none' if @page.custom_page?)}
|
35
35
|
%td
|
36
36
|
= Spina::Page.human_attribute_name :view_template
|
37
37
|
%td
|
38
|
-
.select-dropdown.page-template{data: {page_parts:
|
39
|
-
- options = options_for_select(current_theme.
|
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
40
|
= f.select :view_template, options
|
41
41
|
|
42
42
|
%tr{style: ('display: none' if @page.custom_page?)}
|
@@ -6,6 +6,11 @@
|
|
6
6
|
.horizontal-form-content
|
7
7
|
= f.text_field :title, placeholder: Spina::Page.human_attribute_name(:title_placeholder)
|
8
8
|
|
9
|
-
= f.fields_for :page_parts, @page_parts.sort { |a,b| a.position(current_theme) <=> b.position(current_theme) } do |
|
10
|
-
.
|
11
|
-
|
9
|
+
= f.fields_for :page_parts, @page_parts.sort { |a,b| a.position(current_theme) <=> b.position(current_theme) } do |ff|
|
10
|
+
= ff.hidden_field :id
|
11
|
+
= ff.hidden_field :title
|
12
|
+
= ff.hidden_field :page_partable_type
|
13
|
+
= ff.hidden_field :name
|
14
|
+
|
15
|
+
.horizontal-form-group.page-part{data: {name: ff.object.name}}
|
16
|
+
= render "spina/admin/page_partables/#{ partable_type_partial_namespace(ff.object.page_partable_type) }/form", f: ff
|
@@ -4,7 +4,7 @@
|
|
4
4
|
.horizontal-form-label
|
5
5
|
= Spina::Page.human_attribute_name :seo_title
|
6
6
|
.horizontal-form-content
|
7
|
-
= f.text_field :seo_title, placeholder: Spina::Page.human_attribute_name(:seo_title_placeholder)
|
7
|
+
= f.text_field :seo_title, placeholder: Spina::Page.human_attribute_name(:seo_title_placeholder), value: f.object.read_attribute(:seo_title)
|
8
8
|
|
9
9
|
.horizontal-form-group
|
10
10
|
.horizontal-form-label
|
@@ -1,4 +1,16 @@
|
|
1
|
-
- content_for
|
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
|
2
14
|
%nav.tabs
|
3
15
|
%ul
|
4
16
|
- @tabs.each_with_index do |tab, i|
|
@@ -1,7 +1,5 @@
|
|
1
1
|
.item
|
2
2
|
.overlay
|
3
|
-
= link_to admin_photo_path(photo), class: 'icon-only edit-photo-link', data: {aviary: true} do
|
4
|
-
=t('spina.photos.edit')
|
5
3
|
= link_to spina.admin_photo_path(photo), method: :delete, class: 'icon-only delete-photo-link', data: {confirm: t('spina.photos.delete_confirmation')} do
|
6
4
|
=t('spina.photos.delete')
|
7
|
-
= image_tag photo.file.thumb.url, id: "photo_#{photo.id}"
|
5
|
+
= image_tag photo.file.thumb.url, id: "photo_#{photo.id}"
|
@@ -1,7 +1,6 @@
|
|
1
1
|
<% if @photo.new_record? %>
|
2
2
|
alert("<%= I18n.t 'spina.photos.cannot_be_created' %> <%= j @photo.errors.full_messages.join(', ').html_safe %>");
|
3
3
|
<% else %>
|
4
|
-
$item = $("<%=j render partial: 'spina/admin/photos/
|
4
|
+
$item = $("<%=j render partial: 'spina/admin/photos/photo', object: @photo %>");
|
5
5
|
$(".gallery-prepend-image .infinite-scroll").prepend($item);
|
6
|
-
$(".gallery-prepend-image .infinite-scroll .item:first-child").click();
|
7
6
|
<% end %>
|
@@ -0,0 +1,7 @@
|
|
1
|
+
<% if @photo.new_record? %>
|
2
|
+
alert("<%= I18n.t 'spina.photos.cannot_be_created' %> <%= j @photo.errors.full_messages.join(', ').html_safe %>");
|
3
|
+
<% else %>
|
4
|
+
$item = $("<%=j render partial: 'spina/admin/photos/photo_uploaded', object: @photo %>");
|
5
|
+
$(".gallery-prepend-image .infinite-scroll").prepend($item);
|
6
|
+
$(".gallery-prepend-image .infinite-scroll .item:first-child").click();
|
7
|
+
<% end %>
|
@@ -1,11 +1,12 @@
|
|
1
1
|
.gallery-container
|
2
2
|
.gallery
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
3
|
+
.item
|
4
|
+
= form_for [spina, :admin, @photo], html: {multipart: true} do |f|
|
5
|
+
= hidden_field_tag :media_library, value: true
|
6
|
+
= f.label :file, t('spina.photos.upload_image')
|
7
|
+
= f.file_field :file, data: {customfileinput: true}
|
7
8
|
|
8
|
-
.gallery-prepend-image
|
9
|
-
= render partial: 'spina/admin/photos/photo', collection: @photos
|
9
|
+
.gallery-prepend-image
|
10
|
+
.infinite-scroll= render partial: 'spina/admin/photos/photo', collection: @photos
|
10
11
|
|
11
12
|
.infinite-pagination= link_to_next_page @photos, 'Next', remote: true
|
@@ -0,0 +1,19 @@
|
|
1
|
+
%nav#primary
|
2
|
+
%ul
|
3
|
+
%li{class: ('active' if (%w[pages photos attachments] + Spina::Plugin.all.map { |plugin| plugin.namespace if current_theme.plugins.include?(plugin.name) }).include? controller_name)}
|
4
|
+
= link_to spina.admin_pages_path do
|
5
|
+
= icon('home')
|
6
|
+
|
7
|
+
- Spina::Plugin.all.each do |plugin|
|
8
|
+
- if current_theme.plugins.include? plugin.name
|
9
|
+
- if lookup_context.exists? "spina/admin/hooks/#{ plugin.namespace }/_primary_navigation"
|
10
|
+
= render "spina/admin/hooks/#{ plugin.namespace }/primary_navigation", plugin: plugin
|
11
|
+
|
12
|
+
|
13
|
+
%li{class: ('active' if %w[accounts users tenants].include? controller_name)}
|
14
|
+
= link_to spina.edit_admin_account_path do
|
15
|
+
= icon('cog')
|
16
|
+
|
17
|
+
%li.bottom
|
18
|
+
= link_to spina.admin_logout_path, data: {no_turbolink: true} do
|
19
|
+
= icon('power-off')
|
@@ -1,5 +1,5 @@
|
|
1
|
-
- object_id =
|
2
|
-
=
|
1
|
+
- object_id = f.object.persisted? ? f.object.object_id : "new_association_#{f.object.object_id}"
|
2
|
+
= f.hidden_field field, id: "#{object_id}_input"
|
3
3
|
%trix-toolbar.clearfix{ id: "#{object_id}_toolbar", data: { editor_id: "#{object_id}_editor" }}
|
4
4
|
.button-groups
|
5
5
|
.button-group.pull-left
|
@@ -0,0 +1,16 @@
|
|
1
|
+
.structure-form-pane{class: ('active' if f.options[:child_index] == 0), id: "structure_form_pane_#{f.object.id}"}
|
2
|
+
/ Hidden field
|
3
|
+
= f.hidden_field :position, placeholder: "Position", class: "structure_form_pane_#{f.object.id}_position"
|
4
|
+
|
5
|
+
/ Strucure parts
|
6
|
+
= f.fields_for :structure_parts do |ff|
|
7
|
+
= ff.hidden_field :id
|
8
|
+
= ff.hidden_field :title
|
9
|
+
= ff.hidden_field :structure_partable_type
|
10
|
+
= ff.hidden_field :name
|
11
|
+
.structure-form-part
|
12
|
+
= render "spina/admin/structure_partables/#{ partable_type_partial_namespace(ff.object.structure_partable_type) }/form", f: ff
|
13
|
+
|
14
|
+
= f.hidden_field :_destroy
|
15
|
+
= link_to t('spina.delete'), '#', class: 'remove-structure-item-fields button button-mini button-link pull-right'
|
16
|
+
|
@@ -0,0 +1,11 @@
|
|
1
|
+
= link_to spina.photo_select_admin_photos_path(f.object_name, selected_photo_id: (f.object.structure_partable.id if f.object.structure_partable.present?)), remote: true, class: "media_picker" do
|
2
|
+
- if f.object.structure_partable && f.object.structure_partable.file.present?
|
3
|
+
.placeholder.pull-right
|
4
|
+
%span.button.button-small.button-round{data: {icon: 'U'}}=t 'spina.pages.photo_picker'
|
5
|
+
.image
|
6
|
+
= image_tag f.object.structure_partable.file.thumb
|
7
|
+
- else
|
8
|
+
.placeholder
|
9
|
+
%span.button.button-small.button-round{data: {icon: 'U'}}=t 'spina.pages.photo_picker'
|
10
|
+
|
11
|
+
= f.hidden_field :structure_partable_id
|