binda 0.1.3 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (132) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +83 -25
  3. data/app/assets/javascripts/binda/application.js +3 -3
  4. data/app/assets/javascripts/binda/components/bootstrap.js +3 -4
  5. data/app/assets/javascripts/binda/components/field_group_editor.js +10 -10
  6. data/app/assets/javascripts/binda/components/field_setting_choices.js +61 -49
  7. data/app/assets/javascripts/binda/components/fileupload.js +135 -118
  8. data/app/assets/javascripts/binda/components/form_item.js +65 -65
  9. data/app/assets/javascripts/binda/components/form_item_editor.js +19 -19
  10. data/app/assets/javascripts/binda/components/form_item_image.js +11 -13
  11. data/app/assets/javascripts/binda/components/form_item_repeater.js +77 -71
  12. data/app/assets/javascripts/binda/components/login-shader.js +171 -164
  13. data/app/assets/javascripts/binda/components/login_form.js +65 -73
  14. data/app/assets/javascripts/binda/components/radio-toggle.js +8 -12
  15. data/app/assets/javascripts/binda/components/select2.js +19 -14
  16. data/app/assets/javascripts/binda/components/sortable.js +76 -71
  17. data/app/assets/javascripts/binda/dist/binda.bundle.js +735 -727
  18. data/app/assets/javascripts/binda/index.js +49 -35
  19. data/app/assets/stylesheets/binda/components/assets_manager.scss +13 -22
  20. data/app/assets/stylesheets/binda/components/b-alert.scss +18 -14
  21. data/app/assets/stylesheets/binda/components/b-btn.scss +24 -43
  22. data/app/assets/stylesheets/binda/components/field_setting_choices.scss +16 -31
  23. data/app/assets/stylesheets/binda/components/fileupload.scss +25 -42
  24. data/app/assets/stylesheets/binda/components/form_item.scss +51 -93
  25. data/app/assets/stylesheets/binda/components/form_item_choices.scss +7 -10
  26. data/app/assets/stylesheets/binda/components/login.scss +2 -2
  27. data/app/assets/stylesheets/binda/components/main_header.scss +5 -10
  28. data/app/assets/stylesheets/binda/components/main_sidebar.scss +42 -46
  29. data/app/assets/stylesheets/binda/components/main_sortable_table.scss +12 -21
  30. data/app/assets/stylesheets/binda/components/main_table.scss +18 -35
  31. data/app/assets/stylesheets/binda/components/popup_warning.scss +14 -27
  32. data/app/assets/stylesheets/binda/components/select2.scss +46 -48
  33. data/app/assets/stylesheets/binda/components/sortable.scss +25 -45
  34. data/app/assets/stylesheets/binda/components/standard-form.scss +43 -73
  35. data/app/assets/stylesheets/binda/controllers/users_sessions_new.scss +52 -89
  36. data/app/assets/stylesheets/binda/index.scss +0 -1
  37. data/app/assets/stylesheets/binda/settings/buttons.scss +9 -10
  38. data/app/assets/stylesheets/binda/settings/common.scss +17 -22
  39. data/app/assets/stylesheets/binda/settings/fonts.scss +112 -67
  40. data/app/assets/stylesheets/binda/settings/tiny_mce_overrides.scss +20 -36
  41. data/app/assets/stylesheets/binda/settings/variables.scss +38 -43
  42. data/app/controllers/binda/choices_controller.rb +14 -11
  43. data/app/controllers/binda/components_controller.rb +6 -4
  44. data/app/controllers/binda/structures_controller.rb +7 -3
  45. data/app/helpers/binda/components_helper.rb +69 -3
  46. data/app/helpers/binda/field_groups_helper.rb +16 -6
  47. data/app/helpers/binda/structures_helper.rb +1 -4
  48. data/app/models/binda/application_record.rb +4 -1
  49. data/app/models/binda/asset.rb +3 -1
  50. data/app/models/binda/b.rb +1 -0
  51. data/app/models/binda/category.rb +1 -0
  52. data/app/models/binda/checkbox.rb +2 -0
  53. data/app/models/binda/choice.rb +74 -41
  54. data/app/models/binda/component.rb +1 -1
  55. data/app/models/binda/date.rb +4 -0
  56. data/app/models/binda/deprecation.rb +7 -0
  57. data/app/models/binda/field_group.rb +16 -3
  58. data/app/models/binda/field_setting.rb +168 -41
  59. data/app/models/binda/image.rb +1 -0
  60. data/app/models/binda/radio.rb +2 -0
  61. data/app/models/binda/relation.rb +3 -0
  62. data/app/models/binda/repeater.rb +3 -0
  63. data/app/models/binda/selection.rb +237 -0
  64. data/app/models/binda/string.rb +4 -0
  65. data/app/models/binda/structure.rb +25 -14
  66. data/app/models/binda/text.rb +9 -0
  67. data/app/models/binda/video.rb +1 -0
  68. data/app/models/concerns/binda/default_helpers.rb +40 -31
  69. data/app/models/concerns/binda/deprecations.rb +6 -0
  70. data/app/models/concerns/binda/fieldable_association_helpers.rb +366 -0
  71. data/app/models/concerns/binda/fieldable_associations.rb +32 -369
  72. data/app/views/binda/boards/edit.html.erb +15 -2
  73. data/app/views/binda/categories/_form.html.erb +24 -51
  74. data/app/views/binda/categories/edit.html.erb +23 -3
  75. data/app/views/binda/categories/index.html.erb +49 -25
  76. data/app/views/binda/categories/new.html.erb +21 -2
  77. data/app/views/binda/components/edit.html.erb +27 -4
  78. data/app/views/binda/components/index.html.erb +47 -50
  79. data/app/views/binda/components/new.html.erb +12 -2
  80. data/app/views/binda/components/sort_index.html.erb +28 -13
  81. data/app/views/binda/field_groups/_form_body.html.erb +43 -82
  82. data/app/views/binda/field_groups/_form_item.html.erb +3 -120
  83. data/app/views/binda/field_groups/_form_section.html.erb +11 -16
  84. data/app/views/binda/field_groups/_form_section_repeater.html.erb +7 -15
  85. data/app/views/binda/field_groups/edit.html.erb +14 -2
  86. data/app/views/binda/field_groups/form_item/_form_item_choice_editor.html.erb +11 -0
  87. data/app/views/binda/field_groups/form_item/_form_item_editor.html.erb +14 -0
  88. data/app/views/binda/field_groups/form_item/_form_item_header.html.erb +25 -0
  89. data/app/views/binda/field_groups/form_item/_form_item_new_editor.html.erb +8 -0
  90. data/app/views/binda/field_groups/form_item/_form_item_persisted_editor.html.erb +27 -0
  91. data/app/views/binda/field_groups/form_item/form_item_choice/_form_item_allow_null_choice.html.erb +11 -0
  92. data/app/views/binda/field_groups/form_item/form_item_choice/_form_item_choice_header.html.erb +11 -0
  93. data/app/views/binda/field_groups/form_item/form_item_choice/_form_item_default_choice.html.erb +11 -0
  94. data/app/views/binda/field_groups/form_item/form_item_choice/_form_item_new_choice.html.erb +16 -0
  95. data/app/views/binda/field_groups/form_item/form_item_choice/_form_item_persisted_choices.html.erb +16 -0
  96. data/app/views/binda/field_groups/new.html.erb +14 -2
  97. data/app/views/binda/field_settings/_form_body.html.erb +1 -3
  98. data/app/views/binda/field_settings/edit.html.erb +1 -1
  99. data/app/views/binda/field_settings/new.html.erb +1 -1
  100. data/app/views/binda/fieldable/_form_body.html.erb +24 -72
  101. data/app/views/binda/fieldable/_form_item_date.html.erb +1 -4
  102. data/app/views/binda/fieldable/_form_item_image.html.erb +3 -7
  103. data/app/views/binda/fieldable/_form_item_new_repeater.html.erb +0 -13
  104. data/app/views/binda/fieldable/_form_item_selections.html.erb +20 -112
  105. data/app/views/binda/fieldable/form_item_selections/_form_item_checkbox.html.erb +34 -0
  106. data/app/views/binda/fieldable/form_item_selections/_form_item_radio.html.erb +28 -0
  107. data/app/views/binda/fieldable/form_item_selections/_form_item_selection.html.erb +30 -0
  108. data/app/views/binda/manage/users/_form_body.html.erb +1 -31
  109. data/app/views/binda/manage/users/edit.html.erb +12 -2
  110. data/app/views/binda/manage/users/index.html.erb +36 -19
  111. data/app/views/binda/manage/users/new.html.erb +14 -3
  112. data/app/views/binda/structures/_form_body.html.erb +2 -25
  113. data/app/views/binda/structures/_form_section.html.erb +43 -65
  114. data/app/views/binda/structures/_form_sidebar.html.erb +19 -12
  115. data/app/views/binda/structures/edit.html.erb +20 -3
  116. data/app/views/binda/structures/index.html.erb +46 -26
  117. data/app/views/binda/structures/new.html.erb +13 -2
  118. data/app/views/binda/structures/sort_index.html.erb +37 -17
  119. data/app/views/binda/users/sessions/new.html.erb +25 -20
  120. data/app/views/layouts/binda/_form_errors.html.erb +10 -0
  121. data/app/views/layouts/binda/_sidebar.html.erb +6 -6
  122. data/app/views/layouts/binda/application.html.erb +1 -1
  123. data/config/initializers/carrierwave.rb +3 -2
  124. data/config/locales/en.yml +56 -12
  125. data/config/tinymce.yml +2 -2
  126. data/db/migrate/1_create_binda_tables.rb +1 -1
  127. data/lib/binda/version.rb +1 -1
  128. data/lib/generators/binda/setup/setup_generator.rb +2 -2
  129. data/lib/tasks/add_default_choice_to_all_selections_with_no_choices_task.rake +6 -0
  130. metadata +58 -8
  131. data/app/assets/stylesheets/binda/components/form_item_image.scss +0 -0
  132. data/app/views/binda/field_groups/_form_item_choice.erb +0 -104
@@ -1,15 +1,23 @@
1
1
  <div class="standard-form--header">
2
- <small><%= "#{ t :publish }".capitalize %></small>
2
+ <small>
3
+ <%= "#{ t :publish }".capitalize %>
4
+ </small>
3
5
  </div>
4
-
5
6
  <div class="standard-form--radio">
6
7
  <%= f.input :instance_type,
7
8
  as: :radio_buttons,
8
9
  collection: ['component','board'],
9
10
  include_blank: false,
10
11
  label_method: -> (x){ "<span class=\"standard-form--input-box\"></span>#{x}".html_safe }%>
11
-
12
12
  </div>
13
+ <div class="standard-form--radio">
14
+ <%= f.input :has_preview,
15
+ label: "<span class=\"standard-form--input-box\"></span>#{ t('binda.has_preview')}".html_safe,
16
+ as: :boolean,
17
+ include_blank: false,
18
+ hint: "#{t('binda.preview_path_warning')}:<br /> #{binda.root_path}#{@structure.slug}/:slug".html_safe %>
19
+ </div>
20
+
13
21
  <% if !@structure.new_record? && @structure.instance_type == 'component' %>
14
22
  <div class="standard-form--radio">
15
23
  <%= f.input :has_categories,
@@ -18,18 +26,17 @@
18
26
  include_blank: false,
19
27
  hint: t('binda.has_categories_hint') %>
20
28
  </div>
21
- <div class="standard-form--radio">
22
- <%= f.input :has_preview,
23
- label: "<span class=\"standard-form--input-box\"></span>#{ t('binda.has_preview')}".html_safe,
24
- as: :boolean,
25
- include_blank: false,
26
- hint: "#{t('binda.preview_path_warning')}:<br /> #{binda.root_path}#{@structure.slug}/:slug".html_safe %>
27
- </div>
28
29
  <% end %>
29
30
  <div class="standard-form--main-actions">
30
31
  <%= button_tag '<i class="fas fa-check"></i>Save changes'.html_safe, { class: 'b-btn-block b-btn b-btn-primary b-btn-settings', id: 'save' } %>
31
-
32
32
  <% unless @structure.new_record? %>
33
- <a class="form-body--delete b-btn-block b-btn b-btn-outline-danger b-btn-settings" href="<%= url_for([@structure]) %>" data-method="delete" data-confirm="This operation will delete this structure and there is no coming back. Are you ok with that?"><i class="far fa-trash-alt"></i> <%= t('binda.delete').capitalize %> <%= @structure.name.capitalize %></a>
33
+ <a class="form-body--delete b-btn-block b-btn b-btn-outline-danger b-btn-settings"
34
+ href="<%= url_for([@structure]) %>"
35
+ data-method="delete"
36
+ data-confirm="<%= t('binda.structure.confirm_delete') %>">
37
+ <i class="far fa-trash-alt"></i>
38
+ <%= t('binda.delete').capitalize %>
39
+ <%= @structure.name.capitalize %>
40
+ </a>
34
41
  <% end %>
35
42
  </div>
@@ -1,11 +1,28 @@
1
+ <% content_for :title do %>
2
+ <%= t('binda.edit_structure', { arg1: @structure.name })%>
3
+ <% end %>
4
+
5
+
1
6
  <% content_for :header do %>
2
7
  <div class="main-header--buttons">
3
- <%= link_to "<i class=\"fa fa-plus\" aria-hidden=\"true\"></i> New Structure".html_safe, new_structure_path, class: 'main-header--link b-btn b-btn-primary' %>
8
+ <a href="<%= new_structure_path %>"
9
+ class="main-header--link b-btn b-btn-primary"
10
+ test-hook="new-structure-btn">
11
+ <i class="fa fa-plus" aria-hidden="true"></i>
12
+ <%= t('binda.new_structure') %>
13
+ </a>
4
14
  </div>
5
- <p class="main-header--title"><%= t('binda.edit_structure', { arg1: @structure.name })%></p>
6
- <a href="<%= structures_path %>" class="main-header--back"><span class="glyphicon glyphicon-list"></span> Back to list</a>
15
+ <p class="main-header--title">
16
+ <%= t('binda.edit_structure', { arg1: @structure.name })%>
17
+ </p>
18
+ <a href="<%= structures_path %>"
19
+ class="main-header--back">
20
+ <i class="fas fa-list-ul"></i>
21
+ <%= "#{ t :back_to_index }".capitalize %>
22
+ </a>
7
23
  <% end %>
8
24
 
25
+
9
26
  <% content_for :content do %>
10
27
  <%= render 'form_body', structure: @structure %>
11
28
  <% end %>
@@ -1,41 +1,61 @@
1
+ <% content_for :title do %>
2
+ <%= t('binda.structure.plural') %>
3
+ <% end %>
4
+
5
+
1
6
  <% content_for :header do %>
2
7
  <div class="main-header--buttons">
3
- <%= link_to "<i class=\"fa fa-plus\" aria-hidden=\"true\"></i> New Structure".html_safe, new_structure_path, class: 'main-header--link b-btn b-btn-primary' %>
8
+ <a href="<%= new_structure_path %>"
9
+ class="main-header--link b-btn b-btn-primary">
10
+ <i class="fa fa-plus" aria-hidden="true"></i>
11
+ <%= t('binda.new_structure') %>
12
+ </a>
4
13
  <%= get_structures_sort_index_link %>
5
14
  </div>
6
- <p class="main-header--title">Structures</p>
15
+ <p class="main-header--title">
16
+ <%= t('binda.structure.plural') %>
17
+ </p>
7
18
  <% end %>
8
19
 
20
+
9
21
  <% content_for :content do %>
10
22
  <div class="main-table--container">
23
+ <table class="standard-form--container">
24
+ <thead class="standard-form--header">
25
+ <tr>
26
+ <th colspan="7"><%= t('binda.structure.plural') %></th>
27
+ <th colspan="3"></th>
28
+ </tr>
29
+ </thead>
30
+ <tbody>
31
+ <% @structures.order( :name ).each do |structure| %>
32
+ <tr class="main-table--hover" id="structure_<%= structure.id %>">
11
33
 
12
- <table class="standard-form--container">
13
- <thead class="standard-form--header">
14
- <tr>
15
- <th>Structures</th>
16
- <th style="width: 30%"></th>
34
+ <td colspan="7"><%= link_to structure.name, structure_path(structure) %></td>
35
+ <td colspan="3" class="main-table--actions">
36
+ <a href="<%= edit_structure_path(structure) %>">
37
+ <i class="fas fa-pencil-alt"></i>
38
+ <%= t('binda.edit') %>
39
+ </a>
40
+ <a href="<%= structure_path(structure) %>"
41
+ class="text-destroy"
42
+ data-method="delete"
43
+ data-confirm="<%= t('binda.structure.confirm_delete') %>">
44
+ <i class="far fa-trash-alt"></i>
45
+ <%= t('binda.delete') %>
46
+ </a>
47
+ </td>
17
48
  </tr>
18
- </thead>
19
-
20
- <tbody>
21
- <% @structures.order( :name ).each do |structure| %>
22
- <tr class="main-table--hover" id="structure_<%= structure.id %>">
23
-
24
- <td><%= link_to structure.name, structure_path(structure) %></td>
25
- <td class="main-table--actions">
26
- <%= link_to "<i class=\"fas fa-pencil-alt\"></i> Edit".html_safe, edit_structure_path(structure) %>
27
- <%= link_to "<i class=\"far fa-trash-alt\"></i> Destroy".html_safe, structure, method: :delete, data: { confirm: 'Are you sure?' }, class: 'text-destroy' %>
28
- </td>
29
- </tr>
30
- <% end %>
31
- <tbody>
32
- </table>
33
-
49
+ <% end %>
50
+ <tbody>
51
+ </table>
34
52
  <div class="b-btn--container">
35
53
  <%= paginate @structures %>
36
- <%= link_to "<i class=\"fa fa-plus\" aria-hidden=\"true\"></i> New Structure".html_safe, new_structure_path, class: 'main-header--link b-btn b-btn-primary' %>
54
+ <a href="<%= new_structure_path %>"
55
+ class="main-header--link b-btn b-btn-primary">
56
+ <i class="fa fa-plus" aria-hidden="true"></i>
57
+ <%= t('binda.new_structure') %>
58
+ </a>
37
59
  </div>
38
-
39
60
  </div>
40
-
41
61
  <% end %>
@@ -1,8 +1,19 @@
1
+ <% content_for :title do %>
2
+ <%= t('binda.new_structure') %>
3
+ <% end %>
4
+
1
5
  <% content_for :header do %>
2
- <h3>New Structure</h3>
3
- <a href="<%= structures_path %>" class="main-header--back"><span class="glyphicon glyphicon-list"></span> Back to list</a>
6
+ <h3>
7
+ <%= t('binda.new_structure') %>
8
+ </h3>
9
+ <a href="<%= structures_path %>"
10
+ class="main-header--back">
11
+ <i class="fas fa-list-ul"></i>
12
+ <%= "#{ t :back_to_index }".capitalize %>
13
+ </a>
4
14
  <% end %>
5
15
 
16
+
6
17
  <% content_for :content do %>
7
18
  <%= render 'form_body', structure: @structure %>
8
19
  <% end %>
@@ -1,36 +1,56 @@
1
+ <% content_for :title do %>
2
+ <%= t 'binda.structure.plural' %>
3
+ <% end %>
4
+
1
5
  <% content_for :header do %>
2
6
  <div class="main-header--buttons">
3
- <%= link_to "<i class=\"fa fa-plus\" aria-hidden=\"true\"></i> New Structure".html_safe, new_structure_path, class: 'main-header--link b-btn b-btn-primary' %>
7
+ <a href="<%= new_structure_path %>"
8
+ class="main-header--link b-btn b-btn-primary">
9
+ <i class="fa fa-plus" aria-hidden="true"></i>
10
+ <%= t('binda.new_structure') %>
11
+ </a>
4
12
  </div>
5
- <p class="main-header--title"><%= t 'binda.structures' %></p>
13
+ <p class="main-header--title">
14
+ <%= t 'binda.structure.plural' %>
15
+ </p>
6
16
  <% end %>
7
17
 
8
- <% content_for :content do %>
9
18
 
19
+ <% content_for :content do %>
10
20
  <%= render 'layouts/binda/popup_warning' %>
11
-
12
21
  <div class="main-table--container">
13
- <h5 class="text-muted"><%= t('binda.sort_index_hint', { arg1: t('binda.structures').downcase }).html_safe %></h5>
14
-
22
+ <h5 class="text-muted">
23
+ <%= t('binda.sort_index_hint', { arg1: t('binda.structure.plural').downcase }).html_safe %>
24
+ </h5>
15
25
  <div class="main-sortable-table">
16
26
  <div class="main-sortable-table--header-row">
17
27
  <div class="main-sortable-table--header-title">
18
- <p>Structures</p>
28
+ <p>
29
+ <%= t('binda.structure.plural') %>
30
+ </p>
19
31
  </div>
20
32
  </div>
21
- <div id="structures--sort-index" class="sortable" data-update-url="<%= structures_sort_path() %>" data-message="<%= t 'binda.sort_items_loader', { arg1: t('binda.components').downcase } %>">
22
- <% @structures.order( :name ).each do |structure| %>
23
- <div id="structure_<%= structure.id %>" class="main-sortable-table--row ui-sortable-handle">
24
- <div class="main-sortable-table--row-cell">
25
- <p><%= structure.name %></p>
33
+ <div id="structures--sort-index"
34
+ class="sortable"
35
+ data-update-url="<%= structures_sort_path() %>"
36
+ data-message="<%= t 'binda.sort_items_loader', { arg1: t('binda.components').downcase } %>">
37
+ <% @structures.order( :name ).each do |structure| %>
38
+ <div id="structure_<%= structure.id %>"
39
+ class="main-sortable-table--row ui-sortable-handle">
40
+ <div class="main-sortable-table--row-cell">
41
+ <p>
42
+ <%= structure.name %>
43
+ </p>
44
+ </div>
26
45
  </div>
27
- </div>
28
- <% end %>
46
+ <% end %>
29
47
  </div>
30
48
  </div>
31
49
  </div>
32
-
33
50
  <%= paginate @structures %>
34
- <%= link_to "<i class=\"fa fa-plus\" aria-hidden=\"true\"></i> New Structure".html_safe, new_structure_path, class: 'main-header--link b-btn b-btn-primary' %>
35
-
51
+ <a href="<%= new_structure_path %>"
52
+ class="main-header--link b-btn b-btn-primary">
53
+ <i class="fa fa-plus" aria-hidden="true"></i>
54
+ <%= t('binda.new_structure') %>
55
+ </a>
36
56
  <% end %>
@@ -1,25 +1,37 @@
1
+ <% content_for :title do %>
2
+ <%= t('binda.login_welcome', { arg1: get_website_name }) %>
3
+ <% end %>
4
+
5
+
1
6
  <% content_for :background do %>
2
7
  <div id="background-shader">
3
8
  <%= render 'binda/users/sessions/background' %>
4
9
  </div>
5
10
  <div class="login--header">
6
- <p><%= t('binda.login_welcome', { arg1: get_website_name }) %></p>
11
+ <p>
12
+ <%= t('binda.login_welcome', { arg1: get_website_name }) %>
13
+ </p>
7
14
  </div>
8
15
  <div class="login--footer">
9
- <a href="https://github.com/lacolonia/binda" target="_blank"><%= t('binda.login_credit', { arg1: Binda::VERSION.to_s }) %></a>
16
+ <a href="https://github.com/lacolonia/binda" target="_blank">
17
+ <%= t('binda.login_credit', { arg1: Binda::VERSION.to_s }) %>
18
+ </a>
10
19
  </div>
11
20
  <% end %>
12
21
 
13
- <div class="login">
14
-
15
- <%= simple_form_for resource, as: resource_name, url: session_path(resource_name), html: { class: 'login--form'} do |f| %>
16
22
 
23
+ <div class="login">
24
+ <%= simple_form_for resource,
25
+ as: resource_name,
26
+ url: session_path(resource_name),
27
+ html: { class: 'login--form'} do |f| %>
17
28
  <div class="form-inputs">
18
29
  <ol class="login--questions">
19
30
  <li>
20
31
  <span>
21
32
  <label for="email">
22
- <i class="far fa-user"></i> <%= t 'binda.login_email' %>
33
+ <i class="far fa-user"></i>
34
+ <%= t 'binda.login_email' %>
23
35
  </label>
24
36
  </span>
25
37
  <%= f.input 'email', label: false %>
@@ -27,36 +39,29 @@
27
39
  <li>
28
40
  <span>
29
41
  <label for="password">
30
- <i class="fas fa-key"></i> <%= t 'binda.login_password' %>
42
+ <i class="fas fa-key"></i>
43
+ <%= t 'binda.login_password' %>
31
44
  </label>
32
45
  </span>
33
46
  <%= f.input 'password', label: false %>
34
47
  </li>
35
48
  </ol>
36
49
  </div>
37
-
38
-
39
50
  <div class="login--controls">
40
-
41
51
  <button class="login--next login--show"></button>
42
-
43
52
  <div class="update-form--button form-actions login--submit-button">
44
53
  <%= button_tag '<i class="fas fa-check"></i> ->'.html_safe, {
45
54
  class: 'b-btn b-btn-primary b-btn-alternative',
46
55
  id: 'save',
47
56
  } %>
48
57
  </div>
49
-
50
58
  <div class="form-inputs login--radio-button">
51
- <input type="radio" name="login" id="remember" data-waschecked="true"><label for="remember"><span></span>Remember me</label>
59
+ <input type="radio" name="login" id="remember" data-waschecked="true">
60
+ <label for="remember">
61
+ <span></span> <%= t('binda.remember_me') %>
62
+ </label>
52
63
  </div>
53
-
54
64
  </div>
55
-
56
65
  <% end %>
57
-
58
66
  <%= render "binda/users/shared/links" %>
59
-
60
- </div>
61
-
62
-
67
+ </div>
@@ -0,0 +1,10 @@
1
+ <% if f.object.errors.any? %>
2
+ <div class="standard-form--error-explanation b-alert b-alert--error">
3
+ <%= t('binda.standard_form_error_heading') %> <%= pluralize(f.object.errors.count, t("binda.standard_form_error")) %>:
4
+ <ul>
5
+ <% f.object.errors.full_messages.each do |msg| %>
6
+ <li><%= msg %></li>
7
+ <% end %>
8
+ </ul>
9
+ </div>
10
+ <% end %>
@@ -22,19 +22,19 @@
22
22
  <% if structure.instance_type == 'component' %>
23
23
  <li class="main-sidebar--structure <%= 'main-sidebar--first-structure' if index == 0 %>">
24
24
  <a href="<%= structure_components_path( structure ) %>">
25
- <span class="glyphicon glyphicon-th-list" aria-hidden="true"></span>
25
+ <i class="fas fa-list-ul"></i>
26
26
  <%= structure.name.humanize.pluralize %>
27
27
  </a>
28
28
  <% if structure.has_categories %>
29
29
  <a class="main-sidebar--sub-link" href="<%= structure_categories_path( structure.slug ) %>">
30
- <span class="glyphicon glyphicon-tags" aria-hidden="true"></span> <%= t(:category).capitalize.pluralize %>
30
+ <i class="fas fa-tags"></i> <%= t(:category).capitalize.pluralize %>
31
31
  </a>
32
32
  <% end %>
33
33
  </li>
34
34
  <% else %>
35
35
  <li class="main-sidebar--structure <%= 'main-sidebar--first-structure' if index == 0 %>">
36
36
  <a href="<%= structure_board_path( structure, structure.board ) %>">
37
- <span class="glyphicon glyphicon-list-alt" aria-hidden="true"></span>
37
+ <i class="fas fa-list-alt"></i>
38
38
  <%= structure.board.name.humanize %>
39
39
  </a>
40
40
  </li>
@@ -43,18 +43,18 @@
43
43
  <% if current_user.is_superadmin %>
44
44
  <li>
45
45
  <a href="<%= structures_path %>">
46
- <span class="glyphicon glyphicon-edit" aria-hidden="true"></span> Structures
46
+ <i class="fas fa-sitemap"></i> Structures
47
47
  </a>
48
48
  </li>
49
49
  <% end %>
50
50
  <li>
51
51
  <a href="<%= manage_users_path %>">
52
- <span class="glyphicon glyphicon-user" aria-hidden="true"></span> Users
52
+ <i class="fas fa-user"></i> Users
53
53
  </a>
54
54
  </li>
55
55
  <li>
56
56
  <a href="<%= destroy_user_session_path %>" data-method="delete">
57
- <span class="glyphicon glyphicon-log-out" aria-hidden="true"></span> Log out
57
+ <i class="fas fa-sign-out-alt"></i> Log out
58
58
  </a>
59
59
  </li>
60
60
  </ul>
@@ -1,7 +1,7 @@
1
1
  <!DOCTYPE html>
2
2
  <html lang="<%= I18n.locale %>">
3
3
  <head>
4
- <title>Binda CMS -- <%= controller_name.capitalize %> <%= action_name.capitalize %></title>
4
+ <title>Binda CMS -- <%= yield :title %></title>
5
5
  <%= csrf_meta_tags %>
6
6
 
7
7
  <link href="https://fonts.googleapis.com/css?family=Work+Sans:300,600" rel="stylesheet">
@@ -1,5 +1,5 @@
1
1
  # see: https://til.codes/testing-carrierwave-file-uploads-with-rspec-and-factorygirl/
2
- # This apparently doesn't work... needs further investigation
2
+ # REVIEW This apparently doesn't work... needs further investigation
3
3
  if Rails.env.test? || Rails.env.cucumber?
4
4
 
5
5
  # Setup Carrierwave to use local storage and disable file processing in test env
@@ -24,7 +24,8 @@ if Rails.env.test? || Rails.env.cucumber?
24
24
 
25
25
  # Setting asset_host
26
26
  # (this line should stay outside the initial if statement)
27
- CarrierWave::Uploader::Base.descendants.each do |klass|
27
+ # REVIEW maybe the problem lies here...
28
+ CarrierWave::Uploader::Base.descendants.each do |_|
28
29
  # Set the asset_host option for the carrierwave.
29
30
  config.asset_host = ActionController::Base.asset_host
30
31
  end
@@ -42,9 +42,9 @@ en:
42
42
  default_choice_description: If you have added/removed any choice, this list might not be correct. Please save to update it.
43
43
  instance: instance
44
44
  structure_instance_type: 'This structure is for:'
45
-
45
+
46
46
  binda:
47
- title: title
47
+ title: Title
48
48
  view_website: View website
49
49
  error_related_to_itself: Sorry, this record cannot relate to itself
50
50
  confirm_delete: Do you really want to remove it?
@@ -64,18 +64,44 @@ en:
64
64
  delete: delete
65
65
  edit: edit
66
66
  sort: sort
67
- structure: Structure
68
- structures: Structures
69
- field_group: Field group
70
- field_groups: Field groups
71
- field_setting: Field setting
72
- field_settings: Field settings
67
+ structure:
68
+ singular: Structure
69
+ plural: Structures
70
+ confirm_delete: This operation will delete this structure and there is no coming back. Are you ok with that?
71
+ validation_message:
72
+ instance_type: "%{arg1} is not a valid instance"
73
+ field_group:
74
+ singular: Field group
75
+ plural: FIeld groups
76
+ confirm_delete: This operation will delete this group of settings and all related component content. Are you ok with that?
77
+ validation_message:
78
+ name: cannot be blank.
79
+ slug: "\"%{arg1}\" already in use. Please choose a different slug."
80
+ field_type: "isn't valid. Select a field type among these: %{arg1}."
81
+ default_field_group:
82
+ name: General details
83
+ error_on_create: General Details group hasn't been created
73
84
  repeater_field_settings: Fields settings of the %{arg1} repeater
85
+ field_setting:
86
+ singular: Field setting
87
+ plural: Field settings
88
+ confirm_delete: This operation will delete this setting and all related component content. Are you ok with that?
89
+ validation_message:
90
+ name: Field setting name cannot be blank.
91
+ slug: "\"%{arg1}\" already in use. Please choose a different slug."
92
+ field_type: "isn't valid. Please associate the field setting named \"%{arg1}\" with one of the following field types: %{arg2}."
93
+ field_group_id: "cannot be blank. Field setting named \"%{arg1}\" must be associated to a field group. Check if field_group_id propriety is set."
94
+ allow_null: "canont be true on a radio setting. Please ensure to set allow_null=false for the field setting named \"%{arg1}\" before saving it."
95
+ has_choice_before_updating_allow_null_to_false: "In order to require at least a choice, it's mandatory that at least one is available. Please create a choice for the field setting with slug \"%{arg1}\" before continuing."
74
96
  component: Component
75
97
  components: Component
76
- new: new
77
- new_structure: New %{arg1} structure
78
- new_field_group: New %{arg1} field group
98
+ asset:
99
+ validation_message:
100
+ fieldable_id: cannot be blank. The %{arg1} must be associated with a component or a board
101
+ field_setting_id: cannot be blank. The %{arg1} must be associated with a field setting
102
+ new: New
103
+ new_structure: New structure
104
+ new_field_group: New field group
79
105
  new_component: New %{arg1}
80
106
  new_user: New User
81
107
  new_category: New %{arg1} category
@@ -103,8 +129,26 @@ en:
103
129
  login_password: Enter your password
104
130
  login_welcome: Welcome to %{arg1} admin panel
105
131
  login_credit: Built with Binda %{arg1}
132
+ selection:
133
+ validation_message:
134
+ choices: "The selection field with id=%{arg1} depending on \"%{arg2}\" must have at least a choice."
135
+ choice:
136
+ default_label: Temporary choice
137
+ default_value: temporary-choice
138
+ validation_message:
139
+ label: Label cannot be blank
140
+ value: Value cannot be blank
141
+ field_setting_id: cannot be blank. Choice must be associated to a field setting. Check if field_setting_id propriety is set.
142
+ destroy: It's not possible to delete the last choice as this field setting requires at least one exists. Before trying again, please add another choice.
106
143
  choice_label: label
107
144
  choice_value: value
108
145
  allow_null: Require a choice
109
146
  allow_null_true: Choosing is not required
110
- allow_null_false: Require to choose among the available choices
147
+ allow_null_false: Require at least one choice
148
+ publish_state: Publish state
149
+ user: User
150
+ manage_users: Manage Users
151
+ remember_me: Remember me
152
+ no_available_choice: Sorry, no choice is available.
153
+ no_available_choice_user_hint: Please contact the administrator
154
+ no_available_choice_superadmin_hint: Please ensure you setup at least two possible choices when editing the