fae-rails 2.1.0 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (137) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +5 -2
  3. data/app/assets/config/fae/manifest.js +2 -0
  4. data/app/assets/javascripts/fae/_contrast.js +50 -0
  5. data/app/assets/javascripts/fae/_deploy.js +198 -0
  6. data/app/assets/javascripts/fae/_modals.js +94 -0
  7. data/app/assets/javascripts/fae/application.js +7 -1
  8. data/app/assets/javascripts/fae/form/_ajax.js +17 -5
  9. data/app/assets/javascripts/fae/form/_filtering.js +34 -0
  10. data/app/assets/javascripts/fae/form/_form.js +5 -2
  11. data/app/assets/javascripts/fae/form/_form_manager.js +295 -0
  12. data/app/assets/javascripts/fae/form/_slugger.js.erb +2 -2
  13. data/app/assets/javascripts/fae/form/_validator.js +224 -55
  14. data/app/assets/javascripts/fae/form/drag_drop.js +109 -0
  15. data/app/assets/javascripts/fae/form/inputs/_select.js +10 -4
  16. data/app/assets/javascripts/fae/form/inputs/_text.js +23 -9
  17. data/app/assets/javascripts/fae/vendor/simplemde/codemirror-4.inline-attachment.js +95 -0
  18. data/app/assets/javascripts/fae/vendor/simplemde/inline-attachment.js +405 -0
  19. data/app/assets/stylesheets/fae/application.css +1 -0
  20. data/app/assets/stylesheets/fae/base.scss +7 -3
  21. data/app/assets/stylesheets/fae/globals/_tags.scss +1 -1
  22. data/app/assets/stylesheets/fae/globals/imports/_variables.scss +1 -0
  23. data/app/assets/stylesheets/fae/globals/layout/_base.scss +9 -4
  24. data/app/assets/stylesheets/fae/globals/layout/_content-header.scss +14 -4
  25. data/app/assets/stylesheets/fae/globals/legacy/_pre-1.3.scss +1 -1
  26. data/app/assets/stylesheets/fae/globals/navigation/_footer.scss +1 -1
  27. data/app/assets/stylesheets/fae/globals/navigation/_header.scss +3 -3
  28. data/app/assets/stylesheets/fae/globals/navigation/_multi-col-subnav.scss +50 -0
  29. data/app/assets/stylesheets/fae/globals/navigation/_sidenav.scss +2 -2
  30. data/app/assets/stylesheets/fae/globals/navigation/_utility.scss +1 -1
  31. data/app/assets/stylesheets/fae/modules/_buttons.scss +11 -0
  32. data/app/assets/stylesheets/fae/modules/_deploy.scss +25 -0
  33. data/app/assets/stylesheets/fae/modules/_errors-bar.scss +19 -0
  34. data/app/assets/stylesheets/fae/modules/_modal.scss +25 -0
  35. data/app/assets/stylesheets/fae/modules/_toggles.scss +39 -23
  36. data/app/assets/stylesheets/fae/modules/forms/_asset-actions.scss +1 -1
  37. data/app/assets/stylesheets/fae/modules/forms/_base.scss +14 -1
  38. data/app/assets/stylesheets/fae/modules/forms/_checkbox.scss +1 -1
  39. data/app/assets/stylesheets/fae/modules/forms/_date.scss +20 -4
  40. data/app/assets/stylesheets/fae/modules/forms/_form-manager.scss +82 -0
  41. data/app/assets/stylesheets/fae/modules/forms/_hints.scss +1 -1
  42. data/app/assets/stylesheets/fae/modules/forms/_label.scss +1 -1
  43. data/app/assets/stylesheets/fae/modules/forms/_radio.scss +1 -1
  44. data/app/assets/stylesheets/fae/modules/forms/_select.scss +9 -8
  45. data/app/assets/stylesheets/fae/modules/forms/_simple-mde.scss +72 -1
  46. data/app/assets/stylesheets/fae/modules/forms/_textarea.scss +1 -1
  47. data/app/assets/stylesheets/fae/modules/tables/_base.scss +1 -1
  48. data/app/assets/stylesheets/fae/modules/tables/_filters.scss +4 -0
  49. data/app/assets/stylesheets/fae/modules/tables/_pagination.scss +2 -2
  50. data/app/assets/stylesheets/fae/pages/_error.scss +1 -1
  51. data/app/assets/stylesheets/fae/pages/_login.scss +5 -1
  52. data/app/assets/stylesheets/fae/simplemde_override.scss +32 -0
  53. data/app/controllers/fae/application_controller.rb +9 -2
  54. data/app/controllers/fae/base_controller.rb +6 -2
  55. data/app/controllers/fae/deploy_controller.rb +24 -0
  56. data/app/controllers/fae/deploy_hooks_controller.rb +71 -0
  57. data/app/controllers/fae/form_managers_controller.rb +19 -0
  58. data/app/controllers/fae/options_controller.rb +1 -0
  59. data/app/controllers/fae/setup_controller.rb +2 -2
  60. data/app/controllers/fae/static_pages_controller.rb +6 -1
  61. data/app/controllers/fae/users_controller.rb +11 -1
  62. data/app/controllers/fae/utilities_controller.rb +18 -6
  63. data/app/helpers/fae/application_helper.rb +36 -2
  64. data/app/helpers/fae/form_helper.rb +26 -2
  65. data/app/helpers/fae/view_helper.rb +26 -9
  66. data/app/models/concerns/fae/base_model_concern.rb +17 -0
  67. data/app/models/concerns/fae/seo_set_concern.rb +1 -0
  68. data/app/models/fae/change.rb +20 -6
  69. data/app/models/fae/deploy_hook.rb +12 -0
  70. data/app/models/fae/form_manager.rb +24 -0
  71. data/app/models/fae/option.rb +1 -0
  72. data/app/models/fae/seo_set.rb +14 -0
  73. data/app/models/fae/user.rb +2 -2
  74. data/app/services/fae/netlify_api.rb +213 -0
  75. data/app/uploaders/fae/file_uploader.rb +1 -1
  76. data/app/uploaders/fae/image_uploader.rb +2 -2
  77. data/app/views/devise/unlocks/new.html.slim +5 -9
  78. data/app/views/fae/application/_content_form.html.slim +16 -11
  79. data/app/views/fae/application/_file_uploader.html.slim +7 -2
  80. data/app/views/fae/application/_global_search_results.html.slim +1 -1
  81. data/app/views/fae/application/_header.slim +4 -1
  82. data/app/views/fae/application/_mobilenav.slim +3 -0
  83. data/app/views/fae/application/_seo_set_form.html.slim +12 -0
  84. data/app/views/fae/deploy/index.html.slim +40 -0
  85. data/app/views/fae/deploy_hooks/_form.html.slim +18 -0
  86. data/app/views/fae/deploy_hooks/_table.html.slim +28 -0
  87. data/app/views/fae/deploy_hooks/edit.html.slim +3 -0
  88. data/app/views/fae/deploy_hooks/new.html.slim +3 -0
  89. data/app/views/fae/images/_image_uploader.html.slim +12 -3
  90. data/app/views/fae/options/_form.html.slim +6 -2
  91. data/app/views/fae/pages/activity_log.html.slim +7 -3
  92. data/app/views/fae/pages/home.html.slim +3 -4
  93. data/app/views/fae/shared/_errors.slim +0 -3
  94. data/app/views/fae/shared/_form_header.html.slim +20 -12
  95. data/app/views/fae/shared/_nested_table.html.slim +5 -2
  96. data/app/views/fae/shared/_recent_changes.html.slim +1 -1
  97. data/app/views/fae/shared/_shared_nested_table.html.slim +9 -3
  98. data/app/views/layouts/fae/application.html.slim +2 -1
  99. data/config/deploy.rb +3 -1
  100. data/config/initializers/carrierwave.rb +41 -2
  101. data/config/initializers/devise.rb +6 -6
  102. data/config/initializers/fae_judge.rb +4 -2
  103. data/config/locales/fae.en.yml +49 -4
  104. data/config/locales/fae.zh-CN.yml +2 -2
  105. data/config/puma.rb +82 -0
  106. data/config/routes.rb +9 -1
  107. data/db/migrate/20140809222030_add_user_table.rb +1 -1
  108. data/db/migrate/20190925153222_create_fae_form_managers.rb +11 -0
  109. data/db/migrate/20220118192729_create_fae_publish_hooks.rb +10 -0
  110. data/db/migrate/20220128133730_rename_publish_hooks.rb +5 -0
  111. data/db/migrate/20220202153607_add_position_to_deploy_hooks.rb +6 -0
  112. data/db/migrate/20221118161833_create_fae_seo_sets.rb +13 -0
  113. data/lib/fae/concerns/models/base.rb +2 -0
  114. data/lib/fae/engine.rb +3 -3
  115. data/lib/fae/options.rb +18 -18
  116. data/lib/fae/version.rb +1 -1
  117. data/lib/generators/fae/base_generator.rb +28 -5
  118. data/lib/generators/fae/controller_generator.rb +0 -1
  119. data/lib/generators/fae/install_generator.rb +1 -1
  120. data/lib/generators/fae/model_generator.rb +1 -2
  121. data/lib/generators/fae/nested_index_scaffold_generator.rb +1 -2
  122. data/lib/generators/fae/nested_scaffold_generator.rb +23 -2
  123. data/lib/generators/fae/page_generator.rb +1 -2
  124. data/lib/generators/fae/scaffold_generator.rb +1 -1
  125. data/lib/generators/fae/templates/assets/fae.js +1 -1
  126. data/lib/generators/fae/templates/controllers/nested_scaffold_controller.rb +13 -1
  127. data/lib/generators/fae/templates/controllers/scaffold_controller.rb +7 -0
  128. data/lib/generators/fae/templates/initializers/fae.rb +16 -1
  129. data/lib/generators/fae/templates/views/_form.html.slim +12 -1
  130. data/lib/generators/fae/templates/views/_form_index_nested.html.slim +15 -1
  131. data/lib/generators/fae/templates/views/_form_nested.html.slim +22 -2
  132. data/lib/generators/fae/templates/views/static_page_form.html.slim +13 -1
  133. metadata +53 -24
  134. data/config/deploy/dev.rb +0 -19
  135. data/config/deploy/prod.rb +0 -19
  136. data/config/deploy/stage.rb +0 -19
  137. /data/app/assets/javascripts/fae/vendor/{simplemde.min.js → simplemde/simplemde.min.js} +0 -0
@@ -0,0 +1,18 @@
1
+ ruby:
2
+ form_options = {
3
+ html: {
4
+ multipart: true,
5
+ novalidate: true,
6
+ class: 'js-file-form',
7
+ remote: true,
8
+ data: {
9
+ type: "html"
10
+ }
11
+ }
12
+ }
13
+ = simple_form_for(@deploy_hook, form_options) do |f|
14
+ = fae_input f, :environment
15
+ = fae_input f, :url, label: 'URL'
16
+
17
+ = f.submit
18
+ = button_tag 'Cancel', type: 'button', class: 'js-cancel-nested cancel-nested-button'
@@ -0,0 +1,28 @@
1
+ section.addedit-form.js-addedit-form
2
+ a.js-add-link.table-add-link.button.-small href=fae.new_deploy_hook_path = t('fae.deploy_hook.add_deploy_hook')
3
+ h2 = t('fae.deploy_hook.section_heading')
4
+ - if t('fae.deploy_hook.section_helper_text').present?
5
+ h6.table-helper-text = t('fae.deploy_hook.section_helper_text')
6
+ == render 'fae/application/flash_messages'
7
+ table.js-sort-row
8
+ thead
9
+ tr
10
+ th.th-sortable-handle
11
+ th = t('fae.deploy_hooks.environment')
12
+ th = t('fae.deploy_hooks.url')
13
+ th.-action
14
+ tbody
15
+ - if @deploy_hooks.present?
16
+ - @deploy_hooks.each do |item|
17
+ tr id=tr_id(item)
18
+ td.sortable-handle: i.icon-sort
19
+ td: a.js-edit-link href=edit_deploy_hook_path(item) #{item.environment}
20
+ td = item.url
21
+ td = fae_delete_button item, item, class: 'js-tooltip table-action js-delete-link', remote: true
22
+
23
+ - else
24
+ tr
25
+ - td_link = link_to 'add some', fae.new_deploy_hook_path, class: 'js-add-link'
26
+ td colspan="4" No #{t('fae.deploy_hook.section_heading')} yet, #{td_link}.
27
+
28
+ .js-addedit-form-wrapper
@@ -0,0 +1,3 @@
1
+ .nested-form
2
+ h2 = t('fae.deploy_hook.edit_deploy_hook')
3
+ == render 'form'
@@ -0,0 +1,3 @@
1
+ .nested-form
2
+ h2 = t('fae.deploy_hook.new_deploy_hook')
3
+ == render 'form'
@@ -15,15 +15,19 @@ ruby:
15
15
  attached_as ||= image_name.to_s
16
16
  languages = f.object.class.try(:fae_fields).try(:[], image_name).try(:[], :languages)
17
17
  language ||= nil
18
+ show_form_manager ||= true
18
19
 
19
20
  - if languages.present?
20
21
  - languages.each do |lang|
21
- = render 'fae/images/image_uploader', f: f, item: item, image_name: "#{image_name}_#{lang}".to_sym, label: "#{label} (#{lang.to_s})", alt_label: "#{alt_label} (#{lang.to_s})", caption_label: "#{caption_label} (#{lang.to_s})", helper_text: helper_text, alt_helper_text: alt_helper_text, caption_helper_text: caption_helper_text, show_caption: show_caption, required: required, attached_as: attached_as, language: lang
22
+ = render 'fae/images/image_uploader', f: f, item: item, image_name: "#{image_name}_#{lang}".to_sym, label: "#{label} (#{lang.to_s})", alt_label: "#{alt_label} (#{lang.to_s})", caption_label: "#{caption_label} (#{lang.to_s})", helper_text: helper_text, alt_helper_text: alt_helper_text, caption_helper_text: caption_helper_text, show_caption: show_caption, required: required, attached_as: attached_as, language: lang, show_form_manager: show_form_manager
22
23
 
23
24
  - else
25
+ ruby:
26
+ form_manager_id = show_form_manager ? "#{item.class.name}_#{attached_as}" : nil
27
+ form_manager_id += "_#{language}" if language.present?
24
28
  - wrapper_html = language.present? ? { data: { language: language } } : {}
25
29
  = f.simple_fields_for image_name, defaults: { wrapper_html: wrapper_html } do |i|
26
- .field.input*wrapper_html
30
+ .input.field.image*wrapper_html class="#{image_name}" data-form-manager-id=form_manager_id
27
31
  label class="#{'required' if required}"
28
32
  - if required
29
33
  abbr title="required" *
@@ -31,7 +35,8 @@ ruby:
31
35
  = " #{label.html_safe}"
32
36
 
33
37
  - if helper_text.present?
34
- h6.helper_text = helper_text
38
+ h6.helper_text
39
+ span.helper_text_text = helper_text
35
40
 
36
41
  - if the_image.asset.present?
37
42
  .asset-actions
@@ -52,6 +57,8 @@ ruby:
52
57
  options = { label: caption_label.html_safe }
53
58
  options[:helper_text] = caption_helper_text if caption_helper_text.present?
54
59
  options[:wrapper_html] = wrapper_html
60
+ options[:wrapper_html].merge!({class: "#{form_manager_id}_caption_container"})
61
+ options[:show_form_manager] = false
55
62
 
56
63
  = fae_input i, :caption, options
57
64
 
@@ -60,6 +67,8 @@ ruby:
60
67
  options = { label: alt_label.html_safe }
61
68
  options[:helper_text] = alt_helper_text if alt_helper_text.present?
62
69
  options[:wrapper_html] = wrapper_html
70
+ options[:wrapper_html].merge!({class: "#{form_manager_id}_alt_container"})
71
+ options[:show_form_manager] = false
63
72
 
64
73
  = fae_input i, :alt, options
65
74
 
@@ -3,14 +3,18 @@
3
3
  h1 Root Settings
4
4
  .content-header-buttons
5
5
  a.button#js-header-cancel href=fae.root_path(cancelled: true) = t('fae.form.cancel')
6
- = f.submit t('fae.form.save')
6
+ input name="commit" type="submit" value=t('fae.form.save')
7
7
 
8
8
  == render 'flash_messages'
9
9
 
10
- section.content
10
+ main.content
11
11
  = fae_input f, :title, label: t('fae.options.project.name')
12
12
  = fae_input f, :time_zone, wrapper_class: 'select'
13
+ = fae_input f, :colorway, label: t('fae.options.colorway'), helper_text: t('fae.options.colorway_helper')
13
14
  = fae_input f, :live_url, label: t('fae.options.live_url'), helper_text: t('fae.options.url_helper')
14
15
  = fae_input f, :stage_url, label: t('fae.options.stage_url'), helper_text: t('fae.options.url_helper')
15
16
  = fae_image_form f, :logo, helper_text: t('fae.options.logo_helper')
16
17
  = fae_image_form f, :favicon
18
+
19
+ section.content#deploy_hooks
20
+ == render "fae/deploy_hooks/table"
@@ -1,12 +1,16 @@
1
- == render 'fae/shared/index_header', title: 'Activity Log', new_button: false
1
+ header.content-header.js-content-header
2
+ h1 = t('fae.application.activity_log_heading')
2
3
 
3
4
  main.content
4
5
 
5
6
  == fae_filter_form title: t('fae.changes.title'), action: fae.activity_log_filter_path do
6
- == fae_filter_select :user, options: Fae::User.all.map { |u| [u.full_name, u.id] }, translation_path: 'fae.changes.models'
7
- == fae_filter_select :model, options: Fae::Change.unique_changeable_types, translation_path: 'fae.changes.models'
8
7
  == fae_filter_select :type, options: [t('fae.changes.created'), t('fae.changes.updated'), t('fae.changes.deleted')], translation_path: 'fae.changes.models'
8
+ == fae_filter_datepicker :start_date, placeholder: 'MM/DD/YYYY', class: 'test'
9
+ == fae_filter_datepicker :end_date, placeholder: 'MM/DD/YYYY'
9
10
  == fae_filter_select :date, options: [t('fae.changes.last_hour'), t('fae.changes.last_day'), t('fae.changes.last_week'), t('fae.changes.last_month')], placeholder: t('fae.changes.all_time')
11
+ br
12
+ == fae_filter_select :user, options: Fae::User.all.map { |u| [u.full_name, u.id] }, translation_path: 'fae.changes.models'
13
+ == fae_filter_select :model, options: Fae::Change.unique_changeable_types, translation_path: 'fae.changes.models'
10
14
 
11
15
  table.js-results-table
12
16
  thead
@@ -19,8 +19,8 @@ header.content-header.js-content-header.-dashboard
19
19
  - @list.each do |item|
20
20
  - begin
21
21
  - parent = item.respond_to?(:fae_parent) ? item.fae_parent : nil
22
- - edit_path = edit_polymorphic_path([main_app, fae_scope, parent, item])
23
- - index_path = polymorphic_path([main_app, fae_scope, parent, item.class.to_s.pluralize.underscore])
22
+ - edit_path = edit_polymorphic_path([main_app, fae_scope.to_sym, parent, item])
23
+ - index_path = polymorphic_path([main_app, fae_scope.to_sym, parent, item.class.to_s.pluralize.underscore.to_sym])
24
24
  tr
25
25
  td: a href=edit_path = item.fae_display_field
26
26
  td: a href=index_path = item.class.to_s
@@ -33,5 +33,4 @@ header.content-header.js-content-header.-dashboard
33
33
  p
34
34
  = t('fae.page.no_objs_start')
35
35
  br
36
- a href="https://www.faecms.com/documentation/quickstart-guide" target="_blank"
37
- = t('fae.page.no_objs.end')
36
+ a href="https://www.faecms.com/documentation/quickstart-guide" target="_blank" = t('fae.page.no_objs_end')
@@ -1,4 +1 @@
1
- - unless flash.present?
2
- .flash-message.alert.hide = t('fae.save_error')
3
-
4
1
  == render 'flash_messages'
@@ -1,16 +1,17 @@
1
1
  ruby:
2
2
  require_locals ['header'], local_assigns
3
- save_button_text ||= t('fae.form.save')
4
- cancel_button_text ||= t('fae.form.cancel')
5
- cloneable ||= false
6
- clone_button_text ||= t('fae.form.clone')
7
- subnav ||= []
8
- header_as_string = header.is_a?(String) ? header : header.class.name.split('::').last
9
- header_as_string = header_as_string.singularize
10
- title ||= "#{params[:action]} #{header_as_string}".titleize
11
- breadcrumb = !local_assigns[:breadcrumbs].eql?(false)
12
- languages ||= false
13
- show_flash_messages = !local_assigns[:show_flash_messages].eql?(false)
3
+ save_button_text ||= t('fae.form.save')
4
+ cancel_button_text ||= t('fae.form.cancel')
5
+ cloneable ||= false
6
+ clone_button_text ||= t('fae.form.clone')
7
+ launch_manager_text ||= t('fae.form.launch_form_manager')
8
+ subnav ||= []
9
+ header_as_string = header.is_a?(String) ? header : header.class.name.split('::').last
10
+ header_as_string = header_as_string.singularize
11
+ title ||= "#{params[:action]} #{header_as_string}".titleize
12
+ breadcrumb = !local_assigns[:breadcrumbs].eql?(false)
13
+ languages ||= false
14
+ show_flash_messages = !local_assigns[:show_flash_messages].eql?(false)
14
15
 
15
16
  header.content-header.js-content-header
16
17
  - if breadcrumb
@@ -25,9 +26,12 @@ header.content-header.js-content-header
25
26
  .content-header-select
26
27
  = select_tag 'fae-languages', options_for_select(Fae.languages.map(&:reverse), selected), id: 'js-language', class: 'small_pulldown', prompt: 'All Languages'
27
28
 
29
+ - if Fae.use_form_manager
30
+ a.button.js-launch-form-manager href='#' = launch_manager_text
31
+
28
32
  a.button#js-header-cancel href=@index_path = cancel_button_text
29
33
  - if cloneable.present? && params[:id].present?
30
- a.button data-method="post" href="#{@index_path}?from_existing=#{params[:id]}" = clone_button_text
34
+ a.button#js-header-clone data-method="post" href="#{@index_path}?from_existing=#{params[:id]}" = clone_button_text
31
35
  input name="commit" type="submit" value=save_button_text
32
36
 
33
37
  - if subnav.present?
@@ -38,3 +42,7 @@ header.content-header.js-content-header
38
42
 
39
43
  - if show_flash_messages
40
44
  == render 'fae/shared/errors'
45
+
46
+ .errors-bar-wrapper
47
+ h2 = t('fae.save_error')
48
+ .errors-bar
@@ -11,6 +11,8 @@ ruby:
11
11
  assoc_name ||= assoc.to_s # 'restaurant_bars'
12
12
  title ||= assoc_name.titleize # 'Restaurant Bars'
13
13
  add_button_text ||= t('fae.common.add', title: title.singularize)
14
+ hide_add_button ||= false
15
+ hide_delete_button ||= false
14
16
  ordered ||= false
15
17
  has_thumb ||= false
16
18
  edit_column ||= false
@@ -33,7 +35,7 @@ ruby:
33
35
  new_path += "item_id=#{parent_item.id}&=item_class=#{parent_item.class.to_s}"
34
36
  end
35
37
 
36
- options_for_table = { index: index, assoc: assoc, assoc_name: assoc_name, title: title, add_button_text: add_button_text, ordered: ordered, has_thumb: has_thumb, edit_column: edit_column, cols: cols, assoc_name_singular: assoc_name_singular, new_path: new_path, edit_path: edit_path }
38
+ options_for_table = { index: index, assoc: assoc, assoc_name: assoc_name, title: title, add_button_text: add_button_text, hide_add_button: hide_add_button, hide_delete_button: hide_delete_button, ordered: ordered, has_thumb: has_thumb, edit_column: edit_column, cols: cols, assoc_name_singular: assoc_name_singular, new_path: new_path, edit_path: edit_path }
37
39
  options_for_table[:parent_item] = parent_item unless index
38
40
 
39
41
  section.addedit-form.js-addedit-form class="#{'content' if index}"
@@ -41,7 +43,8 @@ section.addedit-form.js-addedit-form class="#{'content' if index}"
41
43
  == render 'fae/shared/shared_nested_table', options_for_table
42
44
 
43
45
  - else
44
- a.js-add-link.table-add-link.button.-small href=new_path = add_button_text
46
+ - unless hide_add_button
47
+ a.js-add-link.table-add-link.button.-small href=new_path = add_button_text
45
48
  h2 = title
46
49
  - if helper_text.present?
47
50
  h6.table-helper-text = helper_text
@@ -8,7 +8,7 @@
8
8
  th = t('fae.changes.user')
9
9
  th = t('fae.changes.type')
10
10
  th = t('fae.changes.attrs')
11
- th.-action-wide t('fea.changes.modified')
11
+ th.-action-wide = t('fea.changes.modified')
12
12
  tbody
13
13
  - if @item.try(:tracked_changes).present?
14
14
  - @item.tracked_changes.each do |change|
@@ -2,6 +2,7 @@ ruby:
2
2
  colspan = cols.length + 1
3
3
  colspan += 1 if ordered
4
4
  colspan += 1 if has_thumb
5
+ colspan -= 1 if hide_delete_button
5
6
  table_class = ordered ? 'js-sort-row' : nil
6
7
 
7
8
  options_for_td = { cols: cols, edit_path: edit_path, edit_column: edit_column }
@@ -17,7 +18,8 @@ table class=table_class
17
18
  = th_columns(col)
18
19
  - if edit_column
19
20
  th.-action data-sorter="false"
20
- th.-action
21
+ - unless hide_delete_button
22
+ th.-action
21
23
  tbody
22
24
  - records = index ? @items : parent_item.send(assoc)
23
25
  - if records.present?
@@ -35,12 +37,16 @@ table class=table_class
35
37
  td
36
38
  a.js-edit-link.js-tooltip.table-action title=t('fae.common.edit') href=self.send(edit_path, item)
37
39
  i.icon-edit
38
- td = fae_delete_button item, "/#{fae_path}/#{assoc_name}/#{item.id.to_s}", class: 'js-tooltip table-action js-delete-link', remote: true
40
+ - unless hide_delete_button
41
+ td = fae_delete_button item, "/#{fae_path}/#{assoc_name}/#{item.id.to_s}", class: 'js-tooltip table-action js-delete-link', remote: true
39
42
 
40
- - else
43
+ - elsif !hide_add_button
41
44
  tr
42
45
  - td_link = link_to 'add some', new_path, class: 'js-add-link'
43
46
 
44
47
  td colspan=colspan.to_s No #{title} yet, #{td_link}.
48
+ - else
49
+ tr
50
+ td colspan=colspan.to_s No #{title} yet.
45
51
 
46
52
  .js-addedit-form-wrapper
@@ -9,9 +9,10 @@ html
9
9
  == javascript_include_tag 'fae/application'
10
10
  == csrf_meta_tags
11
11
 
12
- body class=body_class
12
+ body class=body_class style=('--highlight-color:' + '#' + @option.colorway if @option.colorway.present?)
13
13
  == render 'mobilenav'
14
14
  == render 'header'
15
+ .js-form-manager-container
15
16
  section.main-content#js-main-content
16
17
  == render 'sidenav'
17
18
 
data/config/deploy.rb CHANGED
@@ -38,7 +38,8 @@ namespace :deploy do
38
38
  desc 'Symlink secrets.yml'
39
39
  task :symlink_secrets do
40
40
  on roles(:app) do
41
- execute "ln -s #{shared_path}/secrets.yml #{release_path}/config/secrets.yml"
41
+ execute "rm #{release_path}/spec/dummy/config/secrets.yml"
42
+ execute "ln -s #{shared_path}/secrets.yml #{release_path}/spec/dummy/config/secrets.yml"
42
43
  end
43
44
  end
44
45
 
@@ -68,6 +69,7 @@ namespace :deploy do
68
69
  end
69
70
  end
70
71
 
72
+ after 'deploy:updating', 'deploy:symlink_secrets'
71
73
  after :finishing, 'deploy:cleanup'
72
74
 
73
75
  end
@@ -1,3 +1,42 @@
1
- CarrierWave.configure do |config|
2
- config.cache_dir = "#{Rails.root}/tmp/fae/uploads"
1
+ CarrierWave.configure do |config|
2
+ config.cache_dir = "#{Rails.root}/tmp/fae/uploads"
3
+
4
+ if Rails.env.production? || Rails.env.remote_development?
5
+ config.fog_provider = 'fog/aws'
6
+ config.fog_credentials = {
7
+ provider: 'AWS',
8
+ aws_access_key_id: ENV['AWS_ACCESS_KEY_ID'],
9
+ aws_secret_access_key: ENV['AWS_SECRET_ACCESS_KEY'],
10
+ region: 'us-west-2'
11
+ }
12
+ config.storage = :fog
13
+ else
14
+ config.storage = :file
15
+ end
16
+
17
+ if Rails.env.production?
18
+ config.asset_host = 'https://s3.us-west-2.amazonaws.com/fae-engine-test-fly'
19
+ config.fog_directory = 'fae-engine-test-fly'
20
+ elsif Rails.env.remote_development?
21
+
22
+ end
23
+
24
+ # uncomment to deliver production assets to the local CMS
25
+ # if Rails.env.development?
26
+ # config.asset_host = ''
27
+ # config.fog_directory = ''
28
+ # end
29
+
30
+ # uncomment to upload to bucket/cdn in local dev
31
+ # if Rails.env.development?
32
+ # config.fog_provider = 'fog/aws'
33
+ # config.fog_credentials = {
34
+ # provider: 'AWS',
35
+ # aws_access_key_id: ENV['AWS_ACCESS_KEY_ID'],
36
+ # aws_secret_access_key: ENV['AWS_SECRET_ACCESS_KEY'],
37
+ # region: 'us-west-2'
38
+ # }
39
+ # config.storage = :fog
40
+ # end
41
+
3
42
  end
@@ -156,27 +156,27 @@ Devise.setup do |config|
156
156
  # Defines which strategy will be used to lock an account.
157
157
  # :failed_attempts = Locks an account after a number of failed attempts to sign in.
158
158
  # :none = No lock strategy. You should handle locking by yourself.
159
- # config.lock_strategy = :failed_attempts
159
+ config.lock_strategy = :failed_attempts
160
160
 
161
161
  # Defines which key will be used when locking and unlocking an account
162
- # config.unlock_keys = [ :email ]
162
+ config.unlock_keys = [ :email ]
163
163
 
164
164
  # Defines which strategy will be used to unlock an account.
165
165
  # :email = Sends an unlock link to the user email
166
166
  # :time = Re-enables login after a certain amount of time (see :unlock_in below)
167
167
  # :both = Enables both strategies
168
168
  # :none = No unlock strategy. You should handle unlocking by yourself.
169
- # config.unlock_strategy = :both
169
+ config.unlock_strategy = :both
170
170
 
171
171
  # Number of authentication tries before locking an account if lock_strategy
172
172
  # is failed attempts.
173
- # config.maximum_attempts = 20
173
+ config.maximum_attempts = 5
174
174
 
175
175
  # Time interval to unlock the account if :time is enabled as unlock_strategy.
176
- # config.unlock_in = 1.hour
176
+ config.unlock_in = 1.hour
177
177
 
178
178
  # Warn on the last attempt before the account is locked.
179
- # config.last_attempt_warning = false
179
+ config.last_attempt_warning = true
180
180
 
181
181
  # ==> Configuration for :recoverable
182
182
  #
@@ -1,3 +1,5 @@
1
- Judge.configure do
2
- expose Fae::User, :email
1
+ Rails.application.config.to_prepare do
2
+ Judge.configure do
3
+ expose Fae::User, :email
4
+ end
3
5
  end
@@ -12,6 +12,9 @@ en:
12
12
  save: 'Save'
13
13
  cancel: 'Cancel'
14
14
  clone: 'Clone'
15
+ launch_form_manager: 'Manage Form'
16
+ save_form_manager: 'Save Changes'
17
+ cancel_form_manager: 'Cancel'
15
18
  attribute:
16
19
  first_name: 'First Name'
17
20
  last_name: 'Last Name'
@@ -31,6 +34,13 @@ en:
31
34
  last_login: 'Last Logged In'
32
35
  active: 'Active'
33
36
  add_user: 'Add User'
37
+ deploy_hook:
38
+ environment: 'Environment'
39
+ add_deploy_hook: 'Add Deploy Hook'
40
+ new_deploy_hook: 'New Deploy Hook'
41
+ edit_deploy_hook: 'Edit Deploy Hook'
42
+ section_heading: 'Deploy Hooks'
43
+ section_helper_text: ''
34
44
  page:
35
45
  title: 'Pages'
36
46
  disabled_title: 'Disabled Admin'
@@ -41,7 +51,7 @@ en:
41
51
  error_end: 'to be taken to our home page.'
42
52
  hello: 'Hello'
43
53
  welcome: 'Welcome to Fae'
44
- no_objs_start: "You don'thave any objects setup to manage. If you need help getting started, check out the"
54
+ no_objs_start: "You don't have any objects setup to manage. If you need help getting started, check out the"
45
55
  no_objs_end: 'Quickstart Guide and Documentation site.'
46
56
  navbar:
47
57
  logout: 'Log Out'
@@ -52,6 +62,8 @@ en:
52
62
  jump_to: 'Jump to...'
53
63
  root_settings: 'Root Settings'
54
64
  no_results: 'No Results'
65
+ deployments: 'Deploy'
66
+ deploy_hooks: 'Deploy Hooks'
55
67
  changes:
56
68
  recent: 'Recent Changes'
57
69
  user: 'User'
@@ -69,6 +81,8 @@ en:
69
81
  last_day: 'Last Day'
70
82
  last_week: 'Last Week'
71
83
  last_month: 'Last Month'
84
+ on_prod: 'On Prod'
85
+ on_stage: 'On Stage'
72
86
  models:
73
87
  users: 'Users'
74
88
  types: 'Types'
@@ -76,18 +90,42 @@ en:
76
90
  user: 'User'
77
91
  type: 'Type'
78
92
  model: 'Model'
93
+ deploy:
94
+ page:
95
+ heading: 'Deploy'
96
+ ctas:
97
+ deploy: 'Deploy'
98
+ table:
99
+ past_heading: 'Past Deploys'
100
+ deploying_heading: 'Deploying'
101
+ deploying_helper: "After making changes in the CMS, click a deploy button above to push these changes to the respective front-end environment. Once your deployment posts to the “Past Deploys” table below, updates will be ready to review in the front-end environment.<br><br>Please note that each environment is distinct and will need to be deployed separately."
102
+ title: 'Activity'
103
+ deployed: 'Date/Time'
104
+ duration: 'Duration'
105
+ branch: 'Branch'
106
+ committer: 'Committer'
107
+ context: 'Environment'
108
+ state: 'State'
109
+ error_msg: 'Error Msg'
110
+ no_deploys: 'No deploys were found.'
111
+ changes:
112
+ production_heading: 'Changes since last production deploy'
113
+ staging_heading: 'Changes since last staging deploy'
79
114
  setup:
80
115
  prompt: 'Please create your super admin user.'
81
116
  password: 'Passwords must contain at least 8 characters.'
82
117
  options:
83
118
  project_name: 'Project Name'
84
119
  live_url: 'Live URL'
120
+ colorway: 'Highlight Color'
121
+ colorway_helper: 'Use 6 digit hex code to set the highlight color. Omit the "#"'
85
122
  url_helper: 'Include http:// for external links.'
86
123
  stage_url: 'Stage URL'
87
124
  logo_helper: 'Used on login page, 300x300px .jpg'
88
125
  images:
89
- alt_helper: 'Brief description of image contents, used in hover text and by visually impaired users.'
126
+ alt_helper: 'Read by search engines and visually impaired readers.'
90
127
  application:
128
+ activity_log_heading: 'Activity Log'
91
129
  user_absent: 'user no longer exists'
92
130
  no_logs: 'No logs available.'
93
131
  view_site: 'View Site'
@@ -111,9 +149,16 @@ en:
111
149
  paragraph_break: 'Paragraph break'
112
150
  paragraph_break_help: 'Adding a blank line in between your paragraphs makes a paragraph break.'
113
151
  seo_title: 'A descriptive page title of ~50-65 characters. Displayed in search engine results.'
114
- seo_description: 'A helpful page summary of 320 characters or less. Displayed in search engine results.'
152
+ seo_description: 'A helpful page summary of 200 characters or less. Displayed in search engine results.'
115
153
  search: 'Search %{search}'
116
154
  reset_search: 'Reset Search'
117
155
  apply_filters: 'Apply Filters'
118
156
  all_items: 'All %{items}'
119
- keyword_search: 'Search by Keyword'
157
+ keyword_search: 'Search by Keyword'
158
+ activerecord:
159
+ errors:
160
+ models:
161
+ fae/image:
162
+ attributes:
163
+ asset:
164
+ size_too_big: 'size is too big'
@@ -41,7 +41,7 @@ zh-CN:
41
41
  error_end: 'to be taken to our home page.'
42
42
  hello: 'Hello'
43
43
  welcome: 'Welcome to Fae'
44
- no_objs_start: "You don'thave any objects setup to manage. If you need help getting started, check out the"
44
+ no_objs_start: "You don't have any objects setup to manage. If you need help getting started, check out the"
45
45
  no_objs_end: 'Quickstart Guide and Documentation site.'
46
46
  navbar:
47
47
  logout: 'Log Out'
@@ -86,7 +86,7 @@ zh-CN:
86
86
  stage_url: 'Stage URL'
87
87
  logo_helper: 'Used on login page, 300x300px .jpg'
88
88
  images:
89
- alt_helper: 'Brief description of image contents, used in hover text and by visually impaired users.'
89
+ alt_helper: 'Read by search engines and visually impaired readers.'
90
90
  application:
91
91
  user_absent: 'user no longer exists'
92
92
  no_logs: 'No logs available.'
data/config/puma.rb ADDED
@@ -0,0 +1,82 @@
1
+ # Puma can serve each request in a thread from an internal thread pool.
2
+ # The `threads` method setting takes two numbers: a minimum and maximum.
3
+ # Any libraries that use thread pools should be configured to match
4
+ # the maximum value specified for Puma. Default is set to 5 threads for minimum
5
+ # and maximum; this matches the default thread size of Active Record.
6
+ #
7
+ max_threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }
8
+ min_threads_count = ENV.fetch("RAILS_MIN_THREADS") { max_threads_count }
9
+ threads min_threads_count, max_threads_count
10
+
11
+ # Specifies the `port` that Puma will listen on to receive requests; default is 3000.
12
+ #
13
+ port ENV.fetch("PORT") { 3000 }
14
+
15
+ # Specifies the `environment` that Puma will run in.
16
+ #
17
+ environment ENV.fetch("RAILS_ENV") { "development" }
18
+
19
+ # Specifies the `pidfile` that Puma will use.
20
+ pidfile ENV.fetch("PIDFILE") { "tmp/pids/server.pid" }
21
+
22
+ # Specifies the number of `workers` to boot in clustered mode.
23
+ # Workers are forked web server processes. If using threads and workers together
24
+ # the concurrency of the application would be max `threads` * `workers`.
25
+ # Workers do not work on JRuby or Windows (both of which do not support
26
+ # processes).
27
+ #
28
+ workers ENV.fetch("WEB_CONCURRENCY") { 4 }
29
+ # Use the `preload_app!` method when specifying a `workers` number.
30
+ # This directive tells Puma to first boot the application and load code
31
+ # before forking the application. This takes advantage of Copy On Write
32
+ # process behavior so workers use less memory.
33
+ #
34
+ preload_app!
35
+ # Allow puma to be restarted by `rails restart` command.
36
+ plugin :tmp_restart
37
+
38
+ # Old setup for fly.io
39
+
40
+ # # Puma can serve each request in a thread from an internal thread pool.
41
+ # # The `threads` method setting takes two numbers: a minimum and maximum.
42
+ # # Any libraries that use thread pools should be configured to match
43
+ # # the maximum value specified for Puma. Default is set to 5 threads for minimum
44
+ # # and maximum; this matches the default thread size of Active Record.
45
+ # #
46
+ # max_threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }
47
+ # min_threads_count = ENV.fetch("RAILS_MIN_THREADS") { max_threads_count }
48
+ # threads min_threads_count, max_threads_count
49
+
50
+ # # Specifies the `worker_timeout` threshold that Puma will use to wait before
51
+ # # terminating a worker in development environments.
52
+ # #
53
+ # worker_timeout 3600 if ENV.fetch("RAILS_ENV", "development") == "development"
54
+
55
+ # # Specifies the `port` that Puma will listen on to receive requests; default is 3000.
56
+ # #
57
+ # port ENV.fetch("PORT") { 3000 }
58
+
59
+ # # Specifies the `environment` that Puma will run in.
60
+ # #
61
+ # environment ENV.fetch("RAILS_ENV") { "development" }
62
+
63
+ # # Specifies the `pidfile` that Puma will use.
64
+ # pidfile ENV.fetch("PIDFILE") { "tmp/pids/server.pid" }
65
+
66
+ # # Specifies the number of `workers` to boot in clustered mode.
67
+ # # Workers are forked web server processes. If using threads and workers together
68
+ # # the concurrency of the application would be max `threads` * `workers`.
69
+ # # Workers do not work on JRuby or Windows (both of which do not support
70
+ # # processes).
71
+ # #
72
+ # workers ENV.fetch("WEB_CONCURRENCY") { 4 }
73
+
74
+ # # Use the `preload_app!` method when specifying a `workers` number.
75
+ # # This directive tells Puma to first boot the application and load code
76
+ # # before forking the application. This takes advantage of Copy On Write
77
+ # # process behavior so workers use less memory.
78
+ # #
79
+ # preload_app!
80
+
81
+ # # Allow puma to be restarted by `bin/rails restart` command.
82
+ # plugin :tmp_restart