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.
Files changed (162) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ci.yml +27 -0
  3. data/.gitignore +14 -0
  4. data/.lock-487e157d270f3062a98b7b2a012753708-1272821827 +0 -0
  5. data/.nvmrc +1 -0
  6. data/CHANGELOG.md +31 -0
  7. data/Gemfile +7 -4
  8. data/Gemfile.lock +191 -25
  9. data/README.md +7 -0
  10. data/Rakefile +1 -7
  11. data/app/assets/javascripts/headmin/config/i18n.js +9 -9
  12. data/app/assets/javascripts/headmin/controllers/autocomplete_controller.js +318 -0
  13. data/app/assets/javascripts/headmin/controllers/blocks_controller.js +74 -79
  14. data/app/assets/javascripts/headmin/controllers/date_range_controller.js +24 -24
  15. data/app/assets/javascripts/headmin/controllers/dropzone_controller.js +23 -25
  16. data/app/assets/javascripts/headmin/controllers/file_preview_controller.js +237 -237
  17. data/app/assets/javascripts/headmin/controllers/filter_controller.js +44 -44
  18. data/app/assets/javascripts/headmin/controllers/filters_controller.js +57 -61
  19. data/app/assets/javascripts/headmin/controllers/flatpickr_controller.js +29 -29
  20. data/app/assets/javascripts/headmin/controllers/hello_controller.js +3 -3
  21. data/app/assets/javascripts/headmin/controllers/notification_controller.js +7 -6
  22. data/app/assets/javascripts/headmin/controllers/popup_controller.js +57 -51
  23. data/app/assets/javascripts/headmin/controllers/redactorx_controller.js +36 -9
  24. data/app/assets/javascripts/headmin/controllers/repeater_controller.js +122 -125
  25. data/app/assets/javascripts/headmin/controllers/select_controller.js +40 -39
  26. data/app/assets/javascripts/headmin/controllers/table_actions_controller.js +100 -101
  27. data/app/assets/javascripts/headmin/controllers/table_controller.js +115 -115
  28. data/app/assets/javascripts/headmin/index.js +38 -35
  29. data/app/assets/javascripts/headmin.js +295 -37
  30. data/app/assets/stylesheets/headmin/forms/autocomplete.scss +21 -0
  31. data/app/assets/stylesheets/headmin/forms/file.scss +46 -0
  32. data/app/assets/stylesheets/headmin/forms/repeater.scss +62 -0
  33. data/app/assets/stylesheets/headmin/forms/search.scss +12 -0
  34. data/app/assets/stylesheets/headmin/forms.scss +11 -0
  35. data/app/assets/stylesheets/headmin/general.scss +14 -0
  36. data/app/assets/stylesheets/headmin/overrides/bootstrap.scss +5 -3
  37. data/app/assets/stylesheets/headmin/overrides/redactorx.scss +74 -0
  38. data/app/assets/stylesheets/headmin/popup.scss +1 -0
  39. data/app/assets/stylesheets/headmin/syntax.scss +36 -349
  40. data/app/assets/stylesheets/headmin/table.scss +1 -1
  41. data/app/assets/stylesheets/headmin/utilities/buttons.scss +19 -0
  42. data/app/assets/stylesheets/headmin/utilities/dropzone.scss +72 -0
  43. data/app/assets/stylesheets/headmin/utilities.scss +2 -68
  44. data/app/assets/stylesheets/headmin.css +209 -205
  45. data/app/assets/stylesheets/headmin.scss +1 -1
  46. data/app/helpers/headmin/admin_helper.rb +0 -1
  47. data/app/helpers/headmin/form_helper.rb +2 -8
  48. data/app/models/concerns/headmin/blockable.rb +1 -1
  49. data/app/models/concerns/headmin/field.rb +4 -1
  50. data/app/models/concerns/headmin/fieldable.rb +138 -44
  51. data/app/models/concerns/headmin/form/autocompletable.rb +38 -0
  52. data/app/models/concerns/headmin/form/hintable.rb +19 -0
  53. data/app/models/concerns/headmin/form/input_groupable.rb +23 -0
  54. data/app/models/concerns/headmin/form/labelable.rb +33 -0
  55. data/app/models/concerns/headmin/form/listable.rb +28 -0
  56. data/app/models/concerns/headmin/form/placeholderable.rb +13 -0
  57. data/app/models/concerns/headmin/form/validatable.rb +40 -0
  58. data/app/models/concerns/headmin/form/wrappable.rb +21 -0
  59. data/app/models/headmin/.DS_Store +0 -0
  60. data/app/models/headmin/blocks_view.rb +15 -0
  61. data/app/models/headmin/form/blocks_view.rb +29 -0
  62. data/app/models/headmin/form/checkbox_view.rb +52 -0
  63. data/app/models/headmin/form/date_range_view.rb +25 -0
  64. data/app/models/headmin/form/date_view.rb +45 -0
  65. data/app/models/headmin/form/email_view.rb +48 -0
  66. data/app/models/headmin/form/file_view.rb +116 -0
  67. data/app/models/headmin/form/flatpickr_range_view.rb +102 -0
  68. data/app/models/headmin/form/flatpickr_view.rb +37 -0
  69. data/app/models/headmin/form/hidden_view.rb +10 -0
  70. data/app/models/headmin/form/hint_view.rb +6 -0
  71. data/app/models/headmin/form/input_group_view.rb +19 -0
  72. data/app/models/headmin/form/label_view.rb +24 -0
  73. data/app/models/headmin/form/number_view.rb +49 -0
  74. data/app/models/headmin/form/password_view.rb +44 -0
  75. data/app/models/headmin/form/redactorx_view.rb +59 -0
  76. data/app/models/headmin/form/search_view.rb +48 -0
  77. data/app/models/headmin/form/select_view.rb +62 -0
  78. data/app/models/headmin/form/switch_view.rb +23 -0
  79. data/app/models/headmin/form/text_view.rb +48 -0
  80. data/app/models/headmin/form/textarea_view.rb +44 -0
  81. data/app/models/headmin/form/url_view.rb +48 -0
  82. data/app/models/headmin/form/wrapper_view.rb +19 -0
  83. data/app/models/headmin/form/wysiwyg_view.rb +17 -0
  84. data/app/models/headmin/{thumbnail.rb → thumbnail_view.rb} +6 -1
  85. data/app/models/view_model.rb +58 -0
  86. data/app/views/headmin/_blocks.html.erb +13 -9
  87. data/app/views/headmin/_heading.html.erb +7 -1
  88. data/app/views/headmin/_thumbnail.html.erb +1 -37
  89. data/app/views/headmin/forms/_autocomplete.html.erb +11 -0
  90. data/app/views/headmin/forms/_blocks.html.erb +16 -17
  91. data/app/views/headmin/forms/_checkbox.html.erb +24 -29
  92. data/app/views/headmin/forms/_datalist.html.erb +3 -0
  93. data/app/views/headmin/forms/_date.html.erb +24 -24
  94. data/app/views/headmin/forms/_date_range.html.erb +19 -21
  95. data/app/views/headmin/forms/_email.html.erb +27 -32
  96. data/app/views/headmin/forms/_errors.html.erb +2 -3
  97. data/app/views/headmin/forms/_file.html.erb +84 -181
  98. data/app/views/headmin/forms/_flatpickr.html.erb +19 -20
  99. data/app/views/headmin/forms/_flatpickr_range.html.erb +28 -37
  100. data/app/views/headmin/forms/_hidden.html.erb +9 -10
  101. data/app/views/headmin/forms/_hint.html.erb +16 -0
  102. data/app/views/headmin/forms/_input_group.html.erb +21 -0
  103. data/app/views/headmin/forms/_label.html.erb +5 -13
  104. data/app/views/headmin/forms/_number.html.erb +23 -35
  105. data/app/views/headmin/forms/_password.html.erb +21 -30
  106. data/app/views/headmin/forms/_redactorx.html.erb +21 -40
  107. data/app/views/headmin/forms/_repeater.html.erb +55 -60
  108. data/app/views/headmin/forms/_search.html.erb +43 -0
  109. data/app/views/headmin/forms/_select.html.erb +24 -49
  110. data/app/views/headmin/forms/_switch.html.erb +29 -0
  111. data/app/views/headmin/forms/_text.html.erb +42 -96
  112. data/app/views/headmin/forms/_textarea.html.erb +21 -32
  113. data/app/views/headmin/forms/_url.html.erb +26 -31
  114. data/app/views/headmin/forms/_validation.html.erb +10 -13
  115. data/app/views/headmin/forms/_wrapper.html.erb +9 -0
  116. data/app/views/headmin/forms/_wysiwyg.html.erb +28 -0
  117. data/app/views/headmin/forms/autocomplete/_item.html.erb +3 -0
  118. data/app/views/headmin/forms/autocomplete/_list.html.erb +3 -0
  119. data/app/views/headmin/forms/fields/_file.html.erb +1 -1
  120. data/app/views/headmin/forms/fields/_files.html.erb +17 -0
  121. data/app/views/headmin/forms/fields/_group.html.erb +9 -2
  122. data/app/views/headmin/forms/repeater/_row.html.erb +4 -4
  123. data/bin/console +0 -1
  124. data/config/locales/headmin/forms/en.yml +1 -12
  125. data/config/locales/headmin/forms/nl.yml +1 -12
  126. data/esbuild-css.js +18 -18
  127. data/esbuild-js.js +8 -8
  128. data/headmin.gemspec +1 -3
  129. data/lib/generators/templates/controllers/auth/confirmations_controller.rb +0 -2
  130. data/lib/generators/templates/controllers/auth/omniauth_callbacks_controller.rb +0 -2
  131. data/lib/generators/templates/controllers/auth/passwords_controller.rb +0 -2
  132. data/lib/generators/templates/controllers/auth/registrations_controller.rb +0 -2
  133. data/lib/generators/templates/controllers/auth/sessions_controller.rb +0 -2
  134. data/lib/generators/templates/controllers/auth/unlocks_controller.rb +0 -2
  135. data/lib/headmin/version.rb +1 -3
  136. data/lib/headmin.rb +0 -2
  137. data/package-lock.json +5359 -0
  138. data/package.json +12 -4
  139. data/view_model_benchmark.rb +74 -0
  140. data/yarn-error.log +17 -12
  141. data/yarn.lock +1575 -31
  142. metadata +64 -25
  143. data/app/assets/stylesheets/headmin/form.scss +0 -132
  144. data/app/assets/stylesheets/headmin/overrides/redactorx.css +0 -3
  145. data/app/helpers/headmin/documentation_helper.rb +0 -35
  146. data/app/models/headmin/documentation_renderer.rb +0 -32
  147. data/app/models/headmin/form/base.rb +0 -78
  148. data/app/models/headmin/form/text.rb +0 -51
  149. data/app/services/block_service.rb +0 -72
  150. data/app/views/headmin/_card.html.erb +0 -52
  151. data/app/views/headmin/forms/_actions.html.erb +0 -28
  152. data/app/views/headmin/forms/_base.html.erb +0 -114
  153. data/app/views/headmin/forms/_image.html.erb +0 -21
  154. data/app/views/headmin/forms/_video.html.erb +0 -21
  155. data/app/views/headmin/forms/actions/_destroy.html.erb +0 -13
  156. data/app/views/headmin/forms/actions/_save.html.erb +0 -12
  157. data/app/views/headmin/forms/actions/_view.html.erb +0 -15
  158. data/app/views/headmin/forms/fields/_image.html.erb +0 -17
  159. data/docs/blocks-and-fields.md +0 -54
  160. data/docs/blocks.md +0 -48
  161. data/docs/devise.md +0 -41
  162. 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
- # * +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'
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
- # <%= render 'headmin/forms/textarea', form: form, attribute: :title %#>
36
-
37
- placeholder = local_assigns[:float] ? local_assigns[:placeholder] || attribute : local_assigns[:placeholder]
24
+ # <%= form_with do |form| %#>
25
+ # <%= render "headmin/forms/textarea", form: form, attribute: :text %#>
26
+ # <% end %#>
38
27
 
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
- )
28
+ textarea = Headmin::Form::TextareaView.new(local_assigns)
46
29
  %>
47
30
 
48
- <%= render 'headmin/forms/base', local_assigns do |form| %>
49
- <%= form.text_area(attribute, options) %>
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
- # * +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'
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://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/text
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
- # <%= render 'headmin/forms/url', form: form, attribute: :website_url %#>
35
-
36
- placeholder = local_assigns[:float] ? local_assigns[:placeholder] || attribute : local_assigns[:placeholder]
26
+ # <%= form_with do |form| %#>
27
+ # <%= render "headmin/forms/url", form: form, attribute: :website_url %#>
28
+ # <% end %#>
37
29
 
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
- )
30
+ url = Headmin::Form::UrlView.new(local_assigns)
44
31
  %>
45
32
 
46
- <%= render 'headmin/forms/base', local_assigns do |form| %>
47
- <%= form.url_field(attribute, options) %>
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
- # ==== Options
5
- # * +form+ - Form object
6
- # * +attribute+ - Name of the attribute of the form model
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 'headmin/forms/validation', form: form, attribute: attribute %#>
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
- <% if show_feedback %>
18
- <div class="invalid-feedback" id="<%= id %>">
19
- <%= message %>
20
- </div>
21
- <% end %>
16
+ <div class="<%= valid ? "valid-feedback" : "invalid-feedback" %>" id="<%= id %>">
17
+ <%= message %>
18
+ </div>
@@ -0,0 +1,9 @@
1
+ <% wrapper = Headmin::Form::WrapperView.new(local_assigns) %>
2
+
3
+ <% if wrapper.bypass %>
4
+ <%= yield %>
5
+ <% else %>
6
+ <div <%= tag.attributes(wrapper.options) %>>
7
+ <%= yield %>
8
+ </div>
9
+ <% end %>
@@ -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,3 @@
1
+ <li class="list-group-item list-group-item-action" data-autocomplete-target="dropdownItem" value="<%= value %>" data-action="click->autocomplete#select">
2
+ <%= yield %>
3
+ </li>
@@ -0,0 +1,3 @@
1
+ <ul class="list-group-flush">
2
+ <%= yield %>
3
+ </ul>
@@ -13,5 +13,5 @@
13
13
  %>
14
14
 
15
15
  <%= render 'headmin/forms/fields/base', form: form, field_type: :file, name: name do |field, label| %>
16
- <% yield field, :file, label %>
16
+ <% yield field, :files, label %>
17
17
  <% end %>
@@ -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
- <li class="list-group-item mb-3">
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
- </li>
44
+ <% end %>
38
45
  <% end %>
@@ -28,7 +28,7 @@
28
28
  <% end %>
29
29
 
30
30
  <!-- Add button-->
31
- <a href="#"
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
- </a>
41
+ </div>
42
42
 
43
43
  <!-- Remove button-->
44
- <a href="#"
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
- </a>
50
+ </div>
51
51
  </div>
data/bin/console CHANGED
@@ -1,5 +1,4 @@
1
1
  #!/usr/bin/env ruby
2
- # frozen_string_literal: true
3
2
 
4
3
  require "bundler/setup"
5
4
  require "headmin"
@@ -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: This list is empty for now.
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: Deze lijst is voorlopig nog leeg.
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("esbuild");
2
- const sassPlugin = require("esbuild-sass-plugin").sassPlugin;
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
- name: "custom-resolver",
8
- setup(build) {
9
- build.onResolve({filter: /^https?:\/\//}, ({path}) => {
10
- return {path, external: true, namespace: "provided"};
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
- 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));
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("esbuild");
1
+ const esbuild = require('esbuild')
2
2
  const watch = process.argv.includes('-w')
3
3
 
4
4
  esbuild.build({
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));
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.27"
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
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  class Auth::ConfirmationsController < Devise::ConfirmationsController
4
2
  layout "auth"
5
3
  # GET /resource/confirmation/new
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  class Auth::OmniauthCallbacksController < Devise::OmniauthCallbacksController
4
2
  layout "auth"
5
3
  # You should configure your model like this:
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  class Auth::PasswordsController < Devise::PasswordsController
4
2
  layout "auth"
5
3
  # GET /resource/password/new
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  class Auth::RegistrationsController < Devise::RegistrationsController
4
2
  layout "auth"
5
3
  # before_action :configure_sign_up_params, only: [:create]
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  class Auth::SessionsController < Devise::SessionsController
4
2
  layout "auth"
5
3
  # before_action :configure_sign_in_params, only: [:create]
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  class Auth::UnlocksController < Devise::UnlocksController
4
2
  layout "auth"
5
3
  # GET /resource/unlock/new
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  module Headmin
4
- VERSION = "0.3.4"
2
+ VERSION = "0.4.2"
5
3
  end
data/lib/headmin.rb CHANGED
@@ -1,4 +1,2 @@
1
- # frozen_string_literal: true
2
-
3
1
  require_relative "headmin/version"
4
2
  require_relative "headmin/engine"