spina 1.2.0 → 2.0.2
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/app/assets/icons/spina/preview/icons_spina-preview.html +0 -2
- data/app/assets/icons/spina/preview/ics_spina-preview.html +0 -2
- data/app/assets/images/spina/favicon.png +0 -0
- data/app/assets/javascripts/spina/admin/application.js +1 -2
- data/app/assets/javascripts/spina/admin/controllers/attachment_picker_controller.js +15 -0
- data/app/assets/javascripts/spina/admin/controllers/image_form_controller.js +5 -4
- data/app/assets/javascripts/spina/admin/controllers/infinite_scroll_controller.js +20 -22
- data/app/assets/javascripts/spina/admin/controllers/media_picker_controller.js +171 -0
- data/app/assets/javascripts/spina/admin/controllers/modal_controller.js +18 -0
- data/app/assets/javascripts/spina/admin/controllers/repeater_form_controller.js +38 -0
- data/app/assets/javascripts/spina/admin/media_gallery.coffee +0 -3
- data/app/assets/javascripts/spina/admin/notifications.coffee +1 -1
- data/app/assets/javascripts/spina/admin/pages.coffee.erb +3 -20
- data/app/assets/javascripts/spina/admin/scaffold.coffee +1 -3
- data/app/assets/javascripts/spina/admin/trix.coffee.erb +14 -18
- data/app/assets/stylesheets/spina.sass +10 -8
- data/app/assets/stylesheets/spina/_buttons.sass +57 -31
- data/app/assets/stylesheets/spina/_forms.sass +66 -74
- data/app/assets/stylesheets/spina/_gallery.sass +18 -2
- data/app/assets/stylesheets/spina/_media_picker.sass +133 -0
- data/app/assets/stylesheets/spina/_modal.sass +35 -2
- data/app/assets/stylesheets/spina/_notifications.sass +20 -14
- data/app/assets/stylesheets/spina/_pages.sass +131 -0
- data/app/assets/stylesheets/spina/_sortable_lists.sass +14 -8
- data/app/assets/stylesheets/spina/_trix_custom.sass +15 -5
- data/app/controllers/concerns/spina/current_methods.rb +26 -0
- data/app/controllers/concerns/spina/frontend.rb +9 -0
- data/app/controllers/spina/admin/accounts_controller.rb +9 -13
- data/app/controllers/spina/admin/admin_controller.rb +5 -1
- data/app/controllers/spina/admin/attachments_controller.rb +0 -22
- data/app/controllers/spina/admin/images_controller.rb +1 -1
- data/app/controllers/spina/admin/media_picker_controller.rb +18 -19
- data/app/controllers/spina/admin/pages_controller.rb +1 -5
- data/app/controllers/spina/admin/resources_controller.rb +9 -4
- data/app/controllers/spina/application_controller.rb +6 -23
- data/app/controllers/spina/pages_controller.rb +11 -13
- data/app/controllers/spina/sitemaps_controller.rb +6 -6
- data/app/helpers/spina/admin/pages_helper.rb +22 -20
- data/app/helpers/spina/{files_helper.rb → attachments_helper.rb} +1 -1
- data/app/helpers/spina/images_helper.rb +9 -18
- data/app/helpers/spina/pages_helper.rb +23 -4
- data/app/models/concerns/spina/partable.rb +19 -7
- data/app/models/concerns/spina/translated_content.rb +19 -0
- data/app/models/spina/account.rb +3 -10
- data/app/models/spina/attachment.rb +0 -4
- data/app/models/spina/current.rb +1 -0
- data/app/models/spina/image.rb +0 -4
- data/app/models/spina/page.rb +19 -18
- data/app/models/spina/parts/attachment.rb +22 -0
- data/app/models/spina/parts/base.rb +12 -0
- data/app/models/spina/parts/image.rb +39 -0
- data/app/models/spina/parts/image_collection.rb +23 -0
- data/app/models/spina/parts/image_variant.rb +19 -0
- data/app/models/spina/parts/line.rb +7 -0
- data/app/models/spina/parts/multi_line.rb +7 -0
- data/app/models/spina/parts/option.rb +13 -0
- data/app/models/spina/parts/repeater.rb +10 -0
- data/app/models/spina/parts/repeater_content.rb +15 -0
- data/app/models/spina/parts/text.rb +7 -0
- data/app/models/spina/resource.rb +4 -0
- data/app/presenters/spina/content_presenter.rb +51 -0
- data/app/presenters/spina/menu_presenter.rb +2 -1
- data/app/views/layouts/spina/admin/admin.html.haml +3 -7
- data/app/views/layouts/spina/admin/pages.html.haml +5 -4
- data/app/views/layouts/spina/login.html.haml +0 -3
- data/app/views/spina/admin/accounts/_form.html.haml +13 -7
- data/app/views/spina/admin/accounts/analytics.html.haml +5 -3
- data/app/views/spina/admin/accounts/social.html.haml +13 -7
- data/app/views/spina/admin/accounts/style.html.haml +26 -21
- data/app/views/spina/admin/attachments/index.html.haml +1 -1
- data/app/views/spina/admin/images/_image.html.haml +1 -1
- data/app/views/spina/admin/images/index.html.haml +7 -5
- data/app/views/spina/admin/media_folders/_media_folder.html.haml +1 -1
- data/app/views/spina/admin/media_folders/show.html.haml +2 -2
- data/app/views/spina/admin/media_picker/_image.html.haml +3 -0
- data/app/views/spina/admin/media_picker/_media_picker.html.haml +32 -0
- data/app/views/spina/admin/media_picker/_media_picker_grid.html.haml +25 -0
- data/app/views/spina/admin/media_picker/_modal.html.haml +1 -1
- data/app/views/spina/admin/media_picker/infinite_scroll.js.erb +4 -4
- data/app/views/spina/admin/media_picker/select.js.erb +2 -0
- data/app/views/spina/admin/media_picker/show.html.haml +1 -0
- data/app/views/spina/admin/media_picker/show.js.erb +1 -1
- data/app/views/spina/admin/pages/_form.html.haml +9 -7
- data/app/views/spina/admin/pages/_form_advanced.html.haml +5 -5
- data/app/views/spina/admin/pages/_form_page_content.html.haml +14 -13
- data/app/views/spina/admin/pages/_form_page_seo.html.haml +9 -5
- data/app/views/spina/admin/pages/_page.html.haml +5 -3
- data/app/views/spina/admin/pages/_page_nested_list.html.haml +2 -3
- data/app/views/spina/admin/pages/index.html.haml +5 -4
- data/app/views/spina/admin/parts/attachments/_form.html.haml +6 -0
- data/app/views/spina/admin/parts/image_collections/_fields.html.haml +7 -0
- data/app/views/spina/admin/parts/image_collections/_form.html.haml +12 -0
- data/app/views/spina/admin/parts/images/_form.html.haml +18 -0
- data/app/views/spina/admin/parts/lines/_form.html.haml +2 -0
- data/app/views/spina/admin/parts/multi_lines/_form.html.haml +2 -0
- data/app/views/spina/admin/parts/options/_form.html.haml +3 -0
- data/app/views/spina/admin/parts/repeaters/_fields.html.haml +15 -0
- data/app/views/spina/admin/parts/repeaters/_form.html.haml +17 -0
- data/app/views/spina/admin/parts/texts/_form.html.haml +6 -0
- data/app/views/spina/admin/resources/edit.html.haml +28 -5
- data/app/views/spina/admin/resources/show.html.haml +5 -2
- data/app/views/spina/admin/shared/_notifications.html.haml +4 -4
- data/config/routes.rb +13 -0
- data/db/migrate/12_add_url_title_to_spina_page_translations.rb +1 -1
- data/db/migrate/13_add_json_attributes_to_spina_accounts.rb +5 -0
- data/db/migrate/14_add_json_attributes_to_spina_pages.rb +5 -0
- data/db/migrate/15_add_slug_to_spina_resources.rb +5 -0
- data/lib/generators/spina/templates/app/views/demo/pages/demo.html.haml +13 -21
- data/lib/generators/spina/templates/app/views/demo/pages/homepage.html.haml +1 -1
- data/lib/generators/spina/templates/config/initializers/mobility.rb +13 -4
- data/lib/generators/spina/templates/config/initializers/spina.rb +4 -0
- data/lib/generators/spina/templates/config/initializers/themes/default.rb +7 -7
- data/lib/generators/spina/templates/config/initializers/themes/demo.rb +32 -44
- data/lib/spina.rb +18 -3
- data/lib/spina/attr_json_spina_parts_model.rb +29 -0
- data/lib/spina/engine.rb +14 -6
- data/lib/spina/part.rb +19 -0
- data/lib/spina/theme.rb +1 -1
- data/lib/spina/version.rb +1 -1
- data/lib/tasks/spina_tasks.rake +1 -1
- data/vendor/assets/javascripts/spina/sortable.js +2 -2
- metadata +72 -51
- data/app/assets/javascripts/spina/admin/account.coffee +0 -16
- data/app/models/concerns/spina/image_collectable.rb +0 -23
- data/app/models/concerns/spina/optionable.rb +0 -12
- data/app/models/concerns/spina/part.rb +0 -38
- data/app/models/spina/attachment_collection.rb +0 -20
- data/app/models/spina/image_collection.rb +0 -23
- data/app/models/spina/image_collections_image.rb +0 -6
- data/app/models/spina/layout_part.rb +0 -22
- data/app/models/spina/line.rb +0 -10
- data/app/models/spina/option.rb +0 -17
- data/app/models/spina/page_part.rb +0 -22
- data/app/models/spina/structure.rb +0 -14
- data/app/models/spina/structure_item.rb +0 -22
- data/app/models/spina/structure_part.rb +0 -20
- data/app/models/spina/text.rb +0 -10
- data/app/views/dummy/show.html.haml +0 -1
- data/app/views/spina/admin/attachments/_attachment_collection.html.haml +0 -2
- data/app/views/spina/admin/attachments/_select.html.haml +0 -17
- data/app/views/spina/admin/attachments/_select_collection.html.haml +0 -18
- data/app/views/spina/admin/attachments/insert.js.erb +0 -5
- data/app/views/spina/admin/attachments/insert_collection.js.coffee +0 -7
- data/app/views/spina/admin/attachments/select.js.erb +0 -2
- data/app/views/spina/admin/attachments/select_collection.js.erb +0 -2
- data/app/views/spina/admin/image_collections/_image_collection.html.haml +0 -5
- data/app/views/spina/admin/layout_partables/lines/_form.html.haml +0 -2
- data/app/views/spina/admin/partables/attachment_collections/_form.html.haml +0 -14
- data/app/views/spina/admin/partables/attachments/_form.html.haml +0 -13
- data/app/views/spina/admin/partables/image_collections/_form.html.haml +0 -16
- data/app/views/spina/admin/partables/images/_form.html.haml +0 -21
- data/app/views/spina/admin/partables/lines/_form.html.haml +0 -5
- data/app/views/spina/admin/partables/options/_form.html.haml +0 -7
- data/app/views/spina/admin/partables/photo_collections/_form.html.haml +0 -4
- data/app/views/spina/admin/partables/photos/_form.html.haml +0 -4
- data/app/views/spina/admin/partables/structures/_form.html.haml +0 -21
- data/app/views/spina/admin/partables/texts/_form.html.haml +0 -8
- data/app/views/spina/admin/structure_items/_fields.html.haml +0 -15
- data/app/views/spina/admin/structure_partables/attachment_collections/_form.html.haml +0 -14
- data/app/views/spina/admin/structure_partables/attachments/_form.html.haml +0 -13
@@ -0,0 +1,39 @@
|
|
1
|
+
module Spina
|
2
|
+
module Parts
|
3
|
+
class Image < Base
|
4
|
+
attr_json :image_id, :integer, default: nil
|
5
|
+
attr_json :signed_blob_id, :string, default: nil
|
6
|
+
attr_json :alt, :string, default: ""
|
7
|
+
attr_json :filename, :string, default: ""
|
8
|
+
|
9
|
+
def to_s
|
10
|
+
alt.presence || filename.presence || Spina::Image.model_name.human
|
11
|
+
end
|
12
|
+
|
13
|
+
def content
|
14
|
+
self
|
15
|
+
end
|
16
|
+
|
17
|
+
def svg?
|
18
|
+
filename =~ /\.svg\z/
|
19
|
+
end
|
20
|
+
|
21
|
+
def spina_image
|
22
|
+
Spina::Image.find_by(id: image_id)
|
23
|
+
end
|
24
|
+
|
25
|
+
def present?
|
26
|
+
signed_blob_id.present?
|
27
|
+
end
|
28
|
+
|
29
|
+
def signed_id
|
30
|
+
signed_blob_id
|
31
|
+
end
|
32
|
+
|
33
|
+
def variant(options)
|
34
|
+
Spina::Parts::ImageVariant.new(self, options)
|
35
|
+
end
|
36
|
+
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module Spina
|
2
|
+
module Parts
|
3
|
+
class ImageCollection < Base
|
4
|
+
include AttrJson::NestedAttributes
|
5
|
+
|
6
|
+
attr_json :images, Image.to_type, array: true
|
7
|
+
attr_json_accepts_nested_attributes_for :images
|
8
|
+
|
9
|
+
def to_s
|
10
|
+
Spina::Parts::ImageCollection.model_name.human
|
11
|
+
end
|
12
|
+
|
13
|
+
def content
|
14
|
+
(images || [])
|
15
|
+
end
|
16
|
+
|
17
|
+
def image_ids
|
18
|
+
content.map(&:image_id)
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module Spina
|
2
|
+
module Parts
|
3
|
+
class ImageVariant
|
4
|
+
attr_reader :blob
|
5
|
+
|
6
|
+
def initialize(image, options)
|
7
|
+
@blob = image
|
8
|
+
@options = options
|
9
|
+
end
|
10
|
+
|
11
|
+
def variation
|
12
|
+
OpenStruct.new({
|
13
|
+
key: ActiveStorage::Variation.encode(@options)
|
14
|
+
})
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module Spina
|
2
|
+
module Parts
|
3
|
+
class RepeaterContent < Base
|
4
|
+
include Partable
|
5
|
+
include AttrJson::NestedAttributes
|
6
|
+
|
7
|
+
attr_json :parts, AttrJson::Type::SpinaPartsModel.new, array: true
|
8
|
+
attr_json_accepts_nested_attributes_for :parts
|
9
|
+
|
10
|
+
def find_part(name)
|
11
|
+
(parts || []).find{|part| part.name.to_s == name.to_s}
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
module Spina
|
2
|
+
class ContentPresenter
|
3
|
+
attr_reader :view_context, :container
|
4
|
+
|
5
|
+
def initialize(view_context, container)
|
6
|
+
@view_context = view_context || Spina::Current.page&.view_context
|
7
|
+
@container = container
|
8
|
+
end
|
9
|
+
|
10
|
+
def text(name)
|
11
|
+
part = find_part(name)
|
12
|
+
part&.content.to_s
|
13
|
+
end
|
14
|
+
|
15
|
+
def html(name)
|
16
|
+
html = find_part(name)&.content
|
17
|
+
ActiveSupport::SafeBuffer.new(html.to_s)
|
18
|
+
end
|
19
|
+
|
20
|
+
def image_tag(image, variant_options = {}, options = {})
|
21
|
+
image = find_part(image) unless image.is_a? Spina::Parts::Image
|
22
|
+
image_tag_options = {alt: image&.alt}
|
23
|
+
view_context.image_tag main_app_image_url(image, variant_options), options.merge(image_tag_options) if image.present?
|
24
|
+
end
|
25
|
+
|
26
|
+
def image_url(image, variant_options = {})
|
27
|
+
image = find_part(image) unless image.is_a? Spina::Parts::Image
|
28
|
+
main_app_image_url(image, variant_options) if image.present?
|
29
|
+
end
|
30
|
+
|
31
|
+
def attachment_url(attachment)
|
32
|
+
attachment = find_part(attachment) unless attachment.is_a? Spina::Parts::Attachment
|
33
|
+
view_context.main_app.url_for(attachment) if attachment.present?
|
34
|
+
end
|
35
|
+
|
36
|
+
private
|
37
|
+
|
38
|
+
def main_app_image_url(image, variant_options = {})
|
39
|
+
# SVG's can't have variants,
|
40
|
+
# Render rails_service_blob_url directly instead
|
41
|
+
return view_context.main_app.url_for(image) if image.svg?
|
42
|
+
|
43
|
+
view_context.main_app.url_for(image.variant(variant_options))
|
44
|
+
end
|
45
|
+
|
46
|
+
def find_part(name)
|
47
|
+
container.find_part(name)
|
48
|
+
end
|
49
|
+
|
50
|
+
end
|
51
|
+
end
|
@@ -50,6 +50,7 @@ module Spina
|
|
50
50
|
end
|
51
51
|
|
52
52
|
def render_item(item)
|
53
|
+
return nil unless item.materialized_path
|
53
54
|
children = scoped_collection(item.children)
|
54
55
|
|
55
56
|
content_tag(list_item_tag, class: list_item_css, data: {page_id: item.page_id, draft: (true if item.draft?) }) do
|
@@ -71,4 +72,4 @@ module Spina
|
|
71
72
|
end
|
72
73
|
|
73
74
|
end
|
74
|
-
end
|
75
|
+
end
|
@@ -6,14 +6,13 @@
|
|
6
6
|
= csrf_meta_tags
|
7
7
|
%meta{name: 'turbolinks-cache-control', content: 'no-preview'}
|
8
8
|
|
9
|
-
%
|
9
|
+
%link{rel: 'icon', href: image_url("spina/favicon.png")}
|
10
|
+
|
11
|
+
%title Spina CMS
|
10
12
|
|
11
13
|
/ Stylesheet
|
12
14
|
= stylesheet_link_tag 'spina/admin/application', data: {turbolinks_track: true}
|
13
15
|
|
14
|
-
/[if lt IE 9]
|
15
|
-
= javascript_include_tag '//html5shiv.googlecode.com/svn/trunk/html5.js', data: {turbolinks_track: true}
|
16
|
-
|
17
16
|
/ JavaScript
|
18
17
|
= javascript_include_tag 'spina/admin/application', data: {turbolinks_track: true}
|
19
18
|
= yield(:plugin_stylesheets)
|
@@ -33,6 +32,3 @@
|
|
33
32
|
= render 'spina/admin/shared/notifications'
|
34
33
|
|
35
34
|
= content_for?(:application) ? yield(:application) : yield
|
36
|
-
|
37
|
-
= link_to 'http://www.spinacms.com', class: 'spina-logo', target: :blank do
|
38
|
-
= image_tag('spina/spina.svg', width: 32, height: 24)
|
@@ -9,15 +9,16 @@
|
|
9
9
|
- content_for :application do
|
10
10
|
%header#header
|
11
11
|
#header_actions
|
12
|
-
= 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
|
13
|
-
|
14
|
-
|
12
|
+
= link_to '#pages_list', class: 'button button-default sort-switch', data: {change_order: t('spina.pages.change_order'), done_changing_order: t('spina.pages.done_changing_order')} do
|
13
|
+
.button-content
|
14
|
+
= icon('random')
|
15
|
+
= t('spina.pages.change_order')
|
15
16
|
|
16
17
|
= yield(:header_actions) if content_for?(:header_actions)
|
17
18
|
|
18
19
|
.breadcrumbs
|
19
20
|
= render_breadcrumbs separator: '<div class="divider"></div>'
|
20
|
-
= link_to '/', class: 'button button-small button-
|
21
|
+
= link_to '/', class: 'button button-small button-default', target: :blank do
|
21
22
|
%i.icon.icon-export{style: "margin: 0"}
|
22
23
|
|
23
24
|
%nav#secondary.tabs
|
@@ -7,42 +7,48 @@
|
|
7
7
|
= icon('check')
|
8
8
|
= t('spina.preferences.account_save')
|
9
9
|
|
10
|
-
|
10
|
+
%div{style: "margin-top: 40px"}
|
11
11
|
.horizontal-form
|
12
12
|
.horizontal-form-group
|
13
13
|
.horizontal-form-label
|
14
14
|
= Spina::Account.human_attribute_name(:name)
|
15
15
|
.horizontal-form-content
|
16
|
-
|
16
|
+
.page-form-control
|
17
|
+
= f.text_field :name, placeholder: Spina::Account.human_attribute_name(:name)
|
17
18
|
|
18
19
|
.horizontal-form-group
|
19
20
|
.horizontal-form-label
|
20
21
|
= Spina::Account.human_attribute_name(:address)
|
21
22
|
.horizontal-form-content
|
22
|
-
|
23
|
+
.page-form-control
|
24
|
+
= f.text_field :address, placeholder: Spina::Account.human_attribute_name(:address)
|
23
25
|
|
24
26
|
.horizontal-form-group
|
25
27
|
.horizontal-form-label
|
26
28
|
= Spina::Account.human_attribute_name(:postal_code)
|
27
29
|
.horizontal-form-content
|
28
|
-
|
30
|
+
.page-form-control
|
31
|
+
= f.text_field :postal_code, placeholder: Spina::Account.human_attribute_name(:postal_code)
|
29
32
|
|
30
33
|
.horizontal-form-group
|
31
34
|
.horizontal-form-label
|
32
35
|
= Spina::Account.human_attribute_name(:city)
|
33
36
|
.horizontal-form-content
|
34
|
-
|
37
|
+
.page-form-control
|
38
|
+
= f.text_field :city, placeholder: Spina::Account.human_attribute_name(:city)
|
35
39
|
|
36
40
|
.horizontal-form-group
|
37
41
|
.horizontal-form-label
|
38
42
|
= Spina::Account.human_attribute_name(:phone)
|
39
43
|
.horizontal-form-content
|
40
|
-
|
44
|
+
.page-form-control
|
45
|
+
= f.text_field :phone, placeholder: Spina::Account.human_attribute_name(:phone)
|
41
46
|
|
42
47
|
.horizontal-form-group
|
43
48
|
.horizontal-form-label
|
44
49
|
= Spina::Account.human_attribute_name(:email)
|
45
50
|
.horizontal-form-content
|
46
|
-
|
51
|
+
.page-form-control
|
52
|
+
= f.text_field :email, placeholder: Spina::Account.human_attribute_name(:email)
|
47
53
|
|
48
54
|
|
@@ -7,7 +7,7 @@
|
|
7
7
|
= icon('check')
|
8
8
|
= t('spina.preferences.analytics_save')
|
9
9
|
|
10
|
-
|
10
|
+
%div{style: "margin-top: 40px"}
|
11
11
|
.horizontal-form
|
12
12
|
.horizontal-form-group
|
13
13
|
.horizontal-form-label
|
@@ -18,9 +18,11 @@
|
|
18
18
|
.horizontal-form-label
|
19
19
|
= Spina::Account.human_attribute_name(:google_analytics)
|
20
20
|
.horizontal-form-content
|
21
|
-
|
21
|
+
.page-form-control
|
22
|
+
= f.text_field :google_analytics, placeholder: Spina::Account.human_attribute_name(:google_analytics)
|
22
23
|
.horizontal-form-group
|
23
24
|
.horizontal-form-label
|
24
25
|
= Spina::Account.human_attribute_name(:google_site_verification)
|
25
26
|
.horizontal-form-content
|
26
|
-
|
27
|
+
.page-form-control
|
28
|
+
= f.text_field :google_site_verification, placeholder: Spina::Account.human_attribute_name(:google_site_verification)
|
@@ -7,40 +7,46 @@
|
|
7
7
|
= icon('check')
|
8
8
|
= t('spina.preferences.social_media_save')
|
9
9
|
|
10
|
-
|
10
|
+
%div{style: "margin-top: 40px"}
|
11
11
|
.horizontal-form
|
12
12
|
.horizontal-form-group
|
13
13
|
.horizontal-form-label
|
14
14
|
= Spina::Account.human_attribute_name(:facebook)
|
15
15
|
.horizontal-form-content
|
16
|
-
|
16
|
+
.page-form-control
|
17
|
+
= f.text_field :facebook, placeholder: Spina::Account.human_attribute_name(:facebook)
|
17
18
|
|
18
19
|
.horizontal-form-group
|
19
20
|
.horizontal-form-label
|
20
21
|
= Spina::Account.human_attribute_name(:twitter)
|
21
22
|
.horizontal-form-content
|
22
|
-
|
23
|
+
.page-form-control
|
24
|
+
= f.text_field :twitter, placeholder: Spina::Account.human_attribute_name(:twitter)
|
23
25
|
|
24
26
|
.horizontal-form-group
|
25
27
|
.horizontal-form-label
|
26
28
|
= Spina::Account.human_attribute_name(:instagram)
|
27
29
|
.horizontal-form-content
|
28
|
-
|
30
|
+
.page-form-control
|
31
|
+
= f.text_field :instagram, placeholder: Spina::Account.human_attribute_name(:instagram)
|
29
32
|
|
30
33
|
.horizontal-form-group
|
31
34
|
.horizontal-form-label
|
32
35
|
= Spina::Account.human_attribute_name(:youtube)
|
33
36
|
.horizontal-form-content
|
34
|
-
|
37
|
+
.page-form-control
|
38
|
+
= f.text_field :youtube, placeholder: Spina::Account.human_attribute_name(:youtube)
|
35
39
|
|
36
40
|
.horizontal-form-group
|
37
41
|
.horizontal-form-label
|
38
42
|
= Spina::Account.human_attribute_name(:linkedin)
|
39
43
|
.horizontal-form-content
|
40
|
-
|
44
|
+
.page-form-control
|
45
|
+
= f.text_field :linkedin, placeholder: Spina::Account.human_attribute_name(:linkedin)
|
41
46
|
|
42
47
|
.horizontal-form-group
|
43
48
|
.horizontal-form-label
|
44
49
|
= Spina::Account.human_attribute_name(:google_plus)
|
45
50
|
.horizontal-form-content
|
46
|
-
|
51
|
+
.page-form-control
|
52
|
+
= f.text_field :google_plus, placeholder: Spina::Account.human_attribute_name(:google_plus)
|
@@ -1,30 +1,35 @@
|
|
1
1
|
= form_for [spina, :admin, current_account], url: spina.admin_account_path do |f|
|
2
2
|
%header#header
|
3
|
-
|
3
|
+
.breadcrumbs
|
4
|
+
= render_breadcrumbs separator: '<div class="divider"></div>'
|
5
|
+
%span{style: 'margin-left: 10px'}
|
6
|
+
- if Spina.config.locales.size > 1
|
7
|
+
%div{style: "display: inline-block", data: {dropdown: true}}
|
8
|
+
= link_to '#', class: 'button button-default button-small', style: 'margin-left: 0; margin-right: 0', data: {trigger: 'dropdown', target: '#locales'} do
|
9
|
+
= icon('comment')
|
10
|
+
=t "spina.languages.#{@locale}"
|
11
|
+
%i.icon.icon-chevron-down{style: 'font-size: 9px; margin-right: 0'}
|
12
|
+
|
13
|
+
%ul#locales
|
14
|
+
- Spina.config.locales.each do |locale|
|
15
|
+
%li
|
16
|
+
= link_to t("spina.languages.#{locale}"), "?locale=#{locale}", style: ('font-weight: 600' if @locale.to_s == locale.to_s).to_s
|
4
17
|
|
5
18
|
#header_actions
|
6
19
|
%button.button.button-primary{type: 'submit', data: {icon: 'o'}}
|
7
20
|
= icon('check')
|
8
21
|
= t('spina.preferences.style_save')
|
9
22
|
|
10
|
-
.
|
11
|
-
.
|
12
|
-
.
|
13
|
-
|
14
|
-
|
15
|
-
.horizontal-form-content
|
16
|
-
.select-dropdown.account-theme{data: {layout_parts: current_theme.layout_parts.map{|layout_part| layout_part[:name]}}}
|
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)
|
18
|
-
= f.select :theme, options
|
19
|
-
|
20
|
-
= f.fields_for :layout_parts do |ff|
|
21
|
-
.horizontal-form-group.layout-part{data: {name: ff.object.name}}
|
22
|
-
.horizontal-form-label
|
23
|
-
= ff.object.title
|
24
|
-
.horizontal-form-content
|
25
|
-
= ff.hidden_field :id
|
26
|
-
= ff.hidden_field :title
|
27
|
-
= ff.hidden_field :layout_partable_type
|
28
|
-
= ff.hidden_field :name
|
23
|
+
.page-form
|
24
|
+
.page-form-group
|
25
|
+
.page-form-label= Spina::Account.human_attribute_name(:theme)
|
26
|
+
.page-form-control
|
27
|
+
.select-dropdown= f.select :theme, Spina::Theme.all.map(&:name)
|
29
28
|
|
30
|
-
|
29
|
+
= f.fields_for "#{@locale}_content".to_sym, build_parts(f.object, current_theme.layout_parts) do |ff|
|
30
|
+
= ff.hidden_field :type, value: ff.object.class
|
31
|
+
= ff.hidden_field :name
|
32
|
+
= ff.hidden_field :title
|
33
|
+
|
34
|
+
.page-form-group.page-part{data: {name: ff.object.name}}
|
35
|
+
= render "spina/admin/parts/#{parts_partial_namespace(ff.object.class.to_s)}/form", f: ff
|