beyond_canvas 0.11.2.pre → 0.15.0.pre

Sign up to get free protection for your applications and to get access to all the features.
Files changed (111) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -20
  3. data/app/assets/images/icons/checkbox_checked.svg +1 -0
  4. data/app/assets/images/icons/checkbox_unchecked.svg +1 -0
  5. data/app/assets/images/icons/file.svg +1 -0
  6. data/app/assets/images/icons/flash_checkbox.svg +1 -0
  7. data/app/assets/images/icons/flash_close.svg +1 -0
  8. data/app/assets/images/icons/flash_error.svg +1 -0
  9. data/app/assets/images/icons/flash_info.svg +1 -0
  10. data/app/assets/images/icons/flash_warning.svg +1 -0
  11. data/app/assets/images/icons/radiobutton_checked.svg +1 -0
  12. data/app/assets/images/icons/radiobutton_unchecked.svg +1 -0
  13. data/app/assets/javascripts/beyond_canvas/base.js +94 -0
  14. data/app/assets/stylesheets/beyond_canvas/base.scss +28 -0
  15. data/app/assets/stylesheets/beyond_canvas/components/_actions.scss +6 -0
  16. data/app/assets/stylesheets/beyond_canvas/components/_buttons.scss +112 -0
  17. data/app/assets/stylesheets/beyond_canvas/components/_cards.scss +34 -0
  18. data/app/assets/stylesheets/beyond_canvas/components/_comments.scss +6 -0
  19. data/app/assets/stylesheets/beyond_canvas/components/_containers.scss +37 -0
  20. data/app/assets/stylesheets/beyond_canvas/components/_flash.scss +66 -0
  21. data/app/assets/stylesheets/beyond_canvas/components/_forms.scss +43 -0
  22. data/app/assets/stylesheets/beyond_canvas/components/_inputs.scss +143 -0
  23. data/app/assets/stylesheets/beyond_canvas/components/_layouts.scss +7 -0
  24. data/app/assets/stylesheets/beyond_canvas/components/_links.scss +17 -0
  25. data/app/assets/stylesheets/beyond_canvas/components/_main.scss +39 -0
  26. data/app/assets/stylesheets/beyond_canvas/components/_margins.scss +9 -0
  27. data/app/assets/stylesheets/beyond_canvas/components/_markdown.scss +74 -0
  28. data/app/assets/stylesheets/beyond_canvas/components/_notices.scss +58 -0
  29. data/app/assets/stylesheets/beyond_canvas/components/_relative.scss +3 -0
  30. data/app/assets/stylesheets/beyond_canvas/components/_spinner.scss +48 -0
  31. data/app/assets/stylesheets/beyond_canvas/components/_tables.scss +31 -0
  32. data/app/assets/stylesheets/beyond_canvas/components/_texts.scss +7 -0
  33. data/app/assets/stylesheets/beyond_canvas/mailer.scss +5 -0
  34. data/app/assets/stylesheets/beyond_canvas/settings/_breakpoints.scss +6 -0
  35. data/app/assets/stylesheets/beyond_canvas/settings/{_reset_css.sass → _reset_css.scss} +29 -21
  36. data/app/assets/stylesheets/beyond_canvas/settings/_typography.scss +67 -0
  37. data/app/assets/stylesheets/beyond_canvas/settings/_variables.scss +171 -0
  38. data/app/assets/stylesheets/beyond_canvas/utilities/_functions.scss +15 -0
  39. data/app/assets/stylesheets/beyond_canvas/utilities/_mixins.scss +24 -0
  40. data/app/controllers/beyond_canvas/application_controller.rb +2 -2
  41. data/app/controllers/beyond_canvas/system_controller.rb +24 -0
  42. data/app/controllers/concerns/beyond_canvas/locale_management.rb +18 -20
  43. data/app/controllers/concerns/beyond_canvas/request_validation.rb +37 -0
  44. data/app/controllers/concerns/beyond_canvas/status_codes.rb +17 -0
  45. data/app/form_builders/beyond_canvas/form_builder.rb +74 -13
  46. data/app/helpers/beyond_canvas/application_helper.rb +17 -18
  47. data/app/helpers/beyond_canvas/locale_switch_helper.rb +1 -1
  48. data/app/javascript/beyond_canvas/base.js +6 -0
  49. data/app/{assets/javascripts/beyond_canvas → javascript/beyond_canvas/initializers}/buttons.js +19 -14
  50. data/app/{assets/javascripts/beyond_canvas → javascript/beyond_canvas/initializers}/flash.js +11 -7
  51. data/app/javascript/beyond_canvas/initializers/inputs.js +39 -0
  52. data/app/views/beyond_canvas/custom/_public_head.html.erb +1 -0
  53. data/app/views/beyond_canvas/locales/_edit.html.erb +8 -0
  54. data/app/views/beyond_canvas/mailer/_header.html.erb +2 -2
  55. data/app/views/beyond_canvas/shared/_flash.html.erb +13 -0
  56. data/app/views/beyond_canvas/shared/_head.html.erb +29 -0
  57. data/app/views/beyond_canvas/shared/_logo.html.erb +2 -0
  58. data/app/views/layouts/beyond_canvas/public.html.erb +16 -0
  59. data/config/initializers/beyond_canvas/filter_parameter_logging.rb +9 -0
  60. data/config/routes.rb +1 -1
  61. data/lib/beyond_canvas.rb +13 -16
  62. data/lib/beyond_canvas/asset_registration.rb +29 -0
  63. data/lib/beyond_canvas/configuration.rb +27 -0
  64. data/lib/beyond_canvas/engine.rb +12 -1
  65. data/lib/beyond_canvas/version.rb +1 -1
  66. data/lib/generators/beyond_canvas/assets/assets_generator.rb +14 -0
  67. data/lib/generators/beyond_canvas/assets/templates/beyond_canvas.js +1 -0
  68. data/lib/generators/beyond_canvas/assets/templates/beyond_canvas.scss +1 -0
  69. data/lib/generators/beyond_canvas/beyond_api/beyond_api_generator.rb +19 -0
  70. data/lib/generators/beyond_canvas/{custom_styles_generator.rb → custom_styles/custom_styles_generator.rb} +2 -2
  71. data/lib/generators/{templates → beyond_canvas/custom_styles/templates}/beyond_canvas_custom_styles.sass +0 -0
  72. data/lib/generators/beyond_canvas/install/install_generator.rb +35 -0
  73. data/lib/generators/beyond_canvas/install/templates/beyond_canvas.rb.erb +40 -0
  74. data/lib/generators/beyond_canvas/webpacker/plugins/jquery.js +7 -0
  75. data/lib/generators/beyond_canvas/webpacker/templates/beyond_canvas.js +3 -0
  76. data/lib/generators/beyond_canvas/webpacker/templates/beyond_canvas.scss +1 -0
  77. data/lib/generators/beyond_canvas/webpacker/webpacker_generator.rb +26 -0
  78. metadata +107 -66
  79. data/app/assets/javascripts/beyond_canvas.js +0 -3
  80. data/app/assets/javascripts/beyond_canvas/inputs.js +0 -28
  81. data/app/assets/stylesheets/beyond_canvas.sass +0 -24
  82. data/app/assets/stylesheets/beyond_canvas/components/_actions.sass +0 -5
  83. data/app/assets/stylesheets/beyond_canvas/components/_buttons.sass +0 -86
  84. data/app/assets/stylesheets/beyond_canvas/components/_cards.sass +0 -26
  85. data/app/assets/stylesheets/beyond_canvas/components/_comments.sass +0 -5
  86. data/app/assets/stylesheets/beyond_canvas/components/_flash.sass +0 -51
  87. data/app/assets/stylesheets/beyond_canvas/components/_forms.sass +0 -32
  88. data/app/assets/stylesheets/beyond_canvas/components/_inputs.sass +0 -79
  89. data/app/assets/stylesheets/beyond_canvas/components/_links.sass +0 -13
  90. data/app/assets/stylesheets/beyond_canvas/components/_main.sass +0 -28
  91. data/app/assets/stylesheets/beyond_canvas/components/_margins.sass +0 -7
  92. data/app/assets/stylesheets/beyond_canvas/components/_markdown.sass +0 -60
  93. data/app/assets/stylesheets/beyond_canvas/components/_notices.sass +0 -41
  94. data/app/assets/stylesheets/beyond_canvas/components/_relative.sass +0 -2
  95. data/app/assets/stylesheets/beyond_canvas/components/_spinner.sass +0 -38
  96. data/app/assets/stylesheets/beyond_canvas/components/_tables.sass +0 -25
  97. data/app/assets/stylesheets/beyond_canvas/components/_texts.sass +0 -6
  98. data/app/assets/stylesheets/beyond_canvas/mailer.sass +0 -5
  99. data/app/assets/stylesheets/beyond_canvas/settings/_typography.sass +0 -53
  100. data/app/assets/stylesheets/beyond_canvas/settings/_variables.sass +0 -145
  101. data/app/assets/stylesheets/beyond_canvas/utilities/_mixins.sass +0 -19
  102. data/app/views/beyond_canvas/custom/_public_head.html.slim +0 -0
  103. data/app/views/beyond_canvas/shared/_flash.html.slim +0 -6
  104. data/app/views/beyond_canvas/shared/_head.html.slim +0 -20
  105. data/app/views/beyond_canvas/shared/_locale_switch.html.slim +0 -6
  106. data/app/views/beyond_canvas/shared/_logo.html.slim +0 -2
  107. data/app/views/layouts/beyond_canvas/public.html.slim +0 -12
  108. data/config/initializers/beyond_canvas/assets.rb +0 -5
  109. data/lib/generators/beyond_canvas/install_generator.rb +0 -13
  110. data/lib/generators/templates/beyond_canvas.rb +0 -8
  111. data/lib/generators/templates/beyond_canvas_form_utils.rb +0 -23
@@ -0,0 +1,37 @@
1
+ # frozen_string_literal: true
2
+
3
+ module BeyondCanvas
4
+ module RequestValidation # :nodoc:
5
+ extend ActiveSupport::Concern
6
+
7
+ private
8
+
9
+ def validate_app_installation_request!
10
+ bad_request unless app_installation_params? && valid_signature?(params[:signature],
11
+ app_installation_data,
12
+ BeyondApi.configuration.client_secret)
13
+ end
14
+
15
+ def app_installation_params?
16
+ if params[:code].nil? ||
17
+ params[:signature].nil? ||
18
+ params[:return_url].nil? ||
19
+ params[:api_url].nil? ||
20
+ params[:access_token_url].nil?
21
+ false
22
+ else
23
+ true
24
+ end
25
+ end
26
+
27
+ def app_installation_data
28
+ "#{params[:code]}:#{params[:access_token_url]}"
29
+ end
30
+
31
+ def valid_signature?(signature, data, secret)
32
+ digest = OpenSSL::Digest.new('SHA1')
33
+ hmac = OpenSSL::HMAC.digest(digest, secret, data)
34
+ signature == Base64.encode64(hmac).chop
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module BeyondCanvas
4
+ module StatusCodes # :nodoc:
5
+ extend ActiveSupport::Concern
6
+
7
+ private
8
+
9
+ def bad_request
10
+ raise ActionController::BadRequest, 'Bad Request'
11
+ end
12
+
13
+ def not_found
14
+ raise ActionController::RoutingError, 'Not Found'
15
+ end
16
+ end
17
+ end
@@ -1,23 +1,44 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module BeyondCanvas
4
- class FormBuilder < ActionView::Helpers::FormBuilder
4
+ class FormBuilder < ActionView::Helpers::FormBuilder # :nodoc:
5
+ ############################################################################
6
+ # Wrappers
7
+ ############################################################################
8
+
5
9
  def field_wrapper(attribute, args, &block)
6
- label = args[:label].present? ? args[:label] : attribute.to_s.humanize
10
+ label = args[:label] == false ? nil : args[:label].presence || attribute.to_s.humanize
7
11
 
8
12
  errors = object.errors[attribute].join(', ') if object.respond_to?(:errors) && object.errors.include?(attribute)
9
13
 
10
14
  @template.content_tag(:div, class: 'form__row') do
11
15
  @template.content_tag(:label, label, class: 'input__label') +
12
- @template.content_tag(:div, class: 'relative') do
13
- block.call +
14
- (@template.content_tag(:label, errors, class: 'input__error') unless errors.blank?)
15
- end +
16
- (@template.content_tag(:div, args[:hint].html_safe, class: 'input__hint') if args[:hint].present?)
16
+ @template.content_tag(:div, class: 'relative') do
17
+ block.call +
18
+ (@template.content_tag(:label, errors, class: 'input__error') if errors.present?)
19
+ end +
20
+ (@template.content_tag(:div, args[:hint].html_safe, class: 'input__hint') if args[:hint].present?)
17
21
  end
18
22
  end
19
23
 
20
- [:email, :text, :password, :file].each do |method|
24
+ def inline_wrapper(attribute, args, &block)
25
+ label = args[:label] == false ? nil : args[:label].presence || attribute.to_s.humanize
26
+
27
+ errors = object.errors[attribute].join(', ') if object.respond_to?(:errors) && object.errors.include?(attribute)
28
+
29
+ @template.content_tag(:div, class: 'form__row') do
30
+ @template.content_tag(:div, class: 'relative', style: 'display: flex; align-items: center;') do
31
+ block.call +
32
+ @template.content_tag(:div) do
33
+ @template.content_tag(:label, label, class: 'input__label') +
34
+ (@template.content_tag(:div, args[:hint].html_safe, class: 'input__hint') if args[:hint].present?)
35
+ end +
36
+ (@template.content_tag(:label, errors, class: 'input__error') if errors.present?)
37
+ end
38
+ end
39
+ end
40
+
41
+ %i[email text number password].each do |method|
21
42
  define_method :"#{method}_field" do |attribute, args = {}|
22
43
  field_wrapper(attribute, args) do
23
44
  super(attribute, args)
@@ -25,9 +46,39 @@ module BeyondCanvas
25
46
  end
26
47
  end
27
48
 
49
+ def check_box(attribute, args = {})
50
+ inline_wrapper(attribute, args) do
51
+ filed_identifyer = filed_identifyer(attribute)
52
+
53
+ args.merge!(id: filed_identifyer)
54
+ .merge!(hidden: true)
55
+
56
+ @template.content_tag(:div, class: 'input__checkbox') do
57
+ super(attribute, args) +
58
+ @template.content_tag(:label, nil, class: 'input__checkbox__control', for: filed_identifyer)
59
+ end
60
+ end
61
+ end
62
+
63
+ def radio_button(attribute, value, args = {})
64
+ args.merge!(label: value) unless args[:label]
65
+
66
+ inline_wrapper(attribute, args) do
67
+ filed_identifyer = filed_identifyer(attribute)
68
+
69
+ args.merge!(id: filed_identifyer)
70
+ .merge!(hidden: true)
71
+
72
+ @template.content_tag(:div, class: 'input__radio') do
73
+ super(attribute, value, args) +
74
+ @template.content_tag(:label, nil, class: 'input__radio__control', for: filed_identifyer)
75
+ end
76
+ end
77
+ end
78
+
28
79
  def file_field(attribute, args = {})
29
80
  field_wrapper(attribute, args) do
30
- filed_identifyer = "#{attribute}_#{(Time.now.to_f * 1000).to_i.to_s}"
81
+ filed_identifyer = filed_identifyer(attribute)
31
82
 
32
83
  args.merge!(id: filed_identifyer)
33
84
  .merge!(hidden: true)
@@ -37,12 +88,22 @@ module BeyondCanvas
37
88
 
38
89
  @template.content_tag(:div, class: 'input__file') do
39
90
  super(attribute, args) +
40
- @template.content_tag(:label, for: filed_identifyer, class: 'input__file__label button__transparent--primary') do
41
- args[:data][:button_text] || 'Choose file'
42
- end +
43
- @template.content_tag(:span, args[:data][:no_file_text] || 'No file chosen', class: "input__file__text #{filed_identifyer}")
91
+ @template.content_tag(:label,
92
+ for: filed_identifyer,
93
+ class: 'input__file__control button__transparent--primary') do
94
+ args[:data][:button_text] || 'Choose file'
95
+ end +
96
+ @template.content_tag(:span,
97
+ args[:data][:no_file_text] || 'No file chosen',
98
+ class: "input__file__text #{filed_identifyer}")
44
99
  end
45
100
  end
46
101
  end
102
+
103
+ private
104
+
105
+ def filed_identifyer(attribute)
106
+ "#{attribute}_#{DateTime.now.strftime('%Q') + rand(10_000).to_s}"
107
+ end
47
108
  end
48
109
  end
@@ -1,14 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module BeyondCanvas
4
- module ApplicationHelper
4
+ module ApplicationHelper # :nodoc:
5
5
  def full_title(page_title = '')
6
- if I18n.exists?('app_name')
7
- base_title = I18n.t('app_name')
8
- else
9
- logger.debug "[BeyondCanvas] Missing translation: #{I18n.locale}.app_name".yellow
10
- base_title = File.basename(Rails.root).humanize
11
- end
6
+ base_title = BeyondCanvas.configuration.site_title
12
7
 
13
8
  page_title.empty? ? base_title : page_title + ' | ' + base_title
14
9
  end
@@ -27,7 +22,7 @@ module BeyondCanvas
27
22
  end
28
23
  end
29
24
 
30
- [:success, :info, :warning, :error].each do |method|
25
+ %i[success info warning error].each do |method|
31
26
  define_method :"notice_#{method}" do |name = nil, html_options = nil, &block|
32
27
  notice_render(method, name, html_options, &block)
33
28
  end
@@ -45,29 +40,33 @@ module BeyondCanvas
45
40
 
46
41
  def get_flash_icon(key)
47
42
  case key
48
- when 'success'
49
- 'fas fa-check'
43
+ when 'success', 'notice'
44
+ inline_svg_tag 'icons/flash_checkbox.svg'
50
45
  when 'info'
51
- 'fas fa-info-circle'
46
+ inline_svg_tag 'icons/flash_info.svg'
52
47
  when 'warning'
53
- 'fas fa-exclamation-circle'
48
+ inline_svg_tag 'icons/flash_warning.svg'
54
49
  when 'error'
55
- 'far fa-times-circle'
50
+ inline_svg_tag 'icons/flash_error.svg'
56
51
  else
57
- 'fas fa-info'
52
+ inline_svg_tag 'icons/flash_info.svg'
58
53
  end
59
54
  end
60
55
 
61
56
  def notice_render(method, name = nil, html_options = nil, &block)
62
- html_options, name = name, block if block_given?
57
+ if block_given?
58
+ html_options = name
59
+ name = block
60
+ end
63
61
 
64
62
  html_options ||= {}
65
63
 
66
- html_options.merge!(class: "notice notice--#{method}") { |key, old_val, new_val| [new_val, old_val].join(' ') }
64
+ html_options.merge!(class: "notice notice--#{method}") { |_key, old_val, new_val| [new_val, old_val].join(' ') }
67
65
 
68
66
  content_tag('div', html_options) do
69
- content_tag('i', nil, class: "notice__icon #{get_flash_icon(method.to_s)}") +
70
- content_tag('span', block_given? ? capture(&name) : name, class: 'notice__content')
67
+ content_tag('div', class: 'notice__icon') do
68
+ get_flash_icon(method.to_s)
69
+ end + content_tag('span', block_given? ? capture(&name) : name, class: 'notice__content')
71
70
  end
72
71
  end
73
72
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module BeyondCanvas
4
- module LocaleSwitchHelper
4
+ module LocaleSwitchHelper # :nodoc:
5
5
  def translate_locale(locale)
6
6
  if I18n.exists?("locales.#{locale}")
7
7
  I18n.t("locales.#{locale}")
@@ -0,0 +1,6 @@
1
+ import 'jquery'
2
+ import 'jquery-ujs'
3
+
4
+ import './initializers/buttons'
5
+ import './initializers/flash'
6
+ import './initializers/inputs'
@@ -1,13 +1,8 @@
1
1
  const SPINNER_ANIMATION_TIMEOUT = 125;
2
2
 
3
3
  (function($) {
4
- $(document).on('click', '[class^="button"]', function() {
5
- disableActionElements();
6
- showSpinner($(this));
7
- });
8
-
9
- $(document).on('ready page:load turbolinks:load', function() {
10
- $('button[class^="button"]').each(function() {
4
+ const onDOMReady = function () {
5
+ $('button[class^="button"]').each(function () {
11
6
  var button = $(this);
12
7
 
13
8
  // Add width attribute and save old width
@@ -16,25 +11,35 @@ const SPINNER_ANIMATION_TIMEOUT = 125;
16
11
 
17
12
  // Add the spinner
18
13
  button.prepend(`
19
- <div class="spinner">
20
- <div class="bounce1"></div>
21
- <div class="bounce2"></div>
22
- <div class="bounce3"></div>
23
- </div>`);
14
+ <div class="spinner">
15
+ <div class="bounce1"></div>
16
+ <div class="bounce2"></div>
17
+ <div class="bounce3"></div>
18
+ </div>`
19
+ );
24
20
 
25
21
  // Bind ajax:success and ajax:error to the form the button belongs to
26
22
  button
27
23
  .closest('form')
28
- .on('ajax:success', function() {
24
+ .on('ajax:success', function () {
29
25
  hideSpinner(button);
30
26
  enableActionElements();
31
27
  })
32
- .on('ajax:error', function() {
28
+ .on('ajax:error', function () {
33
29
  hideSpinner(button);
34
30
  enableActionElements();
35
31
  });
36
32
  });
33
+ };
34
+
35
+ $(document).on('click', '[class^="button"]', function() {
36
+ disableActionElements();
37
+ showSpinner($(this));
37
38
  });
39
+
40
+ $(document)
41
+ .ready(onDOMReady)
42
+ .on('ready page:load turbolinks:load', onDOMReady);
38
43
  })(jQuery);
39
44
 
40
45
  function showSpinner(button) {
@@ -1,17 +1,21 @@
1
1
  (function($) {
2
- $(document).on('click', '.flash', function() {
3
- closeAlert();
4
- });
5
-
6
- $(document).on('ready page:load turbolinks:load', function() {
7
- $('.flash').each(function() {
2
+ const onDOMReady = function () {
3
+ $('.flash').each(function () {
8
4
  $(this).css('right', -$(this).width() + 'px');
9
5
  });
10
6
 
11
- setTimeout(function() {
7
+ setTimeout(function () {
12
8
  $('.flash').addClass('flash--shown');
13
9
  }, 100);
10
+ };
11
+
12
+ $(document).on('click', '.flash', function() {
13
+ closeAlert();
14
14
  });
15
+
16
+ $(document)
17
+ .ready(onDOMReady)
18
+ .on('ready page:load turbolinks:load', onDOMReady);
15
19
  })(jQuery);
16
20
 
17
21
  function closeAlert() {
@@ -0,0 +1,39 @@
1
+ (function($) {
2
+ const onDOMReady = function () {
3
+ $('input[type="file"]').each(function () {
4
+ var $input = $(this),
5
+ $label = $(`.input__file__text.${$input.attr('id')}`),
6
+ labelVal = $label.html();
7
+
8
+ $input.on('change', function (e) {
9
+ var fileName = '';
10
+
11
+ if (this.files && this.files.length > 1)
12
+ fileName = (this.getAttribute('data-multiple-caption') || '').replace(
13
+ '{count}',
14
+ this.files.length
15
+ );
16
+ else if (e.target.value) fileName = e.target.value.split('\\').pop();
17
+
18
+ if (fileName)
19
+ $label.html(
20
+ `<svg class="input__file__icon" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M15 2v5h5v15h-16v-20h11zm1-2h-14v24h20v-18l-6-6z"/></svg>${fileName}`
21
+ );
22
+ else $label.html(labelVal);
23
+ });
24
+
25
+ // Firefox bug fix
26
+ $input
27
+ .on('focus', function () {
28
+ $input.addClass('has-focus');
29
+ })
30
+ .on('blur', function () {
31
+ $input.removeClass('has-focus');
32
+ });
33
+ });
34
+ };
35
+
36
+ $(document)
37
+ .ready(onDOMReady)
38
+ .on('ready page:load turbolinks:load', onDOMReady);
39
+ })(jQuery);
@@ -0,0 +1,8 @@
1
+ <% if defined?(I18n) && I18n.available_locales.count > 1 %>
2
+ <%= form_for :system, url: beyond_canvas.update_locale_path, method: :put do |f| %>
3
+ <%= f.select :locale, I18n.available_locales.collect { |l| [translate_locale(l), l] },
4
+ { selected: cookies[:locale] },
5
+ class: 'select--locale',
6
+ onchange: 'this.form.submit()' %>
7
+ <% end %>
8
+ <% end %>
@@ -1,8 +1,8 @@
1
1
  <!-- Email Header : BEGIN -->
2
2
  <tr>
3
3
  <td style="padding: 20px 0; text-align: center">
4
- <% if BeyondCanvas.configuration.public_logo.present? %>
5
- <%= image_tag BeyondCanvas.configuration.public_logo, width: "200", height: "50", alt: "alt_text", border: "0", style: "height: auto; font-family: sans-serif; font-size: 15px; line-height: 15px; color: #555555;" %>
4
+ <% if BeyondCanvas.configuration.site_logo.present? %>
5
+ <%= image_tag BeyondCanvas.configuration.site_logo, width: "200", height: "50", alt: "alt_text", border: "0", style: "height: auto; font-family: sans-serif; font-size: 15px; line-height: 15px; color: #555555;" %>
6
6
  <% end %>
7
7
  </td>
8
8
  </tr>
@@ -0,0 +1,13 @@
1
+ <% flash.each do |key, value| %>
2
+ <div class="flash">
3
+ <div class="flash__icon flash__icon--<%= key %>">
4
+ <%= get_flash_icon(key) %>
5
+ </div>
6
+ <div class="flash__message">
7
+ <%= value %>
8
+ </div>
9
+ <div class="flash__close">
10
+ <%= inline_svg_tag 'icons/flash_close.svg' %>
11
+ </div>
12
+ </div>
13
+ <% end %>
@@ -0,0 +1,29 @@
1
+ <head>
2
+
3
+ <%= csrf_meta_tags %>
4
+
5
+ <meta content='width=device-width, initial-scale=1.0' name='viewport' />
6
+
7
+ <title><%= full_title(yield :title) %></title>
8
+
9
+ <%= favicon_link_tag BeyondCanvas.configuration.favicon if BeyondCanvas.configuration.favicon %>
10
+
11
+ <% BeyondCanvas.configuration.stylesheets.each do |style, options| %>
12
+ <% if BeyondCanvas.configuration.skip_webpacker %>
13
+ <%= stylesheet_link_tag style, options %>
14
+ <% else %>
15
+ <%= stylesheet_pack_tag style, options %>
16
+ <% end %>
17
+ <% end %>
18
+
19
+ <% BeyondCanvas.configuration.javascripts.each do |path| %>
20
+ <% if BeyondCanvas.configuration.skip_webpacker %>
21
+ <%= javascript_include_tag path %>
22
+ <% else %>
23
+ <%= javascript_pack_tag path %>
24
+ <% end %>
25
+ <% end %>
26
+
27
+ <%= render 'beyond_canvas/custom/public_head' %>
28
+
29
+ </head>