fae-rails 1.7.1 → 2.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (142) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +6 -2
  3. data/Rakefile +0 -3
  4. data/app/assets/images/fae/tutorial_model_location.png +0 -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/_tables.js +11 -25
  8. data/app/assets/javascripts/fae/application.js +4 -2
  9. data/app/assets/javascripts/fae/fae_init.js +0 -4
  10. data/app/assets/javascripts/fae/form/_ajax.js +26 -7
  11. data/app/assets/javascripts/fae/form/_cancel.js +1 -0
  12. data/app/assets/javascripts/fae/form/_filtering.js +34 -0
  13. data/app/assets/javascripts/fae/form/_form.js +1 -0
  14. data/app/assets/javascripts/fae/form/_form_manager.js +295 -0
  15. data/app/assets/javascripts/fae/form/_slugger.js.erb +2 -2
  16. data/app/assets/javascripts/fae/form/_validator.js +24 -14
  17. data/app/assets/javascripts/fae/form/inputs/_color.js +2 -1
  18. data/app/assets/javascripts/fae/form/inputs/_select.js +5 -2
  19. data/app/assets/javascripts/fae/navigation/_language.js +1 -1
  20. data/app/assets/javascripts/fae/navigation/_navigation.js +9 -21
  21. data/app/assets/javascripts/fae/navigation/_subnav_highlighter.js +7 -41
  22. data/app/assets/javascripts/fae/vendor/jqColorPicker.min.js +0 -1
  23. data/app/assets/stylesheets/fae/base.scss +7 -8
  24. data/app/assets/stylesheets/fae/globals/imports/_variables.scss +1 -2
  25. data/app/assets/stylesheets/fae/globals/layout/_base.scss +7 -2
  26. data/app/assets/stylesheets/fae/globals/layout/_content-header.scss +17 -31
  27. data/app/assets/stylesheets/fae/globals/navigation/_header.scss +2 -2
  28. data/app/assets/stylesheets/fae/globals/navigation/_multi-col-subnav.scss +50 -0
  29. data/app/assets/stylesheets/fae/modules/_buttons.scss +11 -0
  30. data/app/assets/stylesheets/fae/modules/_deploy.scss +25 -0
  31. data/app/assets/stylesheets/fae/modules/_modal.scss +25 -0
  32. data/app/assets/stylesheets/fae/modules/_toggles.scss +39 -23
  33. data/app/assets/stylesheets/fae/modules/forms/_asset-actions.scss +1 -1
  34. data/app/assets/stylesheets/fae/modules/forms/_base.scss +1 -1
  35. data/app/assets/stylesheets/fae/modules/forms/_checkbox.scss +1 -1
  36. data/app/assets/stylesheets/fae/modules/forms/_date.scss +16 -0
  37. data/app/assets/stylesheets/fae/modules/forms/_form-manager.scss +82 -0
  38. data/app/assets/stylesheets/fae/modules/forms/_radio.scss +1 -1
  39. data/app/assets/stylesheets/fae/modules/forms/_select.scss +7 -6
  40. data/app/assets/stylesheets/fae/modules/forms/_simple-mde.scss +1 -1
  41. data/app/assets/stylesheets/fae/modules/forms/_textarea.scss +1 -1
  42. data/app/assets/stylesheets/fae/modules/tables/_filters.scss +4 -0
  43. data/app/assets/stylesheets/fae/pages/_home.scss +18 -0
  44. data/app/assets/stylesheets/fae/pages/_login.scss +4 -0
  45. data/app/controllers/fae/application_controller.rb +22 -1
  46. data/app/controllers/fae/base_controller.rb +6 -2
  47. data/app/controllers/fae/deploy_controller.rb +24 -0
  48. data/app/controllers/fae/deploy_hooks_controller.rb +71 -0
  49. data/app/controllers/fae/form_managers_controller.rb +19 -0
  50. data/app/controllers/fae/options_controller.rb +1 -0
  51. data/app/controllers/fae/pages_controller.rb +3 -2
  52. data/app/controllers/fae/static_pages_controller.rb +6 -1
  53. data/app/controllers/fae/users_controller.rb +19 -1
  54. data/app/controllers/fae/utilities_controller.rb +18 -6
  55. data/app/helpers/fae/application_helper.rb +27 -2
  56. data/app/helpers/fae/form_helper.rb +40 -8
  57. data/app/helpers/fae/nested_form_helper.rb +2 -2
  58. data/app/helpers/fae/view_helper.rb +99 -43
  59. data/app/models/concerns/fae/base_model_concern.rb +10 -7
  60. data/app/models/concerns/fae/user_concern.rb +10 -1
  61. data/app/models/fae/change.rb +18 -5
  62. data/app/models/fae/deploy_hook.rb +12 -0
  63. data/app/models/fae/file.rb +1 -1
  64. data/app/models/fae/form_manager.rb +24 -0
  65. data/app/models/fae/image.rb +1 -1
  66. data/app/models/fae/option.rb +1 -1
  67. data/app/models/fae/role.rb +1 -1
  68. data/app/models/fae/static_page.rb +11 -2
  69. data/app/models/fae/user.rb +4 -5
  70. data/app/services/fae/netlify_api.rb +197 -0
  71. data/app/uploaders/fae/file_uploader.rb +2 -5
  72. data/app/uploaders/fae/image_uploader.rb +3 -3
  73. data/app/views/devise/unlocks/new.html.slim +5 -9
  74. data/app/views/fae/application/_content_form.html.slim +16 -11
  75. data/app/views/fae/application/_file_uploader.html.slim +11 -3
  76. data/app/views/fae/application/_global_search_results.html.slim +2 -2
  77. data/app/views/fae/application/_header.slim +12 -9
  78. data/app/views/fae/application/_markdown_helper.slim +17 -17
  79. data/app/views/fae/application/_mobilenav.slim +9 -6
  80. data/app/views/fae/application/_user_log.html.slim +2 -2
  81. data/app/views/fae/deploy/index.html.slim +40 -0
  82. data/app/views/fae/deploy_hooks/_form.html.slim +18 -0
  83. data/app/views/fae/deploy_hooks/_table.html.slim +28 -0
  84. data/app/views/fae/deploy_hooks/edit.html.slim +3 -0
  85. data/app/views/fae/deploy_hooks/new.html.slim +3 -0
  86. data/app/views/fae/images/_image_uploader.html.slim +15 -6
  87. data/app/views/fae/options/_form.html.slim +11 -8
  88. data/app/views/fae/pages/activity_log.html.slim +16 -12
  89. data/app/views/fae/pages/disabled_environment.html.slim +2 -2
  90. data/app/views/fae/pages/error404.html.slim +5 -3
  91. data/app/views/fae/pages/home.html.slim +32 -21
  92. data/app/views/fae/setup/first_user.html.slim +3 -3
  93. data/app/views/fae/shared/_form_header.html.slim +37 -33
  94. data/app/views/fae/shared/_index_header.html.slim +3 -2
  95. data/app/views/fae/shared/_nested_table.html.slim +6 -6
  96. data/app/views/fae/shared/_recent_changes.html.slim +6 -6
  97. data/app/views/fae/shared/_shared_nested_table.html.slim +5 -2
  98. data/app/views/fae/static_pages/index.html.slim +2 -2
  99. data/app/views/fae/users/_form.html.slim +8 -12
  100. data/app/views/fae/users/index.html.slim +7 -7
  101. data/app/views/layouts/fae/application.html.slim +1 -0
  102. data/config/deploy.rb +3 -1
  103. data/config/initializers/devise.rb +6 -6
  104. data/config/locales/devise.cs.yml +59 -0
  105. data/config/locales/fae.cs.yml +125 -0
  106. data/config/locales/fae.en.yml +145 -0
  107. data/config/locales/fae.zh-CN.yml +109 -0
  108. data/config/routes.rb +9 -1
  109. data/db/migrate/20140809222030_add_user_table.rb +2 -2
  110. data/db/migrate/20140822224029_create_fae_roles.rb +1 -1
  111. data/db/migrate/20141008180718_create_fae_images_table.rb +1 -1
  112. data/db/migrate/20141017194616_create_fae_options.rb +1 -1
  113. data/db/migrate/20141021181327_create_fae_files.rb +1 -1
  114. data/db/migrate/20141021183047_create_fae_text_areas.rb +1 -1
  115. data/db/migrate/20141021184311_create_fae_pages.rb +1 -1
  116. data/db/migrate/20141105214814_create_fae_text_fields.rb +1 -1
  117. data/db/migrate/20150930224821_create_fae_changes.rb +1 -1
  118. data/db/migrate/20190925153222_create_fae_form_managers.rb +11 -0
  119. data/db/migrate/20220118192729_create_fae_publish_hooks.rb +10 -0
  120. data/db/migrate/20220128133730_rename_publish_hooks.rb +5 -0
  121. data/db/migrate/20220202153607_add_position_to_deploy_hooks.rb +6 -0
  122. data/lib/fae/options.rb +4 -2
  123. data/lib/fae/version.rb +1 -1
  124. data/lib/generators/fae/base_generator.rb +62 -8
  125. data/lib/generators/fae/nested_index_scaffold_generator.rb +1 -1
  126. data/lib/generators/fae/nested_scaffold_generator.rb +16 -2
  127. data/lib/generators/fae/page_generator.rb +8 -0
  128. data/lib/generators/fae/scaffold_generator.rb +1 -1
  129. data/lib/generators/fae/templates/assets/fae.js +1 -1
  130. data/lib/generators/fae/templates/controllers/nested_scaffold_controller.rb +14 -0
  131. data/lib/generators/fae/templates/graphql/graphql_page_type.rb +17 -0
  132. data/lib/generators/fae/templates/graphql/graphql_type.rb +13 -0
  133. data/lib/generators/fae/templates/initializers/fae.rb +16 -1
  134. data/lib/generators/fae/templates/views/_form.html.slim +11 -4
  135. data/lib/generators/fae/templates/views/_form_index_nested.html.slim +15 -1
  136. data/lib/generators/fae/templates/views/_form_nested.html.slim +19 -2
  137. data/lib/generators/fae/templates/views/index_nested.html.slim +1 -0
  138. data/lib/generators/fae/templates/views/static_page_form.html.slim +14 -3
  139. metadata +70 -47
  140. data/app/views/fae/shared/_form_buttons.html.slim +0 -11
  141. data/app/views/fae/shared/_nested_table_advanced.html.slim +0 -18
  142. data/lib/sub_test_task_patch.rb +0 -129
@@ -1,41 +1,41 @@
1
1
  .markdown-hint
2
2
  .markdown-hint-wrapper
3
- h3 Markdown Options
3
+ h3 = t('fae.application.markdown_opts')
4
4
 
5
- h4 Links
5
+ h4 = t('fae.application.links')
6
6
  p
7
- | To link text, place a [bracket] around the link title and use a (/url) to house the url.
7
+ = t('fae.application.links_help')
8
8
  br
9
9
  | Internal Link: [link to about](/about)
10
10
  br
11
11
  | External link: [link to about](http://www.google.com/about)
12
12
 
13
- h4 Formatting
13
+ h4 = t('fae.application.formatting')
14
14
  p
15
- | Emphasize text in a variety of ways by placing **asterisks** to bold, _underscores_ to italicize.
15
+ = t('fae.application.formatting_help')
16
16
  br
17
- | Bold **bold**
17
+ = t('fae.application.bold')
18
18
  br
19
- | Italicize _italic
19
+ = t('fae.application.italic')
20
20
 
21
- h4 Headers
21
+ h4 = t('fae.application.headers')
22
22
  p
23
- | Use up to six hashtags to identify the importance of the section header.
23
+ = t('fae.application.headers_help')
24
24
  br
25
- | Page Header: # Page Header
25
+ = t('fae.apllication.headers_example')
26
26
  br
27
- | Sub Header: ## Sub Header
27
+ = t('fae.application.subheaders_example')
28
28
 
29
- h4 List
29
+ h4 = t('fae.application.list')
30
30
  p
31
- | Format lists by swapping out the characters that lead the list item.
31
+ = t('fae.application.list_help')
32
32
  br
33
- span Bulleted List:
33
+ span = t('fae.application.bulleted_list')
34
34
  br
35
35
  == ['* bullet', '* bullet 2'].join('<br />')
36
36
  br
37
- span Numbered List
37
+ span = t('fae.application.numbered_list')
38
38
  == ['1. line item', '2. line item'].join('<br />')
39
39
 
40
- h4 Paragraph break
41
- p Adding a blank line in between your paragraphs makes a paragraph break.
40
+ h4 = t('fae.application.paragraph_break')
41
+ p = t('fae.application.paragraph_break_help')
@@ -31,6 +31,9 @@ nav.nav.mobilenav
31
31
  - thirditem[:path] ||= '#'
32
32
  li: a href=thirditem[:path] = thirditem[:text]
33
33
 
34
+ - if current_user.super_admin_or_admin? && netlify_enabled?
35
+ li: a href=fae.deploy_path = t('fae.navbar.deployments')
36
+
34
37
  - if current_user.super_admin_or_admin?
35
38
  li.mobilenav-accordion.js-accordion
36
39
  a href="#" Admin
@@ -55,12 +58,12 @@ nav.nav.mobilenav
55
58
  - if @option.stage_url.present? || @option.live_url.present?
56
59
  li class=view_site_class
57
60
  - if site_urls_are_present
58
- a href="#" View Site
61
+ a href="#" = t('fae.application.view_site')
59
62
  ul.subnav.js-subnav
60
- li: span.mobilenav-subheader.js-mobile-back View Site
61
- li: a.-viewsite href=@option.stage_url target="_blank" Preview Site
62
- li: a.-viewsite href=@option.live_url target="_blank" Live Site
63
+ li: span.mobilenav-subheader.js-mobile-back = t('fae.application.view_site')
64
+ li: a.-viewsite href=@option.stage_url target="_blank" = t('fae.application.preview_site')
65
+ li: a.-viewsite href=@option.live_url target="_blank" = t('fae.application.live_site')
63
66
  - elsif @option.stage_url.present?
64
- a.-viewsite href=@option.stage_url target="_blank" Preview Site
67
+ a.-viewsite href=@option.stage_url target="_blank" = t('fae.application.preview_site')
65
68
  - elsif @option.live_url.present?
66
- a.-viewsite href=@option.live_url target="_blank" Live Site
69
+ a.-viewsite href=@option.live_url target="_blank" = t('fae.application.live_site')
@@ -28,9 +28,9 @@
28
28
  - if changed.present?
29
29
  tr
30
30
  td = version.created_at
31
- td = version.user.present? ? version.user.full_name : content_tag(:em, "user no longer exists")
31
+ td = version.user.present? ? version.user.full_name : content_tag(:em, t('fae.application.user_absent'))
32
32
  td = changed.join(', ')
33
33
 
34
34
  - else
35
35
  tr
36
- td colspan="3" No logs available.
36
+ td colspan="3" = t('fae.application.no_logs')
@@ -0,0 +1,40 @@
1
+ header.content-header.js-content-header
2
+ h1 = t('fae.deploy.page.heading')
3
+
4
+ == render 'flash_messages'
5
+
6
+ main.content
7
+ - if @deploy_hooks.present?
8
+ - @deploy_hooks.each do |deploy_hook|
9
+ button.button.deploy-button.js-run-deploy data-build-hook-type=deploy_hook.environment href="#" = "#{t('fae.deploy.ctas.deploy')} #{deploy_hook.environment.to_s.titleize}"
10
+
11
+ section.content
12
+ p = t('fae.deploy.table.deploying_helper').html_safe
13
+
14
+ section.content#js-deploying-section
15
+ h2.deploying-heading = t('fae.deploy.table.deploying_heading')
16
+ .js-deploys-list.running
17
+ table
18
+ thead
19
+ tr
20
+ th = t('fae.deploy.table.title')
21
+ th = t('fae.deploy.table.deployed')
22
+ th = t('fae.deploy.table.duration')
23
+ th = t('fae.deploy.table.context')
24
+ th = t('fae.deploy.table.error_msg')
25
+ tbody
26
+
27
+ section.content
28
+ h2 = t('fae.deploy.table.past_heading')
29
+ .js-deploys-list.past
30
+ table
31
+ thead
32
+ tr
33
+ th = t('fae.deploy.table.title')
34
+ th = t('fae.deploy.table.deployed')
35
+ th = t('fae.deploy.table.duration')
36
+ th = t('fae.deploy.table.context')
37
+ th = t('fae.deploy.table.error_msg')
38
+ tbody
39
+
40
+
@@ -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'
@@ -4,10 +4,10 @@ ruby:
4
4
  image_name ||= :image
5
5
  the_image = item.send(image_name)
6
6
  label ||= image_name.to_s.titleize
7
- alt_label ||= "#{label} alt text"
8
- caption_label ||= "#{label} caption"
7
+ alt_label ||= "#{label} Alt Text"
8
+ caption_label ||= "#{label} Caption"
9
9
  helper_text ||= ""
10
- alt_helper_text ||= 'Brief description of image contents, used in hover text and by visually impaired users.'
10
+ alt_helper_text ||= t('fae.images.alt_helper')
11
11
  caption_helper_text ||= ""
12
12
  show_alt = true if show_alt.nil?
13
13
  show_caption ||= false
@@ -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
 
@@ -1,16 +1,19 @@
1
1
  = simple_form_for(@option) do |f|
2
2
  header.content-header.js-content-header
3
3
  h1 Root Settings
4
- .main_content-header-save
5
- a.button#js-header-cancel href=fae.root_path(cancelled: true) Cancel
6
- = f.submit 'Save'
4
+ .content-header-buttons
5
+ a.button#js-header-cancel href=fae.root_path(cancelled: true) = t('fae.form.cancel')
6
+ = f.submit t('fae.form.save')
7
7
 
8
8
  == render 'flash_messages'
9
9
 
10
- section.content
11
- = fae_input f, :title, label: 'Project Name'
10
+ main.content
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, :live_url, label: 'Live URL', helper_text: 'Include http:// for external links.'
14
- = fae_input f, :stage_url, label: 'Stage URL', helper_text: 'Include http:// for external links.'
15
- = fae_image_form f, :logo, helper_text: 'Used on login page, 300x300px .jpg'
13
+ = fae_input f, :live_url, label: t('fae.options.live_url'), helper_text: t('fae.options.url_helper')
14
+ = fae_input f, :stage_url, label: t('fae.options.stage_url'), helper_text: t('fae.options.url_helper')
15
+ = fae_image_form f, :logo, helper_text: t('fae.options.logo_helper')
16
16
  = fae_image_form f, :favicon
17
+
18
+ section.content#deploy_hooks
19
+ == render "fae/deploy_hooks/table"
@@ -1,21 +1,25 @@
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
- == fae_filter_form title: 'Search Changes', action: fae.activity_log_filter_path do
6
- == fae_filter_select :user, options: Fae::User.all.map { |u| [u.full_name, u.id] }
7
- == fae_filter_select :model, options: Fae::Change.unique_changeable_types
8
- == fae_filter_select :type, options: ['created', 'updated', 'deleted']
9
- == fae_filter_select :date, options: ['Last Hour', 'Last Day', 'Last Week', 'Last Month'], placeholder: 'All Time'
6
+ == fae_filter_form title: t('fae.changes.title'), action: fae.activity_log_filter_path do
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'
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
13
17
  tr
14
- th data-sort="user.first_name" User
15
- th data-sort="changeable_type" Item
16
- th data-sort="change_type" Type
17
- th Attribute(s) Updated
18
- th data-sort="updated_at" Modified
18
+ th data-sort="user.first_name" = t('fae.changes.user')
19
+ th data-sort="changeable_type" = t('fae.changes.item')
20
+ th data-sort="change_type" = t('fae.changes.type')
21
+ th = t('fae.changes.attrs')
22
+ th data-sort="updated_at" = t('fae.changes.modified')
19
23
  tbody
20
24
  - if @items.present?
21
25
  - @items.each do |change|
@@ -27,6 +31,6 @@ main.content
27
31
  td = fae_datetime_format(change.updated_at)
28
32
  - else
29
33
  tr
30
- td colspan=5 No changes recorded
34
+ td colspan=5 = t('fae.changes.no_changes')
31
35
 
32
36
  == fae_paginate @items
@@ -1,4 +1,4 @@
1
1
  .center
2
2
  .sad_face
3
- h1 Disabled Admin
4
- p The admin on this domain has been disabled. This usually occurs on a staging domain where content is managed in production. Contact application support for more information.
3
+ h1 = t('fae.page.disabled_title')
4
+ p = t('fae.page.disabled_text')
@@ -2,6 +2,8 @@
2
2
  .sad_face
3
3
  h1 Oops!
4
4
  p
5
- | The page you requested can not be found. Please&nbsp;
6
- a href=fae.root_path click here
7
- | &nbsp;to be taken to our home page.
5
+ = t('fae.page.error_start')
6
+ |&nbsp;
7
+ a href=fae.root_path = t('fae.page.click')
8
+ | &nbsp;
9
+ = t('fae.page.error_end')
@@ -1,25 +1,36 @@
1
1
  header.content-header.js-content-header.-dashboard
2
- i.icon-home>
3
- | &nbsp;&nbsp;Welcome,
4
- strong< = current_user.full_name
2
+ div
3
+ i.icon-home>
4
+ | &nbsp;&nbsp;
5
+ = t('fae.page.hello')
6
+ strong< = current_user.full_name
5
7
 
6
8
  == render 'flash_messages'
7
9
 
8
- main.content
9
- table.js-sort-column
10
- thead
11
- tr
12
- th Name
13
- th Type
14
- th.-action-wide Modified
15
- tbody
16
- - @list.each do |item|
17
- - begin
18
- - parent = item.respond_to?(:fae_parent) ? item.fae_parent : nil
19
- - edit_path = edit_polymorphic_path([main_app, fae_scope, parent, item])
20
- - index_path = polymorphic_path([main_app, fae_scope, parent, item.class.to_s.pluralize.underscore])
21
- tr
22
- td: a href=edit_path = item.fae_display_field
23
- td: a href=index_path = item.class.to_s
24
- td = fae_date_format item.updated_at
25
- - rescue
10
+ - if @models.any?
11
+ main.content
12
+ table.js-sort-column
13
+ thead
14
+ tr
15
+ th = t('fae.common.name')
16
+ th = t('fae.changes.type')
17
+ th.-action-wide = t('fae.changes.modified')
18
+ tbody
19
+ - @list.each do |item|
20
+ - begin
21
+ - parent = item.respond_to?(:fae_parent) ? item.fae_parent : nil
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])
24
+ tr
25
+ td: a href=edit_path = item.fae_display_field
26
+ td: a href=index_path = item.class.to_s
27
+ td = fae_date_format item.updated_at
28
+ - rescue
29
+ - else
30
+ section.help-section
31
+ article.content
32
+ h2 = t('fae.page.welcome')
33
+ p
34
+ = t('fae.page.no_objs_start')
35
+ br
36
+ a href="https://www.faecms.com/documentation/quickstart-guide" target="_blank" = t('fae.page.no_objs_end')
@@ -1,11 +1,11 @@
1
1
  .first_user-form
2
- p Please create your super admin user.
2
+ p = t('fae.setup.prompt')
3
3
 
4
4
  = simple_form_for(@user, html: { multipart: true, novalidate: true }, url: fae.first_user_path) do |f|
5
5
  = fae_input f, :first_name
6
6
  = fae_input f, :last_name
7
7
  = fae_input f, :email
8
- = fae_input f, :password, helper_text: 'Passwords must contain at least 8 characters.'
8
+ = fae_input f, :password, helper_text: t('fae.setup.password')
9
9
  = fae_input f, :password_confirmation
10
10
  .login-form-actions
11
- = f.button :submit, "Submit"
11
+ input name="commit" type="submit" value=t('fae.form.save')
@@ -1,40 +1,44 @@
1
1
  ruby:
2
2
  require_locals ['header'], local_assigns
3
- save_button_text ||= 'Save'
4
- cancel_button_text ||= 'Cancel'
5
- cloneable ||= false
6
- clone_button_text ||= '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
- language ||= false # @depreciation - remove in favor of `languages` in v2.0
13
- languages ||= language
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
- - if breadcrumb
16
- == render 'breadcrumb', title: title
17
- - else
18
- = form_header header
16
+ header.content-header.js-content-header
17
+ - if breadcrumb
18
+ == render 'breadcrumb', title: title
19
+ - else
20
+ = form_header header
19
21
 
20
- .content-header-buttons
21
- - if languages
22
- - selected = current_user.language || ''
22
+ .content-header-buttons
23
+ - if languages
24
+ - selected = current_user.language || ''
23
25
 
24
- .content-header-select
25
- = select_tag 'fae-languages', options_for_select(Fae.languages.map(&:reverse), selected), id: 'js-language', class: 'small_pulldown', prompt: 'All Languages'
26
+ .content-header-select
27
+ = select_tag 'fae-languages', options_for_select(Fae.languages.map(&:reverse), selected), id: 'js-language', class: 'small_pulldown', prompt: 'All Languages'
26
28
 
27
- a.button#js-header-cancel href=@index_path = cancel_button_text
28
- - if cloneable.present? && params[:id].present?
29
- a.button data-method="post" href="#{@index_path}?from_existing=#{params[:id]}" = clone_button_text
30
- input name="commit" type="submit" value=save_button_text
29
+ - if Fae.use_form_manager
30
+ a.button.js-launch-form-manager href='#' = launch_manager_text
31
31
 
32
- - if subnav.present?
33
- ul.content-header-subnav#js-content-header-subnav
34
- ruby:
35
- # @depreciation - remove conditional when Rails 4 support is dropped, below becomes:
36
- # link.parameterize(separator: '_')
37
- parameterize_argument = Rails::VERSION::MAJOR == 4 ? '_' : { separator: '_' }
38
- - subnav.each do |link, id_selector|
39
- - subnav_item = link.is_a?(Array) ? link : [link, link.parameterize(parameterize_argument)]
40
- li: a href="##{subnav_item[1]}" = subnav_item[0]
32
+ a.button#js-header-cancel href=@index_path = cancel_button_text
33
+ - if cloneable.present? && params[:id].present?
34
+ a.button#js-header-clone data-method="post" href="#{@index_path}?from_existing=#{params[:id]}" = clone_button_text
35
+ input name="commit" type="submit" value=save_button_text
36
+
37
+ - if subnav.present?
38
+ ul.content-header-subnav#js-content-header-subnav
39
+ - subnav.each do |link, id_selector|
40
+ - subnav_item = link.is_a?(Array) ? link : [link, link.parameterize(separator: '_')]
41
+ li: a href="##{subnav_item[1]}" = subnav_item[0]
42
+
43
+ - if show_flash_messages
44
+ == render 'fae/shared/errors'
@@ -3,7 +3,8 @@ ruby:
3
3
  title ||= @klass_humanized.pluralize.titleize
4
4
  new_button = !local_assigns[:new_button].eql?(false)
5
5
  new_path ||= "new_#{fae_path}_#{@klass_singular}_path"
6
- button_text ||= "Add #{title.singularize}"
6
+ button_text ||= t('fae.common.add', title: title.singularize)
7
+ export_text ||= t('fae.common.csv_export')
7
8
  csv ||= false
8
9
  breadcrumb = !local_assigns[:breadcrumbs].eql?(false)
9
10
 
@@ -15,7 +16,7 @@ header.content-header.js-content-header
15
16
 
16
17
  .content-header-buttons
17
18
  - if csv && @items.present?
18
- a.button href="#{@index_path}.csv" Export to CSV
19
+ a.button href="#{@index_path}.csv" = export_text
19
20
 
20
21
  - if new_button
21
22
  - if nested
@@ -9,10 +9,9 @@ ruby:
9
9
 
10
10
  # optional locals
11
11
  assoc_name ||= assoc.to_s # 'restaurant_bars'
12
- # @depreciation - remove header option in v2.0
13
- header ||= assoc_name.titleize # 'Restaurant Bars'
14
- title ||= header
15
- add_button_text ||= "Add #{title.singularize}"
12
+ title ||= assoc_name.titleize # 'Restaurant Bars'
13
+ add_button_text ||= t('fae.common.add', title: title.singularize)
14
+ hide_add_button ||= false
16
15
  ordered ||= false
17
16
  has_thumb ||= false
18
17
  edit_column ||= false
@@ -35,7 +34,7 @@ ruby:
35
34
  new_path += "item_id=#{parent_item.id}&=item_class=#{parent_item.class.to_s}"
36
35
  end
37
36
 
38
- options_for_table = { index: index, assoc: assoc, assoc_name: assoc_name, title: title, header: header, 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 }
37
+ 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, 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 }
39
38
  options_for_table[:parent_item] = parent_item unless index
40
39
 
41
40
  section.addedit-form.js-addedit-form class="#{'content' if index}"
@@ -43,7 +42,8 @@ section.addedit-form.js-addedit-form class="#{'content' if index}"
43
42
  == render 'fae/shared/shared_nested_table', options_for_table
44
43
 
45
44
  - else
46
- a.js-add-link.table-add-link.button.-small href=new_path = add_button_text
45
+ - unless hide_add_button
46
+ a.js-add-link.table-add-link.button.-small href=new_path = add_button_text
47
47
  h2 = title
48
48
  - if helper_text.present?
49
49
  h6.table-helper-text = helper_text
@@ -1,14 +1,14 @@
1
1
  - unless params[:action] == 'new'
2
2
  .content#recent_changes
3
- h2 Recent Changes
3
+ h2 = t('fae.changes.recent')
4
4
  section.addedit-form.js-addedit-form
5
5
  table
6
6
  thead
7
7
  tr
8
- th User
9
- th Type
10
- th Attribute(s) Updated
11
- th.-action-wide Modified
8
+ th = t('fae.changes.user')
9
+ th = t('fae.changes.type')
10
+ th = t('fae.changes.attrs')
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|
@@ -19,4 +19,4 @@
19
19
  td = fae_datetime_format(change.updated_at)
20
20
  - else
21
21
  tr
22
- td colspan="4" No changes recorded
22
+ td colspan="4" = t('fae.changes.no_changes')
@@ -33,14 +33,17 @@ table class=table_class
33
33
  = td_columns(options_for_td)
34
34
  - if edit_column
35
35
  td
36
- a.js-edit-link.js-tooltip.table-action title="Edit" href=self.send(edit_path, item)
36
+ a.js-edit-link.js-tooltip.table-action title=t('fae.common.edit') href=self.send(edit_path, item)
37
37
  i.icon-edit
38
38
  td = fae_delete_button item, "/#{fae_path}/#{assoc_name}/#{item.id.to_s}", class: 'js-tooltip table-action js-delete-link', remote: true
39
39
 
40
- - else
40
+ - elsif !hide_add_button
41
41
  tr
42
42
  - td_link = link_to 'add some', new_path, class: 'js-add-link'
43
43
 
44
44
  td colspan=colspan.to_s No #{title} yet, #{td_link}.
45
+ - else
46
+ tr
47
+ td colspan=colspan.to_s No #{title} yet.
45
48
 
46
49
  .js-addedit-form-wrapper
@@ -1,10 +1,10 @@
1
- == render 'fae/shared/index_header', title: 'Pages', breadcrumbs: false, new_button: false
1
+ == render 'fae/shared/index_header', title: t('fae.page.title'), breadcrumbs: false, new_button: false
2
2
 
3
3
  main.content
4
4
  table.js-sort-column
5
5
  thead
6
6
  tr
7
- th Name
7
+ th = t('fae.common.name')
8
8
  th.-action-wide Modified
9
9
  tbody
10
10
  - @items.each do |item|