headmin 0.4.2 → 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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +10 -3
- data/Gemfile +14 -0
- data/Gemfile.lock +78 -1
- data/app/assets/javascripts/headmin/controllers/date_range_controller.js +12 -6
- data/app/assets/javascripts/headmin/controllers/filter_controller.js +61 -11
- data/app/assets/javascripts/headmin/controllers/filter_row_controller.js +50 -0
- data/app/assets/javascripts/headmin/controllers/flatpickr_controller.js +2 -6
- data/app/assets/javascripts/headmin/controllers/media_controller.js +237 -0
- data/app/assets/javascripts/headmin/controllers/media_modal_controller.js +110 -0
- data/app/assets/javascripts/headmin/controllers/popup_controller.js +3 -1
- data/app/assets/javascripts/headmin/controllers/remote_modal_controller.js +10 -0
- data/app/assets/javascripts/headmin/controllers/table_actions_controller.js +16 -21
- data/app/assets/javascripts/headmin/controllers/textarea_controller.js +34 -0
- data/app/assets/javascripts/headmin/index.js +10 -0
- data/app/assets/javascripts/headmin.js +413 -38
- data/app/assets/stylesheets/headmin/filter.scss +74 -0
- data/app/assets/stylesheets/headmin/forms/file.scss +40 -5
- data/app/assets/stylesheets/headmin/forms/media.scss +10 -0
- data/app/assets/stylesheets/headmin/forms/repeater.scss +4 -0
- data/app/assets/stylesheets/headmin/forms.scss +7 -0
- data/app/assets/stylesheets/headmin/general.scss +0 -1
- data/app/assets/stylesheets/headmin/layout/body.scss +5 -0
- data/app/assets/stylesheets/headmin/layout/sidebar.scss +0 -1
- data/app/assets/stylesheets/headmin/media/index.scss +9 -0
- data/app/assets/stylesheets/headmin/media.scss +1 -0
- data/app/assets/stylesheets/headmin/popup.scss +0 -1
- data/app/assets/stylesheets/headmin/table.scss +15 -0
- data/app/assets/stylesheets/headmin.css +137 -9
- data/app/assets/stylesheets/headmin.scss +1 -0
- data/app/controllers/concerns/headmin/filterable.rb +27 -0
- data/app/controllers/headmin/media_controller.rb +52 -0
- data/app/controllers/headmin_controller.rb +2 -0
- data/app/models/concerns/headmin/field.rb +0 -1
- data/app/models/concerns/headmin/fieldable.rb +10 -1
- data/app/models/concerns/headmin/form/hintable.rb +6 -1
- data/app/models/headmin/blocks_view.rb +1 -1
- data/app/models/headmin/filter/base.rb +238 -0
- data/app/models/headmin/filter/base_view.rb +64 -0
- data/app/models/headmin/filter/boolean.rb +15 -0
- data/app/models/headmin/filter/boolean_view.rb +61 -0
- data/app/models/headmin/filter/button_view.rb +25 -0
- data/app/models/headmin/filter/conditional_view.rb +16 -0
- data/app/models/headmin/filter/date.rb +67 -0
- data/app/models/headmin/filter/date_view.rb +52 -0
- data/app/models/headmin/filter/flatpickr_view.rb +54 -0
- data/app/models/headmin/filter/menu_item_view.rb +6 -0
- data/app/models/headmin/filter/money.rb +13 -0
- data/app/models/headmin/filter/number.rb +27 -0
- data/app/models/headmin/filter/number_view.rb +54 -0
- data/app/models/headmin/filter/operator_view.rb +30 -0
- data/app/models/headmin/filter/options_view.rb +61 -0
- data/app/models/headmin/filter/row_view.rb +13 -0
- data/app/models/headmin/filter/search.rb +18 -0
- data/app/models/headmin/filter/search_view.rb +31 -0
- data/app/models/headmin/filter/text.rb +25 -0
- data/app/models/headmin/filter/text_view.rb +53 -0
- data/app/models/headmin/filters.rb +29 -0
- data/app/models/headmin/form/color_view.rb +48 -0
- data/app/models/headmin/form/datetime_range_view.rb +25 -0
- data/app/models/headmin/form/datetime_view.rb +45 -0
- data/app/models/headmin/form/flatpickr_range_view.rb +4 -15
- data/app/models/headmin/form/flatpickr_view.rb +3 -12
- data/app/models/headmin/form/media_view.rb +113 -0
- data/app/models/headmin/form/textarea_view.rb +6 -1
- data/app/models/view_model.rb +1 -1
- data/app/views/headmin/_blocks.html.erb +3 -3
- data/app/views/headmin/_breadcrumbs.html.erb +1 -1
- data/app/views/headmin/_dropdown.html.erb +1 -1
- data/app/views/headmin/_filters.html.erb +9 -9
- data/app/views/headmin/_heading.html.erb +1 -1
- data/app/views/headmin/_notifications.html.erb +1 -1
- data/app/views/headmin/_pagination.html.erb +2 -2
- data/app/views/headmin/dropdown/_devise.html.erb +7 -7
- data/app/views/headmin/dropdown/_list.html.erb +1 -1
- data/app/views/headmin/filters/_base.html.erb +95 -0
- data/app/views/headmin/filters/_boolean.html.erb +23 -0
- data/app/views/headmin/filters/_date.html.erb +14 -38
- data/app/views/headmin/filters/_flatpickr.html.erb +15 -48
- data/app/views/headmin/filters/_number.html.erb +23 -0
- data/app/views/headmin/filters/_options.html.erb +24 -0
- data/app/views/headmin/filters/_search.html.erb +14 -12
- data/app/views/headmin/filters/_text.html.erb +23 -0
- data/app/views/headmin/filters/filter/_button.html.erb +9 -10
- data/app/views/headmin/filters/filter/_conditional.html.erb +18 -0
- data/app/views/headmin/filters/filter/_menu_item.html.erb +5 -2
- data/app/views/headmin/filters/filter/_null_select.html.erb +8 -0
- data/app/views/headmin/filters/filter/_operator.html.erb +16 -0
- data/app/views/headmin/filters/filter/_row.html.erb +11 -0
- data/app/views/headmin/forms/_autocomplete.html.erb +2 -2
- data/app/views/headmin/forms/_blocks.html.erb +3 -3
- data/app/views/headmin/forms/_checkbox.html.erb +5 -5
- data/app/views/headmin/forms/_color.html.erb +32 -0
- data/app/views/headmin/forms/_date.html.erb +8 -8
- data/app/views/headmin/forms/_datetime.html.erb +41 -0
- data/app/views/headmin/forms/_datetime_range.html.erb +40 -0
- data/app/views/headmin/forms/_email.html.erb +9 -9
- data/app/views/headmin/forms/_file.html.erb +9 -9
- data/app/views/headmin/forms/_flatpickr.html.erb +1 -1
- data/app/views/headmin/forms/_flatpickr_range.html.erb +9 -10
- data/app/views/headmin/forms/_hidden.html.erb +1 -1
- data/app/views/headmin/forms/_hint.html.erb +7 -2
- data/app/views/headmin/forms/_media.html.erb +58 -0
- data/app/views/headmin/forms/_number.html.erb +8 -8
- data/app/views/headmin/forms/_password.html.erb +7 -7
- data/app/views/headmin/forms/_redactorx.html.erb +2 -2
- data/app/views/headmin/forms/_search.html.erb +9 -9
- data/app/views/headmin/forms/_select.html.erb +8 -8
- data/app/views/headmin/forms/_switch.html.erb +2 -2
- data/app/views/headmin/forms/_text.html.erb +9 -9
- data/app/views/headmin/forms/_textarea.html.erb +7 -7
- data/app/views/headmin/forms/_url.html.erb +9 -9
- data/app/views/headmin/forms/_validation.html.erb +1 -1
- data/app/views/headmin/forms/_wysiwyg.html.erb +2 -2
- data/app/views/headmin/forms/fields/_base.html.erb +1 -1
- data/app/views/headmin/forms/fields/_file.html.erb +1 -1
- data/app/views/headmin/forms/fields/_files.html.erb +1 -1
- data/app/views/headmin/forms/fields/_group.html.erb +2 -2
- data/app/views/headmin/forms/fields/_list.html.erb +1 -1
- data/app/views/headmin/forms/fields/_text.html.erb +1 -1
- data/app/views/headmin/forms/media/_item.html.erb +32 -0
- data/app/views/headmin/forms/media/_validation.html.erb +10 -0
- data/app/views/headmin/forms/repeater/_row.html.erb +12 -11
- data/app/views/headmin/layout/_footer.html.erb +1 -1
- data/app/views/headmin/layout/_main.html.erb +2 -0
- data/app/views/headmin/layout/_remote_modal.html.erb +1 -0
- data/app/views/headmin/layout/_sidebar.html.erb +1 -1
- data/app/views/headmin/media/_item.html.erb +17 -0
- data/app/views/headmin/media/_media_item_modal.html.erb +51 -0
- data/app/views/headmin/media/_modal.html.erb +35 -0
- data/app/views/headmin/media/create.turbo_stream.erb +5 -0
- data/app/views/headmin/media/index.html.erb +3 -0
- data/app/views/headmin/media/show.html.erb +9 -0
- data/app/views/headmin/media/update.turbo_stream.erb +3 -0
- data/app/views/headmin/nav/item/_devise.html.erb +7 -7
- data/app/views/headmin/table/_actions.html.erb +1 -4
- data/app/views/headmin/table/actions/_action.html.erb +3 -3
- data/app/views/headmin/table/actions/_delete.html.erb +2 -2
- data/app/views/headmin/table/actions/_export.html.erb +1 -1
- data/app/views/headmin/table/body/_color.html.erb +10 -0
- data/app/views/headmin/table/body/_image.html.erb +18 -0
- data/app/views/headmin/table/foot/_cell.html.erb +1 -1
- data/app/views/headmin/table/foot/_id.html.erb +1 -1
- data/app/views/headmin/views/devise/confirmations/_new.html.erb +2 -2
- data/app/views/headmin/views/devise/passwords/_edit.html.erb +2 -2
- data/app/views/headmin/views/devise/passwords/_new.html.erb +2 -2
- data/app/views/headmin/views/devise/registrations/_edit.html.erb +1 -1
- data/app/views/headmin/views/devise/registrations/_new.html.erb +2 -2
- data/app/views/headmin/views/devise/sessions/_new.html.erb +1 -1
- data/app/views/headmin/views/devise/unlocks/_new.html.erb +2 -2
- data/config/locales/devise/nl.yml +1 -1
- data/config/locales/en.yml +4 -0
- data/config/locales/headmin/dropdown/en.yml +6 -0
- data/config/locales/headmin/dropdown/nl.yml +6 -0
- data/config/locales/headmin/filters/en.yml +26 -1
- data/config/locales/headmin/filters/nl.yml +26 -1
- data/config/locales/headmin/forms/en.yml +8 -0
- data/config/locales/headmin/forms/nl.yml +8 -0
- data/config/locales/headmin/layout/en.yml +0 -9
- data/config/locales/headmin/layout/nl.yml +0 -9
- data/config/locales/headmin/media/en.yml +23 -0
- data/config/locales/headmin/media/nl.yml +22 -0
- data/config/locales/headmin/nav/en.yml +7 -0
- data/config/locales/headmin/nav/nl.yml +7 -0
- data/config/locales/headmin/table/en.yml +2 -0
- data/config/locales/headmin/table/nl.yml +2 -0
- data/config/locales/nl.yml +4 -0
- data/config/routes.rb +10 -0
- data/lib/generators/templates/views/auth/confirmations/new.html.erb +1 -1
- data/lib/generators/templates/views/auth/mailer/confirmation_instructions.html.erb +1 -1
- data/lib/generators/templates/views/auth/mailer/email_changed.html.erb +1 -1
- data/lib/generators/templates/views/auth/mailer/password_change.html.erb +1 -1
- data/lib/generators/templates/views/auth/mailer/reset_password_instructions.html.erb +1 -1
- data/lib/generators/templates/views/auth/mailer/unlock_instructions.html.erb +1 -1
- data/lib/generators/templates/views/auth/passwords/edit.html.erb +1 -1
- data/lib/generators/templates/views/auth/passwords/new.html.erb +1 -1
- data/lib/generators/templates/views/auth/registrations/edit.html.erb +1 -1
- data/lib/generators/templates/views/auth/registrations/new.html.erb +1 -1
- data/lib/generators/templates/views/auth/sessions/new.html.erb +1 -1
- data/lib/generators/templates/views/auth/unlocks/new.html.erb +1 -1
- data/lib/headmin/version.rb +1 -1
- data/package.json +1 -1
- metadata +70 -7
- data/.lock-487e157d270f3062a98b7b2a012753708-1272821827 +0 -0
- data/app/controllers/concerns/headmin/filter.rb +0 -5
- data/app/controllers/concerns/headmin/searchable.rb +0 -15
- data/app/views/headmin/filters/_select.html.erb +0 -45
- data/app/views/headmin/filters/filter/_template.html.erb +0 -13
@@ -19,10 +19,10 @@
|
|
19
19
|
# ==== Examples
|
20
20
|
# Basic version
|
21
21
|
# <%= form_with do |form| %#>
|
22
|
-
# <%= render
|
22
|
+
# <%= render 'headmin/forms/redactorx', form: form, attribute: :text %#>
|
23
23
|
# <% end %#>
|
24
24
|
|
25
25
|
wysiwyg = Headmin::Form::WysiwygView.new(local_assigns)
|
26
26
|
%>
|
27
27
|
|
28
|
-
<%= render
|
28
|
+
<%= render 'headmin/forms/redactorx', wysiwyg.options %>
|
@@ -9,7 +9,7 @@
|
|
9
9
|
# ==== Examples
|
10
10
|
# Basic version
|
11
11
|
# <%= render 'headmin/forms/fields/base', form: form, field_type: :text, name: name do |field, label| %#>
|
12
|
-
# <%= render
|
12
|
+
# <%= render 'headmin/forms/text', form: field, attribute: :value, label: label %#>
|
13
13
|
# <% end %#>
|
14
14
|
|
15
15
|
field = form.object.fields.detect { |field| field.name.to_s == name.to_s }
|
@@ -8,7 +8,7 @@
|
|
8
8
|
# ==== Examples
|
9
9
|
# Basic version
|
10
10
|
# <%= render 'headmin/forms/fields/file', form: group, name: :file do |field, attribute, label| %#>
|
11
|
-
# <%= render
|
11
|
+
# <%= render 'headmin/forms/file', form: field, attribute: attribute, label: label %#>
|
12
12
|
# <% end %#>
|
13
13
|
%>
|
14
14
|
|
@@ -8,7 +8,7 @@
|
|
8
8
|
# ==== Examples
|
9
9
|
# Basic version
|
10
10
|
# <%= render 'headmin/forms/fields/file', form: group, name: :file do |field, attribute, label| %#>
|
11
|
-
# <%= render
|
11
|
+
# <%= render 'headmin/forms/file', form: field, attribute: attribute, label: label %#>
|
12
12
|
# <% end %#>
|
13
13
|
%>
|
14
14
|
|
@@ -12,12 +12,12 @@
|
|
12
12
|
# <div class="row">
|
13
13
|
# <div class="col-md-6">
|
14
14
|
# <%= render 'headmin/forms/fields/text', form: group, name: :name do |field, attribute, label| %#>
|
15
|
-
# <%= render
|
15
|
+
# <%= render 'headmin/forms/text', form: field, attribute: attribute, label: label %#>
|
16
16
|
# <% end %#>
|
17
17
|
# </div>
|
18
18
|
# <div class="col-md-6">
|
19
19
|
# <%= render 'headmin/forms/fields/text', form: group, name: :url do |field, attribute, label| %#>
|
20
|
-
# <%= render
|
20
|
+
# <%= render 'headmin/forms/text', form: field, attribute: attribute, label: label %#>
|
21
21
|
# <% end %#>
|
22
22
|
# </div>
|
23
23
|
# </div>
|
@@ -10,7 +10,7 @@
|
|
10
10
|
# Basic version
|
11
11
|
# <%= render 'headmin/forms/fields/list', form: form, name: :websites do |list| %#>
|
12
12
|
# <%= render 'headmin/forms/fields/text', form: list, name: :url do |field, attribute, label| %#>
|
13
|
-
# <%= render
|
13
|
+
# <%= render 'headmin/forms/text', form: field, attribute: attribute, label: label %#>
|
14
14
|
# <% end %#>
|
15
15
|
# <% end %#>
|
16
16
|
|
@@ -8,7 +8,7 @@
|
|
8
8
|
# ==== Examples
|
9
9
|
# Basic version
|
10
10
|
# <%= render 'headmin/forms/fields/text', form: group, name: :name do |field, attribute, label| %#>
|
11
|
-
# <%= render
|
11
|
+
# <%= render 'headmin/forms/text', form: field, attribute: attribute, label: label %#>
|
12
12
|
# <% end %#>
|
13
13
|
%>
|
14
14
|
|
@@ -0,0 +1,32 @@
|
|
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
|
9
|
+
%>
|
10
|
+
|
11
|
+
<div class="h-form-file-thumbnail media-drag-sort-handle" title="<%= "#{filename} (#{size})" %>" data-media-target="item">
|
12
|
+
<%= form.hidden_field(:id) %>
|
13
|
+
<%= form.hidden_field(:blob_id) %>
|
14
|
+
<%= form.hidden_field(:position, value: attachment.new_record? ? nil : attachment.position) if sort %>
|
15
|
+
<%= form.hidden_field(:_destroy) %>
|
16
|
+
|
17
|
+
<a href="<%= url %>" data-turbo-frame="remote_modal" data-media-target="modalButton">
|
18
|
+
<%= render 'headmin/thumbnail', src: src, width: 100, height: 100 %>
|
19
|
+
</a>
|
20
|
+
|
21
|
+
<div class="h-form-file-thumbnail-actions">
|
22
|
+
<!-- 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">
|
24
|
+
<%= bootstrap_icon('pencil') %>
|
25
|
+
</a>
|
26
|
+
|
27
|
+
<!-- Remove -->
|
28
|
+
<div class="h-form-file-thumbnail-remove" data-action="click->media#destroy">
|
29
|
+
<%= bootstrap_icon('x') %>
|
30
|
+
</div>
|
31
|
+
</div>
|
32
|
+
</div>
|
@@ -0,0 +1,10 @@
|
|
1
|
+
<!-- Custom validation field -->
|
2
|
+
<%= form.text_field :"validation_#{attribute}",
|
3
|
+
name: nil,
|
4
|
+
value: nil,
|
5
|
+
class: 'h-form-media-validation',
|
6
|
+
data: {
|
7
|
+
'media-target': 'validationInput',
|
8
|
+
'min-message': t('.min', count: min),
|
9
|
+
'max-message': t('.max', count: max),
|
10
|
+
} %>
|
@@ -18,7 +18,6 @@
|
|
18
18
|
<%= form.hidden_field :id %>
|
19
19
|
<%= form.hidden_field :_destroy if destroyable %>
|
20
20
|
<%= form.hidden_field :position if draggable %>
|
21
|
-
<%= yield %>
|
22
21
|
|
23
22
|
<!-- Drag handle -->
|
24
23
|
<% if draggable %>
|
@@ -29,23 +28,25 @@
|
|
29
28
|
|
30
29
|
<!-- Add button-->
|
31
30
|
<div
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
31
|
+
class="repeater-row-add btn btn-link"
|
32
|
+
title="<%= t('.add') %>"
|
33
|
+
data-repeater-target="addButton"
|
34
|
+
data-popup-target="button"
|
35
|
+
data-popup-id="<%= "repeater-buttons-#{repeater_id}" %>"
|
36
|
+
data-popup-pass-thru="<%= pass_thru %>"
|
37
|
+
data-action="click->repeater#resetButtonIndices click->popup#open"
|
39
38
|
>
|
40
39
|
<%= bootstrap_icon('plus-circle') %>
|
41
40
|
</div>
|
42
41
|
|
43
42
|
<!-- Remove button-->
|
44
43
|
<div
|
45
|
-
|
46
|
-
|
47
|
-
|
44
|
+
class="repeater-row-remove btn btn-link"
|
45
|
+
title="<%= t('.remove') %>"
|
46
|
+
data-action="click->repeater#removeRow"
|
48
47
|
>
|
49
48
|
<%= bootstrap_icon('dash-circle') %>
|
50
49
|
</div>
|
50
|
+
|
51
|
+
<%= yield %>
|
51
52
|
</div>
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= turbo_frame_tag "remote_modal", target: "_top" %>
|
@@ -7,7 +7,7 @@
|
|
7
7
|
|
8
8
|
<div class="sidebar col-sm-12 col-md-1 col-lg-2 bg-dark overflow-y d-print-none">
|
9
9
|
<nav class="navbar navbar-expand-md navbar-dark bg-dark w-100 h-100 flex-md-column">
|
10
|
-
<a href="<%= local_assigns[:url] %>" class="nav-brand mb-
|
10
|
+
<a href="<%= local_assigns[:url] %>" class="nav-brand mb-4 mt-3 me-lg-auto">
|
11
11
|
<%= local_assigns[:logo] %>
|
12
12
|
</a>
|
13
13
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#sidebar-nav" aria-controls="sidebar-nav" aria-expanded="false" aria-label="Toggle navigation">
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<div data-media-modal-target="item" title="<%= "#{blob.filename} (#{l(blob.created_at, format: :long)})" %>">
|
2
|
+
<!-- Input -->
|
3
|
+
<input
|
4
|
+
id="media-item-<%= blob.id %>"
|
5
|
+
type="checkbox"
|
6
|
+
value="<%= blob.id %>"
|
7
|
+
<%= "checked" if params[:ids]&.include?(blob.id.to_s) %>
|
8
|
+
data-action="change->media-modal#inputChange"
|
9
|
+
data-media-modal-target="idCheckbox"
|
10
|
+
hidden>
|
11
|
+
|
12
|
+
<!-- Label -->
|
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 %>
|
16
|
+
</label>
|
17
|
+
</div>
|
@@ -0,0 +1,51 @@
|
|
1
|
+
<%= turbo_frame_tag "modal_content" do %>
|
2
|
+
<%= form_with url: headmin_media_item_url(id: @blob.id), model: @blob do |form| %>
|
3
|
+
<div class="modal-header">
|
4
|
+
<h5 class="modal-title"><%= t('.edit') %></h5>
|
5
|
+
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="<%= t('.close') %>"></button>
|
6
|
+
</div>
|
7
|
+
<div class="modal-body">
|
8
|
+
<%= render 'headmin/notifications' %>
|
9
|
+
<div class="row">
|
10
|
+
<div class="col-3">
|
11
|
+
<%= render 'headmin/thumbnail', src: url_for(@blob), width: 100, height: 100 %>
|
12
|
+
</div>
|
13
|
+
<div class="col-8 d-flex flex-column justify-content-center">
|
14
|
+
<p class="small text-secondary m-0">
|
15
|
+
<strong><%= t('.uploaded_at') %>:</strong>
|
16
|
+
<%= l(@blob.created_at, format: :long) %>
|
17
|
+
</p>
|
18
|
+
<p class="small text-secondary m-0">
|
19
|
+
<strong><%= t('.type') %>:</strong>
|
20
|
+
<%= @blob.content_type %>
|
21
|
+
</p>
|
22
|
+
<p class="small text-secondary m-0">
|
23
|
+
<strong><%= t('.dimensions') %>:</strong>
|
24
|
+
<% if @blob.metadata[:width] && @blob.metadata[:height] %>
|
25
|
+
<%= "#{@blob.metadata[:width]}px x #{@blob.metadata[:height]}px" %>
|
26
|
+
<% else %>
|
27
|
+
<%= t('.not_analysed') %>
|
28
|
+
<% end %>
|
29
|
+
</p>
|
30
|
+
<p class="small text-secondary m-0">
|
31
|
+
<strong><%= t('.size') %>:</strong>
|
32
|
+
<% if @blob.byte_size > 0 %>
|
33
|
+
<%= number_to_human_size(@blob.byte_size) %>
|
34
|
+
<% else %>
|
35
|
+
<%= t('.not_analysed') %>
|
36
|
+
<% end %>
|
37
|
+
</p>
|
38
|
+
</div>
|
39
|
+
</div>
|
40
|
+
<div class="row mt-3">
|
41
|
+
<div class="col-12">
|
42
|
+
<%= render 'headmin/forms/text', form: form, attribute: :filename, append: "." + form.object.filename.to_s.rpartition(".").last, value: form.object.filename.to_s.rpartition(".").first %>
|
43
|
+
</div>
|
44
|
+
</div>
|
45
|
+
</div>
|
46
|
+
<div class="modal-footer">
|
47
|
+
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal"><%= t('.close') %></button>
|
48
|
+
<%= form.submit t(".update"), class: "btn btn-primary" %>
|
49
|
+
</div>
|
50
|
+
<% end %>
|
51
|
+
<% end %>
|
@@ -0,0 +1,35 @@
|
|
1
|
+
<div class="media-modal modal fade" tabindex="-1" data-controller="remote-modal media-modal" data-name="<%= name %>" data-min="<%= min %>" data-max="<%= max %>">
|
2
|
+
<div class="modal-dialog modal-lg modal-dialog-scrollable">
|
3
|
+
<div class="modal-content">
|
4
|
+
<div class="modal-header">
|
5
|
+
<h5 class="modal-title">
|
6
|
+
<%= t('.title', count: min.to_i < 1 ? 1 : min.to_i) %>
|
7
|
+
</h5>
|
8
|
+
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="<%= t('.close') %>"></button>
|
9
|
+
</div>
|
10
|
+
<div class="modal-body">
|
11
|
+
<%= turbo_frame_tag 'thumbnails', class: 'd-flex flex-wrap gap-2' do %>
|
12
|
+
<% @blobs.each do |blob| %>
|
13
|
+
<%= render 'headmin/media/item', blob: blob %>
|
14
|
+
<% end %>
|
15
|
+
<div data-media-modal-target="placeholder" class="<%= "d-none" if !@blobs.empty? %>">
|
16
|
+
<p><%= t('.placeholder') %></p>
|
17
|
+
</div>
|
18
|
+
<% end %>
|
19
|
+
</div>
|
20
|
+
<div class="modal-footer">
|
21
|
+
<%= form_with url: headmin_media_path, multipart: true, data: {'media-modal-target': 'form'}, class: "me-auto" do |form| %>
|
22
|
+
<%= form.label :files, class: "btn h-btn-outline-light" do %>
|
23
|
+
<%= bootstrap_icon("upload") %>
|
24
|
+
<%= t('.upload') %>
|
25
|
+
<%= form.file_field :files, class: 'd-none', multiple: true, data: {action: "change->media-modal#submitForm"} %>
|
26
|
+
<% end %>
|
27
|
+
<% end %>
|
28
|
+
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal"><%= t('.close') %></button>
|
29
|
+
<button type="button" class="btn btn-primary" data-bs-dismiss="modal" data-action="click->media-modal#select" data-media-modal-target="selectButton">
|
30
|
+
<%= t('.select') %> (<span data-media-modal-target="count">0</span><%= t('.maximum', count: max.to_i) if max.present? %>)
|
31
|
+
</button>
|
32
|
+
</div>
|
33
|
+
</div>
|
34
|
+
</div>
|
35
|
+
</div>
|
@@ -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 %>
|
@@ -2,20 +2,20 @@
|
|
2
2
|
headmin/layout/sidebar/menu/account
|
3
3
|
accepts block: yes
|
4
4
|
parameters:
|
5
|
-
scope: (symbol) devise scope, i.e.
|
5
|
+
scope: (symbol) devise scope, i.e. ":users" => current_user
|
6
6
|
%>
|
7
7
|
|
8
|
-
<% scope = local_assigns.has_key?(:scope) ? scope :
|
8
|
+
<% scope = local_assigns.has_key?(:scope) ? scope : "users" %>
|
9
9
|
<% singular = scope.to_s.singularize.to_sym %>
|
10
10
|
<% user = send("current_#{singular}") %>
|
11
11
|
|
12
|
-
<%= render 'headmin/dropdown', class:
|
13
|
-
<%= render 'headmin/dropdown/button', class:
|
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:
|
17
|
-
<%= render 'headmin/dropdown/item', name: t(
|
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
18
|
<%= render 'headmin/dropdown/divider' %>
|
19
|
-
<%= render 'headmin/dropdown/item', name: t(
|
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 %>
|
@@ -14,14 +14,11 @@
|
|
14
14
|
<% content_for :table_actions do %>
|
15
15
|
<th class="h-table-actions d-none" data-controller="table-actions" data-table-actions-target="wrapper" data-table-target="actions">
|
16
16
|
<%= form_with url: '', data: { "table-actions-target": 'form' } do |form| %>
|
17
|
+
<%= form.hidden_field :id, value: '', 'data-table-actions-target': 'idInput' %>
|
17
18
|
<%= form.hidden_field :authenticity_token, value: form_authenticity_token %>
|
18
19
|
<%= form.hidden_field :_method, value: 'POST', 'data-table-actions-target': 'method' %>
|
19
20
|
<%= query_parameter_fields(form) %>
|
20
21
|
|
21
|
-
<template data-table-actions-target="idInputTemplate">
|
22
|
-
<%= form.hidden_field :ids, value: 'ID', multiple: true, 'data-table-actions-target': 'id' %>
|
23
|
-
</template>
|
24
|
-
|
25
22
|
<div class="row g-1">
|
26
23
|
<div class="col-6 col-sm-auto">
|
27
24
|
<div class="d-flex align-items-center gap-3">
|
@@ -9,13 +9,13 @@
|
|
9
9
|
#
|
10
10
|
# ==== Examples
|
11
11
|
# Basic version.
|
12
|
-
# <%= render
|
12
|
+
# <%= render 'headmin/table/actions/action', name: 'export', url: export_admin_products_path %#>
|
13
13
|
#
|
14
14
|
# Use a different HTTP method
|
15
|
-
# <%= render
|
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
|
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
|
9
|
+
# <%= render 'headmin/table/actions/delete', url: delete_admin_products_path %#>
|
10
10
|
%>
|
11
11
|
|
12
|
-
<%= render
|
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
|
9
|
+
# <%= render 'headmin/table/actions/export', url: export_admin_products_path %#>
|
10
10
|
%>
|
11
11
|
|
12
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>
|
@@ -1,9 +1,9 @@
|
|
1
1
|
<%= form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: {method: :post}) do |f| %>
|
2
|
-
<%= render
|
2
|
+
<%= render 'headmin/views/devise/shared/error_messages', resource: resource %>
|
3
3
|
|
4
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
|
8
|
+
<%= render 'headmin/views/devise/shared/links' %>
|
9
9
|
<% end %>
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<%= form_for(resource, as: resource_name, url: password_path(resource_name), html: {method: :put}) do |f| %>
|
2
|
-
<%= render
|
2
|
+
<%= render 'headmin/views/devise/shared/error_messages', resource: resource %>
|
3
3
|
|
4
4
|
<%= f.hidden_field :reset_password_token %>
|
5
5
|
|
@@ -8,5 +8,5 @@
|
|
8
8
|
|
9
9
|
<%= f.submit t('.change_password'), class: 'btn btn-lg btn-primary w-100' %>
|
10
10
|
|
11
|
-
<%= render
|
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
|
2
|
+
<%= render 'headmin/views/devise/shared/error_messages', resource: resource %>
|
3
3
|
|
4
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
|
8
|
+
<%= render 'headmin/views/devise/shared/links' %>
|
9
9
|
<% end %>
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<div>
|
2
2
|
<%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| %>
|
3
|
-
<%= render
|
3
|
+
<%= render 'headmin/views/devise/shared/error_messages', resource: resource %>
|
4
4
|
|
5
5
|
<%= render 'headmin/forms/email', form: f, attribute: :email, required: true, float: true %>
|
6
6
|
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<%= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %>
|
2
|
-
<%= render
|
2
|
+
<%= render 'headmin/views/devise/shared/error_messages', resource: resource %>
|
3
3
|
|
4
4
|
<%= render 'headmin/forms/email', form: f, attribute: :email, required: true, float: true %>
|
5
5
|
<%= render 'headmin/forms/password', form: f, attribute: :password, required: true, float: true %>
|
@@ -7,5 +7,5 @@
|
|
7
7
|
|
8
8
|
<%= f.submit t('.sign_up'), class: 'btn btn-lg btn-primary w-100' %>
|
9
9
|
|
10
|
-
<%= render
|
10
|
+
<%= render 'headmin/views/devise/shared/links' %>
|
11
11
|
<% 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
|
2
|
+
<%= render 'headmin/views/devise/shared/error_messages', resource: resource %>
|
3
3
|
|
4
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
|
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
|
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
|
data/config/locales/en.yml
CHANGED