headmin 0.3.4 → 0.4.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/.github/workflows/ci.yml +27 -0
- data/.gitignore +14 -0
- data/.lock-487e157d270f3062a98b7b2a012753708-1272821827 +0 -0
- data/.nvmrc +1 -0
- data/CHANGELOG.md +31 -0
- data/Gemfile +7 -4
- data/Gemfile.lock +191 -25
- data/README.md +7 -0
- data/Rakefile +1 -7
- data/app/assets/javascripts/headmin/config/i18n.js +9 -9
- data/app/assets/javascripts/headmin/controllers/autocomplete_controller.js +318 -0
- data/app/assets/javascripts/headmin/controllers/blocks_controller.js +74 -79
- data/app/assets/javascripts/headmin/controllers/date_range_controller.js +24 -24
- data/app/assets/javascripts/headmin/controllers/dropzone_controller.js +23 -25
- data/app/assets/javascripts/headmin/controllers/file_preview_controller.js +237 -237
- data/app/assets/javascripts/headmin/controllers/filter_controller.js +44 -44
- data/app/assets/javascripts/headmin/controllers/filters_controller.js +57 -61
- data/app/assets/javascripts/headmin/controllers/flatpickr_controller.js +29 -29
- data/app/assets/javascripts/headmin/controllers/hello_controller.js +3 -3
- data/app/assets/javascripts/headmin/controllers/notification_controller.js +7 -6
- data/app/assets/javascripts/headmin/controllers/popup_controller.js +57 -51
- data/app/assets/javascripts/headmin/controllers/redactorx_controller.js +36 -9
- data/app/assets/javascripts/headmin/controllers/repeater_controller.js +122 -125
- data/app/assets/javascripts/headmin/controllers/select_controller.js +40 -39
- data/app/assets/javascripts/headmin/controllers/table_actions_controller.js +100 -101
- data/app/assets/javascripts/headmin/controllers/table_controller.js +115 -115
- data/app/assets/javascripts/headmin/index.js +38 -35
- data/app/assets/javascripts/headmin.js +295 -37
- data/app/assets/stylesheets/headmin/forms/autocomplete.scss +21 -0
- data/app/assets/stylesheets/headmin/forms/file.scss +46 -0
- data/app/assets/stylesheets/headmin/forms/repeater.scss +62 -0
- data/app/assets/stylesheets/headmin/forms/search.scss +12 -0
- data/app/assets/stylesheets/headmin/forms.scss +11 -0
- data/app/assets/stylesheets/headmin/general.scss +14 -0
- data/app/assets/stylesheets/headmin/overrides/bootstrap.scss +5 -3
- data/app/assets/stylesheets/headmin/overrides/redactorx.scss +74 -0
- data/app/assets/stylesheets/headmin/popup.scss +1 -0
- data/app/assets/stylesheets/headmin/syntax.scss +36 -349
- data/app/assets/stylesheets/headmin/table.scss +1 -1
- data/app/assets/stylesheets/headmin/utilities/buttons.scss +19 -0
- data/app/assets/stylesheets/headmin/utilities/dropzone.scss +72 -0
- data/app/assets/stylesheets/headmin/utilities.scss +2 -68
- data/app/assets/stylesheets/headmin.css +209 -205
- data/app/assets/stylesheets/headmin.scss +1 -1
- data/app/helpers/headmin/admin_helper.rb +0 -1
- data/app/helpers/headmin/form_helper.rb +2 -8
- data/app/models/concerns/headmin/blockable.rb +1 -1
- data/app/models/concerns/headmin/field.rb +4 -1
- data/app/models/concerns/headmin/fieldable.rb +138 -44
- data/app/models/concerns/headmin/form/autocompletable.rb +38 -0
- data/app/models/concerns/headmin/form/hintable.rb +19 -0
- data/app/models/concerns/headmin/form/input_groupable.rb +23 -0
- data/app/models/concerns/headmin/form/labelable.rb +33 -0
- data/app/models/concerns/headmin/form/listable.rb +28 -0
- data/app/models/concerns/headmin/form/placeholderable.rb +13 -0
- data/app/models/concerns/headmin/form/validatable.rb +40 -0
- data/app/models/concerns/headmin/form/wrappable.rb +21 -0
- data/app/models/headmin/.DS_Store +0 -0
- data/app/models/headmin/blocks_view.rb +15 -0
- data/app/models/headmin/form/blocks_view.rb +29 -0
- data/app/models/headmin/form/checkbox_view.rb +52 -0
- data/app/models/headmin/form/date_range_view.rb +25 -0
- data/app/models/headmin/form/date_view.rb +45 -0
- data/app/models/headmin/form/email_view.rb +48 -0
- data/app/models/headmin/form/file_view.rb +116 -0
- data/app/models/headmin/form/flatpickr_range_view.rb +102 -0
- data/app/models/headmin/form/flatpickr_view.rb +37 -0
- data/app/models/headmin/form/hidden_view.rb +10 -0
- data/app/models/headmin/form/hint_view.rb +6 -0
- data/app/models/headmin/form/input_group_view.rb +19 -0
- data/app/models/headmin/form/label_view.rb +24 -0
- data/app/models/headmin/form/number_view.rb +49 -0
- data/app/models/headmin/form/password_view.rb +44 -0
- data/app/models/headmin/form/redactorx_view.rb +59 -0
- data/app/models/headmin/form/search_view.rb +48 -0
- data/app/models/headmin/form/select_view.rb +62 -0
- data/app/models/headmin/form/switch_view.rb +23 -0
- data/app/models/headmin/form/text_view.rb +48 -0
- data/app/models/headmin/form/textarea_view.rb +44 -0
- data/app/models/headmin/form/url_view.rb +48 -0
- data/app/models/headmin/form/wrapper_view.rb +19 -0
- data/app/models/headmin/form/wysiwyg_view.rb +17 -0
- data/app/models/headmin/{thumbnail.rb → thumbnail_view.rb} +6 -1
- data/app/models/view_model.rb +58 -0
- data/app/views/headmin/_blocks.html.erb +13 -9
- data/app/views/headmin/_heading.html.erb +7 -1
- data/app/views/headmin/_thumbnail.html.erb +1 -37
- data/app/views/headmin/forms/_autocomplete.html.erb +11 -0
- data/app/views/headmin/forms/_blocks.html.erb +16 -17
- data/app/views/headmin/forms/_checkbox.html.erb +24 -29
- data/app/views/headmin/forms/_datalist.html.erb +3 -0
- data/app/views/headmin/forms/_date.html.erb +24 -24
- data/app/views/headmin/forms/_date_range.html.erb +19 -21
- data/app/views/headmin/forms/_email.html.erb +27 -32
- data/app/views/headmin/forms/_errors.html.erb +2 -3
- data/app/views/headmin/forms/_file.html.erb +84 -181
- data/app/views/headmin/forms/_flatpickr.html.erb +19 -20
- data/app/views/headmin/forms/_flatpickr_range.html.erb +28 -37
- data/app/views/headmin/forms/_hidden.html.erb +9 -10
- data/app/views/headmin/forms/_hint.html.erb +16 -0
- data/app/views/headmin/forms/_input_group.html.erb +21 -0
- data/app/views/headmin/forms/_label.html.erb +5 -13
- data/app/views/headmin/forms/_number.html.erb +23 -35
- data/app/views/headmin/forms/_password.html.erb +21 -30
- data/app/views/headmin/forms/_redactorx.html.erb +21 -40
- data/app/views/headmin/forms/_repeater.html.erb +55 -60
- data/app/views/headmin/forms/_search.html.erb +43 -0
- data/app/views/headmin/forms/_select.html.erb +24 -49
- data/app/views/headmin/forms/_switch.html.erb +29 -0
- data/app/views/headmin/forms/_text.html.erb +42 -96
- data/app/views/headmin/forms/_textarea.html.erb +21 -32
- data/app/views/headmin/forms/_url.html.erb +26 -31
- data/app/views/headmin/forms/_validation.html.erb +10 -13
- data/app/views/headmin/forms/_wrapper.html.erb +9 -0
- data/app/views/headmin/forms/_wysiwyg.html.erb +28 -0
- data/app/views/headmin/forms/autocomplete/_item.html.erb +3 -0
- data/app/views/headmin/forms/autocomplete/_list.html.erb +3 -0
- data/app/views/headmin/forms/fields/_file.html.erb +1 -1
- data/app/views/headmin/forms/fields/_files.html.erb +17 -0
- data/app/views/headmin/forms/fields/_group.html.erb +9 -2
- data/app/views/headmin/forms/repeater/_row.html.erb +4 -4
- data/bin/console +0 -1
- data/config/locales/headmin/forms/en.yml +1 -12
- data/config/locales/headmin/forms/nl.yml +1 -12
- data/esbuild-css.js +18 -18
- data/esbuild-js.js +8 -8
- data/headmin.gemspec +1 -3
- data/lib/generators/templates/controllers/auth/confirmations_controller.rb +0 -2
- data/lib/generators/templates/controllers/auth/omniauth_callbacks_controller.rb +0 -2
- data/lib/generators/templates/controllers/auth/passwords_controller.rb +0 -2
- data/lib/generators/templates/controllers/auth/registrations_controller.rb +0 -2
- data/lib/generators/templates/controllers/auth/sessions_controller.rb +0 -2
- data/lib/generators/templates/controllers/auth/unlocks_controller.rb +0 -2
- data/lib/headmin/version.rb +1 -3
- data/lib/headmin.rb +0 -2
- data/package-lock.json +5359 -0
- data/package.json +12 -4
- data/view_model_benchmark.rb +74 -0
- data/yarn-error.log +17 -12
- data/yarn.lock +1575 -31
- metadata +64 -25
- data/app/assets/stylesheets/headmin/form.scss +0 -132
- data/app/assets/stylesheets/headmin/overrides/redactorx.css +0 -3
- data/app/helpers/headmin/documentation_helper.rb +0 -35
- data/app/models/headmin/documentation_renderer.rb +0 -32
- data/app/models/headmin/form/base.rb +0 -78
- data/app/models/headmin/form/text.rb +0 -51
- data/app/services/block_service.rb +0 -72
- data/app/views/headmin/_card.html.erb +0 -52
- data/app/views/headmin/forms/_actions.html.erb +0 -28
- data/app/views/headmin/forms/_base.html.erb +0 -114
- data/app/views/headmin/forms/_image.html.erb +0 -21
- data/app/views/headmin/forms/_video.html.erb +0 -21
- data/app/views/headmin/forms/actions/_destroy.html.erb +0 -13
- data/app/views/headmin/forms/actions/_save.html.erb +0 -12
- data/app/views/headmin/forms/actions/_view.html.erb +0 -15
- data/app/views/headmin/forms/fields/_image.html.erb +0 -17
- data/docs/blocks-and-fields.md +0 -54
- data/docs/blocks.md +0 -48
- data/docs/devise.md +0 -41
- data/docs/fields.md +0 -79
@@ -2,49 +2,38 @@
|
|
2
2
|
# headmin/forms/textarea
|
3
3
|
#
|
4
4
|
# ==== Required parameters
|
5
|
-
# * +form+ - Form object
|
6
5
|
# * +attribute+ - Name of the attribute of the form model
|
6
|
+
# * +form+ - Form object
|
7
7
|
#
|
8
8
|
# ==== Optional parameters
|
9
|
-
# * +
|
10
|
-
# * +
|
11
|
-
# * +
|
12
|
-
# * +
|
13
|
-
# * +
|
14
|
-
# * +
|
15
|
-
# * +
|
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'
|
9
|
+
# * +append+ - Display as input group with text on the right-hand side
|
10
|
+
# * +float+ - Use floating labels. Defaults to false
|
11
|
+
# * +hint+ - Informative text to assist with data input. HTML markup is allowed.
|
12
|
+
# * +label+ - Text to display inside label tag. Defaults to the attribute name. Set to false if you don"t want to show a label.
|
13
|
+
# * +plaintext+ - Render input as plain text.
|
14
|
+
# * +prepend+ - Display as input group with text on the left-hand side
|
15
|
+
# * +wrapper+ - Hash with all options for the surrounding html tag
|
28
16
|
#
|
29
17
|
# ==== References
|
18
|
+
# https://headmin.dev/docs/forms/textarea
|
30
19
|
# https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea
|
31
20
|
# https://apidock.com/rails/ActionView/Helpers/FormHelper/text_area
|
32
21
|
#
|
33
22
|
# ==== Examples
|
34
23
|
# Basic version
|
35
|
-
# <%=
|
36
|
-
|
37
|
-
|
24
|
+
# <%= form_with do |form| %#>
|
25
|
+
# <%= render "headmin/forms/textarea", form: form, attribute: :text %#>
|
26
|
+
# <% end %#>
|
38
27
|
|
39
|
-
|
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
|
-
)
|
28
|
+
textarea = Headmin::Form::TextareaView.new(local_assigns)
|
46
29
|
%>
|
47
30
|
|
48
|
-
<%= render
|
49
|
-
<%=
|
31
|
+
<%= render "headmin/forms/wrapper", textarea.wrapper_options do %>
|
32
|
+
<%= render "headmin/forms/label", textarea.label_options if textarea.prepend_label? %>
|
33
|
+
<%= render "headmin/forms/input_group", textarea.input_group_options do %>
|
34
|
+
<%= form.text_area(textarea.attribute, textarea.input_options) %>
|
35
|
+
<% end %>
|
36
|
+
<%= render "headmin/forms/validation", textarea.validation_options if textarea.validate? %>
|
37
|
+
<%= render "headmin/forms/hint", textarea.hint_options if textarea.hint? %>
|
38
|
+
<%= render "headmin/forms/label", textarea.label_options if textarea.append_label? %>
|
50
39
|
<% end %>
|
@@ -2,47 +2,42 @@
|
|
2
2
|
# headmin/forms/url
|
3
3
|
#
|
4
4
|
# ==== Required parameters
|
5
|
-
# * +form+ - Form object
|
6
5
|
# * +attribute+ - Name of the attribute of the form model
|
6
|
+
# * +form+ - Form object
|
7
7
|
#
|
8
8
|
# ==== Optional parameters
|
9
|
-
# * +
|
10
|
-
# * +
|
11
|
-
# * +
|
12
|
-
# * +
|
13
|
-
# * +
|
14
|
-
# * +
|
15
|
-
# * +
|
16
|
-
# * +
|
17
|
-
# * +
|
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'
|
9
|
+
# * +append+ - Display as input group with text on the right-hand side
|
10
|
+
# * +collection+ - Values to be suggested while typing. Can be an collection array or a remote URL.
|
11
|
+
# * +float+ - Use floating labels. Defaults to false
|
12
|
+
# * +hint+ - Informative text to assist with data input. HTML markup is allowed.
|
13
|
+
# * +label+ - Text to display inside label tag. Defaults to the attribute name. Set to false if you don"t want to show a label.
|
14
|
+
# * +list+ - Options are passed through options_for_select
|
15
|
+
# * +plaintext+ - Render input as plain text.
|
16
|
+
# * +prepend+ - Display as input group with text on the left-hand side
|
17
|
+
# * +wrapper+ - Hash with all options for the surrounding html tag
|
27
18
|
#
|
28
19
|
# ==== References
|
29
|
-
# https://
|
20
|
+
# https://headmin.dev/docs/forms/url
|
21
|
+
# https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/url
|
30
22
|
# https://apidock.com/rails/ActionView/Helpers/FormHelper/url_field
|
31
23
|
#
|
32
24
|
# ==== Examples
|
33
25
|
# Basic version
|
34
|
-
# <%=
|
35
|
-
|
36
|
-
|
26
|
+
# <%= form_with do |form| %#>
|
27
|
+
# <%= render "headmin/forms/url", form: form, attribute: :website_url %#>
|
28
|
+
# <% end %#>
|
37
29
|
|
38
|
-
|
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
|
-
)
|
30
|
+
url = Headmin::Form::UrlView.new(local_assigns)
|
44
31
|
%>
|
45
32
|
|
46
|
-
<%= render
|
47
|
-
<%=
|
33
|
+
<%= render "headmin/forms/wrapper", url.wrapper_options do %>
|
34
|
+
<%= render "headmin/forms/label", url.label_options if url.prepend_label? %>
|
35
|
+
<%= render "headmin/forms/input_group", url.input_group_options do %>
|
36
|
+
<%= form.url_field(url.attribute, url.input_options) %>
|
37
|
+
<%= render "headmin/forms/datalist", url.datalist_options if url.datalist? %>
|
38
|
+
<%= render "headmin/forms/autocomplete", url.autocomplete_options if url.autocomplete? %>
|
39
|
+
<% end %>
|
40
|
+
<%= render "headmin/forms/validation", url.validation_options if url.validate? %>
|
41
|
+
<%= render "headmin/forms/hint", url.hint_options if url.hint? %>
|
42
|
+
<%= render "headmin/forms/label", url.label_options if url.append_label? %>
|
48
43
|
<% end %>
|
@@ -1,21 +1,18 @@
|
|
1
1
|
<%
|
2
2
|
# headmin/forms/validation
|
3
3
|
#
|
4
|
-
# ====
|
5
|
-
# * +
|
6
|
-
# * +
|
4
|
+
# ==== Required parameters
|
5
|
+
# * +id+ - Form object
|
6
|
+
# * +message+ - Name of the attribute of the form model
|
7
|
+
#
|
8
|
+
# ==== Optional parameters
|
9
|
+
# * +valid+ - Show success message when true, failure message when false (default: true)
|
7
10
|
#
|
8
11
|
# ==== Examples
|
9
12
|
# Basic version
|
10
|
-
# <%= render
|
11
|
-
|
12
|
-
show_feedback = form.object && !form_field_valid?(form, attribute)
|
13
|
-
id = form_field_validation_id(form, attribute)
|
14
|
-
message = form.object&.errors[attribute]&.join(', ')
|
13
|
+
# <%= render "headmin/forms/validation", id: id, message: message %#>
|
15
14
|
%>
|
16
15
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
</div>
|
21
|
-
<% end %>
|
16
|
+
<div class="<%= valid ? "valid-feedback" : "invalid-feedback" %>" id="<%= id %>">
|
17
|
+
<%= message %>
|
18
|
+
</div>
|
@@ -0,0 +1,28 @@
|
|
1
|
+
<%
|
2
|
+
# headmin/forms/wysiwyg
|
3
|
+
#
|
4
|
+
# ==== Required parameters
|
5
|
+
# * +attribute+ - Name of the attribute of the form model
|
6
|
+
# * +form+ - Form object
|
7
|
+
#
|
8
|
+
# ==== Optional parameters
|
9
|
+
# * +hint+ - Informative text to assist with data input. HTML markup is allowed.
|
10
|
+
# * +label+ - Text to display inside label tag. Defaults to the attribute name. Set to false if you don"t want to show a label.
|
11
|
+
# * +toolbar+ - Show toolbar (default true)
|
12
|
+
# * +wrapper+ - Hash with all options for the surrounding html tag
|
13
|
+
#
|
14
|
+
# ==== References
|
15
|
+
# https://headmin.dev/docs/forms/redactorx
|
16
|
+
# https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea
|
17
|
+
# https://apidock.com/rails/ActionView/Helpers/FormHelper/text_area
|
18
|
+
#
|
19
|
+
# ==== Examples
|
20
|
+
# Basic version
|
21
|
+
# <%= form_with do |form| %#>
|
22
|
+
# <%= render "headmin/forms/redactorx", form: form, attribute: :text %#>
|
23
|
+
# <% end %#>
|
24
|
+
|
25
|
+
wysiwyg = Headmin::Form::WysiwygView.new(local_assigns)
|
26
|
+
%>
|
27
|
+
|
28
|
+
<%= render "headmin/forms/redactorx", wysiwyg.options %>
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<%
|
2
|
+
# name: headmin/forms/fields/file
|
3
|
+
#
|
4
|
+
# ==== Options
|
5
|
+
# * +form+ - Form object
|
6
|
+
# * +name+ - Name for the field
|
7
|
+
#
|
8
|
+
# ==== Examples
|
9
|
+
# Basic version
|
10
|
+
# <%= render 'headmin/forms/fields/file', form: group, name: :file do |field, attribute, label| %#>
|
11
|
+
# <%= render "headmin/forms/file", form: field, attribute: attribute, label: label %#>
|
12
|
+
# <% end %#>
|
13
|
+
%>
|
14
|
+
|
15
|
+
<%= render 'headmin/forms/fields/base', form: form, field_type: :files, name: name do |field, label| %>
|
16
|
+
<% yield field, :files, label %>
|
17
|
+
<% end %>
|
@@ -24,6 +24,7 @@
|
|
24
24
|
# <% end %#>
|
25
25
|
|
26
26
|
label = local_assigns.has_key?(:label) ? label : nil
|
27
|
+
wrapper = local_assigns.has_key?(:wrapper) ? local_assigns[:wrapper] : true
|
27
28
|
show_label = label != false
|
28
29
|
%>
|
29
30
|
|
@@ -32,7 +33,13 @@
|
|
32
33
|
<%= render 'headmin/forms/label', form: form, attribute: :value, text: label || field_label %>
|
33
34
|
<% end %>
|
34
35
|
|
35
|
-
|
36
|
+
<% if wrapper %>
|
37
|
+
<ul class="list-group mb-3">
|
38
|
+
<li class="list-group-item">
|
39
|
+
<%= yield group %>
|
40
|
+
</li>
|
41
|
+
</ul>
|
42
|
+
<% else %>
|
36
43
|
<%= yield group %>
|
37
|
-
|
44
|
+
<% end %>
|
38
45
|
<% end %>
|
@@ -28,7 +28,7 @@
|
|
28
28
|
<% end %>
|
29
29
|
|
30
30
|
<!-- Add button-->
|
31
|
-
<
|
31
|
+
<div
|
32
32
|
class="repeater-row-add btn btn-link"
|
33
33
|
title="<%= t('.add') %>"
|
34
34
|
data-repeater-target="addButton"
|
@@ -38,14 +38,14 @@
|
|
38
38
|
data-action="click->repeater#resetButtonIndices click->popup#open"
|
39
39
|
>
|
40
40
|
<%= bootstrap_icon('plus-circle') %>
|
41
|
-
</
|
41
|
+
</div>
|
42
42
|
|
43
43
|
<!-- Remove button-->
|
44
|
-
<
|
44
|
+
<div
|
45
45
|
class="repeater-row-remove btn btn-link"
|
46
46
|
title="<%= t('.remove') %>"
|
47
47
|
data-action="click->repeater#removeRow"
|
48
48
|
>
|
49
49
|
<%= bootstrap_icon('dash-circle') %>
|
50
|
-
</
|
50
|
+
</div>
|
51
51
|
</div>
|
data/bin/console
CHANGED
@@ -1,17 +1,6 @@
|
|
1
1
|
en:
|
2
2
|
headmin:
|
3
3
|
forms:
|
4
|
-
actions:
|
5
|
-
description: Status & visibility
|
6
|
-
destroy:
|
7
|
-
title: Delete
|
8
|
-
confirm: Are you sure you want to delete this?
|
9
|
-
format: '%m-%d-%Y %H:%M'
|
10
|
-
save:
|
11
|
-
title: Save
|
12
|
-
title: Status
|
13
|
-
view:
|
14
|
-
title: View
|
15
4
|
file:
|
16
5
|
not_found: Not available
|
17
6
|
placeholder:
|
@@ -33,7 +22,7 @@ en:
|
|
33
22
|
blank: Make a choice
|
34
23
|
repeater:
|
35
24
|
add: "Add %{name}"
|
36
|
-
empty:
|
25
|
+
empty: Start by adding your first block
|
37
26
|
row:
|
38
27
|
add: Add row
|
39
28
|
remove: Remove row
|
@@ -1,17 +1,6 @@
|
|
1
1
|
nl:
|
2
2
|
headmin:
|
3
3
|
forms:
|
4
|
-
actions:
|
5
|
-
description: Status & zichtbaarheid
|
6
|
-
destroy:
|
7
|
-
title: Verwijderen
|
8
|
-
confirm: Ben je zeker dat je dit wil verwijderen?
|
9
|
-
format: '%d-%m-%Y %H:%M'
|
10
|
-
save:
|
11
|
-
title: Opslaan
|
12
|
-
title: Status
|
13
|
-
view:
|
14
|
-
title: Bekijken
|
15
4
|
file:
|
16
5
|
not_found: Niet beschikbaar
|
17
6
|
placeholder:
|
@@ -32,7 +21,7 @@ nl:
|
|
32
21
|
blank: Maak een keuze
|
33
22
|
repeater:
|
34
23
|
add: "%{name} toevoegen"
|
35
|
-
empty:
|
24
|
+
empty: Voeg je eerste blok toe om te beginnen
|
36
25
|
row:
|
37
26
|
add: Rij toevoegen
|
38
27
|
remove: Rij verwijderen
|
data/esbuild-css.js
CHANGED
@@ -1,25 +1,25 @@
|
|
1
|
-
const esbuild = require(
|
2
|
-
const sassPlugin = require(
|
1
|
+
const esbuild = require('esbuild')
|
2
|
+
const sassPlugin = require('esbuild-sass-plugin').sassPlugin
|
3
3
|
const watch = process.argv.includes('-w')
|
4
4
|
|
5
5
|
// Used to skip external URLs in scss files
|
6
6
|
const externalUrlPlugin = {
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
7
|
+
name: 'custom-resolver',
|
8
|
+
setup (build) {
|
9
|
+
build.onResolve({ filter: /^https?:\/\// }, ({ path }) => {
|
10
|
+
return { path, external: true, namespace: 'provided' }
|
11
|
+
})
|
12
|
+
}
|
13
13
|
}
|
14
14
|
|
15
15
|
esbuild.build({
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
}).catch((e) => console.error(e.message))
|
16
|
+
entryPoints: ['src/scss/headmin.scss'],
|
17
|
+
outfile: 'app/assets/stylesheets/headmin.css',
|
18
|
+
bundle: true,
|
19
|
+
watch: watch,
|
20
|
+
allowOverwrite: true,
|
21
|
+
plugins: [
|
22
|
+
externalUrlPlugin,
|
23
|
+
sassPlugin()
|
24
|
+
]
|
25
|
+
}).catch((e) => console.error(e.message))
|
data/esbuild-js.js
CHANGED
@@ -1,11 +1,11 @@
|
|
1
|
-
const esbuild = require(
|
1
|
+
const esbuild = require('esbuild')
|
2
2
|
const watch = process.argv.includes('-w')
|
3
3
|
|
4
4
|
esbuild.build({
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
}).catch((e) => console.error(e.message))
|
5
|
+
entryPoints: ['src/js/headmin.js'],
|
6
|
+
outfile: 'app/assets/javascripts/headmin.js',
|
7
|
+
bundle: true,
|
8
|
+
allowOverwrite: true,
|
9
|
+
format: 'esm',
|
10
|
+
watch: watch
|
11
|
+
}).catch((e) => console.error(e.message))
|
data/headmin.gemspec
CHANGED
@@ -1,5 +1,3 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
1
|
require_relative "lib/headmin/version"
|
4
2
|
|
5
3
|
Gem::Specification.new do |spec|
|
@@ -32,7 +30,7 @@ Gem::Specification.new do |spec|
|
|
32
30
|
spec.add_runtime_dependency "closure_tree", "~> 7.4"
|
33
31
|
spec.add_runtime_dependency "inline_svg", "~> 1.7"
|
34
32
|
spec.add_runtime_dependency "redcarpet", "~> 3.5"
|
35
|
-
spec.add_runtime_dependency "rouge", "~> 3.
|
33
|
+
spec.add_runtime_dependency "rouge", "~> 3.28"
|
36
34
|
|
37
35
|
# For more information and examples about making a new gem, checkout our
|
38
36
|
# guide at: https://bundler.io/guides/creating_gem.html
|
data/lib/headmin/version.rb
CHANGED
data/lib/headmin.rb
CHANGED