headmin 0.5.3 → 0.5.5

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 (63) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/app/assets/javascripts/headmin/controllers/media_controller.js +14 -14
  4. data/app/assets/javascripts/headmin/controllers/media_modal_controller.js +5 -5
  5. data/app/assets/javascripts/headmin/controllers/remote_modal_controller.js +1 -2
  6. data/app/assets/javascripts/headmin/controllers/textarea_controller.js +3 -3
  7. data/app/assets/javascripts/headmin.js +11 -11
  8. data/app/assets/stylesheets/headmin/forms/repeater.scss +0 -4
  9. data/app/assets/stylesheets/headmin/forms.scss +0 -6
  10. data/app/assets/stylesheets/headmin/overrides/redactorx.scss +1 -1
  11. data/app/assets/stylesheets/headmin/vendor/{tom-select-bootstrap.css → tom-select-bootstrap.scss} +0 -1
  12. data/app/assets/stylesheets/headmin.css +4 -8
  13. data/app/controllers/concerns/headmin/pagination.rb +5 -1
  14. data/app/models/concerns/headmin/field.rb +1 -1
  15. data/app/models/headmin/filter/association.rb +86 -0
  16. data/app/models/headmin/filter/association_view.rb +74 -0
  17. data/app/models/headmin/filter/base.rb +39 -19
  18. data/app/models/headmin/filter/boolean_view.rb +2 -5
  19. data/app/models/headmin/filter/date_view.rb +2 -5
  20. data/app/models/headmin/filter/field.rb +55 -0
  21. data/app/models/headmin/filter/field_view.rb +50 -0
  22. data/app/models/headmin/filter/filter_view.rb +25 -0
  23. data/app/models/headmin/filter/flatpickr_view.rb +1 -0
  24. data/app/models/headmin/filter/number_view.rb +2 -5
  25. data/app/models/headmin/filter/operator_view.rb +3 -1
  26. data/app/models/headmin/filter/options_view.rb +2 -5
  27. data/app/models/headmin/filter/text_view.rb +2 -5
  28. data/app/models/headmin/filters.rb +19 -4
  29. data/app/models/headmin/form/association_view.rb +102 -0
  30. data/app/models/headmin/form/blocks_view.rb +4 -1
  31. data/app/models/headmin/form/file_view.rb +0 -8
  32. data/app/models/headmin/form/flatpickr_view.rb +2 -1
  33. data/app/models/headmin/form/media_item_view.rb +39 -0
  34. data/app/models/headmin/form/media_view.rb +27 -3
  35. data/app/models/headmin/form/select_view.rb +2 -1
  36. data/app/models/headmin/thumbnail_view.rb +40 -19
  37. data/app/models/view_model.rb +4 -0
  38. data/app/views/headmin/_filters.html.erb +7 -2
  39. data/app/views/headmin/_thumbnail.html.erb +32 -8
  40. data/app/views/headmin/filters/_association.html.erb +24 -0
  41. data/app/views/headmin/filters/_field.html.erb +23 -0
  42. data/app/views/headmin/filters/_options.html.erb +1 -1
  43. data/app/views/headmin/forms/_association.html.erb +30 -0
  44. data/app/views/headmin/forms/_file.html.erb +4 -5
  45. data/app/views/headmin/forms/_media.html.erb +7 -5
  46. data/app/views/headmin/forms/_repeater.html.erb +10 -8
  47. data/app/views/headmin/forms/_wrapper.html.erb +0 -1
  48. data/app/views/headmin/forms/fields/_list.html.erb +6 -4
  49. data/app/views/headmin/forms/media/_item.html.erb +18 -12
  50. data/app/views/headmin/forms/repeater/_row.html.erb +2 -1
  51. data/app/views/headmin/media/_item.html.erb +1 -2
  52. data/app/views/headmin/media/_media_item_modal.html.erb +2 -2
  53. data/app/views/headmin/table/body/_association.html.erb +17 -3
  54. data/app/views/headmin/views/devise/shared/_links.html.erb +14 -20
  55. data/config/locales/activerecord/en.yml +1 -0
  56. data/config/locales/activerecord/nl.yml +1 -0
  57. data/config/locales/headmin/filters/en.yml +3 -1
  58. data/config/locales/headmin/filters/nl.yml +2 -0
  59. data/config/locales/headmin/media/en.yml +2 -2
  60. data/config/locales/headmin/media/nl.yml +2 -1
  61. data/lib/headmin/version.rb +1 -1
  62. data/package.json +1 -1
  63. metadata +13 -3
@@ -0,0 +1,24 @@
1
+ <%
2
+ # headmin/filters/association
3
+ #
4
+ # ==== Required parameters
5
+ # * +attribute+ - Name of the attribute to be filtered
6
+ # * +collection+ - Values to create option tags for
7
+ # * +form+ - Form object
8
+ #
9
+ # ==== Optional parameters
10
+ # * +label+ - Display label
11
+ # * +name+ - Name of the filter parameter
12
+ #
13
+ # ==== Examples
14
+ # Basic version
15
+ # <%= render "headmin/filters", url: admin_orders_path do |form| %#>
16
+ # <%= render "headmin/filters/association", form: form, attribute: :product %#>
17
+ # <% end %#>
18
+
19
+ association = Headmin::Filter::AssociationView.new(local_assigns.merge(params: params))
20
+ %>
21
+
22
+ <%= render "headmin/filters/base", association.base_options do |value| %>
23
+ <%= render "headmin/forms/select", association.input_options.merge(selected: value) %>
24
+ <% end %>
@@ -0,0 +1,23 @@
1
+ <%
2
+ # headmin/filters/field
3
+ #
4
+ # ==== Required parameters
5
+ # * +form+ - Form object
6
+ # * +attribute+ - Name of the attribute to be filtered
7
+ #
8
+ # ==== Optional parameters
9
+ # * +label+ - Display label
10
+ # * +name+ - Name of the filter parameter
11
+ #
12
+ # ==== Examples
13
+ # Basic version
14
+ # <%= render "headmin/filters", url: admin_orders_path do |form| %#>
15
+ # <%= render "headmin/filters/field", form: form, attribute: :title %#>
16
+ # <% end %#>
17
+
18
+ text = Headmin::Filter::FieldView.new(local_assigns.merge(params: params))
19
+ %>
20
+
21
+ <%= render "headmin/filters/base", text.base_options do |value| %>
22
+ <%= render "headmin/forms/text", text.input_options.merge({value: value}) %>
23
+ <% end %>
@@ -1,5 +1,5 @@
1
1
  <%
2
- # headmin/filters/boolean
2
+ # headmin/filters/options
3
3
  #
4
4
  # ==== Required parameters
5
5
  # * +attribute+ - Name of the attribute to be filtered
@@ -0,0 +1,30 @@
1
+ <%
2
+ # headmin/forms/association
3
+ #
4
+ # ==== Required parameters
5
+ # * +attribute+ - Name of the association
6
+ # * +form+ - Form object
7
+ #
8
+ # ==== Optional parameters
9
+ # * +collection+ - Values to create option tags for
10
+ #
11
+ #
12
+ # ==== Examples
13
+ # Basic version
14
+ # <%= form_with do |form| %#>
15
+ # <%= render "headmin/forms/association", form: form, attribute: :product %#>
16
+ # <% end %#>
17
+
18
+ association = Headmin::Form::AssociationView.new(local_assigns)
19
+
20
+ %>
21
+
22
+ <%= render "headmin/forms/wrapper", association.wrapper_options do %>
23
+ <%= render "headmin/forms/label", association.label_options if association.prepend_label? %>
24
+ <%= render "headmin/forms/input_group", association.input_group_options do %>
25
+ <%= form.select(association.attribute_with_id, association.collection, association.select_options, association.input_options) %>
26
+ <% end %>
27
+ <%= render "headmin/forms/validation", association.validation_options if association.validate? %>
28
+ <%= render "headmin/forms/hint", association.hint_options if association.hint? %>
29
+ <%= render "headmin/forms/label", association.label_options if association.append_label? %>
30
+ <% end %>
@@ -45,12 +45,11 @@
45
45
  next unless attachment
46
46
  filename = attachment.blob.filename.to_s
47
47
  size = number_to_human_size(attachment.blob.byte_size)
48
- src = attachment.image? ? url_for(attachment.variant(resize_to_fill: [file.thumbnail_width, file.thumbnail_height])) : url_for(attachment)
49
48
  %>
50
49
  <div class="h-form-file-thumbnail" title="<%= "#{filename} (#{size})" %>" data-file-preview-target="thumbnail">
51
50
  <%= ff.hidden_field(:id, disabled: !file.destroy) %>
52
51
  <%= ff.hidden_field(:_destroy, data: {"file-preview-target": "thumbnailDestroy"}, disabled: !file.destroy) %>
53
- <%= render "headmin/thumbnail", src: src, width: file.thumbnail_width, height: file.thumbnail_height %>
52
+ <%= render "headmin/thumbnail", file: attachment %>
54
53
 
55
54
  <% if file.destroy %>
56
55
  <div class="h-form-file-thumbnail-remove" data-action="click->file-preview#remove" data-file-preview-name-param="<%= filename %>">
@@ -62,12 +61,12 @@
62
61
 
63
62
  <!-- Placeholder -->
64
63
  <% if file.dropzone %>
65
- <div class="h-dropzone-placeholder <%= "d-none" if file.attachments.any? %>" data-file-preview-target="placeholder" style="height: <%= file.thumbnail_height %>px;">
64
+ <div class="h-dropzone-placeholder <%= "d-none" if file.attachments.any? %>" data-file-preview-target="placeholder" style="height: 100px;">
66
65
  <%= t("headmin.forms.file.placeholder", count: file.number_of_files) %>
67
66
  </div>
68
67
  <% else %>
69
68
  <div class="h-form-file-thumbnail <%= "d-none" if file.attachments.any? %>" title="<%= t("headmin.forms.file.not_found") %>" data-file-preview-target="placeholder">
70
- <%= render "headmin/thumbnail", width: file.thumbnail_width, height: file.thumbnail_height, icon: "plus" %>
69
+ <%= render "headmin/thumbnail", icon: "plus" %>
71
70
  </div>
72
71
  <% end %>
73
72
  </div>
@@ -76,7 +75,7 @@
76
75
  <!-- Template -->
77
76
  <template data-file-preview-target="template">
78
77
  <div class="h-form-file-thumbnail" title="" data-file-preview-target="thumbnail">
79
- <%= render "headmin/thumbnail", src: nil, width: file.thumbnail_width, height: file.thumbnail_height %>
78
+ <%= render "headmin/thumbnail" %>
80
79
 
81
80
  <% if file.destroy %>
82
81
  <div class="h-form-file-thumbnail-remove" data-action="click->file-preview#remove">
@@ -1,5 +1,5 @@
1
1
  <%
2
- # headmin/forms/file
2
+ # headmin/forms/media
3
3
  #
4
4
  # ==== Required parameters
5
5
  # * +attribute+ - Name of the attribute of the form model
@@ -13,6 +13,8 @@
13
13
  # * +max+ - Limit the selection to a maximum amount of items.
14
14
  # * +sort+ - Allow sorting by dragging items. `active_storage_attachments` must have a position column.
15
15
  # * +wrapper+ - Hash with all options for the surrounding html tag
16
+ # * +width+ - Width of the thumbnail
17
+ # * +height+ - Height of the thumbnail
16
18
  #
17
19
  # ==== References
18
20
  # https://headmin.dev/docs/forms/media
@@ -33,13 +35,13 @@
33
35
 
34
36
  <!-- Render previews for attachments -->
35
37
  <%= form.fields_for(media.nested_attribute, media.association_object) do |ff| %>
36
- <%= render "headmin/forms/media/item", form: ff, url: media.media_modal_url, sort: media.sort %>
38
+ <%= render "headmin/forms/media/item", media.item_options.merge(form: ff, url: headmin_media_url(name: media.name, ids: media.blob_ids, min: media.min, max: media.max)) %>
37
39
  <% end %>
38
40
 
39
41
  <!-- Placeholder -->
40
42
  <div class="<%= "d-none" if media.attachments.any? %>" data-media-target="placeholder">
41
- <a href="<%= media.media_modal_url %>" data-turbo-frame="remote_modal" data-media-target="modalButton">
42
- <%= render "headmin/thumbnail", src: nil, width: 100, height: 100, icon: "plus" %>
43
+ <a href="<%= headmin_media_url(name: media.name, ids: media.blob_ids, min: media.min, max: media.max) %>" data-turbo-frame="remote_modal" data-media-target="modalButton">
44
+ <%= render "headmin/thumbnail", media.thumbnail_options %>
43
45
  </a>
44
46
  </div>
45
47
  </div>
@@ -48,7 +50,7 @@
48
50
  <% association_object = ActiveStorage::Attachment.new %>
49
51
  <template data-media-target="template" data-template-id-regex="<%= association_object.object_id %>">
50
52
  <%= form.fields_for(media.nested_attribute, ActiveStorage::Attachment.new, child_index: association_object.object_id) do |ff| %>
51
- <%= render "headmin/forms/media/item", form: ff, url: media.media_modal_url, sort: media.sort %>
53
+ <%= render "headmin/forms/media/item", media.item_options.merge(form: ff, url: headmin_media_url(name: media.name, ids: media.blob_ids, min: media.min, max: media.max)) %>
52
54
  <% end %>
53
55
  </template>
54
56
 
@@ -2,12 +2,13 @@
2
2
  # headmin/forms/repeater
3
3
  #
4
4
  # ==== Options
5
- # * +form</tt> - Form object
6
- # * +attribute</tt> - Name of the attribute of the form model
7
- # * +header</tt> - Name of the template to use as header
5
+ # * +form+ - Form object
6
+ # * +attribute+ - Name of the attribute of the form model
7
+ # * +header+ - Name of the template to use as header
8
8
  # * +label+ - Text to show as label. Label will be hidden if value is false
9
- # * +templates</tt> - List of all views that can be used as a template for a new block
10
- # * +flush</tt> - Set to true if you want the list items to sit flush with its parent.
9
+ # * +templates+ - List of all views that can be used as a template for a new block
10
+ # * +flush+ - Set to true if you want the list items to sit flush with its parent.
11
+ # * +row+ - Pass hash with options to pass to the row template.
11
12
  #
12
13
  # ==== Examples
13
14
  # # Basic version
@@ -36,6 +37,7 @@
36
37
  header = local_assigns.has_key?(:header) ? header : nil
37
38
  templates = local_assigns.has_key?(:templates) ? templates : []
38
39
  flush = local_assigns.has_key?(:flush) ? flush : true
40
+ row_options = local_assigns.has_key?(:row) ? row : {}
39
41
 
40
42
  template_names = templates.map { |template| File.basename(template, ".html.erb") }
41
43
  template_names = template_names.any? ? template_names : ["new"]
@@ -55,7 +57,7 @@
55
57
  <%= render "headmin/forms/label", form: form, attribute: attribute, text: label, required: required %>
56
58
  <% end %>
57
59
 
58
- <ul class="repeater list-group <%= "list-group-flush" if flush %>" data-controller="repeater" data-repeater-target="list" data-repeater-id-value="<%= repeater_id %>">
60
+ <ul class="repeater list-group <%= "list-group-flush" if flush %> mb-3" data-controller="repeater" data-repeater-target="list" data-repeater-id-value="<%= repeater_id %>">
59
61
 
60
62
  <!-- Header -->
61
63
  <% if header %>
@@ -66,7 +68,7 @@
66
68
 
67
69
  <!-- Rows -->
68
70
  <%= form.fields_for attribute, associations do |ff| %>
69
- <%= render "headmin/forms/repeater/row", pass_thru: pass_thru, form: ff, repeater_id: repeater_id do %>
71
+ <%= render "headmin/forms/repeater/row", row_options.merge(pass_thru: pass_thru, form: ff, repeater_id: repeater_id) do %>
70
72
  <%= yield(ff) %>
71
73
  <% end %>
72
74
  <% end %>
@@ -114,7 +116,7 @@
114
116
  <% template_names.each do |name| %>
115
117
  <template data-repeater-target="template" data-template-name="<%= name %>" data-template-id-regex="<%= association_object.object_id %>">
116
118
  <%= form.fields_for attribute, association_object, child_index: association_object.object_id do |ff| %>
117
- <%= render "headmin/forms/repeater/row", form: ff, pass_thru: pass_thru, repeater_id: repeater_id do %>
119
+ <%= render "headmin/forms/repeater/row", row_options.merge(form: ff, pass_thru: pass_thru, repeater_id: repeater_id) do %>
118
120
  <% yield(ff, name) %>
119
121
  <% end %>
120
122
  <% end %>
@@ -1,5 +1,4 @@
1
1
  <% wrapper = Headmin::Form::WrapperView.new(local_assigns) %>
2
-
3
2
  <% if wrapper.bypass %>
4
3
  <%= yield %>
5
4
  <% else %>
@@ -19,8 +19,10 @@
19
19
  %>
20
20
 
21
21
  <%= render "headmin/forms/fields/base", form: form, name: name, field_type: :list do |list, field_label| %>
22
- <%= render "headmin/forms/repeater", form: list, attribute: :fields, label: show_label ? label || field_label : false, flush: false do |field| %>
23
- <%= field.hidden_field :field_type, value: :group %>
24
- <%= yield field %>
25
- <% end %>
22
+ <div class="mb-3">
23
+ <%= render "headmin/forms/repeater", form: list, attribute: :fields, label: show_label ? label || field_label : false, flush: false do |field| %>
24
+ <%= field.hidden_field :field_type, value: :group %>
25
+ <%= yield field %>
26
+ <% end %>
27
+ </div>
26
28
  <% end %>
@@ -1,26 +1,32 @@
1
1
  <%
2
- attachment = form.object
3
- filename = attachment.blob&.filename&.to_s
4
- size = number_to_human_size(attachment.blob&.byte_size || 0)
5
- src = nil
6
- if attachment.blob
7
- src = attachment.image? ? url_for(attachment.variant(resize_to_fill: [100, 100])) : url_for(attachment)
8
- end
2
+ # headmin/forms/media/item
3
+ #
4
+ # ==== Required parameters
5
+ # * +form+ - Form object
6
+ # * +url+ - URL for the media modal
7
+ #
8
+ # ==== Optional parameters
9
+ # * +sort+ - Allow sorting by dragging items. `active_storage_attachments` must have a position column.
10
+ # * +width+ - Width of the thumbnail
11
+ # * +height+ - Height of the thumbnail
12
+ #
13
+
14
+ media_item = Headmin::Form::MediaItemView.new(local_assigns)
9
15
  %>
10
16
 
11
- <div class="h-form-file-thumbnail media-drag-sort-handle" title="<%= "#{filename} (#{size})" %>" data-media-target="item">
17
+ <div class="h-form-file-thumbnail media-drag-sort-handle" title="<%= "#{media_item.filename} (#{media_item.size})" %>" data-media-target="item">
12
18
  <%= form.hidden_field(:id) %>
13
19
  <%= form.hidden_field(:blob_id) %>
14
- <%= form.hidden_field(:position, value: attachment.new_record? ? nil : attachment.position) if sort %>
20
+ <%= form.hidden_field(:position, value: media_item.position_value) if media_item.sort %>
15
21
  <%= form.hidden_field(:_destroy) %>
16
22
 
17
- <a href="<%= url %>" data-turbo-frame="remote_modal" data-media-target="modalButton">
18
- <%= render "headmin/thumbnail", src: src, width: 100, height: 100 %>
23
+ <a href="<%= media_item.url %>" data-turbo-frame="remote_modal" data-media-target="modalButton">
24
+ <%= render "headmin/thumbnail", media_item.thumbnail_options %>
19
25
  </a>
20
26
 
21
27
  <div class="h-form-file-thumbnail-actions">
22
28
  <!-- Edit -->
23
- <a href="<%= headmin_media_item_url(id: attachment.blob ? attachment.blob.id : "$1") %>" class="h-form-file-thumbnail-edit" data-turbo-frame="remote_modal" data-media-target="editButton">
29
+ <a href="<%= headmin_media_item_url(id: media_item.id) %>" class="h-form-file-thumbnail-edit" data-turbo-frame="remote_modal" data-media-target="editButton">
24
30
  <%= bootstrap_icon("pencil") %>
25
31
  </a>
26
32
 
@@ -7,9 +7,10 @@
7
7
 
8
8
  draggable = form.object.respond_to?(:position)
9
9
  destroyable = form.object.respond_to?(:destroy)
10
+ class_names = local_assigns.has_key?(:class) ? local_assigns[:class] : "repeater-row list-group-item"
10
11
  %>
11
12
 
12
- <div class="repeater-row list-group-item"
13
+ <div class="<%= class_names %>"
13
14
  data-repeater-target="row"
14
15
  data-row-index="<%= form.options[:child_index] %>"
15
16
  data-new-record="<%= form.object.new_record? %>"
@@ -11,7 +11,6 @@
11
11
 
12
12
  <!-- Label -->
13
13
  <label for="media-item-<%= blob.id %>">
14
- <% src = blob.image? ? url_for(blob.variant(resize_to_fill: [100, 100])) : url_for(blob) %>
15
- <%= render "headmin/thumbnail", src: src, width: 100, height: 100 %>
14
+ <%= render "headmin/thumbnail", file: blob %>
16
15
  </label>
17
16
  </div>
@@ -7,8 +7,8 @@
7
7
  <div class="modal-body">
8
8
  <%= render "headmin/notifications" %>
9
9
  <div class="row">
10
- <div class="col-3">
11
- <%= render "headmin/thumbnail", src: url_for(@blob), width: 100, height: 100 %>
10
+ <div class="col-4">
11
+ <%= render "headmin/thumbnail", file: @blob %>
12
12
  </div>
13
13
  <div class="col-8 d-flex flex-column justify-content-center">
14
14
  <p class="small text-secondary m-0">
@@ -2,10 +2,24 @@
2
2
  headmin/table/body/association
3
3
  accepts block: no
4
4
  parameters:
5
- object: (ActiveRecord::Base) Model resource for which an association needs to be called
6
- attribute: (string) Name of the association
5
+ value: (string) Name of the association
7
6
  %>
8
7
 
9
8
  <td>
10
- <%= t(".items", count: object.send(attribute).count) %>
9
+ <% if defined?(url) && url %>
10
+ <a href="<%= url %>" title="<% t(".open") %>" target=_blank>
11
+ <% if value.respond_to?(:each) %>
12
+ <%= value.map { |i| i.to_s }.join(", ") %>
13
+ <% else %>
14
+ <%= value.to_s %>
15
+ <% end %>
16
+ <%= bootstrap_icon("box-arrow-up-right") %>
17
+ </a>
18
+ <% else %>
19
+ <% if value.respond_to?(:each) %>
20
+ <%= value.map { |i| i.to_s }.join(", ") %>
21
+ <% else %>
22
+ <%= value.to_s %>
23
+ <% end %>
24
+ <% end %>
11
25
  </td>
@@ -1,27 +1,21 @@
1
1
  <div class="bg-light mt-5 text-center">
2
- <%- if controller_name != "sessions" %>
3
- <%= link_to t(".sign_in"), new_session_path(resource_name) %><br />
4
- <% end %>
5
-
6
- <%- if devise_mapping.registerable? && controller_name != "registrations" %>
7
- <%= link_to t(".sign_up"), new_registration_path(resource_name) %><br />
8
- <% end %>
2
+ <%- if controller_name != "sessions" %>
3
+ <%= link_to t(".sign_in"), new_session_path(resource_name) %><br/>
4
+ <% end %>
9
5
 
10
- <%- if devise_mapping.recoverable? && controller_name != "passwords" && controller_name != "registrations" %>
11
- <%= link_to t(".forgot_password"), new_password_path(resource_name) %><br />
12
- <% end %>
6
+ <%- if devise_mapping.registerable? && controller_name != "registrations" %>
7
+ <%= link_to t(".sign_up"), new_registration_path(resource_name) %><br/>
8
+ <% end %>
13
9
 
14
- <%- if devise_mapping.confirmable? && controller_name != "confirmations" %>
15
- <%= link_to t(".confirmation"), new_confirmation_path(resource_name) %><br />
16
- <% end %>
10
+ <%- if devise_mapping.recoverable? && controller_name != "passwords" && controller_name != "registrations" %>
11
+ <%= link_to t(".forgot_password"), new_password_path(resource_name) %><br/>
12
+ <% end %>
17
13
 
18
- <%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != "unlocks" %>
19
- <%= link_to t(".unlock"), new_unlock_path(resource_name) %><br />
20
- <% end %>
14
+ <%- if devise_mapping.confirmable? && controller_name != "confirmations" %>
15
+ <%= link_to t(".confirmation"), new_confirmation_path(resource_name) %><br/>
16
+ <% end %>
21
17
 
22
- <%- if devise_mapping.omniauthable? %>
23
- <%- resource_class.omniauth_providers.each do |provider| %>
24
- <%= link_to t(".omniauth", provider: OmniAuth::Utils.camelize(provider)), omniauth_authorize_path(resource_name, provider), method: :post %><br />
18
+ <%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != "unlocks" %>
19
+ <%= link_to t(".unlock"), new_unlock_path(resource_name) %><br/>
25
20
  <% end %>
26
- <% end %>
27
21
  </div>
@@ -2,6 +2,7 @@ en:
2
2
  attributes:
3
3
  created_at: Created at
4
4
  email: Email
5
+ filename: Filename
5
6
  password: Password
6
7
  password_confirmation: Password confirmation
7
8
  remember_me: Stay logged in
@@ -2,6 +2,7 @@ nl:
2
2
  attributes:
3
3
  created_at: Aangemaakt
4
4
  email: E-mailadres
5
+ filename: Bestandsnaam
5
6
  password: Wachtwoord
6
7
  password_confirmation: Wachtwoord bevestiging
7
8
  remember_me: Aangemeld blijven
@@ -31,8 +31,10 @@ en:
31
31
  does_not_match: does not matches with
32
32
  is_not_null: is not null
33
33
  is_null: is null
34
+ in: includes
35
+ not_in: does not include
34
36
  values:
35
37
  "false": "False"
36
38
  "no": "No"
37
- "true": "Hello"
39
+ "true": "True"
38
40
  "yes": "Yes"
@@ -31,6 +31,8 @@ nl:
31
31
  does_not_match: lijkt niet op
32
32
  is_not_null: is ingevuld
33
33
  is_null: is niet ingevuld
34
+ in: bevat
35
+ not_in: bevat niet
34
36
  values:
35
37
  "false": Onwaar
36
38
  "no": Nee
@@ -3,15 +3,15 @@ en:
3
3
  media:
4
4
  modal:
5
5
  close: Close
6
- placeholder: Upload your first file to the media library
7
6
  limits: "minimum: %{min} en maximum: %{max}"
7
+ maximum: " of %{count}"
8
+ placeholder: Upload your first file to the media library
8
9
  select: Select
9
10
  title:
10
11
  one: Select at least 1 file
11
12
  other: Select at least %{count} files
12
13
  unlimited: unlimited
13
14
  upload: Upload new files
14
- maximum: " of %{count}"
15
15
  media_item_modal:
16
16
  close: Close
17
17
  dimensions: Dimensions
@@ -3,8 +3,9 @@ nl:
3
3
  media:
4
4
  modal:
5
5
  close: Sluiten
6
- placeholder: Upload je eerste bestand naar de mediabibliotheek
7
6
  limits: "minimum: %{min} and maximum: %{max}"
7
+ maximum: " van %{count}"
8
+ placeholder: Upload je eerste bestand naar de mediabibliotheek
8
9
  select: Selecteer
9
10
  title:
10
11
  one: Selecteer bestand
@@ -1,3 +1,3 @@
1
1
  module Headmin
2
- VERSION = "0.5.3"
2
+ VERSION = "0.5.5"
3
3
  end
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "headmin",
3
- "version": "0.5.2",
3
+ "version": "0.5.4",
4
4
  "description": "Admin component library",
5
5
  "module": "app/assets/javascripts/headmin.js",
6
6
  "main": "app/assets/javascripts/headmin.js",
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: headmin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.3
4
+ version: 0.5.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jef Vlamings
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-07-05 00:00:00.000000000 Z
11
+ date: 2022-09-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: closure_tree
@@ -230,7 +230,7 @@ files:
230
230
  - app/assets/stylesheets/headmin/vendor/bootstrap/scss/vendor/_rfs.scss
231
231
  - app/assets/stylesheets/headmin/vendor/flatpickr.css
232
232
  - app/assets/stylesheets/headmin/vendor/redactorx.css
233
- - app/assets/stylesheets/headmin/vendor/tom-select-bootstrap.css
233
+ - app/assets/stylesheets/headmin/vendor/tom-select-bootstrap.scss
234
234
  - app/controllers/concerns/headmin/acts_as_list.rb
235
235
  - app/controllers/concerns/headmin/authentication.rb
236
236
  - app/controllers/concerns/headmin/filterable.rb
@@ -258,6 +258,8 @@ files:
258
258
  - app/models/concerns/headmin/form/wrappable.rb
259
259
  - app/models/headmin/.DS_Store
260
260
  - app/models/headmin/blocks_view.rb
261
+ - app/models/headmin/filter/association.rb
262
+ - app/models/headmin/filter/association_view.rb
261
263
  - app/models/headmin/filter/base.rb
262
264
  - app/models/headmin/filter/base_view.rb
263
265
  - app/models/headmin/filter/boolean.rb
@@ -266,6 +268,9 @@ files:
266
268
  - app/models/headmin/filter/conditional_view.rb
267
269
  - app/models/headmin/filter/date.rb
268
270
  - app/models/headmin/filter/date_view.rb
271
+ - app/models/headmin/filter/field.rb
272
+ - app/models/headmin/filter/field_view.rb
273
+ - app/models/headmin/filter/filter_view.rb
269
274
  - app/models/headmin/filter/flatpickr_view.rb
270
275
  - app/models/headmin/filter/menu_item_view.rb
271
276
  - app/models/headmin/filter/money.rb
@@ -279,6 +284,7 @@ files:
279
284
  - app/models/headmin/filter/text.rb
280
285
  - app/models/headmin/filter/text_view.rb
281
286
  - app/models/headmin/filters.rb
287
+ - app/models/headmin/form/association_view.rb
282
288
  - app/models/headmin/form/blocks_view.rb
283
289
  - app/models/headmin/form/checkbox_view.rb
284
290
  - app/models/headmin/form/color_view.rb
@@ -294,6 +300,7 @@ files:
294
300
  - app/models/headmin/form/hint_view.rb
295
301
  - app/models/headmin/form/input_group_view.rb
296
302
  - app/models/headmin/form/label_view.rb
303
+ - app/models/headmin/form/media_item_view.rb
297
304
  - app/models/headmin/form/media_view.rb
298
305
  - app/models/headmin/form/number_view.rb
299
306
  - app/models/headmin/form/password_view.rb
@@ -328,9 +335,11 @@ files:
328
335
  - app/views/headmin/dropdown/_item.html.erb
329
336
  - app/views/headmin/dropdown/_list.html.erb
330
337
  - app/views/headmin/dropdown/_locale.html.erb
338
+ - app/views/headmin/filters/_association.html.erb
331
339
  - app/views/headmin/filters/_base.html.erb
332
340
  - app/views/headmin/filters/_boolean.html.erb
333
341
  - app/views/headmin/filters/_date.html.erb
342
+ - app/views/headmin/filters/_field.html.erb
334
343
  - app/views/headmin/filters/_flatpickr.html.erb
335
344
  - app/views/headmin/filters/_number.html.erb
336
345
  - app/views/headmin/filters/_options.html.erb
@@ -342,6 +351,7 @@ files:
342
351
  - app/views/headmin/filters/filter/_null_select.html.erb
343
352
  - app/views/headmin/filters/filter/_operator.html.erb
344
353
  - app/views/headmin/filters/filter/_row.html.erb
354
+ - app/views/headmin/forms/_association.html.erb
345
355
  - app/views/headmin/forms/_autocomplete.html.erb
346
356
  - app/views/headmin/forms/_blocks.html.erb
347
357
  - app/views/headmin/forms/_checkbox.html.erb