headmin 0.2.5 → 0.3.1
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 +29 -3
- data/Gemfile.lock +13 -2
- data/README.md +64 -57
- data/app/assets/config/headmin_manifest.js +2 -0
- data/app/assets/javascripts/headmin/config/i18n.js +11 -0
- data/{src/js → app/assets/javascripts}/headmin/controllers/blocks_controller.js +1 -2
- data/app/assets/javascripts/headmin/controllers/date_range_controller.js +32 -0
- data/app/assets/javascripts/headmin/controllers/dropzone_controller.js +33 -0
- data/app/assets/javascripts/headmin/controllers/file_preview_controller.js +244 -0
- data/{src/js → app/assets/javascripts}/headmin/controllers/filter_controller.js +13 -7
- data/{src/js → app/assets/javascripts}/headmin/controllers/filters_controller.js +1 -1
- data/app/assets/javascripts/headmin/controllers/flatpickr_controller.js +39 -0
- data/app/assets/javascripts/headmin/controllers/hello_controller.js +7 -0
- data/app/assets/javascripts/headmin/controllers/notification_controller.js +8 -0
- data/{src/js → app/assets/javascripts}/headmin/controllers/popup_controller.js +1 -2
- data/app/assets/javascripts/headmin/controllers/redactorx_controller.js +13 -0
- data/{src/js → app/assets/javascripts}/headmin/controllers/repeater_controller.js +8 -9
- data/app/assets/javascripts/headmin/controllers/select_controller.js +48 -0
- data/app/assets/javascripts/headmin/controllers/table_actions_controller.js +98 -0
- data/app/assets/javascripts/headmin/controllers/table_controller.js +110 -0
- data/app/assets/javascripts/headmin/index.js +41 -0
- data/app/assets/javascripts/headmin.js +15934 -0
- data/{src/scss → app/assets/stylesheets}/headmin/filter.scss +0 -0
- data/{src/scss → app/assets/stylesheets}/headmin/filters.scss +0 -0
- data/{src/scss → app/assets/stylesheets}/headmin/form.scss +55 -2
- data/{src/scss → app/assets/stylesheets}/headmin/general.scss +0 -0
- data/{src/scss → app/assets/stylesheets}/headmin/layout/body.scss +0 -0
- data/{src/scss → app/assets/stylesheets}/headmin/layout/sidebar.scss +0 -0
- data/{src/scss → app/assets/stylesheets}/headmin/layout.scss +0 -0
- data/{src/scss → app/assets/stylesheets}/headmin/login.scss +0 -0
- data/{src/scss/vendor/bootstrap/variables.scss → app/assets/stylesheets/headmin/overrides/bootstrap.scss} +0 -0
- data/{src/scss/vendor/redactorx/override.css → app/assets/stylesheets/headmin/overrides/redactorx.css} +0 -0
- data/{src/scss → app/assets/stylesheets}/headmin/popup.scss +0 -0
- data/app/assets/stylesheets/headmin/syntax.scss +349 -0
- data/{src/scss → app/assets/stylesheets}/headmin/table.scss +1 -0
- data/app/assets/stylesheets/headmin/thumbnail.scss +20 -0
- data/app/assets/stylesheets/headmin/utilities.scss +68 -0
- data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/_accordion.scss +118 -0
- data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/_alert.scss +57 -0
- data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/_badge.scss +29 -0
- data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/_breadcrumb.scss +28 -0
- data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/_button-group.scss +139 -0
- data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/_buttons.scss +111 -0
- data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/_card.scss +216 -0
- data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/_carousel.scss +229 -0
- data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/_close.scss +40 -0
- data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/_containers.scss +41 -0
- data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/_dropdown.scss +240 -0
- data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/_forms.scss +9 -0
- data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/_functions.scss +302 -0
- data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/_grid.scss +33 -0
- data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/_helpers.scss +9 -0
- data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/_images.scss +42 -0
- data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/_list-group.scss +174 -0
- data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/_mixins.scss +43 -0
- data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/_modal.scss +209 -0
- data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/_nav.scss +139 -0
- data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/_navbar.scss +335 -0
- data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/_offcanvas.scss +83 -0
- data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/_pagination.scss +64 -0
- data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/_placeholders.scss +51 -0
- data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/_popover.scss +158 -0
- data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/_progress.scss +48 -0
- data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/_reboot.scss +625 -0
- data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/_root.scss +54 -0
- data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/_spinners.scss +69 -0
- data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/_tables.scss +155 -0
- data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/_toasts.scss +51 -0
- data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/_tooltip.scss +115 -0
- data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/_transitions.scss +27 -0
- data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/_type.scss +104 -0
- data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/_utilities.scss +630 -0
- data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/_variables.scss +1641 -0
- data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/bootstrap-grid.scss +67 -0
- data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/bootstrap-reboot.scss +13 -0
- data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/bootstrap-utilities.scss +18 -0
- data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/bootstrap.scss +53 -0
- data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/forms/_floating-labels.scss +63 -0
- data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/forms/_form-check.scss +152 -0
- data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/forms/_form-control.scss +219 -0
- data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/forms/_form-range.scss +91 -0
- data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/forms/_form-select.scss +72 -0
- data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/forms/_form-text.scss +11 -0
- data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/forms/_input-group.scss +121 -0
- data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/forms/_labels.scss +36 -0
- data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/forms/_validation.scss +12 -0
- data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/helpers/_clearfix.scss +3 -0
- data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/helpers/_colored-links.scss +12 -0
- data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/helpers/_position.scss +30 -0
- data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/helpers/_ratio.scss +26 -0
- data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/helpers/_stacks.scss +15 -0
- data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/helpers/_stretched-link.scss +15 -0
- data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/helpers/_text-truncation.scss +7 -0
- data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/helpers/_visually-hidden.scss +8 -0
- data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/helpers/_vr.scss +8 -0
- data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/mixins/_alert.scss +11 -0
- data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/mixins/_backdrop.scss +14 -0
- data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/mixins/_border-radius.scss +78 -0
- data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/mixins/_box-shadow.scss +18 -0
- data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/mixins/_breakpoints.scss +127 -0
- data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/mixins/_buttons.scss +133 -0
- data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/mixins/_caret.scss +64 -0
- data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/mixins/_clearfix.scss +9 -0
- data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/mixins/_color-scheme.scss +7 -0
- data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/mixins/_container.scss +9 -0
- data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/mixins/_deprecate.scss +10 -0
- data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/mixins/_forms.scss +144 -0
- data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/mixins/_gradients.scss +47 -0
- data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/mixins/_grid.scss +151 -0
- data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/mixins/_image.scss +16 -0
- data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/mixins/_list-group.scss +24 -0
- data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/mixins/_lists.scss +7 -0
- data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/mixins/_pagination.scss +31 -0
- data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/mixins/_reset-text.scss +17 -0
- data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/mixins/_resize.scss +6 -0
- data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/mixins/_table-variants.scss +21 -0
- data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/mixins/_text-truncate.scss +8 -0
- data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/mixins/_transition.scss +26 -0
- data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/mixins/_utilities.scss +89 -0
- data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/mixins/_visually-hidden.scss +29 -0
- data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/utilities/_api.scss +47 -0
- data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/vendor/_rfs.scss +354 -0
- data/app/assets/stylesheets/headmin/vendor/flatpickr.css +903 -0
- data/{src/scss/vendor/redactorx → app/assets/stylesheets/headmin/vendor}/redactorx.css +0 -0
- data/app/assets/stylesheets/headmin/vendor/tom-select-bootstrap.css +537 -0
- data/app/assets/stylesheets/headmin.css +13454 -0
- data/app/assets/stylesheets/headmin.scss +65 -0
- data/app/helpers/headmin/admin_helper.rb +4 -59
- data/app/helpers/headmin/bootstrap_helper.rb +31 -0
- data/app/helpers/headmin/documentation_helper.rb +35 -0
- data/app/helpers/headmin/filter_helper.rb +7 -3
- data/app/helpers/headmin/form_helper.rb +40 -0
- data/app/helpers/headmin/request_helper.rb +34 -0
- data/app/models/concerns/headmin/fieldable.rb +3 -1
- data/app/models/headmin/documentation_renderer.rb +32 -0
- data/app/models/headmin/form/base.rb +79 -0
- data/app/models/headmin/form/text.rb +53 -0
- data/app/services/block_service.rb +8 -4
- data/app/views/examples/admin.html.erb +1 -1
- data/app/views/headmin/_blocks.html.erb +2 -2
- data/app/views/headmin/_breadcrumbs.html.erb +1 -1
- data/app/views/headmin/_card.html.erb +10 -6
- data/app/views/headmin/_dropdown.html.erb +1 -1
- data/app/views/headmin/_filters.html.erb +23 -11
- data/app/views/headmin/_form.html.erb +14 -14
- 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 +3 -2
- data/app/views/headmin/_popup.html.erb +10 -4
- data/app/views/headmin/_table.html.erb +10 -4
- data/app/views/headmin/_thumbnail.html.erb +47 -0
- data/app/views/headmin/dropdown/_devise.html.erb +20 -10
- data/app/views/headmin/dropdown/_list.html.erb +14 -7
- data/app/views/headmin/filters/_date.html.erb +9 -13
- data/app/views/headmin/filters/_flatpickr.html.erb +57 -0
- data/app/views/headmin/filters/_search.html.erb +5 -5
- data/app/views/headmin/filters/_select.html.erb +6 -6
- data/app/views/headmin/filters/filter/_button.html.erb +7 -7
- data/app/views/headmin/filters/filter/_template.html.erb +1 -1
- data/app/views/headmin/forms/_actions.html.erb +1 -1
- data/app/views/headmin/forms/_base.html.erb +100 -46
- data/app/views/headmin/forms/_blocks.html.erb +14 -7
- data/app/views/headmin/forms/_checkbox.html.erb +3 -3
- data/app/views/headmin/forms/_date.html.erb +30 -34
- data/app/views/headmin/forms/_date_range.html.erb +42 -0
- data/app/views/headmin/forms/_email.html.erb +35 -26
- data/app/views/headmin/forms/_file.html.erb +186 -34
- data/app/views/headmin/forms/_flatpickr.html.erb +34 -0
- data/app/views/headmin/forms/_flatpickr_range.html.erb +50 -0
- data/app/views/headmin/forms/_hidden.html.erb +24 -0
- data/app/views/headmin/forms/_image.html.erb +11 -45
- data/app/views/headmin/forms/_label.html.erb +18 -12
- data/app/views/headmin/forms/_number.html.erb +40 -37
- data/app/views/headmin/forms/_password.html.erb +37 -58
- data/app/views/headmin/forms/_redactorx.html.erb +8 -7
- data/app/views/headmin/forms/_repeater.html.erb +11 -14
- data/app/views/headmin/forms/_select.html.erb +43 -45
- data/app/views/headmin/forms/_text.html.erb +94 -59
- data/app/views/headmin/forms/_textarea.html.erb +37 -26
- data/app/views/headmin/forms/_url.html.erb +35 -26
- data/app/views/headmin/forms/_validation.html.erb +3 -3
- data/app/views/headmin/forms/_video.html.erb +21 -0
- data/app/views/headmin/forms/fields/_base.html.erb +3 -3
- data/app/views/headmin/forms/fields/_file.html.erb +2 -2
- data/app/views/headmin/forms/fields/_group.html.erb +3 -3
- data/app/views/headmin/forms/fields/_image.html.erb +2 -2
- data/app/views/headmin/forms/fields/_list.html.erb +3 -3
- data/app/views/headmin/forms/fields/_text.html.erb +2 -2
- data/app/views/headmin/forms/repeater/_row.html.erb +1 -1
- data/app/views/headmin/heading/_title.html.erb +1 -1
- data/app/views/headmin/layout/_body.html.erb +1 -1
- data/app/views/headmin/layout/_content.html.erb +1 -1
- data/app/views/headmin/layout/_footer.html.erb +1 -1
- data/app/views/headmin/layout/_header.html.erb +1 -1
- data/app/views/headmin/layout/_main.html.erb +12 -6
- data/app/views/headmin/layout/_sidebar.html.erb +3 -3
- data/app/views/headmin/layout/sidebar/_bottom.html.erb +1 -1
- data/app/views/headmin/layout/sidebar/_nav.html.erb +1 -1
- data/app/views/headmin/nav/_dropdown.html.erb +34 -0
- data/app/views/headmin/nav/_item.html.erb +22 -13
- data/app/views/headmin/table/_actions.html.erb +35 -11
- data/app/views/headmin/table/_body.html.erb +1 -1
- data/app/views/headmin/table/_foot.html.erb +1 -1
- data/app/views/headmin/table/_footer.html.erb +1 -1
- data/app/views/headmin/table/_head.html.erb +1 -1
- data/app/views/headmin/table/_header.html.erb +1 -1
- data/app/views/headmin/table/actions/_action.html.erb +4 -4
- data/app/views/headmin/table/actions/_delete.html.erb +1 -1
- data/app/views/headmin/table/actions/_export.html.erb +1 -1
- data/app/views/headmin/table/body/_row.html.erb +15 -7
- data/app/views/headmin/views/devise/confirmations/_new.html.erb +1 -1
- data/app/views/headmin/views/devise/passwords/_edit.html.erb +2 -2
- data/app/views/headmin/views/devise/passwords/_new.html.erb +1 -1
- data/app/views/headmin/views/devise/registrations/_edit.html.erb +4 -4
- data/app/views/headmin/views/devise/registrations/_new.html.erb +3 -3
- data/app/views/headmin/views/devise/shared/_links.html.erb +7 -7
- data/app/views/headmin/views/devise/unlocks/_new.html.erb +1 -1
- data/config/importmap.rb +2 -0
- data/config/locales/activerecord/en.yml +9 -0
- data/config/locales/activerecord/nl.yml +9 -0
- data/config/locales/en.yml +0 -3
- data/config/locales/headmin/forms/en.yml +5 -0
- data/config/locales/headmin/forms/nl.yml +5 -0
- data/config/locales/headmin/popup/en.yml +4 -0
- data/config/locales/headmin/popup/nl.yml +4 -0
- data/config/locales/headmin/table/en.yml +5 -1
- data/config/locales/headmin/table/nl.yml +5 -1
- data/config/locales/headmin/thumbnail/en.yml +4 -0
- data/config/locales/headmin/thumbnail/nl.yml +4 -0
- data/config/locales/headmin/views/en.yml +1 -1
- data/config/locales/headmin/views/nl.yml +14 -14
- data/config/locales/nl.yml +0 -3
- data/docs/blocks.md +0 -7
- data/esbuild-css.js +25 -0
- data/esbuild-js.js +11 -0
- data/headmin.gemspec +4 -1
- data/lib/generators/headmin/blocks_generator.rb +4 -1
- data/lib/generators/headmin/devise_generator.rb +5 -1
- data/lib/generators/headmin/fields_generator.rb +4 -1
- data/lib/generators/templates/controllers/auth/confirmations_controller.rb +31 -0
- data/lib/generators/templates/controllers/auth/omniauth_callbacks_controller.rb +31 -0
- data/lib/generators/templates/controllers/auth/passwords_controller.rb +35 -0
- data/lib/generators/templates/controllers/auth/registrations_controller.rb +63 -0
- data/lib/generators/templates/controllers/auth/sessions_controller.rb +28 -0
- data/lib/generators/templates/controllers/auth/unlocks_controller.rb +31 -0
- data/lib/headmin/engine.rb +15 -0
- data/lib/headmin/version.rb +1 -1
- data/lib/headmin.rb +1 -1
- data/package.json +20 -35
- data/src/js/headmin.js +1 -1
- data/src/scss/headmin.scss +1 -61
- data/yarn.lock +443 -5345
- metadata +198 -30
- data/.nvmrc +0 -1
- data/app/controllers/concerns/headmin/ckeditor.rb +0 -27
- data/app/views/headmin/forms/_ckeditor.html.erb +0 -42
- data/dist/css/headmin.css +0 -12313
- data/dist/js/headmin.js +0 -1548
- data/src/js/headmin/controllers/table_actions_controller.js +0 -33
- data/src/js/headmin/controllers/table_controller.js +0 -119
- data/src/js/headmin/headmin.js +0 -141
- data/src/scss/headmin/utilities.scss +0 -19
- data/webpack.config.js +0 -30
@@ -1,39 +1,50 @@
|
|
1
1
|
<%
|
2
2
|
# headmin/forms/textarea
|
3
3
|
#
|
4
|
-
# ====
|
5
|
-
# *
|
6
|
-
# *
|
7
|
-
#
|
8
|
-
#
|
9
|
-
# *
|
10
|
-
# *
|
4
|
+
# ==== Required parameters
|
5
|
+
# * +form+ - Form object
|
6
|
+
# * +attribute+ - Name of the attribute of the form model
|
7
|
+
#
|
8
|
+
# ==== Optional parameters
|
9
|
+
# * +aria+ - Provide a hash to define all aria attributes
|
10
|
+
# * +autocomplete+ - Value to be autofilled by the browser
|
11
|
+
# * +autofocus+ - Value to be autofilled by the browser
|
12
|
+
# * +cols+ - Visible width in average charachter width (default = 20)
|
13
|
+
# * +data+ - Provide a hash to define all data attributes
|
14
|
+
# * +disabled+ - Sets the placeholder of the field
|
15
|
+
# * +id+ - Input identifier
|
16
|
+
# * +maxlength+ - Maximum amount of characters to be used
|
17
|
+
# * +minlength+ - Minimum amount of characters to be used
|
18
|
+
# * +placeholder+ - Sets the placeholder of the field
|
19
|
+
# * +readonly+ - Sets the placeholder of the field
|
20
|
+
# * +required+ - Set to true to mark as required
|
21
|
+
# * +rows+ - Visible text lines
|
22
|
+
# * +spellcheck+ - Indicate whether or not to enable spell checking by the browser
|
23
|
+
# * +value+ - Overrides the value of the form
|
24
|
+
# * +wrap+ - How to wrap text. Soft (default), hard, or off
|
25
|
+
#
|
26
|
+
# ==== Extra parameters
|
27
|
+
# Listed in 'headmin/forms/base'
|
28
|
+
#
|
29
|
+
# ==== References
|
30
|
+
# https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea
|
31
|
+
# https://apidock.com/rails/ActionView/Helpers/FormHelper/text_area
|
11
32
|
#
|
12
33
|
# ==== Examples
|
13
34
|
# Basic version
|
14
35
|
# <%= render 'headmin/forms/textarea', form: form, attribute: :title %#>
|
15
36
|
|
16
|
-
|
17
|
-
class_names = local_assigns.has_key?(:class) ? local_assigns[:class] : false
|
18
|
-
data = local_assigns.has_key?(:data) ? data : nil
|
19
|
-
disabled = local_assigns.has_key?(:disabled) ? disabled : false
|
20
|
-
float = local_assigns.has_key?(:float) ? float : false
|
21
|
-
label = local_assigns.has_key?(:label) ? label : nil
|
22
|
-
readonly = local_assigns.has_key?(:readonly) ? readonly : false
|
23
|
-
required = local_assigns.has_key?(:required) ? required : false
|
24
|
-
prepend = local_assigns.has_key?(:prepend) ? prepend : nil
|
37
|
+
placeholder = local_assigns[:float] ? local_assigns[:placeholder] || attribute : local_assigns[:placeholder]
|
25
38
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
placeholder:
|
32
|
-
|
33
|
-
required: required,
|
34
|
-
}
|
39
|
+
option_keys = %i(aria autocomplete autofocus cols data disabled id maxlength minlength placeholder readonly required rows spellcheck value wrap)
|
40
|
+
options = local_assigns.slice(*option_keys).merge(
|
41
|
+
aria: { describedby: form_field_validation_id(form, attribute) },
|
42
|
+
class: ['form-control', form_field_validation_class(form, attribute)].join(' '),
|
43
|
+
list: local_assigns[:list] ? "#{attribute}_list" : nil,
|
44
|
+
placeholder: placeholder
|
45
|
+
)
|
35
46
|
%>
|
36
47
|
|
37
|
-
<%= render 'headmin/forms/base',
|
48
|
+
<%= render 'headmin/forms/base', local_assigns do |form| %>
|
38
49
|
<%= form.text_area(attribute, options) %>
|
39
50
|
<% end %>
|
@@ -1,39 +1,48 @@
|
|
1
1
|
<%
|
2
2
|
# headmin/forms/url
|
3
3
|
#
|
4
|
-
# ====
|
5
|
-
# *
|
6
|
-
# *
|
7
|
-
#
|
8
|
-
#
|
9
|
-
# *
|
10
|
-
# *
|
4
|
+
# ==== Required parameters
|
5
|
+
# * +form+ - Form object
|
6
|
+
# * +attribute+ - Name of the attribute of the form model
|
7
|
+
#
|
8
|
+
# ==== Optional parameters
|
9
|
+
# * +aria+ - Provide a hash to define all aria attributes
|
10
|
+
# * +autocomplete+ - Value to be autofilled by the browser
|
11
|
+
# * +autofocus+ - Set to true to focus on this field when the page renders
|
12
|
+
# * +data+ - Provide a hash to define all data attributes
|
13
|
+
# * +disabled+ - Sets the placeholder of the field
|
14
|
+
# * +id+ - Input identifier
|
15
|
+
# * +maxlength+ - Maximum amount of characters to be used
|
16
|
+
# * +minlength+ - Minimum amount of characters to be used
|
17
|
+
# * +list+ - Add array of options to show in a data list
|
18
|
+
# * +pattern+ -a A regular expression that the input's value must match
|
19
|
+
# * +placeholder+ - Sets the placeholder of the field
|
20
|
+
# * +readonly+ - Sets the placeholder of the field
|
21
|
+
# * +required+ - Set to true to mark as required
|
22
|
+
# * +size+ - How much of the input should be shown
|
23
|
+
# * +value+ - Overrides the value of the form
|
24
|
+
#
|
25
|
+
# ==== Extra parameters
|
26
|
+
# Listed in 'headmin/forms/base'
|
27
|
+
#
|
28
|
+
# ==== References
|
29
|
+
# https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/text
|
30
|
+
# https://apidock.com/rails/ActionView/Helpers/FormHelper/url_field
|
11
31
|
#
|
12
32
|
# ==== Examples
|
13
33
|
# Basic version
|
14
34
|
# <%= render 'headmin/forms/url', form: form, attribute: :website_url %#>
|
15
35
|
|
16
|
-
|
17
|
-
class_names = local_assigns.has_key?(:class) ? local_assigns[:class] : false
|
18
|
-
data = local_assigns.has_key?(:data) ? data : nil
|
19
|
-
disabled = local_assigns.has_key?(:disabled) ? disabled : false
|
20
|
-
float = local_assigns.has_key?(:float) ? float : false
|
21
|
-
label = local_assigns.has_key?(:label) ? label : nil
|
22
|
-
prepend = local_assigns.has_key?(:prepend) ? prepend : nil
|
23
|
-
readonly = local_assigns.has_key?(:readonly) ? readonly : false
|
24
|
-
required = local_assigns.has_key?(:required) ? required : false
|
36
|
+
placeholder = local_assigns[:float] ? local_assigns[:placeholder] || attribute : local_assigns[:placeholder]
|
25
37
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
readonly: readonly,
|
33
|
-
required: required,
|
34
|
-
}
|
38
|
+
option_keys = %i(aria autocomplete autofocus data disabled id list placeholder maxlength minlength pattern readonly required size value)
|
39
|
+
options = local_assigns.slice(*option_keys).merge(
|
40
|
+
aria: { describedby: form_field_validation_id(form, attribute) },
|
41
|
+
class: ['form-control', form_field_validation_class(form, attribute)].join(' '),
|
42
|
+
placeholder: placeholder
|
43
|
+
)
|
35
44
|
%>
|
36
45
|
|
37
|
-
<%= render 'headmin/forms/base',
|
46
|
+
<%= render 'headmin/forms/base', local_assigns do |form| %>
|
38
47
|
<%= form.url_field(attribute, options) %>
|
39
48
|
<% end %>
|
@@ -2,8 +2,8 @@
|
|
2
2
|
# headmin/forms/validation
|
3
3
|
#
|
4
4
|
# ==== Options
|
5
|
-
# *
|
6
|
-
# *
|
5
|
+
# * +form+ - Form object
|
6
|
+
# * +attribute+ - Name of the attribute of the form model
|
7
7
|
#
|
8
8
|
# ==== Examples
|
9
9
|
# Basic version
|
@@ -11,7 +11,7 @@
|
|
11
11
|
|
12
12
|
show_feedback = form.object && !form_field_valid?(form, attribute)
|
13
13
|
id = form_field_validation_id(form, attribute)
|
14
|
-
message = form.object.
|
14
|
+
message = form.object&.errors.try(attribute)&.join(', ')
|
15
15
|
%>
|
16
16
|
|
17
17
|
<% if show_feedback %>
|
@@ -0,0 +1,21 @@
|
|
1
|
+
<%
|
2
|
+
# name: headmin/forms/video
|
3
|
+
#
|
4
|
+
# ==== Required parameters
|
5
|
+
# * +form+ - Form object
|
6
|
+
# * +attribute+ - Name of the attribute of the form model
|
7
|
+
#
|
8
|
+
# ==== Extra parameters
|
9
|
+
# Listed in 'headmin/forms/file'
|
10
|
+
# Listed in 'headmin/forms/base'
|
11
|
+
#
|
12
|
+
# ==== Examples
|
13
|
+
# Basic version
|
14
|
+
# <%= render 'headmin/forms/video', form: form, attribute: :video %#>
|
15
|
+
|
16
|
+
options = local_assigns.merge(
|
17
|
+
accept: 'video/*'
|
18
|
+
)
|
19
|
+
%>
|
20
|
+
|
21
|
+
<%= render 'headmin/forms/file', options %>
|
@@ -2,9 +2,9 @@
|
|
2
2
|
# name: headmin/forms/fields/base
|
3
3
|
#
|
4
4
|
# ==== Options
|
5
|
-
# *
|
6
|
-
# *
|
7
|
-
# *
|
5
|
+
# * +form+ - Form object
|
6
|
+
# * +name+ - Name for the field
|
7
|
+
# * +field_type+ - Type of the field. Options: [:text, :image, :file, :list, :group]
|
8
8
|
#
|
9
9
|
# ==== Examples
|
10
10
|
# Basic version
|
@@ -2,9 +2,9 @@
|
|
2
2
|
# name: headmin/forms/fields/group
|
3
3
|
#
|
4
4
|
# ==== Options
|
5
|
-
# *
|
6
|
-
# *
|
7
|
-
# *
|
5
|
+
# * +form+ - Form object
|
6
|
+
# * +name+ - Name for the field
|
7
|
+
# * +label+ - Text to show as label. Label will be hidden if value is false
|
8
8
|
#
|
9
9
|
# ==== Examples
|
10
10
|
# Basic version
|
@@ -2,9 +2,9 @@
|
|
2
2
|
# name: headmin/forms/fields/list
|
3
3
|
#
|
4
4
|
# ==== Options
|
5
|
-
# *
|
6
|
-
# *
|
7
|
-
# *
|
5
|
+
# * +form+ - Form object
|
6
|
+
# * +name+ - Name for the field
|
7
|
+
# * +label+ - Text to show as label. Label will be hidden if value is false
|
8
8
|
#
|
9
9
|
# ==== Examples
|
10
10
|
# Basic version
|
@@ -1,13 +1,19 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
1
|
+
<%
|
2
|
+
# headmin/layout/main
|
3
|
+
#
|
4
|
+
# ==== Examples
|
5
|
+
# Basic version
|
6
|
+
# <%= render 'headmin/layout/main' do %#>
|
7
|
+
# ...
|
8
|
+
# <% end %#>
|
9
|
+
|
10
|
+
class_names = local_assigns.has_key?(:class) ? local_assigns[:class] : false
|
5
11
|
%>
|
6
12
|
|
7
|
-
<div class="main" data-controller="popup">
|
13
|
+
<div class="main <%= class_names %>" data-controller="popup">
|
8
14
|
<div class="container-fluid">
|
9
15
|
<div class="row">
|
10
|
-
<%= yield
|
16
|
+
<%= yield %>
|
11
17
|
</div>
|
12
18
|
</div>
|
13
19
|
</div>
|
@@ -7,14 +7,14 @@
|
|
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="<%=
|
11
|
-
<%= logo %>
|
10
|
+
<a href="<%= local_assigns[:url] %>" class="nav-brand mb-lg-4 ms-lg-3 me-lg-auto">
|
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">
|
14
14
|
<span class="navbar-toggler-icon"></span>
|
15
15
|
</button>
|
16
16
|
<div class="navbar-nav navbar-collapse collapse flex-column align-items-start justify-content-start w-100 h-100" id="sidebar-nav">
|
17
|
-
<%= yield
|
17
|
+
<%= yield %>
|
18
18
|
</div>
|
19
19
|
</nav>
|
20
20
|
</div>
|
@@ -0,0 +1,34 @@
|
|
1
|
+
<%
|
2
|
+
# headmin/nav/dropdown
|
3
|
+
#
|
4
|
+
# ==== Options
|
5
|
+
# * +name</tt> - Name of the nav item
|
6
|
+
# * +url</tt> - URL for this nav item
|
7
|
+
# * +icon</tt> - Optional Bootstrap icon name
|
8
|
+
# * +active</tt> - Set to true if this nav dropdown needs to be highlighted
|
9
|
+
#
|
10
|
+
# ==== Examples
|
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) %#>
|
15
|
+
# <% end %#>
|
16
|
+
|
17
|
+
name = local_assigns.has_key?(:name) ? name : ''
|
18
|
+
icon = local_assigns.has_key?(:icon) ? icon : nil
|
19
|
+
collapse_id = "nav-dropdown-#{name.parameterize}"
|
20
|
+
url = local_assigns.has_key?(:url) ? url : request.url
|
21
|
+
active = local_assigns.has_key?(:active) ? active : current_url?(url)
|
22
|
+
%>
|
23
|
+
|
24
|
+
<li class="nav-item">
|
25
|
+
<a class="nav-link d-flex align-items-center dropdown-toggle <%= 'active' if active %>" href="#<%= collapse_id %>" role="button" data-bs-toggle="collapse" aria-expanded="<%= active.to_s %>" aria-controls="<%= collapse_id %>">
|
26
|
+
<%= bootstrap_icon(icon, class: 'me-2') if icon %>
|
27
|
+
<span class="d-block d-md-none d-lg-block">
|
28
|
+
<%= name %>
|
29
|
+
</span>
|
30
|
+
</a>
|
31
|
+
<ul class="collapse <%= 'show' if active %>" id="<%= collapse_id %>">
|
32
|
+
<%= yield %>
|
33
|
+
</ul>
|
34
|
+
</li>
|
@@ -1,21 +1,30 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
1
|
+
<%
|
2
|
+
# headmin/nav/item
|
3
|
+
#
|
4
|
+
# ==== Options
|
5
|
+
# * +name</tt> - Name of the nav item
|
6
|
+
# * +url</tt> - URL for this nav item
|
7
|
+
# * +icon</tt> - Optional Bootstrap icon name
|
8
|
+
# * +active</tt> - Set to true if this nav item needs to be highlighted
|
9
|
+
#
|
10
|
+
# ==== Examples
|
11
|
+
# Basic version.
|
12
|
+
# <%= render 'headmin/nav/item', name: 'Dashboard', url: admin_root_path %#>
|
13
|
+
#
|
14
|
+
# With icon
|
15
|
+
# <%= render 'headmin/nav/item', name: 'Dashboard', url: admin_root_path, icon: 'speedometer' %#>
|
16
|
+
|
17
|
+
name = local_assigns.has_key?(:name) ? name : ''
|
18
|
+
icon = local_assigns.has_key?(:icon) ? icon : nil
|
19
|
+
url = local_assigns.has_key?(:url) ? url : request.url
|
20
|
+
active = local_assigns.has_key?(:active) ? active : current_url?(url)
|
8
21
|
%>
|
9
|
-
<% name = local_assigns.has_key?(:name) ? name : '' %>
|
10
|
-
<% icon = local_assigns.has_key?(:icon) ? icon : nil %>
|
11
|
-
<% url = local_assigns.has_key?(:url) ? url : '' %>
|
12
|
-
<% active = local_assigns.has_key?(:active) ? current_url?(url) : false %>
|
13
22
|
|
14
23
|
<li class="nav-item">
|
15
24
|
<a class="nav-link d-flex align-items-center <%= 'active' if active %>" aria-current="page" href="<%= url %>">
|
16
25
|
<%= bootstrap_icon(icon, class: 'me-2') if icon %>
|
17
26
|
<span class="d-block d-md-none d-lg-block">
|
18
|
-
|
19
|
-
</span>
|
27
|
+
<%= name %>
|
28
|
+
</span>
|
20
29
|
</a>
|
21
30
|
</li>
|
@@ -1,19 +1,43 @@
|
|
1
|
+
<%
|
2
|
+
# headmin/table/actions
|
3
|
+
#
|
4
|
+
# The form action url is dynamically set when switching between actions.
|
5
|
+
#
|
6
|
+
# ==== Examples
|
7
|
+
# Basic version
|
8
|
+
# <%= render 'headmin/table/actions' do %#>
|
9
|
+
# <%= render 'headmin/table/actions/delete', url: destroy_admin_pages_path %#>
|
10
|
+
# <% end %#>
|
11
|
+
|
12
|
+
%>
|
13
|
+
|
1
14
|
<% content_for :table_actions do %>
|
2
|
-
<th class="h-table-actions d-none" data-controller="table-actions" data-table-target="actions">
|
3
|
-
|
4
|
-
<%=
|
5
|
-
<%=
|
15
|
+
<th class="h-table-actions d-none" data-controller="table-actions" data-table-actions-target="wrapper" data-table-target="actions">
|
16
|
+
<%= form_with url: '', data: { 'table-actions-target': 'form' } do |form| %>
|
17
|
+
<%= form.hidden_field :authenticity_token, value: form_authenticity_token %>
|
18
|
+
<%= form.hidden_field :_method, value: 'POST', 'data-table-actions-target': 'method' %>
|
19
|
+
<%= query_parameter_fields(form) %>
|
6
20
|
|
7
|
-
<template data-table-target="
|
8
|
-
<%=
|
21
|
+
<template data-table-actions-target="idInputTemplate">
|
22
|
+
<%= form.hidden_field :ids, value: 'ID', multiple: true, 'data-table-actions-target': 'id' %>
|
9
23
|
</template>
|
10
24
|
|
11
25
|
<div class="row g-1">
|
12
26
|
<div class="col-6 col-sm-auto">
|
13
|
-
<
|
14
|
-
<
|
15
|
-
|
16
|
-
|
27
|
+
<div class="d-flex align-items-center gap-3">
|
28
|
+
<label class="text-nowrap"
|
29
|
+
data-table-actions-target="counter"
|
30
|
+
data-items-zero="<%= t('.items_html', count: 0) %>"
|
31
|
+
data-items-one="<%= t('.items_html', count: 1) %>"
|
32
|
+
data-items-other="<%= t('.items_html', count: 2) %>"
|
33
|
+
>
|
34
|
+
<%= t('.items_html', count: 0) %>
|
35
|
+
</label>
|
36
|
+
<select class="form-select me-1" data-table-actions-target="select" data-action="change->table-actions#update">
|
37
|
+
<option disabled selected="selected"><%= t('.selection') %></option>
|
38
|
+
<%= yield %>
|
39
|
+
</select>
|
40
|
+
</div>
|
17
41
|
</div>
|
18
42
|
<div class="col-6 col-sm-auto">
|
19
43
|
<button class="btn h-btn-outline-light w-100" type="submit" data-table-actions-target="button" disabled>
|
@@ -21,6 +45,6 @@
|
|
21
45
|
</button>
|
22
46
|
</div>
|
23
47
|
</div>
|
24
|
-
|
48
|
+
<% end %>
|
25
49
|
</th>
|
26
50
|
<% end %>
|
@@ -2,10 +2,10 @@
|
|
2
2
|
# headmin/table/actions/action
|
3
3
|
#
|
4
4
|
# ==== Options
|
5
|
-
# *
|
6
|
-
# *
|
7
|
-
# *
|
8
|
-
# *
|
5
|
+
# * +name</tt> - Name of the bulk action
|
6
|
+
# * +url</tt> - URL to send the request to
|
7
|
+
# * +method</tt> - HTTP method for the request (defaults to GET)
|
8
|
+
# * +confirm</tt> - Message to show in a confirm dialog. Leave blank if no confirm dialog needs to be shown
|
9
9
|
#
|
10
10
|
# ==== Examples
|
11
11
|
# Basic version.
|
@@ -1,9 +1,17 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
1
|
+
<%
|
2
|
+
# headmin/table/body/row
|
3
|
+
#
|
4
|
+
# ==== Options
|
5
|
+
# * +class</tt> - Custom class names to add to the table row
|
6
|
+
#
|
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 %#>
|
11
|
+
# <% end %#>
|
6
12
|
|
7
|
-
|
8
|
-
|
13
|
+
class_names = local_assigns.has_key?(:class) ? local_assigns[:class] : false
|
14
|
+
%>
|
15
|
+
<tr class="<%= class_names %>" data-table-target="row">
|
16
|
+
<%= yield %>
|
9
17
|
</tr>
|