headmin 0.5.1 → 0.5.2

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 (142) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +2 -2
  3. data/Gemfile +14 -0
  4. data/Gemfile.lock +77 -0
  5. data/app/assets/javascripts/headmin/controllers/media_controller.js +237 -0
  6. data/app/assets/javascripts/headmin/controllers/media_modal_controller.js +110 -0
  7. data/app/assets/javascripts/headmin/controllers/remote_modal_controller.js +10 -0
  8. data/app/assets/javascripts/headmin/controllers/textarea_controller.js +34 -0
  9. data/app/assets/javascripts/headmin/index.js +8 -0
  10. data/app/assets/javascripts/headmin.js +294 -0
  11. data/app/assets/stylesheets/headmin/forms/file.scss +40 -5
  12. data/app/assets/stylesheets/headmin/forms/media.scss +10 -0
  13. data/app/assets/stylesheets/headmin/forms/repeater.scss +4 -0
  14. data/app/assets/stylesheets/headmin/forms.scss +7 -0
  15. data/app/assets/stylesheets/headmin/layout/sidebar.scss +0 -1
  16. data/app/assets/stylesheets/headmin/media/index.scss +9 -0
  17. data/app/assets/stylesheets/headmin/media.scss +1 -0
  18. data/app/assets/stylesheets/headmin/table.scss +8 -0
  19. data/app/assets/stylesheets/headmin.css +64 -7
  20. data/app/assets/stylesheets/headmin.scss +1 -0
  21. data/app/controllers/headmin/media_controller.rb +52 -0
  22. data/app/controllers/headmin_controller.rb +2 -0
  23. data/app/models/concerns/headmin/field.rb +0 -1
  24. data/app/models/concerns/headmin/fieldable.rb +10 -1
  25. data/app/models/concerns/headmin/form/hintable.rb +6 -1
  26. data/app/models/headmin/filter/date.rb +49 -1
  27. data/app/models/headmin/form/media_view.rb +113 -0
  28. data/app/models/headmin/form/textarea_view.rb +6 -1
  29. data/app/views/examples/admin.html.erb +13 -13
  30. data/app/views/examples/auth.html.erb +1 -1
  31. data/app/views/headmin/_blocks.html.erb +2 -2
  32. data/app/views/headmin/_breadcrumbs.html.erb +1 -1
  33. data/app/views/headmin/_dropdown.html.erb +1 -1
  34. data/app/views/headmin/_filters.html.erb +3 -3
  35. data/app/views/headmin/_form.html.erb +2 -2
  36. data/app/views/headmin/_heading.html.erb +1 -1
  37. data/app/views/headmin/_index.html.erb +1 -1
  38. data/app/views/headmin/_notifications.html.erb +1 -1
  39. data/app/views/headmin/_pagination.html.erb +1 -1
  40. data/app/views/headmin/_popup.html.erb +2 -2
  41. data/app/views/headmin/_table.html.erb +1 -1
  42. data/app/views/headmin/dropdown/_devise.html.erb +8 -8
  43. data/app/views/headmin/dropdown/_list.html.erb +1 -1
  44. data/app/views/headmin/dropdown/_locale.html.erb +4 -4
  45. data/app/views/headmin/filters/_base.html.erb +20 -20
  46. data/app/views/headmin/filters/_boolean.html.erb +4 -4
  47. data/app/views/headmin/filters/_date.html.erb +4 -4
  48. data/app/views/headmin/filters/_flatpickr.html.erb +4 -4
  49. data/app/views/headmin/filters/_number.html.erb +4 -4
  50. data/app/views/headmin/filters/_options.html.erb +4 -4
  51. data/app/views/headmin/filters/_search.html.erb +3 -3
  52. data/app/views/headmin/filters/_text.html.erb +4 -4
  53. data/app/views/headmin/filters/filter/_button.html.erb +1 -1
  54. data/app/views/headmin/forms/_autocomplete.html.erb +2 -2
  55. data/app/views/headmin/forms/_blocks.html.erb +4 -4
  56. data/app/views/headmin/forms/_checkbox.html.erb +5 -5
  57. data/app/views/headmin/forms/_color.html.erb +5 -5
  58. data/app/views/headmin/forms/_date.html.erb +8 -8
  59. data/app/views/headmin/forms/_date_range.html.erb +3 -3
  60. data/app/views/headmin/forms/_datetime.html.erb +8 -8
  61. data/app/views/headmin/forms/_datetime_range.html.erb +3 -3
  62. data/app/views/headmin/forms/_email.html.erb +9 -9
  63. data/app/views/headmin/forms/_file.html.erb +12 -12
  64. data/app/views/headmin/forms/_flatpickr.html.erb +2 -2
  65. data/app/views/headmin/forms/_flatpickr_range.html.erb +8 -8
  66. data/app/views/headmin/forms/_hidden.html.erb +1 -1
  67. data/app/views/headmin/forms/_hint.html.erb +7 -2
  68. data/app/views/headmin/forms/_label.html.erb +1 -1
  69. data/app/views/headmin/forms/_media.html.erb +58 -0
  70. data/app/views/headmin/forms/_number.html.erb +8 -8
  71. data/app/views/headmin/forms/_password.html.erb +7 -7
  72. data/app/views/headmin/forms/_redactorx.html.erb +2 -2
  73. data/app/views/headmin/forms/_repeater.html.erb +12 -12
  74. data/app/views/headmin/forms/_search.html.erb +9 -9
  75. data/app/views/headmin/forms/_select.html.erb +8 -8
  76. data/app/views/headmin/forms/_switch.html.erb +2 -2
  77. data/app/views/headmin/forms/_text.html.erb +9 -9
  78. data/app/views/headmin/forms/_textarea.html.erb +7 -7
  79. data/app/views/headmin/forms/_url.html.erb +9 -9
  80. data/app/views/headmin/forms/_validation.html.erb +1 -1
  81. data/app/views/headmin/forms/_wysiwyg.html.erb +2 -2
  82. data/app/views/headmin/forms/fields/_base.html.erb +2 -2
  83. data/app/views/headmin/forms/fields/_file.html.erb +3 -3
  84. data/app/views/headmin/forms/fields/_files.html.erb +3 -3
  85. data/app/views/headmin/forms/fields/_group.html.erb +7 -7
  86. data/app/views/headmin/forms/fields/_list.html.erb +5 -5
  87. data/app/views/headmin/forms/fields/_text.html.erb +3 -3
  88. data/app/views/headmin/forms/media/_item.html.erb +32 -0
  89. data/app/views/headmin/forms/media/_validation.html.erb +10 -0
  90. data/app/views/headmin/forms/repeater/_row.html.erb +12 -11
  91. data/app/views/headmin/layout/_main.html.erb +3 -1
  92. data/app/views/headmin/layout/_remote_modal.html.erb +1 -0
  93. data/app/views/headmin/layout/_sidebar.html.erb +1 -1
  94. data/app/views/headmin/media/_item.html.erb +17 -0
  95. data/app/views/headmin/media/_media_item_modal.html.erb +51 -0
  96. data/app/views/headmin/media/_modal.html.erb +35 -0
  97. data/app/views/headmin/media/create.turbo_stream.erb +5 -0
  98. data/app/views/headmin/media/index.html.erb +3 -0
  99. data/app/views/headmin/media/show.html.erb +9 -0
  100. data/app/views/headmin/media/update.turbo_stream.erb +3 -0
  101. data/app/views/headmin/nav/_dropdown.html.erb +3 -3
  102. data/app/views/headmin/nav/_item.html.erb +2 -2
  103. data/app/views/headmin/nav/item/_devise.html.erb +6 -6
  104. data/app/views/headmin/nav/item/_locale.html.erb +4 -4
  105. data/app/views/headmin/table/_actions.html.erb +2 -2
  106. data/app/views/headmin/table/actions/_action.html.erb +3 -3
  107. data/app/views/headmin/table/actions/_delete.html.erb +2 -2
  108. data/app/views/headmin/table/actions/_export.html.erb +2 -2
  109. data/app/views/headmin/table/body/_image.html.erb +18 -0
  110. data/app/views/headmin/table/body/_row.html.erb +3 -3
  111. data/app/views/headmin/table/foot/_cell.html.erb +1 -1
  112. data/app/views/headmin/views/devise/confirmations/_new.html.erb +3 -3
  113. data/app/views/headmin/views/devise/passwords/_edit.html.erb +4 -4
  114. data/app/views/headmin/views/devise/passwords/_new.html.erb +3 -3
  115. data/app/views/headmin/views/devise/registrations/_edit.html.erb +5 -5
  116. data/app/views/headmin/views/devise/registrations/_new.html.erb +5 -5
  117. data/app/views/headmin/views/devise/sessions/_new.html.erb +4 -4
  118. data/app/views/headmin/views/devise/unlocks/_new.html.erb +3 -3
  119. data/config/locales/devise/nl.yml +1 -1
  120. data/config/locales/headmin/forms/en.yml +8 -0
  121. data/config/locales/headmin/forms/nl.yml +8 -0
  122. data/config/locales/headmin/media/en.yml +23 -0
  123. data/config/locales/headmin/media/nl.yml +22 -0
  124. data/config/locales/headmin/table/en.yml +2 -0
  125. data/config/locales/headmin/table/nl.yml +2 -0
  126. data/config/routes.rb +10 -0
  127. data/lib/generators/templates/views/auth/confirmations/new.html.erb +1 -1
  128. data/lib/generators/templates/views/auth/mailer/confirmation_instructions.html.erb +1 -1
  129. data/lib/generators/templates/views/auth/mailer/email_changed.html.erb +1 -1
  130. data/lib/generators/templates/views/auth/mailer/password_change.html.erb +1 -1
  131. data/lib/generators/templates/views/auth/mailer/reset_password_instructions.html.erb +1 -1
  132. data/lib/generators/templates/views/auth/mailer/unlock_instructions.html.erb +1 -1
  133. data/lib/generators/templates/views/auth/passwords/edit.html.erb +1 -1
  134. data/lib/generators/templates/views/auth/passwords/new.html.erb +1 -1
  135. data/lib/generators/templates/views/auth/registrations/edit.html.erb +1 -1
  136. data/lib/generators/templates/views/auth/registrations/new.html.erb +1 -1
  137. data/lib/generators/templates/views/auth/sessions/new.html.erb +1 -1
  138. data/lib/generators/templates/views/auth/unlocks/new.html.erb +1 -1
  139. data/lib/generators/templates/views/layouts/auth.html.erb +1 -1
  140. data/lib/headmin/version.rb +1 -1
  141. metadata +27 -3
  142. data/.lock-487e157d270f3062a98b7b2a012753708-1272821827 +0 -0
@@ -0,0 +1,9 @@
1
+ <%= turbo_frame_tag "remote_modal" do %>
2
+ <div class="media-item-modal modal fade" tabindex="-1" data-controller="remote-modal">
3
+ <div class="modal-dialog modal-md modal-dialog-scrollable">
4
+ <div class="modal-content">
5
+ <%= render "headmin/media/media_item_modal" %>
6
+ </div>
7
+ </div>
8
+ </div>
9
+ <% end %>
@@ -0,0 +1,3 @@
1
+ <%= turbo_stream.update "modal_content" do %>
2
+ <%= render 'headmin/media/media_item_modal' %>
3
+ <% end %>
@@ -9,9 +9,9 @@
9
9
  #
10
10
  # ==== Examples
11
11
  # Basic version.
12
- # <%= render "headmin/nav/dropdown", name: 'My Account', url: admin_user_path, icon: 'person-circle' do %#>
13
- # <%= render "headmin/nav/item", name: 'Edit info', url: edit_admin_user_path(current_user) %#>
14
- # <%= render "headmin/nav/item", name: 'Log out', url: destroy_user_session_path(current_user) %#>
12
+ # <%= render 'headmin/nav/dropdown', name: 'My Account', url: admin_user_path, icon: 'person-circle' do %#>
13
+ # <%= render 'headmin/nav/item', name: 'Edit info', url: edit_admin_user_path(current_user) %#>
14
+ # <%= render 'headmin/nav/item', name: 'Log out', url: destroy_user_session_path(current_user) %#>
15
15
  # <% end %#>
16
16
 
17
17
  name = local_assigns.has_key?(:name) ? name : ''
@@ -9,10 +9,10 @@
9
9
  #
10
10
  # ==== Examples
11
11
  # Basic version.
12
- # <%= render "headmin/nav/item", name: 'Dashboard', url: admin_root_path %#>
12
+ # <%= render 'headmin/nav/item', name: 'Dashboard', url: admin_root_path %#>
13
13
  #
14
14
  # With icon
15
- # <%= render "headmin/nav/item", name: 'Dashboard', url: admin_root_path, icon: 'speedometer' %#>
15
+ # <%= render 'headmin/nav/item', name: 'Dashboard', url: admin_root_path, icon: 'speedometer' %#>
16
16
 
17
17
  name = local_assigns.has_key?(:name) ? name : ''
18
18
  icon = local_assigns.has_key?(:icon) ? icon : nil
@@ -9,13 +9,13 @@
9
9
  <% singular = scope.to_s.singularize.to_sym %>
10
10
  <% user = send("current_#{singular}") %>
11
11
 
12
- <%= render "headmin/dropdown", class: "nav-item" do %>
13
- <%= render "headmin/dropdown/button", class: "nav-link", id: "nav-item-devise" do %>
12
+ <%= render 'headmin/dropdown', class: "nav-item" do %>
13
+ <%= render 'headmin/dropdown/button', class: "nav-link", id: "nav-item-devise" do %>
14
14
  <%= user.to_s %>
15
15
  <% end %>
16
- <%= render "headmin/dropdown/list", id: "nav-item-devise" do %>
17
- <%= render "headmin/dropdown/item", name: t("headmin.nav.item.devise.edit_profile"), url: polymorphic_path([:edit, :admin, user]) %>
18
- <%= render "headmin/dropdown/divider" %>
19
- <%= render "headmin/dropdown/item", name: t("headmin.nav.item.devise.log_out"), url: polymorphic_path([:destroy, singular, :session]), data: { "turbo-method": "delete" } %>
16
+ <%= render 'headmin/dropdown/list', id: "nav-item-devise" do %>
17
+ <%= render 'headmin/dropdown/item', name: t("headmin.nav.item.devise.edit_profile"), url: polymorphic_path([:edit, :admin, user]) %>
18
+ <%= render 'headmin/dropdown/divider' %>
19
+ <%= render 'headmin/dropdown/item', name: t("headmin.nav.item.devise.log_out"), url: polymorphic_path([:destroy, singular, :session]), data: { "turbo-method": "delete" } %>
20
20
  <% end %>
21
21
  <% end %>
@@ -4,14 +4,14 @@
4
4
  parameters: none
5
5
  %>
6
6
 
7
- <%= render "headmin/dropdown", class: 'nav-item' do %>
8
- <%= render "headmin/dropdown/button", class: 'nav-link', id: 'nav-item-locale' do %>
7
+ <%= render 'headmin/dropdown', class: 'nav-item' do %>
8
+ <%= render 'headmin/dropdown/button', class: 'nav-link', id: 'nav-item-locale' do %>
9
9
  <%= bootstrap_icon('globe', class: 'me-2') %>
10
10
  <%= t('language_name', locale: ::I18n.locale) %>
11
11
  <% end %>
12
- <%= render "headmin/dropdown/list", id: 'nav-item-locale' do %>
12
+ <%= render 'headmin/dropdown/list', id: 'nav-item-locale' do %>
13
13
  <% I18n.available_locales.each do |locale| %>
14
- <%= render "headmin/dropdown/item", name: t('language_name', locale: locale), url: url_for({locale: locale.to_s}) %>
14
+ <%= render 'headmin/dropdown/item', name: t('language_name', locale: locale), url: url_for({locale: locale.to_s}) %>
15
15
  <% end %>
16
16
  <% end %>
17
17
  <% end %>
@@ -5,8 +5,8 @@
5
5
  #
6
6
  # ==== Examples
7
7
  # Basic version
8
- # <%= render "headmin/table/actions" do %#>
9
- # <%= render "headmin/table/actions/delete", url: destroy_admin_pages_path %#>
8
+ # <%= render 'headmin/table/actions' do %#>
9
+ # <%= render 'headmin/table/actions/delete', url: destroy_admin_pages_path %#>
10
10
  # <% end %#>
11
11
 
12
12
  %>
@@ -9,13 +9,13 @@
9
9
  #
10
10
  # ==== Examples
11
11
  # Basic version.
12
- # <%= render "headmin/table/actions/action", name: 'export', url: export_admin_products_path %#>
12
+ # <%= render 'headmin/table/actions/action', name: 'export', url: export_admin_products_path %#>
13
13
  #
14
14
  # Use a different HTTP method
15
- # <%= render "headmin/table/actions/action", name: 'export', url: export_admin_products_path, method: :post %#>
15
+ # <%= render 'headmin/table/actions/action', name: 'export', url: export_admin_products_path, method: :post %#>
16
16
  #
17
17
  # Show a confirm dialog before submitting.
18
- # <%= render "headmin/table/actions/action", name: 'delete', url: destroy_admin_products_path, confirm: 'Are you sure you want to delete these products?' %#>
18
+ # <%= render 'headmin/table/actions/action', name: 'delete', url: destroy_admin_products_path, confirm: 'Are you sure you want to delete these products?' %#>
19
19
 
20
20
  url = local_assigns.has_key?(:url) ? local_assigns[:url] : request.path
21
21
  method = local_assigns.has_key?(:method) ? local_assigns[:method] : 'GET'
@@ -6,7 +6,7 @@
6
6
  #
7
7
  # ==== Examples
8
8
  # Basic version.
9
- # <%= render "headmin/table/actions/delete", url: delete_admin_products_path %#>
9
+ # <%= render 'headmin/table/actions/delete', url: delete_admin_products_path %#>
10
10
  %>
11
11
 
12
- <%= render "headmin/table/actions/action", name: t(".button"), url: url, method: "DELETE", confirm: t(".confirm") %>
12
+ <%= render 'headmin/table/actions/action', name: t(".button"), url: url, method: "DELETE", confirm: t(".confirm") %>
@@ -6,7 +6,7 @@
6
6
  #
7
7
  # ==== Examples
8
8
  # Basic version.
9
- # <%= render "headmin/table/actions/export", url: export_admin_products_path %#>
9
+ # <%= render 'headmin/table/actions/export', url: export_admin_products_path %#>
10
10
  %>
11
11
 
12
- <%= render "headmin/table/actions/action", name: t('.button'), url: url %>
12
+ <%= render 'headmin/table/actions/action', name: t('.button'), url: url %>
@@ -0,0 +1,18 @@
1
+ <%#
2
+ headmin/table/body/text
3
+ accepts block: no
4
+ parameters:
5
+ value: (activestorage) image
6
+ %>
7
+
8
+ <td class="h-table-cell-image">
9
+ <% if value&.attached? %>
10
+ <% if defined?(url) && url %>
11
+ <%= link_to url, title: t(".open") do %>
12
+ <%= image_tag value.variant(resize_to_fill: [34, 34]), width: 34, height: 34, alt: value.filename, title: value.filename %>
13
+ <% end %>
14
+ <% else %>
15
+ <%= image_tag value.variant(resize_to_fill: [34, 34]), width: 34, height: 34, alt: value.filename, title: value.filename %>
16
+ <% end %>
17
+ <% end %>
18
+ </td>
@@ -5,9 +5,9 @@
5
5
  # * +class</tt> - Custom class names to add to the table row
6
6
  #
7
7
  # ==== Examples
8
- # <%= render "headmin/table/body/row" do %#>
9
- # <%= render "headmin/table/body/id", value: page.id %#>
10
- # <%= render "headmin/table/body/string", value: page.title %#>
8
+ # <%= render 'headmin/table/body/row' do %#>
9
+ # <%= render 'headmin/table/body/id', value: page.id %#>
10
+ # <%= render 'headmin/table/body/string', value: page.title %#>
11
11
  # <% end %#>
12
12
 
13
13
  class_names = local_assigns.has_key?(:class) ? local_assigns[:class] : false
@@ -7,4 +7,4 @@
7
7
 
8
8
  <% value = local_assigns.has_key?(:value) ? value : nil %>
9
9
  <% sort = local_assigns.has_key?(:sort) ? sort : nil %>
10
- <%= render "headmin/table/head/cell", value: value, sort: sort %>
10
+ <%= render 'headmin/table/head/cell', value: value, sort: sort %>
@@ -1,9 +1,9 @@
1
1
  <%= form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: {method: :post}) do |f| %>
2
- <%= render "headmin/views/devise/shared/error_messages", resource: resource %>
2
+ <%= render 'headmin/views/devise/shared/error_messages', resource: resource %>
3
3
 
4
- <%= render "headmin/forms/email", form: f, attribute: :email, required: true, float: true %>
4
+ <%= render 'headmin/forms/email', form: f, attribute: :email, required: true, float: true %>
5
5
 
6
6
  <%= f.submit t('.resend'), class: 'btn btn-lg btn-primary w-100' %>
7
7
 
8
- <%= render "headmin/views/devise/shared/links" %>
8
+ <%= render 'headmin/views/devise/shared/links' %>
9
9
  <% end %>
@@ -1,12 +1,12 @@
1
1
  <%= form_for(resource, as: resource_name, url: password_path(resource_name), html: {method: :put}) do |f| %>
2
- <%= render "headmin/views/devise/shared/error_messages", resource: resource %>
2
+ <%= render 'headmin/views/devise/shared/error_messages', resource: resource %>
3
3
 
4
4
  <%= f.hidden_field :reset_password_token %>
5
5
 
6
- <%= render "headmin/forms/password", form: f, attribute: :password, required: true, float: true %>
7
- <%= render "headmin/forms/password", form: f, attribute: :password_confirmation, required: true, float: true %>
6
+ <%= render 'headmin/forms/password', form: f, attribute: :password, required: true, float: true %>
7
+ <%= render 'headmin/forms/password', form: f, attribute: :password_confirmation, required: true, float: true %>
8
8
 
9
9
  <%= f.submit t('.change_password'), class: 'btn btn-lg btn-primary w-100' %>
10
10
 
11
- <%= render "headmin/views/devise/shared/links" %>
11
+ <%= render 'headmin/views/devise/shared/links' %>
12
12
  <% end %>
@@ -1,9 +1,9 @@
1
1
  <%= form_for(resource, as: resource_name, url: password_path(resource_name), html: {method: :post}) do |f| %>
2
- <%= render "headmin/views/devise/shared/error_messages", resource: resource %>
2
+ <%= render 'headmin/views/devise/shared/error_messages', resource: resource %>
3
3
 
4
- <%= render "headmin/forms/email", form: f, attribute: :email, required: true, float: true %>
4
+ <%= render 'headmin/forms/email', form: f, attribute: :email, required: true, float: true %>
5
5
 
6
6
  <%= f.submit t('.send_instructions'), class: 'btn btn-lg btn-primary w-100' %>
7
7
 
8
- <%= render "headmin/views/devise/shared/links" %>
8
+ <%= render 'headmin/views/devise/shared/links' %>
9
9
  <% end %>
@@ -1,16 +1,16 @@
1
1
  <div>
2
2
  <%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| %>
3
- <%= render "headmin/views/devise/shared/error_messages", resource: resource %>
3
+ <%= render 'headmin/views/devise/shared/error_messages', resource: resource %>
4
4
 
5
- <%= render "headmin/forms/email", form: f, attribute: :email, required: true, float: true %>
5
+ <%= render 'headmin/forms/email', form: f, attribute: :email, required: true, float: true %>
6
6
 
7
7
  <% if devise_mapping.confirmable? && resource.pending_reconfirmation? %>
8
8
  <div><%= t('.waiting_confirmation', email: resource.unconfirmed_email) %></div>
9
9
  <% end %>
10
10
 
11
- <%= render "headmin/forms/password", form: f, attribute: :password, required: true, float: true %>
12
- <%= render "headmin/forms/password", form: f, attribute: :password_confirmation, required: true, float: true %>
13
- <%= render "headmin/forms/password", form: f, attribute: :current_password, required: true, float: true %>
11
+ <%= render 'headmin/forms/password', form: f, attribute: :password, required: true, float: true %>
12
+ <%= render 'headmin/forms/password', form: f, attribute: :password_confirmation, required: true, float: true %>
13
+ <%= render 'headmin/forms/password', form: f, attribute: :current_password, required: true, float: true %>
14
14
 
15
15
  <%= f.submit t('.change'), class: 'btn btn-lg btn-primary w-100' %>
16
16
  <% end %>
@@ -1,11 +1,11 @@
1
1
  <%= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %>
2
- <%= render "headmin/views/devise/shared/error_messages", resource: resource %>
2
+ <%= render 'headmin/views/devise/shared/error_messages', resource: resource %>
3
3
 
4
- <%= render "headmin/forms/email", form: f, attribute: :email, required: true, float: true %>
5
- <%= render "headmin/forms/password", form: f, attribute: :password, required: true, float: true %>
6
- <%= render "headmin/forms/password", form: f, attribute: :password_confirmation, required: true, float: true %>
4
+ <%= render 'headmin/forms/email', form: f, attribute: :email, required: true, float: true %>
5
+ <%= render 'headmin/forms/password', form: f, attribute: :password, required: true, float: true %>
6
+ <%= render 'headmin/forms/password', form: f, attribute: :password_confirmation, required: true, float: true %>
7
7
 
8
8
  <%= f.submit t('.sign_up'), class: 'btn btn-lg btn-primary w-100' %>
9
9
 
10
- <%= render "headmin/views/devise/shared/links" %>
10
+ <%= render 'headmin/views/devise/shared/links' %>
11
11
  <% end %>
@@ -1,13 +1,13 @@
1
1
  <%= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %>
2
2
 
3
- <%= render "headmin/forms/email", form: f, attribute: :email, required: true, float: true %>
4
- <%= render "headmin/forms/password", form: f, attribute: :password, required: true, float: true %>
3
+ <%= render 'headmin/forms/email', form: f, attribute: :email, required: true, float: true %>
4
+ <%= render 'headmin/forms/password', form: f, attribute: :password, required: true, float: true %>
5
5
 
6
6
  <% if devise_mapping.rememberable? %>
7
- <%= render "headmin/forms/checkbox", form: f, attribute: :remember_me %>
7
+ <%= render 'headmin/forms/checkbox', form: f, attribute: :remember_me %>
8
8
  <% end %>
9
9
 
10
10
  <%= f.submit t('.login'), class: 'btn btn-lg btn-primary w-100' %>
11
11
 
12
- <%= render "headmin/views/devise/shared/links" %>
12
+ <%= render 'headmin/views/devise/shared/links' %>
13
13
  <% end %>
@@ -1,10 +1,10 @@
1
1
  <%= form_for(resource, as: resource_name, url: unlock_path(resource_name), html: {method: :post}) do |f| %>
2
- <%= render "headmin/views/devise/shared/error_messages", resource: resource %>
2
+ <%= render 'headmin/views/devise/shared/error_messages', resource: resource %>
3
3
 
4
- <%= render "headmin/forms/email", form: f, attribute: :email, required: true, float: true %>
4
+ <%= render 'headmin/forms/email', form: f, attribute: :email, required: true, float: true %>
5
5
 
6
6
  <%= f.submit t('.resend'), class: 'btn btn-lg btn-primary w-100' %>
7
7
 
8
- <%= render "headmin/views/devise/shared/links" %>
8
+ <%= render 'headmin/views/devise/shared/links' %>
9
9
 
10
10
  <% end %>
@@ -5,7 +5,7 @@
5
5
  # This includes the changes from Devise 4.5 and 4.6:
6
6
  # A new key was added in Devise 4.5: `updated_but_not_signed_in:`
7
7
  # In Devise 4.6, the old helper `<% devise_error_messages %>` was replaced with
8
- # `<%= render "devise/shared/error_messages", resource: resource %>`
8
+ # `<%= render 'devise/shared/error_messages', resource: resource %>`
9
9
 
10
10
  # Starting points for this translation:
11
11
  # * User-centered language: don't tell what the system knows, tell what the user should do or should expect
@@ -18,6 +18,14 @@ en:
18
18
  remove:
19
19
  title: Delete
20
20
  confirm: Are you sure you want to delete this?
21
+ media:
22
+ validation:
23
+ min:
24
+ one: "Please select at least 1 item"
25
+ other: "Please select at least %{count} items"
26
+ max:
27
+ one: "Please limit your selection to maximum 1 item"
28
+ other: "Please limit your selection to maximum %{count} items"
21
29
  select:
22
30
  blank: Make a choice
23
31
  repeater:
@@ -17,6 +17,14 @@ nl:
17
17
  remove:
18
18
  title: Verwijderen
19
19
  confirm: Ben je zeker dat je dit wil verwijderen?
20
+ media:
21
+ validation:
22
+ min:
23
+ one: "Gelieve minstens 1 item te selecteren"
24
+ other: "Gelieve minstens %{count} items te selecteren"
25
+ max:
26
+ one: "Gelieve maximum 1 item te selecteren"
27
+ other: "Gelieve maximum %{count} items te selecteren"
20
28
  select:
21
29
  blank: Maak een keuze
22
30
  repeater:
@@ -0,0 +1,23 @@
1
+ en:
2
+ headmin:
3
+ media:
4
+ modal:
5
+ close: Close
6
+ placeholder: Upload your first file to the media library
7
+ limits: "minimum: %{min} en maximum: %{max}"
8
+ select: Select
9
+ title:
10
+ one: Select at least 1 file
11
+ other: Select at least %{count} files
12
+ unlimited: unlimited
13
+ upload: Upload new files
14
+ maximum: " of %{count}"
15
+ media_item_modal:
16
+ close: Close
17
+ dimensions: Dimensions
18
+ edit: Edit Media item
19
+ not_analysed: Not yet analysed
20
+ size: Size
21
+ type: File type
22
+ update: Update
23
+ uploaded_at: Uploaded at
@@ -0,0 +1,22 @@
1
+ nl:
2
+ headmin:
3
+ media:
4
+ modal:
5
+ close: Sluiten
6
+ placeholder: Upload je eerste bestand naar de mediabibliotheek
7
+ limits: "minimum: %{min} and maximum: %{max}"
8
+ select: Selecteer
9
+ title:
10
+ one: Selecteer bestand
11
+ other: Selecteer bestanden
12
+ unlimited: onbeperkt
13
+ upload: Nieuwe bestanden uploaden
14
+ media_item_modal:
15
+ close: Sluiten
16
+ dimensions: Afmetingen
17
+ edit: Media item wijzigen
18
+ not_analysed: Nog niet geanalyseerd
19
+ size: Grootte
20
+ type: Bestandstype
21
+ update: Update
22
+ uploaded_at: Geüpload op
@@ -25,3 +25,5 @@ en:
25
25
  empty: N/A
26
26
  format: '%m-%d-%Y %H:%M'
27
27
  empty: No results found
28
+ image:
29
+ open: Open
@@ -25,3 +25,5 @@ nl:
25
25
  empty: Nvt.
26
26
  format: '%d-%m-%Y %H:%M'
27
27
  empty: Geen resultaten gevonden
28
+ image:
29
+ open: Openen
data/config/routes.rb ADDED
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ Rails.application.routes.draw do
4
+ namespace(:headmin) do
5
+ get "media", to: "media#index", as: :media
6
+ post "media", to: "media#create"
7
+ get "media/:id", to: "media#show", as: :media_item
8
+ patch "media/:id", to: "media#update"
9
+ end
10
+ end
@@ -1 +1 @@
1
- <%= render "headmin/views/devise/confirmations/new" %>
1
+ <%= render 'headmin/views/devise/confirmations/new' %>
@@ -1 +1 @@
1
- <%= render "headmin/views/devise/mailer/confirmation_instructions" %>
1
+ <%= render 'headmin/views/devise/mailer/confirmation_instructions' %>
@@ -1 +1 @@
1
- <%= render "headmin/views/devise/mailer/email_changed" %>
1
+ <%= render 'headmin/views/devise/mailer/email_changed' %>
@@ -1 +1 @@
1
- <%= render "headmin/views/devise/mailer/password_change" %>
1
+ <%= render 'headmin/views/devise/mailer/password_change' %>
@@ -1 +1 @@
1
- <%= render "headmin/views/devise/mailer/reset_password_instructions" %>
1
+ <%= render 'headmin/views/devise/mailer/reset_password_instructions' %>
@@ -1 +1 @@
1
- <%= render "headmin/views/devise/mailer/unlock_instructions" %>
1
+ <%= render 'headmin/views/devise/mailer/unlock_instructions' %>
@@ -1 +1 @@
1
- <%= render "headmin/views/devise/passwords/edit" %>
1
+ <%= render 'headmin/views/devise/passwords/edit' %>
@@ -1 +1 @@
1
- <%= render "headmin/views/devise/passwords/new" %>
1
+ <%= render 'headmin/views/devise/passwords/new' %>
@@ -1 +1 @@
1
- <%= render "headmin/views/devise/registrations/edit" %>
1
+ <%= render 'headmin/views/devise/registrations/edit' %>
@@ -1 +1 @@
1
- <%= render "headmin/views/devise/registrations/new" %>
1
+ <%= render 'headmin/views/devise/registrations/new' %>
@@ -1 +1 @@
1
- <%= render "headmin/views/devise/sessions/new" %>
1
+ <%= render 'headmin/views/devise/sessions/new' %>
@@ -1 +1 @@
1
- <%= render "headmin/views/devise/unlocks/new" %>
1
+ <%= render 'headmin/views/devise/unlocks/new' %>
@@ -10,7 +10,7 @@
10
10
  </head>
11
11
  <body class="bg-light w-100 vh-100">
12
12
 
13
- <%= render "headmin/notifications" %>
13
+ <%= render 'headmin/notifications' %>
14
14
 
15
15
  <main class="d-flex justify-content-center align-items-center w-100 vh-100 p-3">
16
16
  <%= yield %>
@@ -1,3 +1,3 @@
1
1
  module Headmin
2
- VERSION = "0.5.1"
2
+ VERSION = "0.5.2"
3
3
  end