workarea-blog 3.4.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.editorconfig +20 -0
- data/.eslintignore +2 -0
- data/.eslintrc +24 -0
- data/.github/ISSUE_TEMPLATE/bug_report.md +37 -0
- data/.github/ISSUE_TEMPLATE/documentation-request.md +17 -0
- data/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
- data/.gitignore +16 -0
- data/.rspec +2 -0
- data/.scss-lint.yml +188 -0
- data/.tailor +180 -0
- data/.yardopts +1 -0
- data/CHANGELOG.md +1123 -0
- data/CODE_OF_CONDUCT.md +3 -0
- data/CONTRIBUTING.md +3 -0
- data/Gemfile +7 -0
- data/LICENSE +52 -0
- data/README.md +140 -0
- data/Rakefile +42 -0
- data/app/assets/images/workarea/admin/blog/content_block_types/blog_entry.svg +1 -0
- data/app/assets/images/workarea/admin/blog/icons/blog.svg +1 -0
- data/app/assets/images/workarea/admin/blog/icons/blog_entry.svg +1 -0
- data/app/assets/images/workarea/admin/blog/icons/blog_post_comment.svg +1 -0
- data/app/assets/javascripts/workarea/storefront/blog/modules/blog_comment_placeholder.js +33 -0
- data/app/assets/stylesheets/workarea/admin/blog/components/_blog_entry_card.scss +14 -0
- data/app/assets/stylesheets/workarea/storefront/blog/components/_blog_entry.scss +91 -0
- data/app/assets/stylesheets/workarea/storefront/blog/components/_blog_entry_summary.scss +74 -0
- data/app/assets/stylesheets/workarea/storefront/blog/components/_featured_entry_content_block.scss +22 -0
- data/app/controllers/workarea/admin/application_controller.decorator +5 -0
- data/app/controllers/workarea/admin/content_blog_comments_controller.rb +54 -0
- data/app/controllers/workarea/admin/content_blog_entries_controller.rb +70 -0
- data/app/controllers/workarea/admin/content_blogs_controller.rb +56 -0
- data/app/controllers/workarea/admin/create_content_blog_entries_controller.rb +69 -0
- data/app/controllers/workarea/storefront/blog_comments_controller.rb +14 -0
- data/app/controllers/workarea/storefront/blog_entries_controller.rb +48 -0
- data/app/controllers/workarea/storefront/blogs_controller.rb +19 -0
- data/app/helpers/workarea/admin/blogs_helper.rb +61 -0
- data/app/models/workarea/content/blog.rb +26 -0
- data/app/models/workarea/content/blog_comment.rb +67 -0
- data/app/models/workarea/content/blog_entry.rb +35 -0
- data/app/models/workarea/content/fields/blog_entry_id.rb +11 -0
- data/app/models/workarea/content/fields/blog_id.rb +8 -0
- data/app/models/workarea/search/admin/content_blog.rb +27 -0
- data/app/models/workarea/search/admin/content_blog_entry.rb +37 -0
- data/app/queries/workarea/metadata/content_blog.rb +6 -0
- data/app/queries/workarea/metadata/content_blog_entry.rb +6 -0
- data/app/queries/workarea/search/admin_blog_entries.rb +24 -0
- data/app/queries/workarea/search/admin_blogs.rb +20 -0
- data/app/seeds/workarea/blog_comments_seeds.rb +26 -0
- data/app/seeds/workarea/blog_entry_seeds.rb +73 -0
- data/app/seeds/workarea/blog_seeds.rb +53 -0
- data/app/services/workarea/search/queries/blog_admin.rb +20 -0
- data/app/services/workarea/search/queries/blog_entry_admin.rb +13 -0
- data/app/services/workarea/set_navigable.decorator +10 -0
- data/app/view_models/workarea/admin/blog_comments_view_model.rb +45 -0
- data/app/view_models/workarea/admin/blog_entries_view_model.rb +31 -0
- data/app/view_models/workarea/admin/blog_entry_view_model.rb +29 -0
- data/app/view_models/workarea/admin/blog_search_view_model.rb +6 -0
- data/app/view_models/workarea/admin/blog_view_model.rb +13 -0
- data/app/view_models/workarea/storefront/blog_entry_view_model.rb +43 -0
- data/app/view_models/workarea/storefront/blog_index_view_model.rb +17 -0
- data/app/view_models/workarea/storefront/blog_view_model.rb +83 -0
- data/app/view_models/workarea/storefront/content_blocks/blog_entry_content_block_view_model.rb +63 -0
- data/app/views/workarea/admin/activities/_content_blog_comment_create.html.haml +12 -0
- data/app/views/workarea/admin/activities/_content_blog_comment_destroy.html.haml +9 -0
- data/app/views/workarea/admin/activities/_content_blog_comment_update.html.haml +10 -0
- data/app/views/workarea/admin/activities/_content_blog_create.html.haml +12 -0
- data/app/views/workarea/admin/activities/_content_blog_destroy.html.haml +10 -0
- data/app/views/workarea/admin/activities/_content_blog_entry_create.html.haml +12 -0
- data/app/views/workarea/admin/activities/_content_blog_entry_destroy.html.haml +10 -0
- data/app/views/workarea/admin/activities/_content_blog_entry_update.html.haml +10 -0
- data/app/views/workarea/admin/activities/_content_blog_update.html.haml +10 -0
- data/app/views/workarea/admin/blog/_dashboard_navigation.html.haml +1 -0
- data/app/views/workarea/admin/blog/_menu.html.haml +13 -0
- data/app/views/workarea/admin/content_blocks/_blog_entry_id.html.haml +4 -0
- data/app/views/workarea/admin/content_blocks/_blog_id.html.haml +3 -0
- data/app/views/workarea/admin/content_blog_comments/_summary.html.haml +24 -0
- data/app/views/workarea/admin/content_blog_comments/edit.html.haml +60 -0
- data/app/views/workarea/admin/content_blog_comments/index.html.haml +49 -0
- data/app/views/workarea/admin/content_blog_entries/_aux_navigation.html.haml +4 -0
- data/app/views/workarea/admin/content_blog_entries/_cards.html.haml +113 -0
- data/app/views/workarea/admin/content_blog_entries/_summary.html.haml +10 -0
- data/app/views/workarea/admin/content_blog_entries/edit.html.haml +75 -0
- data/app/views/workarea/admin/content_blog_entries/index.html.haml +80 -0
- data/app/views/workarea/admin/content_blog_entries/index.json.jbuilder +5 -0
- data/app/views/workarea/admin/content_blog_entries/show.html.haml +20 -0
- data/app/views/workarea/admin/content_blog_entries/thumbnail_image.html.haml +55 -0
- data/app/views/workarea/admin/content_blogs/_aux_navigation.html.haml +2 -0
- data/app/views/workarea/admin/content_blogs/_cards.html.haml +58 -0
- data/app/views/workarea/admin/content_blogs/_summary.html.haml +6 -0
- data/app/views/workarea/admin/content_blogs/edit.html.haml +51 -0
- data/app/views/workarea/admin/content_blogs/index.html.haml +76 -0
- data/app/views/workarea/admin/content_blogs/index.json.jbuilder +4 -0
- data/app/views/workarea/admin/content_blogs/new.html.haml +33 -0
- data/app/views/workarea/admin/content_blogs/show.html.haml +19 -0
- data/app/views/workarea/admin/create_content_blog_entries/content.html.haml +28 -0
- data/app/views/workarea/admin/create_content_blog_entries/featured_products.html.haml +71 -0
- data/app/views/workarea/admin/create_content_blog_entries/publish.html.haml +51 -0
- data/app/views/workarea/admin/create_content_blog_entries/setup.html.haml +61 -0
- data/app/views/workarea/admin/create_content_blog_entries/thumbnail_image.html.haml +48 -0
- data/app/views/workarea/storefront/blog_comments/index.html.haml +31 -0
- data/app/views/workarea/storefront/blog_entries/_summary.html.haml +25 -0
- data/app/views/workarea/storefront/blog_entries/show.html.haml +85 -0
- data/app/views/workarea/storefront/blog_metadata/_publisher.html.haml +7 -0
- data/app/views/workarea/storefront/blogs/_blog_navigation.html.haml +7 -0
- data/app/views/workarea/storefront/blogs/index.html.haml +25 -0
- data/app/views/workarea/storefront/blogs/show.atom.builder +26 -0
- data/app/views/workarea/storefront/blogs/show.html.haml +31 -0
- data/app/views/workarea/storefront/content_blocks/_blog_entry.html.haml +20 -0
- data/app/workers/workarea/generate_content_metadata.decorator +15 -0
- data/bin/rails +18 -0
- data/config/initializers/appends.rb +26 -0
- data/config/initializers/content_block_types.rb +13 -0
- data/config/initializers/jump_to_navigation.rb +3 -0
- data/config/initializers/seeds.rb +5 -0
- data/config/initializers/workarea.rb +15 -0
- data/config/locales/en.yml +244 -0
- data/config/routes.rb +49 -0
- data/data/blog_thumbnails/thumbnail_1.png +0 -0
- data/data/blog_thumbnails/thumbnail_2.png +0 -0
- data/data/blog_thumbnails/thumbnail_3.png +0 -0
- data/lib/tasks/import_wordpress.rake +13 -0
- data/lib/tasks/import_wordpress_attachments.rake +18 -0
- data/lib/tasks/import_wordpress_pages.rake +21 -0
- data/lib/tasks/import_wordpress_posts.rake +25 -0
- data/lib/workarea/blog/engine.rb +8 -0
- data/lib/workarea/blog/import/wordpress/attachment.rb +40 -0
- data/lib/workarea/blog/import/wordpress/content_cleaner.rb +64 -0
- data/lib/workarea/blog/import/wordpress/entry.rb +76 -0
- data/lib/workarea/blog/import/wordpress/entry_parser.rb +64 -0
- data/lib/workarea/blog/import/wordpress/page.rb +69 -0
- data/lib/workarea/blog/import/wordpress/page_parser.rb +50 -0
- data/lib/workarea/blog/version.rb +5 -0
- data/lib/workarea/blog.rb +11 -0
- data/test/dummy/Rakefile +6 -0
- data/test/dummy/app/assets/config/manifest.js +4 -0
- data/test/dummy/app/assets/images/.keep +0 -0
- data/test/dummy/app/assets/javascripts/application.js +13 -0
- data/test/dummy/app/assets/stylesheets/application.css +15 -0
- data/test/dummy/app/controllers/application_controller.rb +3 -0
- data/test/dummy/app/controllers/concerns/.keep +0 -0
- data/test/dummy/app/helpers/application_helper.rb +2 -0
- data/test/dummy/app/jobs/application_job.rb +2 -0
- data/test/dummy/app/mailers/application_mailer.rb +4 -0
- data/test/dummy/app/models/concerns/.keep +0 -0
- data/test/dummy/app/views/layouts/application.html.erb +14 -0
- data/test/dummy/app/views/layouts/mailer.html.erb +13 -0
- data/test/dummy/app/views/layouts/mailer.text.erb +1 -0
- data/test/dummy/bin/bundle +3 -0
- data/test/dummy/bin/rails +4 -0
- data/test/dummy/bin/rake +4 -0
- data/test/dummy/bin/setup +34 -0
- data/test/dummy/bin/update +29 -0
- data/test/dummy/config/application.rb +26 -0
- data/test/dummy/config/boot.rb +5 -0
- data/test/dummy/config/cable.yml +9 -0
- data/test/dummy/config/environment.rb +5 -0
- data/test/dummy/config/environments/development.rb +59 -0
- data/test/dummy/config/environments/production.rb +86 -0
- data/test/dummy/config/environments/test.rb +43 -0
- data/test/dummy/config/initializers/application_controller_renderer.rb +6 -0
- data/test/dummy/config/initializers/assets.rb +11 -0
- data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/test/dummy/config/initializers/cookies_serializer.rb +5 -0
- data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/test/dummy/config/initializers/inflections.rb +16 -0
- data/test/dummy/config/initializers/mime_types.rb +4 -0
- data/test/dummy/config/initializers/new_framework_defaults.rb +18 -0
- data/test/dummy/config/initializers/session_store.rb +3 -0
- data/test/dummy/config/initializers/workarea.rb +3 -0
- data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/test/dummy/config/locales/en.yml +23 -0
- data/test/dummy/config/puma.rb +47 -0
- data/test/dummy/config/routes.rb +5 -0
- data/test/dummy/config/secrets.yml +22 -0
- data/test/dummy/config/spring.rb +6 -0
- data/test/dummy/config.ru +5 -0
- data/test/dummy/db/seeds.rb +2 -0
- data/test/dummy/lib/assets/.keep +0 -0
- data/test/dummy/log/.keep +0 -0
- data/test/factories/blog.rb +33 -0
- data/test/factories/wordpress_import.rb +17 -0
- data/test/fixtures/test_wordpress.xml +493 -0
- data/test/integration/workarea/blog/admin_integration_test.rb +55 -0
- data/test/integration/workarea/blog/create_blog_entries_integration_test.rb +106 -0
- data/test/integration/workarea/blog/storefront_integration_test.rb +112 -0
- data/test/integration/workarea/blog/wordpress_import_integration_test.rb +26 -0
- data/test/lib/workarea/blog/import/wordpress/attachment_test.rb +20 -0
- data/test/lib/workarea/blog/import/wordpress/content_cleaner_test.rb +65 -0
- data/test/lib/workarea/blog/import/wordpress/entry_parser_test.rb +42 -0
- data/test/lib/workarea/blog/import/wordpress/entry_test.rb +61 -0
- data/test/lib/workarea/blog/import/wordpress/page_parser_test.rb +35 -0
- data/test/lib/workarea/blog/import/wordpress/page_test.rb +52 -0
- data/test/models/workarea/content/blog_comment_test.rb +57 -0
- data/test/models/workarea/content/blog_entry_test.rb +17 -0
- data/test/queries/workarea/metadata/content_blog_entry_test.rb +36 -0
- data/test/queries/workarea/metadata/content_blog_test.rb +36 -0
- data/test/support/workarea/blog/stub_wordpress_assets.rb +19 -0
- data/test/system/workarea/admin/blog_entries_system_test.rb +103 -0
- data/test/system/workarea/admin/blog_system_test.rb +93 -0
- data/test/system/workarea/admin/blog_taxonomy_system_test.rb +21 -0
- data/test/system/workarea/admin/blog_user_comments_system_test.rb +138 -0
- data/test/system/workarea/storefront/blog_content_block_system_test.rb +36 -0
- data/test/system/workarea/storefront/blog_system_test.rb +256 -0
- data/test/test_helper.rb +9 -0
- data/test/view_models/workarea/admin/blog_comments_view_model_test.rb +77 -0
- data/test/view_models/workarea/admin/blog_entries_view_model_test.rb +36 -0
- data/test/view_models/workarea/storefront/blog_entry_content_block_view_model_test.rb +100 -0
- data/test/view_models/workarea/storefront/blog_entry_view_model_test.rb +47 -0
- data/test/view_models/workarea/storefront/blog_view_model_test.rb +149 -0
- data/test/workers/workarea/generate_content_blog_metadata_test.rb +18 -0
- data/workarea-blog.gemspec +19 -0
- metadata +274 -0
@@ -0,0 +1,33 @@
|
|
1
|
+
- @page_title = t('workarea.admin.content_blogs.new.page_title')
|
2
|
+
|
3
|
+
.view
|
4
|
+
.view__header
|
5
|
+
.grid.grid--middle
|
6
|
+
.grid__cell.grid__cell--25
|
7
|
+
= render 'workarea/admin/releases/select'
|
8
|
+
.grid__cell.grid__cell--50
|
9
|
+
.view__heading
|
10
|
+
= link_to t('workarea.admin.content_blogs.new.blogs'), content_blogs_path
|
11
|
+
%h1= t('workarea.admin.content_blogs.new.title')
|
12
|
+
|
13
|
+
- if @blog.errors.present?
|
14
|
+
= render 'workarea/admin/shared/errors', errors: @blog.errors
|
15
|
+
|
16
|
+
.view__container.view__container--narrow
|
17
|
+
= form_tag content_blogs_path, method: 'post', id: 'blog_form' do
|
18
|
+
.section
|
19
|
+
.property.property--required
|
20
|
+
= label_tag 'blog_name', nil, class: 'property__name' do
|
21
|
+
%span.property__text= t('workarea.admin.content_blogs.new.name')
|
22
|
+
= text_field_tag 'blog[name]', @blog.name, class: 'text-box text-box--i18n', required: true
|
23
|
+
.property
|
24
|
+
= label_tag 'blog_slug', nil, class: 'property__name' do
|
25
|
+
%span.property__text= t('workarea.admin.content_blogs.new.page_url')
|
26
|
+
%span= storefront.blog_url('')
|
27
|
+
= text_field_tag 'blog[slug]', @blog[:slug], class: 'text-box text-box--medium', placeholder: @blog[:slug] || 'your-slug-here'
|
28
|
+
%span.property__note= t('workarea.admin.content_blogs.new.page_url_note')
|
29
|
+
|
30
|
+
.workflow-bar
|
31
|
+
.grid.grid--auto.grid--right.grid--middle
|
32
|
+
.grid__cell= render 'workarea/admin/shared/publishing_select'
|
33
|
+
.grid__cell= button_tag t('workarea.admin.content_blogs.new.create_blog'), value: 'save_blog', class: 'workflow-bar__button workflow-bar__button--create'
|
@@ -0,0 +1,19 @@
|
|
1
|
+
- @page_title = @blog.name
|
2
|
+
|
3
|
+
.view
|
4
|
+
.view__header
|
5
|
+
.grid.grid--middle
|
6
|
+
.grid__cell.grid__cell--25
|
7
|
+
= render 'workarea/admin/releases/select'
|
8
|
+
.grid__cell.grid__cell--50
|
9
|
+
.view__heading
|
10
|
+
= link_to_index_for(@blog)
|
11
|
+
%h1= @blog.name
|
12
|
+
.grid__cell.grid__cell--25
|
13
|
+
= render_aux_navigation_for(@blog)
|
14
|
+
|
15
|
+
.view__container
|
16
|
+
= render_cards_for(@blog)
|
17
|
+
|
18
|
+
.workflow-bar
|
19
|
+
= link_to t('workarea.admin.actions.delete'), content_blog_path(@blog), class: 'workflow-bar__button workflow-bar__button--delete', data: { method: 'delete', confirm: t('workarea.admin.content_blogs.actions.delete_confirmation') }
|
@@ -0,0 +1,28 @@
|
|
1
|
+
- @page_title = t('workarea.admin.create_content_blog_entries.content.page_title', name: @blog_entry.name)
|
2
|
+
|
3
|
+
.view
|
4
|
+
.view__header
|
5
|
+
.view__heading
|
6
|
+
%h1= t('workarea.admin.create_content_blog_entries.content.title', name: @blog_entry.name)
|
7
|
+
|
8
|
+
.view__container
|
9
|
+
|
10
|
+
= render 'workarea/admin/content/edit', content: @content, workflow: true
|
11
|
+
|
12
|
+
.workflow-bar
|
13
|
+
.grid.grid--middle
|
14
|
+
.grid__cell.grid__cell--20
|
15
|
+
= link_to t('workarea.admin.form.cancel'), content_blog_entry_path(@blog_entry), class: 'workflow-bar__button workflow-bar__button--delete', data: { method: 'delete', confirm: t('workarea.admin.create_content_blog_entries.workflow.cancel_message') }
|
16
|
+
|
17
|
+
.grid__cell.grid__cell--60
|
18
|
+
%ol.workflow-bar__steps
|
19
|
+
%li
|
20
|
+
%li 1) #{link_to t('workarea.admin.create_content_blog_entries.workflow.steps.setup'), create_content_blog_entry_path(@blog_entry)}
|
21
|
+
%li 2) #{link_to t('workarea.admin.create_content_blog_entries.workflow.steps.thumbnail_image'), thumbnail_image_create_content_blog_entry_path(@blog_entry)}
|
22
|
+
%strong 3) #{ t('workarea.admin.create_content_blog_entries.workflow.steps.content')}
|
23
|
+
%li 4) #{link_to t('workarea.admin.create_content_blog_entries.workflow.steps.featured_products'), featured_products_create_content_blog_entry_path(@blog_entry)}
|
24
|
+
%li 5) #{link_to t('workarea.admin.create_content_blog_entries.workflow.steps.publish'), publish_create_content_blog_entry_path(@blog_entry)}
|
25
|
+
|
26
|
+
.grid__cell.grid__cell--20
|
27
|
+
.grid.grid--auto.grid--right.grid--middle
|
28
|
+
.grid__cell= link_to t('workarea.admin.create_content_blog_entries.content.button'), featured_products_create_content_blog_entry_path(@blog_entry), class: 'workflow-bar__button'
|
@@ -0,0 +1,71 @@
|
|
1
|
+
- @page_title = t('workarea.admin.create_content_blog_entries.featured_products.page_title', name: @blog_entry.name)
|
2
|
+
|
3
|
+
.view
|
4
|
+
.view__header
|
5
|
+
.view__heading
|
6
|
+
%h1.heading.heading--no-margin= t('workarea.admin.create_content_blog_entries.featured_products.title', name: @blog_entry.name)
|
7
|
+
%p= link_to t('workarea.admin.create_content_blog_entries.workflow.skip_this'), content_blog_create_entry_path(@blog_entry)
|
8
|
+
|
9
|
+
.view__container
|
10
|
+
.section
|
11
|
+
%p.align-center= t('workarea.admin.create_content_blog_entries.featured_products.instruction')
|
12
|
+
|
13
|
+
.browsing-controls.browsing-controls--with-divider.browsing-controls--center{ class: ('browsing-controls--filters-displayed' unless @search.toggle_facets?) }
|
14
|
+
= form_tag featured_products_create_content_blog_entry_path(@blog_entry), method: 'get', id: 'product_search_form' do
|
15
|
+
= facet_hidden_inputs(@search.facets)
|
16
|
+
.browsing-controls__sort
|
17
|
+
.property.property--inline
|
18
|
+
= label_tag 'sort', t('workarea.admin.search.sort_by'), class: 'property__name'
|
19
|
+
= select_tag :sort, options_for_select(@search.sorts, selected: @search.sort), data: { form_submitting_control: '' }
|
20
|
+
|
21
|
+
.browsing-controls__search
|
22
|
+
.search-form
|
23
|
+
= text_field_tag :q, params[:q], class: 'search-form__input', title: t('workarea.admin.search.keywords'), placeholder: t('workarea.admin.search.keywords')
|
24
|
+
= submit_tag 'search_products', class: 'search-form__button'
|
25
|
+
|
26
|
+
= render 'workarea/admin/shared/creation_date', search: @search, form_path: featured_products_create_content_blog_entry_path(@blog_entry)
|
27
|
+
|
28
|
+
- if @search.facets.present?
|
29
|
+
- @search.facets.each do |facet|
|
30
|
+
= render "workarea/admin/facets/#{facet.type}", facet: facet
|
31
|
+
|
32
|
+
-if @search.toggle_facets?
|
33
|
+
.browsing-controls__toggle-filters
|
34
|
+
%button.text-button{ type: 'button', data: { toggle_filters: '' } }= t('workarea.admin.search.show_filters')
|
35
|
+
|
36
|
+
= render 'workarea/admin/facets/applied', search: @search, reset_path: featured_products_create_content_blog_entry_path(@blog_entry)
|
37
|
+
|
38
|
+
- if @search.results.blank?
|
39
|
+
%h2
|
40
|
+
= t('workarea.admin.create_content_blog_entries.featured_products.no_matching_products')
|
41
|
+
= link_to t('workarea.admin.create_content_blog_entries.featured_products.start_over'), featured_products_create_content_blog_entry_path(@blog_entry)
|
42
|
+
|
43
|
+
- else
|
44
|
+
.grid.grid--auto.grid--flush.grid--center
|
45
|
+
- @search.results.each do |result|
|
46
|
+
.grid__cell
|
47
|
+
- if @blog_entry.product_ids.include?(result.id)
|
48
|
+
= render 'workarea/admin/featured_products/selected', featurable: @blog_entry, product: result
|
49
|
+
- else
|
50
|
+
= render 'workarea/admin/featured_products/unselected', featurable: @blog_entry, product: result
|
51
|
+
|
52
|
+
- if @search.results.total_pages > 1
|
53
|
+
= render 'workarea/admin/shared/pagination', collection: @search.results
|
54
|
+
|
55
|
+
.workflow-bar
|
56
|
+
.grid.grid--middle
|
57
|
+
.grid__cell.grid__cell--20
|
58
|
+
= link_to t('workarea.admin.form.cancel'), content_blog_entry_path(@blog_entry), class: 'workflow-bar__button workflow-bar__button--delete', data: { method: 'delete', confirm: t('workarea.admin.create_content_blog_entries.workflow.cancel_message') }
|
59
|
+
|
60
|
+
.grid__cell.grid__cell--60
|
61
|
+
%ol.workflow-bar__steps
|
62
|
+
%li.workflow-bar__step 1) #{link_to t('workarea.admin.create_content_blog_entries.workflow.steps.setup'), create_content_blog_entry_path(@blog_entry)}
|
63
|
+
%li.workflow-bar__step 2) #{link_to t('workarea.admin.create_content_blog_entries.workflow.steps.thumbnail_image'), thumbnail_image_create_content_blog_entry_path(@blog_entry)}
|
64
|
+
%li.workflow-bar__step 3) #{link_to t('workarea.admin.create_content_blog_entries.workflow.steps.content'), content_create_content_blog_entry_path(@blog_entry)}
|
65
|
+
%li.workflow-bar__step
|
66
|
+
%strong 4) #{t('workarea.admin.create_content_blog_entries.workflow.steps.featured_products')}
|
67
|
+
%li.workflow-bar__step 5) #{link_to t('workarea.admin.create_content_blog_entries.workflow.steps.publish'), publish_create_content_blog_entry_path(@blog_entry)}
|
68
|
+
|
69
|
+
.grid__cell.grid__cell--20
|
70
|
+
.grid.grid--auto.grid--right.grid--middle
|
71
|
+
.grid__cell= link_to "#{t('workarea.admin.create_content_blog_entries.featured_products.button')} →", publish_create_content_blog_entry_path(@blog_entry), class: 'workflow-bar__button'
|
@@ -0,0 +1,51 @@
|
|
1
|
+
- @page_title = t('workarea.admin.create_content_blog_entries.publish.page_title', name: @blog_entry.name)
|
2
|
+
|
3
|
+
.view
|
4
|
+
.view__header
|
5
|
+
.view__heading
|
6
|
+
%h1= t('workarea.admin.create_content_blog_entries.publish.title', name: @blog_entry.name)
|
7
|
+
|
8
|
+
.view__container
|
9
|
+
= form_tag save_publish_create_content_blog_entry_path(@blog_entry), method: 'post' do
|
10
|
+
.section
|
11
|
+
.grid.grid--center
|
12
|
+
.grid__cell.grid__cell--40-at-medium
|
13
|
+
.publish-create-release{ data: { publish_create_release: '' } }
|
14
|
+
.property
|
15
|
+
= radio_button_tag 'activate', 'now', current_release.blank?, title: 'Active'
|
16
|
+
= label_tag 'activate_now', 'Now', class: 'heading--4'
|
17
|
+
|
18
|
+
- release_options.each do |release|
|
19
|
+
.property
|
20
|
+
= radio_button_tag 'activate', release.id, release == current_release, title: 'Active'
|
21
|
+
= label_tag "activate_#{release.id}", "With #{release.name}", class: 'heading--4'
|
22
|
+
|
23
|
+
.property
|
24
|
+
= radio_button_tag 'activate', 'new_release', params[:activate] == 'new_release', title: 'Active'
|
25
|
+
= label_tag 'activate_new_release', 'With a new release:', class: 'heading--4'
|
26
|
+
|
27
|
+
.publish-create-release__fields.hidden
|
28
|
+
.property
|
29
|
+
= label_tag 'release[name]', 'Release name', class: 'property__name'
|
30
|
+
= text_field_tag 'release[name]', nil, class: 'text-box text-box--wide', placeholder: "Mother's Day #{Time.now.year}"
|
31
|
+
.property
|
32
|
+
= label_tag 'release[publish_at]', 'When does it publish?', class: 'property__name'
|
33
|
+
= hidden_field_tag 'release[publish_at]', nil, placeholder: 'When does it publish?', data: { datetimepicker_field: { inline: true } }
|
34
|
+
|
35
|
+
.workflow-bar
|
36
|
+
.grid.grid--middle
|
37
|
+
.grid__cell.grid__cell--20
|
38
|
+
= link_to t('workarea.admin.form.cancel'), content_blog_entry_path(@blog_entry), class: 'workflow-bar__button workflow-bar__button--delete', data: { method: 'delete', confirm: t('workarea.admin.create_content_blog_entries.workflow.cancel_message') }
|
39
|
+
|
40
|
+
.grid__cell.grid__cell--60
|
41
|
+
%ol.workflow-bar__steps
|
42
|
+
%li
|
43
|
+
%li 1) #{link_to t('workarea.admin.create_content_blog_entries.workflow.steps.setup'), create_content_blog_entry_path(@blog_entry)}
|
44
|
+
%li 2) #{link_to t('workarea.admin.create_content_blog_entries.workflow.steps.thumbnail_image'), thumbnail_image_create_content_blog_entry_path(@blog_entry)}
|
45
|
+
%li 3) #{link_to t('workarea.admin.create_content_blog_entries.workflow.steps.content'), content_create_content_blog_entry_path(@blog_entry)}
|
46
|
+
%li 4) #{link_to t('workarea.admin.create_content_blog_entries.workflow.steps.featured_products'), featured_products_create_content_blog_entry_path(@blog_entry)}
|
47
|
+
%strong 5) #{t('workarea.admin.create_content_blog_entries.workflow.steps.publish')}
|
48
|
+
|
49
|
+
.grid__cell.grid__cell--20
|
50
|
+
.grid.grid--auto.grid--right.grid--middle
|
51
|
+
.grid__cell= button_tag t('workarea.admin.create_content_blog_entries.publish.button'), class: 'workflow-bar__button'
|
@@ -0,0 +1,61 @@
|
|
1
|
+
- @page_title = t('workarea.admin.create_content_blog_entries.setup.page_title')
|
2
|
+
- @breadcrumbs = ['Marketing', 'Blog']
|
3
|
+
|
4
|
+
.view
|
5
|
+
.view__header
|
6
|
+
.view__heading
|
7
|
+
%h1= t('workarea.admin.create_content_blog_entries.setup.title')
|
8
|
+
|
9
|
+
.view__container.view__container--narrow
|
10
|
+
- @blog_entry.errors.full_messages.each do |message|
|
11
|
+
= render_message 'error', message
|
12
|
+
|
13
|
+
= form_tag create_content_blog_entries_path, method: 'post' do
|
14
|
+
= hidden_field_tag :id, @blog_entry.slug unless @blog_entry.new_record?
|
15
|
+
= hidden_field_tag 'blog_entry[active]', false
|
16
|
+
= hidden_field_tag 'blog_entry[blog_id]', @blog.id
|
17
|
+
|
18
|
+
.section
|
19
|
+
.property.property--required
|
20
|
+
= label_tag 'blog_entry_name', t('workarea.admin.create_content_blog_entries.setup.name_label'), class: 'property__name'
|
21
|
+
= text_field_tag 'blog_entry[name]', @blog_entry.name, class: 'text-box text-box--i18n', required: true
|
22
|
+
|
23
|
+
.property.property--required
|
24
|
+
= label_tag 'blog_entry_author', t('workarea.admin.create_content_blog_entries.setup.author_label'), class: 'property__name'
|
25
|
+
= text_field_tag 'blog_entry[author]', @blog_entry.author || current_user.name, class: 'text-box text-box--i18n', required: true
|
26
|
+
|
27
|
+
.property
|
28
|
+
= label_tag 'blog_entry_summary', t('workarea.admin.create_content_blog_entries.summary.summary_label'), class: 'property__name'
|
29
|
+
= text_area_tag 'blog_entry[summary]', @blog_entry.summary, class: 'text-box text-box--i18n text-box--multi-line'
|
30
|
+
|
31
|
+
.property
|
32
|
+
= label_tag 'blog_entry[tag_list]', t('workarea.admin.fields.tags'), class: 'property__name'
|
33
|
+
= text_field_tag 'blog_entry[tag_list]', @blog_entry.tag_list, class: 'text-box'
|
34
|
+
%span.property__note= t('workarea.admin.form.csv_field_note')
|
35
|
+
|
36
|
+
.workflow-bar
|
37
|
+
.grid.grid--middle
|
38
|
+
.grid__cell.grid__cell--20
|
39
|
+
- if @blog_entry.new_record?
|
40
|
+
= link_to t('workarea.admin.form.cancel'), content_blog_blog_entries_path, class: 'workflow-bar__button workflow-bar__button--delete'
|
41
|
+
- else
|
42
|
+
= link_to t('workarea.admin.form.cancel'), content_blog_entries_path(@blog_entry), class: 'workflow-bar__button workflow-bar__button--delete', data: { method: 'delete', confirm: t('workarea.admin.create_content_blog_entries.workflow.cancel_message') }
|
43
|
+
|
44
|
+
.grid__cell.grid__cell--60
|
45
|
+
%ol.workflow-bar__steps
|
46
|
+
%li
|
47
|
+
%strong 1) #{t('workarea.admin.create_content_blog_entries.workflow.steps.setup')}
|
48
|
+
- if @blog_entry.new_record?
|
49
|
+
%li 2) #{t('workarea.admin.create_content_blog_entries.workflow.steps.thumbnail_image')}
|
50
|
+
%li 3) #{t('workarea.admin.create_content_blog_entries.workflow.steps.content')}
|
51
|
+
%li 4) #{t('workarea.admin.create_content_blog_entries.workflow.steps.featured_products')}
|
52
|
+
%li 5) #{t('workarea.admin.create_content_blog_entries.workflow.steps.publish')}
|
53
|
+
- else
|
54
|
+
%li 2) #{link_to t('workarea.admin.create_content_blog_entries.workflow.steps.thumbnail_image'), thumbnail_image_create_content_blog_entry_path(@blog_entry)}
|
55
|
+
%li 3) #{link_to t('workarea.admin.create_content_blog_entries.workflow.steps.content'), content_create_content_blog_entry_path(@blog_entry)}
|
56
|
+
%li 4) #{link_to t('workarea.admin.create_content_blog_entries.workflow.steps.featured_products'), featured_products_create_content_blog_entry_path(@blog_entry)}
|
57
|
+
%li 5) #{link_to t('workarea.admin.create_content_blog_entries.workflow.steps.publish'), publish_create_content_blog_entry_path(@blog_entry)}
|
58
|
+
|
59
|
+
.grid__cell.grid__cell--20
|
60
|
+
.grid.grid--auto.grid--right.grid--middle
|
61
|
+
.grid__cell= button_tag t('workarea.admin.create_content_blog_entries.setup.button'), value: 'save_setup', class: 'workflow-bar__button workflow-bar__button--create'
|
@@ -0,0 +1,48 @@
|
|
1
|
+
- @page_title = t('workarea.admin.create_content_blog_entries.thumbnail_image.page_title', name: @blog_entry.name)
|
2
|
+
|
3
|
+
.view
|
4
|
+
.view__header
|
5
|
+
.view__heading
|
6
|
+
%h1= t('workarea.admin.create_content_blog_entries.thumbnail_image.title', name: @blog_entry.name)
|
7
|
+
|
8
|
+
.view__container.view__container--narrow
|
9
|
+
- @blog_entry.errors.full_messages.each do |message|
|
10
|
+
= render_message 'error', message
|
11
|
+
|
12
|
+
= form_tag save_thumbnail_image_create_content_blog_entry_path(@blog_entry), method: 'post' do
|
13
|
+
= hidden_field_tag :id, @blog_entry.slug unless @blog_entry.new_record?
|
14
|
+
= hidden_field_tag 'blog_entry[active]', false
|
15
|
+
|
16
|
+
.property
|
17
|
+
= label_tag 'blog_entry[thumbnail_image]', class: 'property__name' do
|
18
|
+
%span.property__text Choose Image File
|
19
|
+
|
20
|
+
.asset-picker-field{ data: { asset_picker_field: '' } }
|
21
|
+
.asset-picker-field__cell
|
22
|
+
= hidden_field_tag "blog_entry[thumbnail_image]", @blog_entry[:thumbnail_image], class: 'text-box text-box--i18n'
|
23
|
+
|
24
|
+
%span{ data: { asset_name: true } }
|
25
|
+
- asset = Workarea::Content::Asset.find_or_initialize_by(id: @blog_entry[:thumbnail_image])
|
26
|
+
= asset.name.presence || t('workarea.admin.content_blocks.asset.name_missing')
|
27
|
+
|
28
|
+
.asset-picker-field__cell= link_to t('workarea.admin.content_blocks.asset.select_an_asset'), insert_content_assets_path(file_type: 'image'), class: 'text-button', data: { asset_picker_field_open: '', turbolinks: false }
|
29
|
+
- if asset.name.present?
|
30
|
+
.asset-picker-field__cell= button_tag t('workarea.admin.content_blocks.asset.clear_asset'), type: 'button', value: 'clear_asset', id: 'clear_asset', class: 'text-button text-button--destroy', data: { asset_picker_field_clear: '' }
|
31
|
+
|
32
|
+
.workflow-bar
|
33
|
+
.grid.grid--middle
|
34
|
+
.grid__cell.grid__cell--20
|
35
|
+
= link_to t('workarea.admin.form.cancel'), content_blog_entry_path(@blog_entry), class: 'workflow-bar__button workflow-bar__button--delete', data: { method: 'delete', confirm: t('workarea.admin.create_content_blog_entries.workflow.cancel_message') }
|
36
|
+
|
37
|
+
.grid__cell.grid__cell--60
|
38
|
+
%ol.workflow-bar__steps
|
39
|
+
%li
|
40
|
+
%li 1) #{link_to t('workarea.admin.create_content_blog_entries.workflow.steps.setup'), create_content_blog_entry_path(@blog_entry)}
|
41
|
+
%strong 2) #{t('workarea.admin.create_content_blog_entries.workflow.steps.thumbnail_image')}
|
42
|
+
%li 3) #{link_to t('workarea.admin.create_content_blog_entries.workflow.steps.content'), content_create_content_blog_entry_path(@blog_entry)}
|
43
|
+
%li 4) #{link_to t('workarea.admin.create_content_blog_entries.workflow.steps.featured_products'), featured_products_create_content_blog_entry_path(@blog_entry)}
|
44
|
+
%li 5) #{link_to t('workarea.admin.create_content_blog_entries.workflow.steps.publish'), publish_create_content_blog_entry_path(@blog_entry)}
|
45
|
+
|
46
|
+
.grid__cell.grid__cell--20
|
47
|
+
.grid.grid--auto.grid--right.grid--middle
|
48
|
+
.grid__cell= button_tag t('workarea.admin.create_content_blog_entries.thumbnail_image.button'), value: 'save_setup', class: 'workflow-bar__button workflow-bar__button--create'
|
@@ -0,0 +1,31 @@
|
|
1
|
+
#write-comment.blog-entry__section
|
2
|
+
|
3
|
+
%h2.blog-entry__comment-heading= t('workarea.storefront.blogs.write_comment')
|
4
|
+
|
5
|
+
- if !logged_in?
|
6
|
+
|
7
|
+
%p #{t('workarea.storefront.blogs.must_be_logged_in')} #{link_to t('workarea.storefront.users.login'), login_path(return_to: blog_entry_path(@entry))}
|
8
|
+
|
9
|
+
- else
|
10
|
+
|
11
|
+
- if @comment.present? && @comment.errors.present?
|
12
|
+
= render 'workarea/storefront/shared/errors', errors: @comment.errors
|
13
|
+
|
14
|
+
= form_tag blog_entry_comment_path(@entry), method: 'post', class: 'blog-entry__comments-form', id: 'comment-form' do
|
15
|
+
|
16
|
+
- if current_user.public_info.blank?
|
17
|
+
.property
|
18
|
+
= label_tag 'first_name', nil, class: 'property__name' do
|
19
|
+
%span.property__text= t('workarea.storefront.users.first_name')
|
20
|
+
.value= text_field_tag 'first_name', nil, class: 'text-box', required: true
|
21
|
+
.property
|
22
|
+
= label_tag 'last_name', nil, class: 'property__name' do
|
23
|
+
%span.property__text= t('workarea.storefront.users.last_name')
|
24
|
+
.value= text_field_tag 'last_name', nil, class: 'text-box', required: true
|
25
|
+
|
26
|
+
.property
|
27
|
+
= label_tag 'body', nil, class: 'property__name' do
|
28
|
+
%span.property__text= t('workarea.storefront.blogs.comment')
|
29
|
+
.value= text_area_tag 'body', @comment.try(:body), class: 'text-box text-box--wide text-box--multi-line', required: true, minlength: 10
|
30
|
+
|
31
|
+
%p= button_tag t('workarea.storefront.blogs.submit_comment'), value: 'submit_comment', class: 'button'
|
@@ -0,0 +1,25 @@
|
|
1
|
+
%article.blog-entry-summary__entry{ class: entry.featured ? 'blog-entry-summary__entry--featured' : '', itemprop: 'blogPost', itemscope: true, itemtype: 'http://schema.org/BlogPosting', data: { pagination_item: '' } }
|
2
|
+
%heading
|
3
|
+
%h2.blog-entry-summary__entry-title{ itemprop: 'mainEntityOfPage' }
|
4
|
+
%span{ itemprop: 'headline' }= link_to entry.name, blog_entry_path(entry), itemprop: 'url'
|
5
|
+
|
6
|
+
%p.blog-entry-summary__entry-author{ itemprop: 'author', itemscope: '', itemType: 'http://schema.org/Person' }
|
7
|
+
%span{ itemprop: 'name' }= entry.author
|
8
|
+
%p.blog-entry-summary__entry-datetime
|
9
|
+
= local_time(entry.written_at, format: :long, itemprop: 'datePublished dateModified')
|
10
|
+
%p.blog-entry-summary__entry-comment-count{ itemprop: 'commentCount' }= link_to t('workarea.storefront.blogs.comments', count: entry.comment_count), blog_entry_path(entry, anchor: 'blog-entry-comments')
|
11
|
+
= render 'workarea/storefront/blog_metadata/publisher'
|
12
|
+
|
13
|
+
- if entry.has_thumbnail_image?
|
14
|
+
%p.blog-entry-summary__entry-thumbnail= image_tag(entry.thumbnail_image_url, itemprop: 'image' )
|
15
|
+
|
16
|
+
- if entry.tags.present?
|
17
|
+
.blog-entry-summary__entry-tags
|
18
|
+
%p.blog-entry-summary__entry-label= t('workarea.storefront.blogs.tags')
|
19
|
+
%ul.blog-entry-summary__entry-tags-list{ itemprop: 'keywords' }
|
20
|
+
- entry.tags.each do |tag|
|
21
|
+
%li.blog-entry-summary__entry-tags-list-item= link_to tag, blog_tagged_path(entry.blog, tag)
|
22
|
+
|
23
|
+
.blog-entry-summary__content{ itemprop: 'description' }
|
24
|
+
= entry.summary
|
25
|
+
= link_to t('workarea.storefront.blogs.read_more'), blog_entry_path(entry)
|
@@ -0,0 +1,85 @@
|
|
1
|
+
- @title = @entry.browser_title
|
2
|
+
- @breadcrumbs = @breadcrumbs
|
3
|
+
|
4
|
+
- add_css(@entry.css)
|
5
|
+
- add_javascript(@entry.javascript)
|
6
|
+
|
7
|
+
- content_for :breadcrumbs do
|
8
|
+
%p.breadcrumbs__node-group
|
9
|
+
%span.breadcrumbs__node{ itemprop: 'breadcrumb' }
|
10
|
+
= link_to t('workarea.storefront.layouts.home'), root_path, rel: 'home'
|
11
|
+
%span.breadcrumbs__node{ itemprop: 'breadcrumb' }
|
12
|
+
= link_to @entry.blog.name, blog_path(@entry.blog)
|
13
|
+
%span.breadcrumbs__node{ itemprop: 'breadcrumb' } #{@entry.name}
|
14
|
+
|
15
|
+
- content_for :head do
|
16
|
+
%link{ href: blog_entry_path(@entry), rel: 'canonical' }
|
17
|
+
%meta{ property: 'og:title', content: @entry.name }
|
18
|
+
%meta{ property: 'og:type', content: 'article' }
|
19
|
+
%meta{ property: 'og:url', content: blog_entry_path(@entry) }
|
20
|
+
- if @entry.thumbnail_image.present?
|
21
|
+
%meta{ property: 'og:image', content: @entry.thumbnail_image_url }
|
22
|
+
%meta{ property: 'global-id', content: @entry.to_global_id.to_param }
|
23
|
+
- unless @entry.meta_description.blank?
|
24
|
+
%meta{ name: :description, content: @entry.meta_description }
|
25
|
+
|
26
|
+
- content_for :page_aside do
|
27
|
+
= render 'workarea/storefront/blogs/blog_navigation', blog: @entry.blog
|
28
|
+
|
29
|
+
%article.blog-entry.view{ itemscope: true, itemtype: 'http://schema.org/BlogPosting' }
|
30
|
+
|
31
|
+
%heading.blog-entry__header
|
32
|
+
- if @entry.content_blocks_for(:blog_header).present?
|
33
|
+
!= render_content_blocks(@entry.content_blocks_for('blog_header'))
|
34
|
+
|
35
|
+
- if @entry.has_thumbnail_image?
|
36
|
+
%meta{ itemprop: 'image', content: @entry.thumbnail_image_url }
|
37
|
+
|
38
|
+
%h1.blog-entry__title{ itemprop: 'mainEntityOfPage' }
|
39
|
+
%span{ itemprop: 'headline' }= @entry.name
|
40
|
+
%p.blog-entry__author{ itemprop: 'author' }= @entry.author
|
41
|
+
%p.blog-entry__datetime
|
42
|
+
%meta{ itemprop: 'dateModified', content: @entry.written_at }
|
43
|
+
= local_time(@entry.written_at, format: :long, itemprop: 'datePublished')
|
44
|
+
%p.blog-entry__comment-count{ itemprop: 'commentCount' }= link_to t('workarea.storefront.blogs.comments', count: @entry.comment_count), blog_entry_path(@entry, anchor: 'blog-entry-comments')
|
45
|
+
= render 'workarea/storefront/blog_metadata/publisher'
|
46
|
+
|
47
|
+
- if @entry.tags.present?
|
48
|
+
.blog-entry__tags
|
49
|
+
%p.blog-entry__label= t('workarea.storefront.blogs.tags')
|
50
|
+
%ul.blog-entry__tags-list{ itemprop: 'keywords' }
|
51
|
+
- @entry.tags.each do |tag|
|
52
|
+
%li.blog-entry__tags-list-item= link_to tag, blog_tagged_path(@entry.blog, tag)
|
53
|
+
|
54
|
+
.blog-entry__body{ itemprop: 'articleBody' }
|
55
|
+
- if @entry.content_blocks_for(:blog_content).present?
|
56
|
+
!= render_content_blocks(@entry.content_blocks_for('blog_content'))
|
57
|
+
|
58
|
+
- if @entry.products.present?
|
59
|
+
.blog-entry__products
|
60
|
+
%h2.blog-entry__products-heading= t('workarea.storefront.blogs.related_products')
|
61
|
+
%ul.grid.grid--auto
|
62
|
+
- @entry.products.each do |product|
|
63
|
+
%li.grid__cell>
|
64
|
+
.product-summary{ itemscope: true, itemtype: 'http://schema.org/Product' }
|
65
|
+
= render 'workarea/storefront/products/summary', product: product
|
66
|
+
|
67
|
+
#blog-entry-comments.blog-entry__comments
|
68
|
+
|
69
|
+
- if @entry.comments.present?
|
70
|
+
.blog-entry__section
|
71
|
+
.blog-entry__comments-header
|
72
|
+
%h2.blog-entry__comments-heading= t('workarea.storefront.blogs.comments', count: @entry.comment_count)
|
73
|
+
%p.blog-entry__write-comment-link= link_to t('workarea.storefront.blogs.write_comment'), '#write-comment', class: 'button'
|
74
|
+
%ul.blog-entry__comment-group
|
75
|
+
- @entry.comments.each do |comment|
|
76
|
+
%li.blog-entry__comment{ itemprop: 'comment', itemscope: true, itemType: 'http://schema.org/Comment' }
|
77
|
+
%p.blog-entry__comment-item.blog-entry__comment-item--author
|
78
|
+
= comment.user_info
|
79
|
+
%p.blog-entry__comment-item.blog-entry__comment-item--datetime
|
80
|
+
= local_time(comment.created_at, format: :long, itemprop: 'dateCreated');
|
81
|
+
|
82
|
+
%p.blog-entry__comment-item.blog-entry__comment-item--body{itemprop: 'text'}
|
83
|
+
= comment.body
|
84
|
+
|
85
|
+
#write-comment.blog-entry__section{ data: { blog_comment_placeholder: blog_entry_comments_path(@entry) } }
|
@@ -0,0 +1,7 @@
|
|
1
|
+
%div{ itemprop: 'publisher', itemscope: 'itemscope', itemtype: 'https://schema.org/Organization'}
|
2
|
+
%meta{ itemprop: 'url', content: root_url }
|
3
|
+
%meta{ itemprop: 'name', content: Workarea.config.site_name }
|
4
|
+
-# TODO: Add meta data for logo, this must include url, width, and height attributes
|
5
|
+
-# This will require a helper method for site logo with something similar to dragonfly analyzers for width & height
|
6
|
+
-# example: https://webmasters.stackexchange.com/questions/95957/how-to-specify-publisher-in-schema-orgs-article-structured-data
|
7
|
+
|
@@ -0,0 +1,7 @@
|
|
1
|
+
- if blog.tags.present?
|
2
|
+
%h2= t('workarea.storefront.blogs.tags')
|
3
|
+
%ul.secondary-nav{ role: 'navigation' }
|
4
|
+
- blog.tags.each do |tag|
|
5
|
+
%li.secondary-nav__item
|
6
|
+
= link_to blog_tagged_path(blog, tag[:name]), class: 'secondary-nav__link' do
|
7
|
+
= t('workarea.storefront.blogs.tag_link', tag)
|
@@ -0,0 +1,25 @@
|
|
1
|
+
- @title = @blog_index.browser_title
|
2
|
+
|
3
|
+
- add_css(@blog_index.css)
|
4
|
+
- add_javascript(@blog_index.javascript)
|
5
|
+
|
6
|
+
- content_for :head do
|
7
|
+
%link{ href: blog_path(@blog_index), rel: 'canonical' }
|
8
|
+
- unless @blog_index.meta_description.blank?
|
9
|
+
%meta{ name: :description, content: @blog_index.meta_description }
|
10
|
+
|
11
|
+
.blog-index.view{ itemscope: true, itemtype: 'http://schema.org/Blog' }
|
12
|
+
|
13
|
+
= render_content_blocks(@blog_index.content_blocks_for(:header_content))
|
14
|
+
|
15
|
+
%h1.blog-entry-summary__title{ itemprop: 'name' }= t('workarea.storefront.blogs.name')
|
16
|
+
|
17
|
+
- @blog_index.each do |blog|
|
18
|
+
%section
|
19
|
+
%h2.blog-index__title{ itemprop: 'name' }
|
20
|
+
= link_to blog.name, blog_path(blog), itemprop: 'url'
|
21
|
+
|
22
|
+
.pagination-results
|
23
|
+
.blog-entry-summary__entry-group
|
24
|
+
- blog.entries_on_index.each do |entry|
|
25
|
+
= render 'workarea/storefront/blog_entries/summary', entry: entry
|
@@ -0,0 +1,26 @@
|
|
1
|
+
xml.instruct! :xml, version: '1.0'
|
2
|
+
xml.feed xmlns: 'http://www.w3.org/2005/Atom' do
|
3
|
+
xml.title @blog.browser_title
|
4
|
+
xml.link rel: 'alternate', type: 'text/html', href: blog_url(@blog)
|
5
|
+
xml.link rel: 'self', type: 'application/atom+xml', href: blog_url(@blog, format: 'atom')
|
6
|
+
xml.id blog_url(@blog, format: 'atom')
|
7
|
+
xml.updated @blog.updated_at.xmlschema if @blog.updated_at.present?
|
8
|
+
|
9
|
+
@blog.entries.each do |entry|
|
10
|
+
xml.entry do
|
11
|
+
xml.title entry.name
|
12
|
+
xml.link rel: 'alternate', type: 'text/html', href: blog_entry_url(@blog, entry)
|
13
|
+
xml.published entry.updated_at.xmlschema
|
14
|
+
xml.updated entry.updated_at.xmlschema
|
15
|
+
xml.author do
|
16
|
+
xml.name entry.author
|
17
|
+
end
|
18
|
+
|
19
|
+
if entry.summary.present?
|
20
|
+
xml.summary type: 'html' do
|
21
|
+
xml.cdata! entry.summary
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
- @title = @blog.browser_title
|
2
|
+
- @breadcrumbs = @blog.breadcrumbs
|
3
|
+
|
4
|
+
- add_css(@blog.css)
|
5
|
+
- add_javascript(@blog.javascript)
|
6
|
+
|
7
|
+
- content_for :head do
|
8
|
+
%link{ href: blog_path(@blog), rel: 'canonical' }
|
9
|
+
%link{ href: blog_path(@blog, format: 'atom'), rel: 'alternate', type: 'application/atom-xml', title: 'Atom' }
|
10
|
+
%meta{ property: 'global-id', content: @blog.to_global_id.to_param }
|
11
|
+
- unless @blog.meta_description.blank?
|
12
|
+
%meta{ name: :description, content: @blog.meta_description }
|
13
|
+
|
14
|
+
- content_for :page_aside do
|
15
|
+
= render 'workarea/storefront/blogs/blog_navigation', blog: @blog
|
16
|
+
|
17
|
+
.blog-entry-summary.view{ itemscope: true, itemtype: 'http://schema.org/Blog', itemprop: '' }
|
18
|
+
|
19
|
+
%h1.blog-entry-summary__title{ itemprop: 'name' }= @blog.name
|
20
|
+
|
21
|
+
- if @blog.content_blocks_for(:header_content).present?
|
22
|
+
.blog-entry-summary__banner-content!= render_content_blocks(@blog.content_blocks_for(:header_content))
|
23
|
+
|
24
|
+
.pagination{ data: { pagination: pagination_data(@blog.entries) } }
|
25
|
+
.pagination-results
|
26
|
+
.blog-entry-summary__entry-group
|
27
|
+
- @blog.entries.each do |entry|
|
28
|
+
= render 'workarea/storefront/blog_entries/summary', entry: entry
|
29
|
+
- if show_pagination?(@blog.entries)
|
30
|
+
.pagination__button
|
31
|
+
= link_to t('workarea.storefront.pagination.next_page'), pagination_path_for(page: @blog.next_page), class: 'button', data: { pagination_button: '' }
|
@@ -0,0 +1,20 @@
|
|
1
|
+
.featured-entry-content-block
|
2
|
+
- if local_assigns[:entries].present?
|
3
|
+
- local_assigns[:entries].each do |entry|
|
4
|
+
- if entry.active
|
5
|
+
.featured-entry-content-block__entry
|
6
|
+
.featured-entry-content-block__banner
|
7
|
+
- if entry.thumbnail_image.present?
|
8
|
+
= link_to image_tag(entry.thumbnail_image_url, alt: 'Blog entry featured image', class: 'featured-entry-content-block__image'), blog_entry_path(entry)
|
9
|
+
.featured-entry-content-block__content
|
10
|
+
- if entry.blog.present?
|
11
|
+
= link_to entry.blog.name, blog_path(entry.blog), class: 'featured-entry-content-block__category-tag'
|
12
|
+
- if entry.name.present?
|
13
|
+
%h3.featured-entry-content-block__heading
|
14
|
+
= link_to entry.name.titleize, blog_entry_path(entry)
|
15
|
+
- if entry.author.present?
|
16
|
+
.featured-entry-content-block__byline= t('workarea.storefront.blogs.byline', author: entry.author)
|
17
|
+
- if entry.summary.present?
|
18
|
+
.featured-entry-content-block__body
|
19
|
+
%p= truncate(entry.summary, length: 150, separator: ' ')
|
20
|
+
= link_to t('workarea.storefront.blogs.read_more'), blog_entry_path(entry), class: 'featured-entry-content-block__read-more text-button text-button--large text-button--caret'
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module Workarea
|
2
|
+
decorate GenerateContentMetadata, with: :blog do
|
3
|
+
def perform(*)
|
4
|
+
super
|
5
|
+
|
6
|
+
Content::Blog.all.each_by(100) do |blog|
|
7
|
+
Metadata.update(Content.for(blog))
|
8
|
+
|
9
|
+
blog.entries.each_by(100) do |entry|
|
10
|
+
Metadata.update(Content.for(entry))
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
data/bin/rails
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# This command will automatically be run when you run "rails" with Rails gems
|
3
|
+
# installed from the root of your application.
|
4
|
+
|
5
|
+
ENGINE_ROOT = File.expand_path('../..', __FILE__)
|
6
|
+
ENGINE_PATH = File.expand_path('../../lib/blog/engine', __FILE__)
|
7
|
+
|
8
|
+
# Set up gems listed in the Gemfile.
|
9
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
|
10
|
+
require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
|
11
|
+
|
12
|
+
require 'action_controller/railtie'
|
13
|
+
require 'action_view/railtie'
|
14
|
+
require 'action_mailer/railtie'
|
15
|
+
require 'rails/test_unit/railtie'
|
16
|
+
require 'sprockets/railtie'
|
17
|
+
|
18
|
+
require 'rails/engine/commands'
|