workarea-super_hero 2.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (97) hide show
  1. checksums.yaml +7 -0
  2. data/.editorconfig +15 -0
  3. data/.eslintrc +26 -0
  4. data/.gitignore +11 -0
  5. data/.jshintrc +37 -0
  6. data/.rails-rubocop.yml +119 -0
  7. data/.rubocop.yml +12 -0
  8. data/.scss-lint.yml +188 -0
  9. data/CHANGELOG.md +334 -0
  10. data/Gemfile +5 -0
  11. data/README.md +120 -0
  12. data/Rakefile +60 -0
  13. data/app/assets/images/workarea/admin/content_block_types/super_hero.svg +1 -0
  14. data/app/assets/images/workarea/svg/position_grid.svg +38 -0
  15. data/app/assets/javascripts/workarea/admin/super_hero/modules/media_modes.js +54 -0
  16. data/app/assets/javascripts/workarea/admin/super_hero/modules/position_input.js +59 -0
  17. data/app/assets/javascripts/workarea/storefront/super_hero/modules/vimeo_api.js +85 -0
  18. data/app/assets/javascripts/workarea/storefront/super_hero/modules/youtube_api.js +122 -0
  19. data/app/assets/stylesheets/workarea/admin/super_hero/components/_position_grid.scss +27 -0
  20. data/app/assets/stylesheets/workarea/storefront/super_hero/components/_content_position.scss +46 -0
  21. data/app/assets/stylesheets/workarea/storefront/super_hero/components/_super_hero_content_block.scss +69 -0
  22. data/app/models/workarea/content/fields/media_mode.rb +8 -0
  23. data/app/models/workarea/content/fields/video_advanced.rb +8 -0
  24. data/app/services/workarea/storefront/color_tools.rb +24 -0
  25. data/app/services/workarea/storefront/video_embedder/vimeo.rb +50 -0
  26. data/app/services/workarea/storefront/video_embedder/youtube.rb +56 -0
  27. data/app/services/workarea/storefront/video_embedder.rb +59 -0
  28. data/app/view_models/workarea/storefront/content_blocks/super_hero_view_model.rb +79 -0
  29. data/app/views/workarea/admin/content_blocks/_media_mode.html.haml +3 -0
  30. data/app/views/workarea/admin/content_blocks/_video_advanced.html.haml +12 -0
  31. data/app/views/workarea/admin/content_blocks/types/_super_hero.html.haml +106 -0
  32. data/app/views/workarea/storefront/content_blocks/_super_hero.html.haml +27 -0
  33. data/bin/rails +18 -0
  34. data/config/initializers/appends.rb +42 -0
  35. data/config/initializers/content_block_types.rb +49 -0
  36. data/config/locales/en.yml +23 -0
  37. data/config/routes.rb +2 -0
  38. data/lib/workarea/super_hero/engine.rb +8 -0
  39. data/lib/workarea/super_hero/version.rb +5 -0
  40. data/lib/workarea/super_hero.rb +11 -0
  41. data/script/admin_ci +9 -0
  42. data/script/ci +11 -0
  43. data/script/core_ci +9 -0
  44. data/script/plugins_ci +9 -0
  45. data/script/storefront_ci +9 -0
  46. data/super_hero_logo.svg +15 -0
  47. data/test/dummy/Rakefile +6 -0
  48. data/test/dummy/app/assets/config/manifest.js +4 -0
  49. data/test/dummy/app/assets/images/.keep +0 -0
  50. data/test/dummy/app/assets/javascripts/application.js +13 -0
  51. data/test/dummy/app/assets/stylesheets/application.css +15 -0
  52. data/test/dummy/app/controllers/application_controller.rb +3 -0
  53. data/test/dummy/app/controllers/concerns/.keep +0 -0
  54. data/test/dummy/app/helpers/application_helper.rb +2 -0
  55. data/test/dummy/app/jobs/application_job.rb +2 -0
  56. data/test/dummy/app/mailers/application_mailer.rb +4 -0
  57. data/test/dummy/app/models/concerns/.keep +0 -0
  58. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  59. data/test/dummy/app/views/layouts/mailer.html.erb +13 -0
  60. data/test/dummy/app/views/layouts/mailer.text.erb +1 -0
  61. data/test/dummy/bin/bundle +3 -0
  62. data/test/dummy/bin/rails +4 -0
  63. data/test/dummy/bin/rake +4 -0
  64. data/test/dummy/bin/setup +34 -0
  65. data/test/dummy/bin/update +29 -0
  66. data/test/dummy/config/application.rb +23 -0
  67. data/test/dummy/config/boot.rb +5 -0
  68. data/test/dummy/config/cable.yml +9 -0
  69. data/test/dummy/config/environment.rb +5 -0
  70. data/test/dummy/config/environments/development.rb +54 -0
  71. data/test/dummy/config/environments/production.rb +86 -0
  72. data/test/dummy/config/environments/test.rb +43 -0
  73. data/test/dummy/config/initializers/application_controller_renderer.rb +6 -0
  74. data/test/dummy/config/initializers/assets.rb +11 -0
  75. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  76. data/test/dummy/config/initializers/cookies_serializer.rb +5 -0
  77. data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  78. data/test/dummy/config/initializers/inflections.rb +16 -0
  79. data/test/dummy/config/initializers/mime_types.rb +4 -0
  80. data/test/dummy/config/initializers/new_framework_defaults.rb +18 -0
  81. data/test/dummy/config/initializers/session_store.rb +3 -0
  82. data/test/dummy/config/initializers/workarea.rb +5 -0
  83. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  84. data/test/dummy/config/locales/en.yml +23 -0
  85. data/test/dummy/config/puma.rb +47 -0
  86. data/test/dummy/config/routes.rb +5 -0
  87. data/test/dummy/config/secrets.yml +22 -0
  88. data/test/dummy/config/spring.rb +6 -0
  89. data/test/dummy/config.ru +5 -0
  90. data/test/dummy/lib/assets/.keep +0 -0
  91. data/test/dummy/log/.keep +0 -0
  92. data/test/services/workarea/storefront/color_tools_test.rb +32 -0
  93. data/test/services/workarea/storefront/video_embedder_test.rb +52 -0
  94. data/test/test_helper.rb +10 -0
  95. data/test/view_models/workarea/storefront/super_hero_view_model_test.rb +38 -0
  96. data/workarea-super_hero.gemspec +18 -0
  97. metadata +158 -0
@@ -0,0 +1,106 @@
1
+ %h3.legend-heading.legend-heading--4= t("workarea.admin.content_blocks.types.super_hero.super_hero")
2
+ %fieldset
3
+ -# Media fields begin
4
+ .property
5
+ = label_tag dom_id(block, :"media_mode_for"), class: 'property__name' do
6
+ %span.property__text= t("workarea.admin.content_blocks.types.super_hero.media_mode")
7
+ .value= select_tag "block[data][media_mode]", options_for_select([['Resize', 'resize'],['Crop', 'crop'], ['Switch', 'switch'], ['Video', 'video']], block.data["media_mode"]), id: dom_id(block, :"media_mode_for"), data: {media_mode: 'control'}
8
+ .toggle-group{data: {media_mode: ['resize', 'crop', 'switch'] }}
9
+ .property.property--stacked
10
+ = label_tag dom_id(block, :"media_for"), class: 'property__name' do
11
+ %span.property__text= t("workarea.admin.content_blocks.types.super_hero.media")
12
+ %span.property__requirement *
13
+ .value
14
+ .asset-picker-field
15
+ .asset-picker-field__cell= text_field_tag "block[data][media]", block.data["media"], id: dom_id(block, :"media_for"), class: 'text-box text-box--i18n'
16
+ .asset-picker-field__cell= link_to t("workarea.admin.content_blocks.types.super_hero.view_assets"), insert_content_assets_url(file_type: ["image"]), class: 'text-button', data: { dialog_button: '' }
17
+
18
+ .toggle-group{data: {media_mode: ['switch'] }}
19
+ .property.property--stacked
20
+ = label_tag dom_id(block, :"media_medium_for"), class: 'property__name' do
21
+ %span.property__text= t("workarea.admin.content_blocks.types.super_hero.media_tablet")
22
+ %span.property__requirement *
23
+ .value
24
+ .asset-picker-field
25
+ .asset-picker-field__cell= text_field_tag "block[data][media_medium]", block.data["media_medium"], id: dom_id(block, :"media_medium_for"), class: 'text-box text-box--i18n'
26
+ .asset-picker-field__cell= link_to t("workarea.admin.content_blocks.types.super_hero.view_assets"), insert_content_assets_url(file_type: ["image"]), class: 'text-button', data: { dialog_button: '' }
27
+
28
+ .property.property--stacked
29
+ = label_tag dom_id(block, :"media_small_for"), class: 'property__name' do
30
+ %span.property__text= t("workarea.admin.content_blocks.types.super_hero.media_mobile")
31
+ %span.property__requirement *
32
+ .value
33
+ .asset-picker-field
34
+ .asset-picker-field__cell= text_field_tag "block[data][media_small]", block.data["media_small"], id: dom_id(block, :"media_small_for"), class: 'text-box text-box--i18n'
35
+ .asset-picker-field__cell= link_to t("workarea.admin.content_blocks.types.super_hero.view_assets"), insert_content_assets_url(file_type: ["image"]), class: 'text-button', data: { dialog_button: '' }
36
+
37
+ .toggle-group{data: {media_mode: ['crop'] }}
38
+ .property
39
+ = label_tag dom_id(block, :"crop_side_for"), class: 'property__name' do
40
+ %span.property__text= t("workarea.admin.content_blocks.types.super_hero.crop_to")
41
+ .value= select_tag "block[data][crop_side]", options_for_select(['center', 'left', 'right'], block.data["crop_side"]), id: dom_id(block, :"crop_side_for")
42
+
43
+ .toggle-group{data: {media_mode: ['video'] }}
44
+
45
+ .property.property--stacked
46
+ = label_tag "block[data][video_embed]", for: dom_id(block, :"video_embed_for"), class: 'property__name' do
47
+ %span.property__text= t("workarea.admin.content_blocks.types.super_hero.video_embed_code")
48
+ %span.property__requirement *
49
+ .value
50
+ = text_area_tag "block[data][video_embed]", block.data["video_embed"], id: dom_id(block, :"video_embed_for"), class: 'text-box text-box--multi-line text-box--i18n'
51
+ = render "workarea/admin/content_blocks/templates/video_content_options", block: block, count: nil, fields: %w{autoplay loop mute}
52
+
53
+ -# Content fields begin
54
+ .property.property--stacked
55
+ = label_tag "block[data][html]", for: dom_id(block, :"html_for"), class: 'property__name' do
56
+ %span.property__text= t("workarea.admin.content_blocks.types.super_hero.content")
57
+ .value
58
+ .wysiwyg= text_area_tag "block[data][html]", block.data["html"], id: dom_id(block, :"html_for"), class: 'text-box text-box--multi-line text-box--i18n', data: { toolbar: "#{block.config[:wysiwyg_toolbar]}" }
59
+
60
+ .property
61
+ = label_tag dom_id(block, :"link_text_for"), class: 'property__name' do
62
+ %span.property__text= t("workarea.admin.content_blocks.types.super_hero.link_text")
63
+ .value= text_field_tag "block[data][link_text]", block.data["link_text"], id: dom_id(block, :"link_text_for"), class: 'text-box text-box--i18n'
64
+
65
+ .property
66
+ = label_tag dom_id(block, :"link_url_for"), class: 'property__name' do
67
+ %span.property__text= t("workarea.admin.content_blocks.types.super_hero.link_url")
68
+ .value= text_field_tag "block[data][link_url]", block.data["link_url"], id: dom_id(block, :"link_url_for"), class: 'text-box text-box--i18n'
69
+
70
+ -# Content Options Begin
71
+ .property.property--stacked{ data: {position_input: ''}}
72
+ = label_tag dom_id(block, :"content_position_for"),class: 'property__name' do
73
+ %span.property__text= t("workarea.admin.content_blocks.types.super_hero.content_position")
74
+ .value
75
+ =select_tag "block[data][content_position]", options_for_select(['top-left', 'top-center', 'top-right', 'middle-left', 'middle-center', 'middle-right', 'bottom-left', 'bottom-center', 'bottom-right'], block.data["content_position"]), id: dom_id(block, :"content_position_for"), class: 'position-grid--input'
76
+ = inline_svg 'workarea/svg/position_grid'
77
+
78
+ .property
79
+ = label_tag dom_id(block, :"text_color_for"), class: 'property__name' do
80
+ %span.property__text= t("workarea.admin.content_blocks.types.super_hero.text_color")
81
+ %input{type: 'color', name: "block[data][text_color]",id: dom_id(block, :"text_color_for"), class: 'color-picker', value: block.data["text_color"], list: 'colors'}
82
+ %datalist{id: 'colors'}
83
+ - block.config[:text_colors].each do |color|
84
+ %option= color
85
+
86
+ .property.property--stacked
87
+ = label_tag dom_id(block, :"background_for"), class: 'property__name' do
88
+ %span.property__text= t("workarea.admin.content_blocks.types.super_hero.background")
89
+ .value
90
+ .property.property--inline
91
+ %input{type: 'color', name: "block[data][background]",id: dom_id(block, :"background_for"), class: 'color-picker', value: block.data["background"], list: 'colors'}
92
+ %datalist{id: 'colors'}
93
+ - block.config[:background_colors].each do |color|
94
+ %option= color
95
+
96
+ .property.property--inline
97
+ .value{data: {range_field:''}}
98
+ %input{type: 'range', name: "block[data][background_alpha]",id: dom_id(block, :"background_alpha_for"), class: 'range-input', max: '100', min: '0', value: block.data["background_alpha"], list: 'alphas'}
99
+ %datalist{id: 'alphas'}
100
+ - 11.times do |i|
101
+ %option= i * 10
102
+ = text_field_tag "background_alpha", block.data["background_alpha"], class: 'text-box--mini text-box--i18n'
103
+
104
+ .form-action
105
+ .action-group
106
+ %p.action-group__item= button_tag 'Clear Content', { class: 'button', data: {content_block_clear_fieldset: ''}}
@@ -0,0 +1,27 @@
1
+ .super-hero-content-block
2
+ - if content.present? || local_assigns[:link_text].present?
3
+ .super-hero-content-block__content{ class: view_model.content_class, style: view_model.content_styles }
4
+ - if content.present?
5
+ != content
6
+ - if link_text.present? && link.present?
7
+ %p.content-block__action= link_to link_text, link, class: link_style
8
+
9
+ - if media_mode == 'video'
10
+ - if video.present?
11
+ .super-hero-content-block__media-container.super-hero-content-block__media-container--maintain-aspect-ratio{ style: "#{view_model.video_iframe_attrs[:container_style]}" }
12
+ %iframe.super-hero-content-block__media{ view_model.video_iframe_attrs }
13
+
14
+ - elsif media_mode == 'switch'
15
+ - if view_model.image.url.present?
16
+ = link_to_if_with_block link.present?, link do
17
+ .super-hero-content-block__media-container{ style: view_model.media_styles }
18
+ %picture{ class: "super-hero-content-block__media--#{view_model.media_class}" }
19
+ %source{ srcset: view_model.image.url, media: "(min-width:#{view_model.breakpoints[:wide]}px)" }
20
+ %source{ srcset: view_model.image_medium_url, media: "(min-width:#{view_model.breakpoints[:medium]}px)" }
21
+ %source{ srcset: view_model.image_small_url }
22
+ = image_tag( view_model.image.url, alt: view_model.alt_text, itemprop: 'image')
23
+
24
+ - else
25
+ = link_to_if_with_block link.present?, link do
26
+ .super-hero-content-block__media-container.super-hero-content-block__media-container--maintain-aspect-ratio{ style: view_model.media_styles }
27
+ .super-hero-content-block__media{ class: "super-hero-content-block__media--#{view_model.media_class}", style: "background-image: url(#{view_model.image.url})" }
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/super_hero/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'
@@ -0,0 +1,42 @@
1
+ module Workarea
2
+ should_append_range_module = proc do
3
+ if Plugin.javascripts_appends['admin.modules'].nil?
4
+ true
5
+ else
6
+ Plugin.javascripts_appends['admin.modules'].none? { |append| %r{/modules/range_fields} =~ append }
7
+ end
8
+ end
9
+
10
+ should_append_video_api_modules = proc do
11
+ if Plugin.javascripts_appends['storefront.modules'].nil?
12
+ true
13
+ else
14
+ Plugin.javascripts_appends['storefront.modules'].none? { |append| %r{/modules/youtube_api} =~ append }
15
+ end
16
+ end
17
+
18
+ Plugin.append_stylesheets(
19
+ 'admin.components',
20
+ 'workarea/admin/super_hero/components/position_grid'
21
+ )
22
+
23
+ Plugin.append_javascripts(
24
+ 'admin.modules',
25
+ 'workarea/admin/super_hero/modules/media_modes',
26
+ 'workarea/admin/super_hero/modules/position_input'
27
+ )
28
+
29
+ Plugin.append_stylesheets(
30
+ 'storefront.components',
31
+ 'workarea/storefront/super_hero/components/super_hero_content_block',
32
+ 'workarea/storefront/super_hero/components/content_position'
33
+ )
34
+
35
+ if should_append_video_api_modules.call
36
+ Plugin.append_javascripts(
37
+ 'storefront.modules',
38
+ 'workarea/storefront/super_hero/modules/youtube_api',
39
+ 'workarea/storefront/super_hero/modules/vimeo_api'
40
+ )
41
+ end
42
+ end
@@ -0,0 +1,49 @@
1
+ Workarea::Content.define_block_types do
2
+ find_asset_id = lambda do |name|
3
+ proc do
4
+ asset = Workarea::Content::Asset.where(file_name: name).first ||
5
+ Workarea::Content::Asset.placeholder
6
+
7
+ asset.try(:id)
8
+ end
9
+ end
10
+
11
+ block_type 'Super Hero' do
12
+ description 'Text over a background image. Text may be positioned and may contain a link.'
13
+ view_model 'Workarea::Storefront::ContentBlocks::SuperHeroViewModel'
14
+
15
+ fieldset 'Media' do
16
+ field 'Media Mode', :media_mode, default: 'crop'
17
+ field 'Asset', :asset, required: true, file_types: 'image', default: find_asset_id.call('960x470_light.png'), html_data_attributes: { media_mode: ['resize', 'crop', 'switch'] }
18
+ field 'Asset Medium', :asset, file_types: 'image', default: find_asset_id.call('960x470_light.png'), html_data_attributes: { media_mode: ['switch'] }
19
+ field 'Asset Small', :asset, file_types: 'image', default: find_asset_id.call('960x470_light.png'), html_data_attributes: { media_mode: ['switch'] }
20
+ field 'Alt Text', :string, default: 'An Image', placeholder: 'A description of the image', html_data_attributes: { media_mode: ['switch'] }
21
+ field 'Video', :video_advanced, html_data_attributes: { media_mode: ['video'] }
22
+ field 'Crop Side', :options, values: ['left', 'center', 'right'], default: 'Center', html_data_attributes: { media_mode: ['crop'] }
23
+ end
24
+
25
+ fieldset 'Content' do
26
+ field 'Content', :text, default: "<h2>Text</h2><p>#{Workarea.config.placeholder_text}</p>"
27
+ field 'Text Color', :color, default: '#000000', presets: ['#000000', '#ffffff', '#999999', '#ff0000', '#00ff00', '#0000ff']
28
+ field 'Background Color', :color, default: '#ffffff', presets: ['#000000', '#ffffff', '#999999', '#ff0000', '#00ff00', '#0000ff']
29
+ field 'Background Alpha', :range, default: '50', min: 0, max: 100, step: 1
30
+ field 'Content Position', :options, values: [
31
+ 'Top, Left',
32
+ 'Top, Center',
33
+ 'Top, Right',
34
+ 'Middle, Left',
35
+ 'Middle, Center',
36
+ 'Middle, Right',
37
+ 'Bottom, Left',
38
+ 'Bottom, Center',
39
+ 'Bottom, Right'
40
+ ], default: 'Middle, Center'
41
+ end
42
+
43
+ fieldset 'CTA' do
44
+ field 'Link', :url, default: '/'
45
+ field 'Link Text', :string, default: 'Click Me!'
46
+ field 'Link Style', :options, values: ['button', 'text-button', 'link'], default: 'button'
47
+ end
48
+ end
49
+ end
@@ -0,0 +1,23 @@
1
+ ---
2
+ en:
3
+ workarea:
4
+ admin:
5
+ content_blocks:
6
+ types:
7
+ super_hero:
8
+ background: Background (color, transparency)
9
+ content: Content
10
+ content_position: Content Position
11
+ crop_to: Crop to
12
+ link_text: Link Text
13
+ link_url: Link URL
14
+ media: Media
15
+ media_mobile: Media - Mobile
16
+ media_tablet: Media - Tablet
17
+ media_mode: Media Mode
18
+ super_hero: Super Hero
19
+ text_color: Text Color
20
+ video_embed_code: Video Embed Code
21
+ view_assets: View Assets
22
+ video_advanced:
23
+ video_options: Video Options
data/config/routes.rb ADDED
@@ -0,0 +1,2 @@
1
+ Rails.application.routes.draw do
2
+ end
@@ -0,0 +1,8 @@
1
+ module Workarea
2
+ module SuperHero
3
+ class Engine < ::Rails::Engine
4
+ include Workarea::Plugin
5
+ isolate_namespace Workarea::SuperHero
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,5 @@
1
+ module Workarea
2
+ module SuperHero
3
+ VERSION = '2.2.1'.freeze
4
+ end
5
+ end
@@ -0,0 +1,11 @@
1
+ require 'workarea'
2
+ require 'workarea/storefront'
3
+ require 'workarea/admin'
4
+
5
+ require 'workarea/super_hero/engine'
6
+ require 'workarea/super_hero/version'
7
+
8
+ module Workarea
9
+ module SuperHero
10
+ end
11
+ end
data/script/admin_ci ADDED
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env bash
2
+
3
+ gem install bundler
4
+ bundle update
5
+
6
+ CI_GEM_PATH="$(bundle show workarea-ci)"
7
+ . ${CI_GEM_PATH}/exe/workarea-set-ci-env
8
+
9
+ bin/rails app:workarea:test:admin
data/script/ci ADDED
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env bash
2
+
3
+ gem install bundler
4
+ bundle update
5
+
6
+ CI_GEM_PATH="$(bundle show workarea-ci)"
7
+ . ${CI_GEM_PATH}/exe/workarea-set-ci-env
8
+
9
+ bundle exec workarea-lint
10
+ bundle exec workarea-audit
11
+ bin/rails test test/**/*_test.rb
data/script/core_ci ADDED
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env bash
2
+
3
+ gem install bundler
4
+ bundle update
5
+
6
+ CI_GEM_PATH="$(bundle show workarea-ci)"
7
+ . ${CI_GEM_PATH}/exe/workarea-set-ci-env
8
+
9
+ bin/rails app:workarea:test:core
data/script/plugins_ci ADDED
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env bash
2
+
3
+ gem install bundler
4
+ bundle update
5
+
6
+ CI_GEM_PATH="$(bundle show workarea-ci)"
7
+ . ${CI_GEM_PATH}/exe/workarea-set-ci-env
8
+
9
+ bin/rails app:workarea:test:plugins
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env bash
2
+
3
+ gem install bundler
4
+ bundle update
5
+
6
+ CI_GEM_PATH="$(bundle show workarea-ci)"
7
+ . ${CI_GEM_PATH}/exe/workarea-set-ci-env
8
+
9
+ bin/rails app:workarea:test:storefront
@@ -0,0 +1,15 @@
1
+ <svg id="Layer_1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 229.5 187.5">
2
+ <style>
3
+ .st0{fill:#FFFFFF;stroke:#000000;stroke-width:2;stroke-miterlimit:10;} .st1{fill:none;stroke:#000000;stroke-width:2;stroke-miterlimit:10;} .st2{fill:#FFFFFF;stroke:#000000;stroke-width:1.6452;stroke-miterlimit:10;} .st3{stroke:#000000;stroke-width:8.879396e-02;stroke-miterlimit:10;}
4
+ </style>
5
+ <path class="st0" d="M46.5 61.8c33.1-6.7 72.8 15 75.2 40.8 4.2 45.5-22.1 63.7-55.2 66.9-22.3 2.2-41.3-10.3-47.7-33.2 3.7-2.7 28-73.4 27.7-74.5z"/>
6
+ <path class="st0" d="M67.2 48.5c-5.7-7.2-4.6 15.1-17 4.5-10.5-9-19.7.2-17.8-5 1.9-5.2-1.4-11.6-1.4-11.6-.6-3.3-1.2-6.6-1.9-9.8-.8-3.4-1.2-3.9 1.9-6.3 4.3-3.2 9.2-5.8 14-8.3 1.9-1 4.1-2.7 6.2-2.8 3.2-.1 7.4 1.7 10.3 2.9 12.2 5 18.4 15.1 21 27.5 2.3 11.2.9 25.9-7.6 35.2l-35.9-8c.2-6-1.4-12.2-3.2-17.9"/>
7
+ <ellipse class="st1" cx="54.4" cy="38" rx="5" ry="5.2"/>
8
+ <path class="st1" d="M96.8 91.3S90.3 77 78 70.2"/>
9
+ <path d="M102.1 134.2s-3.9 18.9-22.9 27.1c0 0-16.3 25.3-53.7-8.8 0 0 45 12 74.1-18.3"/>
10
+ <path class="st0" d="M26.1 177.6l21.4.4s-7-34.7-17.1-44.6c-1.6-1.6-1.6.9-6.9 2 0 0-1 0-2.2-.1.5.7.7 1.5.8 2.3.9.9 1.4 2.2 1.4 3.4 0 1.3-.5 2.6-1.5 3.5 6.1 12 11.7 30 4.1 33.1zm-.6-34.2l-1.4-.7c1.6.1 2.7 0 1.4.7zM52.5 137s28.6 36.4 14.4 43.2l24.3.5s-7-35.7-17.1-45.6c-2.6-2.4-17.1 3-21.6 1.9zM88.9 79.4c7.8 12.2 19 25.8 21.1 45.2 1.1 10-1.4 19.5-5.6 23.7-5.4 5.3-7-4.2-7.2-12.7-.3-12.3-.2-23.4-2.7-36.3-.6-2.9-1.3-5.8-2.2-8.5-.4-1.1-2.9-6.5-2.9-7.3 0-.1-1.5-5.6-.5-4.1z"/>
11
+ <ellipse transform="rotate(-8.31 35.1 36.086)" class="st1" cx="35.1" cy="36.1" rx="3.2" ry="5.2"/>
12
+ <path class="st0" d="M36.6 67.3c1.6 13.3-8.2 35.8-8.2 35.8-3.4 7-8.9 15.1-9.9 22.6-1.9 13.2 3.1 26.6 17.7 32.7 8.2 3.4 17.4 5 26.5 4.4 20.6-1.5 32-13.3 36.6-29.9 2.6-9.5.5-18.9-1.3-28.6-8.8-46.3-62.7-48.1-61.4-37z"/>
13
+ <path class="st2" d="M151.5 160.6c9.5 2.3 18.7 6.9 28.2 9.4 4.5 1.2 6.9 3.1 10.2.8-2.5-6.9-3.7-15.7.9-21.8 3-4 6.4-6 8.5-10.8 2-4.4 2.9-8.8 3.8-13.5 2-10.4 4.4-19.5 10.1-28.6 2.2-3.6 7.6-4.1 7.2-11.5-5.6-.5-11.6 1-17.3-.4-13.8-3.5-27.6-11.2-41.3-15.7-5.9-1.9-11.5-5.4-17.1-7.1-2-.6-6.2.7-8.2.3-8.2-1.7-9.4-2.2-10.8-2.6-16.4-3.5-9.6 4.1-26.8 3.5-5.1-.2-12.2 2-16.9-.4-2.6 5.7-.3 3.5-5.2 7.6C90 73.8 81 129.4 92 137c10.8 7.5 22.2 16 34.8 19.9l24.7 3.7z"/>
14
+ <path class="st3" d="M179.9 75.6c.1 2 .5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,6 @@
1
+ # Add your own tasks in files placed in lib/tasks ending in .rake,
2
+ # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3
+
4
+ require_relative 'config/application'
5
+
6
+ Rails.application.load_tasks
@@ -0,0 +1,4 @@
1
+
2
+ //= link_tree ../images
3
+ //= link_directory ../javascripts .js
4
+ //= link_directory ../stylesheets .css
File without changes
@@ -0,0 +1,13 @@
1
+ // This is a manifest file that'll be compiled into application.js, which will include all the files
2
+ // listed below.
3
+ //
4
+ // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5
+ // or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
6
+ //
7
+ // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8
+ // compiled file. JavaScript code in this file should be added after the last require_* statement.
9
+ //
10
+ // Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
11
+ // about supported directives.
12
+ //
13
+ //= require_tree .
@@ -0,0 +1,15 @@
1
+ /*
2
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
3
+ * listed below.
4
+ *
5
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
+ * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
7
+ *
8
+ * You're free to add application-wide styles to this file and they'll appear at the bottom of the
9
+ * compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
10
+ * files in this directory. Styles in this file should be added after the last require_* statement.
11
+ * It is generally better to create a new file per style scope.
12
+ *
13
+ *= require_tree .
14
+ *= require_self
15
+ */
@@ -0,0 +1,3 @@
1
+ class ApplicationController < ActionController::Base
2
+ protect_from_forgery with: :exception
3
+ end
File without changes
@@ -0,0 +1,2 @@
1
+ module ApplicationHelper
2
+ end
@@ -0,0 +1,2 @@
1
+ class ApplicationJob < ActiveJob::Base
2
+ end
@@ -0,0 +1,4 @@
1
+ class ApplicationMailer < ActionMailer::Base
2
+ default from: 'from@example.com'
3
+ layout 'mailer'
4
+ end
File without changes
@@ -0,0 +1,14 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Dummy</title>
5
+ <%= csrf_meta_tags %>
6
+
7
+ <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
8
+ <%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %>
9
+ </head>
10
+
11
+ <body>
12
+ <%= yield %>
13
+ </body>
14
+ </html>
@@ -0,0 +1,13 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5
+ <style>
6
+ /* Email styles need to be inline */
7
+ </style>
8
+ </head>
9
+
10
+ <body>
11
+ <%= yield %>
12
+ </body>
13
+ </html>
@@ -0,0 +1 @@
1
+ <%= yield %>
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
3
+ load Gem.bin_path('bundler', 'bundle')
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ APP_PATH = File.expand_path('../config/application', __dir__)
3
+ require_relative '../config/boot'
4
+ require 'rails/commands'
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ require_relative '../config/boot'
3
+ require 'rake'
4
+ Rake.application.run
@@ -0,0 +1,34 @@
1
+ #!/usr/bin/env ruby
2
+ require 'pathname'
3
+ require 'fileutils'
4
+ include FileUtils
5
+
6
+ # path to your application root.
7
+ APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
8
+
9
+ def system!(*args)
10
+ system(*args) || abort("\n== Command #{args} failed ==")
11
+ end
12
+
13
+ chdir APP_ROOT do
14
+ # This script is a starting point to setup your application.
15
+ # Add necessary setup steps to this file.
16
+
17
+ puts '== Installing dependencies =='
18
+ system! 'gem install bundler --conservative'
19
+ system('bundle check') || system!('bundle install')
20
+
21
+ # puts "\n== Copying sample files =="
22
+ # unless File.exist?('config/database.yml')
23
+ # cp 'config/database.yml.sample', 'config/database.yml'
24
+ # end
25
+
26
+ puts "\n== Preparing database =="
27
+ system! 'bin/rails db:setup'
28
+
29
+ puts "\n== Removing old logs and tempfiles =="
30
+ system! 'bin/rails log:clear tmp:clear'
31
+
32
+ puts "\n== Restarting application server =="
33
+ system! 'bin/rails restart'
34
+ end
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env ruby
2
+ require 'pathname'
3
+ require 'fileutils'
4
+ include FileUtils
5
+
6
+ # path to your application root.
7
+ APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
8
+
9
+ def system!(*args)
10
+ system(*args) || abort("\n== Command #{args} failed ==")
11
+ end
12
+
13
+ chdir APP_ROOT do
14
+ # This script is a way to update your development environment automatically.
15
+ # Add necessary update steps to this file.
16
+
17
+ puts '== Installing dependencies =='
18
+ system! 'gem install bundler --conservative'
19
+ system('bundle check') || system!('bundle install')
20
+
21
+ puts "\n== Updating database =="
22
+ system! 'bin/rails db:migrate'
23
+
24
+ puts "\n== Removing old logs and tempfiles =="
25
+ system! 'bin/rails log:clear tmp:clear'
26
+
27
+ puts "\n== Restarting application server =="
28
+ system! 'bin/rails restart'
29
+ end
@@ -0,0 +1,23 @@
1
+ require_relative 'boot'
2
+
3
+ require 'action_controller/railtie'
4
+ require 'action_mailer/railtie'
5
+ require 'sprockets/railtie'
6
+ require 'rails/test_unit/railtie'
7
+ require 'workarea'
8
+ require 'workarea/super_hero'
9
+ require 'teaspoon-mocha'
10
+
11
+ # Require the gems listed in Gemfile, including any gems
12
+ # you've limited to :test, :development, or :production.
13
+ Bundler.require(*Rails.groups)
14
+
15
+ module Dummy
16
+ class Application < Rails::Application
17
+ # Settings in config/environments/* take precedence over those specified here.
18
+ # Application configuration should go into files in config/initializers
19
+ # -- all .rb files in that directory are automatically loaded.
20
+
21
+ I18n.enforce_available_locales = false
22
+ end
23
+ end
@@ -0,0 +1,5 @@
1
+ # Set up gems listed in the Gemfile.
2
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../Gemfile', __dir__)
3
+
4
+ require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
5
+ $LOAD_PATH.unshift File.expand_path('../../../lib', __dir__)
@@ -0,0 +1,9 @@
1
+ development:
2
+ adapter: async
3
+
4
+ test:
5
+ adapter: async
6
+
7
+ production:
8
+ adapter: redis
9
+ url: redis://localhost:6379/1
@@ -0,0 +1,5 @@
1
+ # Load the Rails application.
2
+ require_relative 'application'
3
+
4
+ # Initialize the Rails application.
5
+ Rails.application.initialize!