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.
Files changed (264) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +29 -3
  3. data/Gemfile.lock +13 -2
  4. data/README.md +64 -57
  5. data/app/assets/config/headmin_manifest.js +2 -0
  6. data/app/assets/javascripts/headmin/config/i18n.js +11 -0
  7. data/{src/js → app/assets/javascripts}/headmin/controllers/blocks_controller.js +1 -2
  8. data/app/assets/javascripts/headmin/controllers/date_range_controller.js +32 -0
  9. data/app/assets/javascripts/headmin/controllers/dropzone_controller.js +33 -0
  10. data/app/assets/javascripts/headmin/controllers/file_preview_controller.js +244 -0
  11. data/{src/js → app/assets/javascripts}/headmin/controllers/filter_controller.js +13 -7
  12. data/{src/js → app/assets/javascripts}/headmin/controllers/filters_controller.js +1 -1
  13. data/app/assets/javascripts/headmin/controllers/flatpickr_controller.js +39 -0
  14. data/app/assets/javascripts/headmin/controllers/hello_controller.js +7 -0
  15. data/app/assets/javascripts/headmin/controllers/notification_controller.js +8 -0
  16. data/{src/js → app/assets/javascripts}/headmin/controllers/popup_controller.js +1 -2
  17. data/app/assets/javascripts/headmin/controllers/redactorx_controller.js +13 -0
  18. data/{src/js → app/assets/javascripts}/headmin/controllers/repeater_controller.js +8 -9
  19. data/app/assets/javascripts/headmin/controllers/select_controller.js +48 -0
  20. data/app/assets/javascripts/headmin/controllers/table_actions_controller.js +98 -0
  21. data/app/assets/javascripts/headmin/controllers/table_controller.js +110 -0
  22. data/app/assets/javascripts/headmin/index.js +41 -0
  23. data/app/assets/javascripts/headmin.js +15934 -0
  24. data/{src/scss → app/assets/stylesheets}/headmin/filter.scss +0 -0
  25. data/{src/scss → app/assets/stylesheets}/headmin/filters.scss +0 -0
  26. data/{src/scss → app/assets/stylesheets}/headmin/form.scss +55 -2
  27. data/{src/scss → app/assets/stylesheets}/headmin/general.scss +0 -0
  28. data/{src/scss → app/assets/stylesheets}/headmin/layout/body.scss +0 -0
  29. data/{src/scss → app/assets/stylesheets}/headmin/layout/sidebar.scss +0 -0
  30. data/{src/scss → app/assets/stylesheets}/headmin/layout.scss +0 -0
  31. data/{src/scss → app/assets/stylesheets}/headmin/login.scss +0 -0
  32. data/{src/scss/vendor/bootstrap/variables.scss → app/assets/stylesheets/headmin/overrides/bootstrap.scss} +0 -0
  33. data/{src/scss/vendor/redactorx/override.css → app/assets/stylesheets/headmin/overrides/redactorx.css} +0 -0
  34. data/{src/scss → app/assets/stylesheets}/headmin/popup.scss +0 -0
  35. data/app/assets/stylesheets/headmin/syntax.scss +349 -0
  36. data/{src/scss → app/assets/stylesheets}/headmin/table.scss +1 -0
  37. data/app/assets/stylesheets/headmin/thumbnail.scss +20 -0
  38. data/app/assets/stylesheets/headmin/utilities.scss +68 -0
  39. data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/_accordion.scss +118 -0
  40. data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/_alert.scss +57 -0
  41. data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/_badge.scss +29 -0
  42. data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/_breadcrumb.scss +28 -0
  43. data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/_button-group.scss +139 -0
  44. data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/_buttons.scss +111 -0
  45. data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/_card.scss +216 -0
  46. data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/_carousel.scss +229 -0
  47. data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/_close.scss +40 -0
  48. data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/_containers.scss +41 -0
  49. data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/_dropdown.scss +240 -0
  50. data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/_forms.scss +9 -0
  51. data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/_functions.scss +302 -0
  52. data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/_grid.scss +33 -0
  53. data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/_helpers.scss +9 -0
  54. data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/_images.scss +42 -0
  55. data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/_list-group.scss +174 -0
  56. data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/_mixins.scss +43 -0
  57. data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/_modal.scss +209 -0
  58. data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/_nav.scss +139 -0
  59. data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/_navbar.scss +335 -0
  60. data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/_offcanvas.scss +83 -0
  61. data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/_pagination.scss +64 -0
  62. data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/_placeholders.scss +51 -0
  63. data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/_popover.scss +158 -0
  64. data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/_progress.scss +48 -0
  65. data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/_reboot.scss +625 -0
  66. data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/_root.scss +54 -0
  67. data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/_spinners.scss +69 -0
  68. data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/_tables.scss +155 -0
  69. data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/_toasts.scss +51 -0
  70. data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/_tooltip.scss +115 -0
  71. data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/_transitions.scss +27 -0
  72. data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/_type.scss +104 -0
  73. data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/_utilities.scss +630 -0
  74. data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/_variables.scss +1641 -0
  75. data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/bootstrap-grid.scss +67 -0
  76. data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/bootstrap-reboot.scss +13 -0
  77. data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/bootstrap-utilities.scss +18 -0
  78. data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/bootstrap.scss +53 -0
  79. data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/forms/_floating-labels.scss +63 -0
  80. data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/forms/_form-check.scss +152 -0
  81. data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/forms/_form-control.scss +219 -0
  82. data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/forms/_form-range.scss +91 -0
  83. data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/forms/_form-select.scss +72 -0
  84. data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/forms/_form-text.scss +11 -0
  85. data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/forms/_input-group.scss +121 -0
  86. data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/forms/_labels.scss +36 -0
  87. data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/forms/_validation.scss +12 -0
  88. data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/helpers/_clearfix.scss +3 -0
  89. data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/helpers/_colored-links.scss +12 -0
  90. data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/helpers/_position.scss +30 -0
  91. data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/helpers/_ratio.scss +26 -0
  92. data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/helpers/_stacks.scss +15 -0
  93. data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/helpers/_stretched-link.scss +15 -0
  94. data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/helpers/_text-truncation.scss +7 -0
  95. data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/helpers/_visually-hidden.scss +8 -0
  96. data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/helpers/_vr.scss +8 -0
  97. data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/mixins/_alert.scss +11 -0
  98. data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/mixins/_backdrop.scss +14 -0
  99. data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/mixins/_border-radius.scss +78 -0
  100. data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/mixins/_box-shadow.scss +18 -0
  101. data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/mixins/_breakpoints.scss +127 -0
  102. data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/mixins/_buttons.scss +133 -0
  103. data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/mixins/_caret.scss +64 -0
  104. data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/mixins/_clearfix.scss +9 -0
  105. data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/mixins/_color-scheme.scss +7 -0
  106. data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/mixins/_container.scss +9 -0
  107. data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/mixins/_deprecate.scss +10 -0
  108. data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/mixins/_forms.scss +144 -0
  109. data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/mixins/_gradients.scss +47 -0
  110. data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/mixins/_grid.scss +151 -0
  111. data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/mixins/_image.scss +16 -0
  112. data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/mixins/_list-group.scss +24 -0
  113. data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/mixins/_lists.scss +7 -0
  114. data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/mixins/_pagination.scss +31 -0
  115. data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/mixins/_reset-text.scss +17 -0
  116. data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/mixins/_resize.scss +6 -0
  117. data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/mixins/_table-variants.scss +21 -0
  118. data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/mixins/_text-truncate.scss +8 -0
  119. data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/mixins/_transition.scss +26 -0
  120. data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/mixins/_utilities.scss +89 -0
  121. data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/mixins/_visually-hidden.scss +29 -0
  122. data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/utilities/_api.scss +47 -0
  123. data/app/assets/stylesheets/headmin/vendor/bootstrap/scss/vendor/_rfs.scss +354 -0
  124. data/app/assets/stylesheets/headmin/vendor/flatpickr.css +903 -0
  125. data/{src/scss/vendor/redactorx → app/assets/stylesheets/headmin/vendor}/redactorx.css +0 -0
  126. data/app/assets/stylesheets/headmin/vendor/tom-select-bootstrap.css +537 -0
  127. data/app/assets/stylesheets/headmin.css +13454 -0
  128. data/app/assets/stylesheets/headmin.scss +65 -0
  129. data/app/helpers/headmin/admin_helper.rb +4 -59
  130. data/app/helpers/headmin/bootstrap_helper.rb +31 -0
  131. data/app/helpers/headmin/documentation_helper.rb +35 -0
  132. data/app/helpers/headmin/filter_helper.rb +7 -3
  133. data/app/helpers/headmin/form_helper.rb +40 -0
  134. data/app/helpers/headmin/request_helper.rb +34 -0
  135. data/app/models/concerns/headmin/fieldable.rb +3 -1
  136. data/app/models/headmin/documentation_renderer.rb +32 -0
  137. data/app/models/headmin/form/base.rb +79 -0
  138. data/app/models/headmin/form/text.rb +53 -0
  139. data/app/services/block_service.rb +8 -4
  140. data/app/views/examples/admin.html.erb +1 -1
  141. data/app/views/headmin/_blocks.html.erb +2 -2
  142. data/app/views/headmin/_breadcrumbs.html.erb +1 -1
  143. data/app/views/headmin/_card.html.erb +10 -6
  144. data/app/views/headmin/_dropdown.html.erb +1 -1
  145. data/app/views/headmin/_filters.html.erb +23 -11
  146. data/app/views/headmin/_form.html.erb +14 -14
  147. data/app/views/headmin/_heading.html.erb +1 -1
  148. data/app/views/headmin/_notifications.html.erb +1 -1
  149. data/app/views/headmin/_pagination.html.erb +3 -2
  150. data/app/views/headmin/_popup.html.erb +10 -4
  151. data/app/views/headmin/_table.html.erb +10 -4
  152. data/app/views/headmin/_thumbnail.html.erb +47 -0
  153. data/app/views/headmin/dropdown/_devise.html.erb +20 -10
  154. data/app/views/headmin/dropdown/_list.html.erb +14 -7
  155. data/app/views/headmin/filters/_date.html.erb +9 -13
  156. data/app/views/headmin/filters/_flatpickr.html.erb +57 -0
  157. data/app/views/headmin/filters/_search.html.erb +5 -5
  158. data/app/views/headmin/filters/_select.html.erb +6 -6
  159. data/app/views/headmin/filters/filter/_button.html.erb +7 -7
  160. data/app/views/headmin/filters/filter/_template.html.erb +1 -1
  161. data/app/views/headmin/forms/_actions.html.erb +1 -1
  162. data/app/views/headmin/forms/_base.html.erb +100 -46
  163. data/app/views/headmin/forms/_blocks.html.erb +14 -7
  164. data/app/views/headmin/forms/_checkbox.html.erb +3 -3
  165. data/app/views/headmin/forms/_date.html.erb +30 -34
  166. data/app/views/headmin/forms/_date_range.html.erb +42 -0
  167. data/app/views/headmin/forms/_email.html.erb +35 -26
  168. data/app/views/headmin/forms/_file.html.erb +186 -34
  169. data/app/views/headmin/forms/_flatpickr.html.erb +34 -0
  170. data/app/views/headmin/forms/_flatpickr_range.html.erb +50 -0
  171. data/app/views/headmin/forms/_hidden.html.erb +24 -0
  172. data/app/views/headmin/forms/_image.html.erb +11 -45
  173. data/app/views/headmin/forms/_label.html.erb +18 -12
  174. data/app/views/headmin/forms/_number.html.erb +40 -37
  175. data/app/views/headmin/forms/_password.html.erb +37 -58
  176. data/app/views/headmin/forms/_redactorx.html.erb +8 -7
  177. data/app/views/headmin/forms/_repeater.html.erb +11 -14
  178. data/app/views/headmin/forms/_select.html.erb +43 -45
  179. data/app/views/headmin/forms/_text.html.erb +94 -59
  180. data/app/views/headmin/forms/_textarea.html.erb +37 -26
  181. data/app/views/headmin/forms/_url.html.erb +35 -26
  182. data/app/views/headmin/forms/_validation.html.erb +3 -3
  183. data/app/views/headmin/forms/_video.html.erb +21 -0
  184. data/app/views/headmin/forms/fields/_base.html.erb +3 -3
  185. data/app/views/headmin/forms/fields/_file.html.erb +2 -2
  186. data/app/views/headmin/forms/fields/_group.html.erb +3 -3
  187. data/app/views/headmin/forms/fields/_image.html.erb +2 -2
  188. data/app/views/headmin/forms/fields/_list.html.erb +3 -3
  189. data/app/views/headmin/forms/fields/_text.html.erb +2 -2
  190. data/app/views/headmin/forms/repeater/_row.html.erb +1 -1
  191. data/app/views/headmin/heading/_title.html.erb +1 -1
  192. data/app/views/headmin/layout/_body.html.erb +1 -1
  193. data/app/views/headmin/layout/_content.html.erb +1 -1
  194. data/app/views/headmin/layout/_footer.html.erb +1 -1
  195. data/app/views/headmin/layout/_header.html.erb +1 -1
  196. data/app/views/headmin/layout/_main.html.erb +12 -6
  197. data/app/views/headmin/layout/_sidebar.html.erb +3 -3
  198. data/app/views/headmin/layout/sidebar/_bottom.html.erb +1 -1
  199. data/app/views/headmin/layout/sidebar/_nav.html.erb +1 -1
  200. data/app/views/headmin/nav/_dropdown.html.erb +34 -0
  201. data/app/views/headmin/nav/_item.html.erb +22 -13
  202. data/app/views/headmin/table/_actions.html.erb +35 -11
  203. data/app/views/headmin/table/_body.html.erb +1 -1
  204. data/app/views/headmin/table/_foot.html.erb +1 -1
  205. data/app/views/headmin/table/_footer.html.erb +1 -1
  206. data/app/views/headmin/table/_head.html.erb +1 -1
  207. data/app/views/headmin/table/_header.html.erb +1 -1
  208. data/app/views/headmin/table/actions/_action.html.erb +4 -4
  209. data/app/views/headmin/table/actions/_delete.html.erb +1 -1
  210. data/app/views/headmin/table/actions/_export.html.erb +1 -1
  211. data/app/views/headmin/table/body/_row.html.erb +15 -7
  212. data/app/views/headmin/views/devise/confirmations/_new.html.erb +1 -1
  213. data/app/views/headmin/views/devise/passwords/_edit.html.erb +2 -2
  214. data/app/views/headmin/views/devise/passwords/_new.html.erb +1 -1
  215. data/app/views/headmin/views/devise/registrations/_edit.html.erb +4 -4
  216. data/app/views/headmin/views/devise/registrations/_new.html.erb +3 -3
  217. data/app/views/headmin/views/devise/shared/_links.html.erb +7 -7
  218. data/app/views/headmin/views/devise/unlocks/_new.html.erb +1 -1
  219. data/config/importmap.rb +2 -0
  220. data/config/locales/activerecord/en.yml +9 -0
  221. data/config/locales/activerecord/nl.yml +9 -0
  222. data/config/locales/en.yml +0 -3
  223. data/config/locales/headmin/forms/en.yml +5 -0
  224. data/config/locales/headmin/forms/nl.yml +5 -0
  225. data/config/locales/headmin/popup/en.yml +4 -0
  226. data/config/locales/headmin/popup/nl.yml +4 -0
  227. data/config/locales/headmin/table/en.yml +5 -1
  228. data/config/locales/headmin/table/nl.yml +5 -1
  229. data/config/locales/headmin/thumbnail/en.yml +4 -0
  230. data/config/locales/headmin/thumbnail/nl.yml +4 -0
  231. data/config/locales/headmin/views/en.yml +1 -1
  232. data/config/locales/headmin/views/nl.yml +14 -14
  233. data/config/locales/nl.yml +0 -3
  234. data/docs/blocks.md +0 -7
  235. data/esbuild-css.js +25 -0
  236. data/esbuild-js.js +11 -0
  237. data/headmin.gemspec +4 -1
  238. data/lib/generators/headmin/blocks_generator.rb +4 -1
  239. data/lib/generators/headmin/devise_generator.rb +5 -1
  240. data/lib/generators/headmin/fields_generator.rb +4 -1
  241. data/lib/generators/templates/controllers/auth/confirmations_controller.rb +31 -0
  242. data/lib/generators/templates/controllers/auth/omniauth_callbacks_controller.rb +31 -0
  243. data/lib/generators/templates/controllers/auth/passwords_controller.rb +35 -0
  244. data/lib/generators/templates/controllers/auth/registrations_controller.rb +63 -0
  245. data/lib/generators/templates/controllers/auth/sessions_controller.rb +28 -0
  246. data/lib/generators/templates/controllers/auth/unlocks_controller.rb +31 -0
  247. data/lib/headmin/engine.rb +15 -0
  248. data/lib/headmin/version.rb +1 -1
  249. data/lib/headmin.rb +1 -1
  250. data/package.json +20 -35
  251. data/src/js/headmin.js +1 -1
  252. data/src/scss/headmin.scss +1 -61
  253. data/yarn.lock +443 -5345
  254. metadata +198 -30
  255. data/.nvmrc +0 -1
  256. data/app/controllers/concerns/headmin/ckeditor.rb +0 -27
  257. data/app/views/headmin/forms/_ckeditor.html.erb +0 -42
  258. data/dist/css/headmin.css +0 -12313
  259. data/dist/js/headmin.js +0 -1548
  260. data/src/js/headmin/controllers/table_actions_controller.js +0 -33
  261. data/src/js/headmin/controllers/table_controller.js +0 -119
  262. data/src/js/headmin/headmin.js +0 -141
  263. data/src/scss/headmin/utilities.scss +0 -19
  264. data/webpack.config.js +0 -30
@@ -1,7 +1,7 @@
1
1
  <%= form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: {method: :post}) do |f| %>
2
2
  <%= render "headmin/views/devise/shared/error_messages", resource: resource %>
3
3
 
4
- <%= render 'headmin/forms/email', form: f, attribute: :email, required: true, label: :float %>
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
 
@@ -3,8 +3,8 @@
3
3
 
4
4
  <%= f.hidden_field :reset_password_token %>
5
5
 
6
- <%= render 'headmin/forms/password', form: f, attribute: :password, required: true, label: :float %>
7
- <%= render 'headmin/forms/password', form: f, attribute: :password_confirmation, required: true, label: :float %>
6
+ <%= render 'headmin/forms/password', form: f, attribute: :password, required: true, float: true %>
7
+ <%= render 'headmin/forms/password', form: f, attribute: :password_confirmation, required: true, float: true %>
8
8
 
9
9
  <%= f.submit t('.change_password'), class: 'btn btn-lg btn-primary w-100' %>
10
10
 
@@ -1,7 +1,7 @@
1
1
  <%= form_for(resource, as: resource_name, url: password_path(resource_name), html: {method: :post}) do |f| %>
2
2
  <%= render "headmin/views/devise/shared/error_messages", resource: resource %>
3
3
 
4
- <%= render 'headmin/forms/email', form: f, attribute: :email, required: true, label: :float %>
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
 
@@ -2,15 +2,15 @@
2
2
  <%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: {method: :put}) do |f| %>
3
3
  <%= render "headmin/views/devise/shared/error_messages", resource: resource %>
4
4
 
5
- <%= render 'headmin/forms/email', form: f, attribute: :email, required: true, label: :float %>
5
+ <%= render 'headmin/forms/email', form: f, attribute: :email, required: true, float: true %>
6
6
 
7
7
  <% if devise_mapping.confirmable? && resource.pending_reconfirmation? %>
8
8
  <div><%= t('.waiting_confirmation', email: resource.unconfirmed_email) %></div>
9
9
  <% end %>
10
10
 
11
- <%= render 'headmin/forms/password', form: f, attribute: :password, required: true, label: :float %>
12
- <%= render 'headmin/forms/password', form: f, attribute: :password_confirmation, required: true, label: :float %>
13
- <%= render 'headmin/forms/password', form: f, attribute: :current_password, required: true, label: :float %>
11
+ <%= render 'headmin/forms/password', form: f, attribute: :password, required: true, float: true %>
12
+ <%= render 'headmin/forms/password', form: f, attribute: :password_confirmation, required: true, float: true %>
13
+ <%= render 'headmin/forms/password', form: f, attribute: :current_password, required: true, float: true %>
14
14
 
15
15
  <%= f.submit t('.change'), class: 'btn btn-lg btn-primary w-100' %>
16
16
  <% end %>
@@ -1,9 +1,9 @@
1
1
  <%= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %>
2
2
  <%= render "headmin/views/devise/shared/error_messages", resource: resource %>
3
3
 
4
- <%= render 'headmin/forms/email', form: f, attribute: :email, required: true, label: :float %>
5
- <%= render 'headmin/forms/password', form: f, attribute: :password, required: true, label: :float %>
6
- <%= render 'headmin/forms/password', form: f, attribute: :password_confirmation, required: true, label: :float %>
4
+ <%= render 'headmin/forms/email', form: f, attribute: :email, required: true, float: true %>
5
+ <%= render 'headmin/forms/password', form: f, attribute: :password, required: true, float: true %>
6
+ <%= render 'headmin/forms/password', form: f, attribute: :password_confirmation, required: true, float: true %>
7
7
 
8
8
  <%= f.submit t('.sign_up'), class: 'btn btn-lg btn-primary w-100' %>
9
9
 
@@ -1,27 +1,27 @@
1
- <div class="bg-light mt-5 text-end">
1
+ <div class="bg-light mt-5 text-center">
2
2
  <%- if controller_name != 'sessions' %>
3
- <%= link_to "Log in", new_session_path(resource_name) %><br />
3
+ <%= link_to t('.sign_in'), new_session_path(resource_name) %><br />
4
4
  <% end %>
5
5
 
6
6
  <%- if devise_mapping.registerable? && controller_name != 'registrations' %>
7
- <%= link_to "Sign up", new_registration_path(resource_name) %><br />
7
+ <%= link_to t('.sign_up'), new_registration_path(resource_name) %><br />
8
8
  <% end %>
9
9
 
10
10
  <%- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations' %>
11
- <%= link_to "Forgot your password?", new_password_path(resource_name) %><br />
11
+ <%= link_to t('.forgot_password'), new_password_path(resource_name) %><br />
12
12
  <% end %>
13
13
 
14
14
  <%- if devise_mapping.confirmable? && controller_name != 'confirmations' %>
15
- <%= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name) %><br />
15
+ <%= link_to t('.confirmation'), new_confirmation_path(resource_name) %><br />
16
16
  <% end %>
17
17
 
18
18
  <%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %>
19
- <%= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name) %><br />
19
+ <%= link_to t('.unlock'), new_unlock_path(resource_name) %><br />
20
20
  <% end %>
21
21
 
22
22
  <%- if devise_mapping.omniauthable? %>
23
23
  <%- resource_class.omniauth_providers.each do |provider| %>
24
- <%= link_to "Sign in with #{OmniAuth::Utils.camelize(provider)}", omniauth_authorize_path(resource_name, provider), method: :post %><br />
24
+ <%= link_to t('.omniauth', provider: OmniAuth::Utils.camelize(provider)), omniauth_authorize_path(resource_name, provider), method: :post %><br />
25
25
  <% end %>
26
26
  <% end %>
27
27
  </div>
@@ -1,7 +1,7 @@
1
1
  <%= form_for(resource, as: resource_name, url: unlock_path(resource_name), html: {method: :post}) do |f| %>
2
2
  <%= render "headmin/views/devise/shared/error_messages", resource: resource %>
3
3
 
4
- <%= render 'headmin/forms/email', form: f, attribute: :email, required: true, label: :float %>
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
 
@@ -0,0 +1,2 @@
1
+ # Pin npm packages by running ./bin/importmap
2
+ pin "headmin"
@@ -0,0 +1,9 @@
1
+ en:
2
+ attributes:
3
+ created_at: Created at
4
+ email: Email
5
+ password: Password
6
+ password_confirmation: Password confirmation
7
+ remember_me: Stay logged in
8
+ updated_at: Updated at
9
+ value: Value
@@ -0,0 +1,9 @@
1
+ nl:
2
+ attributes:
3
+ created_at: Aangemaakt
4
+ email: E-mailadres
5
+ password: Wachtwoord
6
+ password_confirmation: Wachtwoord bevestiging
7
+ remember_me: Aangemeld blijven
8
+ updated_at: Aangepast
9
+ value: Waarde
@@ -1,5 +1,2 @@
1
1
  en:
2
2
  language_name: English
3
- headmin:
4
- popup:
5
- add: 'Add %{name}'
@@ -12,6 +12,11 @@ en:
12
12
  title: Status
13
13
  view:
14
14
  title: View
15
+ file:
16
+ not_found: Not available
17
+ placeholder:
18
+ one: Browse file or drag & drop it here
19
+ other: Browse files or drag & drop them here
15
20
  group:
16
21
  save: Save
17
22
  blocks:
@@ -12,6 +12,11 @@ nl:
12
12
  title: Status
13
13
  view:
14
14
  title: Bekijken
15
+ file:
16
+ not_found: Niet beschikbaar
17
+ placeholder:
18
+ one: Kies bestand of sleep het hierheen
19
+ other: Kies bestanden of sleep ze hierheen
15
20
  group:
16
21
  save: Opslaan
17
22
  blocks:
@@ -0,0 +1,4 @@
1
+ en:
2
+ headmin:
3
+ popup:
4
+ add: 'Add %{name}'
@@ -0,0 +1,4 @@
1
+ nl:
2
+ headmin:
3
+ popup:
4
+ add: '%{name} toevoegen'
@@ -3,7 +3,11 @@ en:
3
3
  table:
4
4
  actions:
5
5
  apply: Apply
6
- selection: With selection
6
+ items_html:
7
+ zero: '<b>Without</b> items'
8
+ one: 'With <b>1</b> item'
9
+ other: 'With <b>%{count}</b> items'
10
+ selection: Choose an action
7
11
  export:
8
12
  button: Export
9
13
  delete:
@@ -3,7 +3,11 @@ nl:
3
3
  table:
4
4
  actions:
5
5
  apply: Toepassen
6
- selection: Met selectie
6
+ items_html:
7
+ zero: '<b>Zonder</b> items'
8
+ one: 'Met <b>1</b> item'
9
+ other: 'Met <b>%{count}</b> items'
10
+ selection: Selecteer een actie
7
11
  export:
8
12
  button: Exporteren
9
13
  delete:
@@ -0,0 +1,4 @@
1
+ en:
2
+ headmin:
3
+ thumbnail:
4
+ title: Title
@@ -0,0 +1,4 @@
1
+ nl:
2
+ headmin:
3
+ thumbnail:
4
+ title: Titel
@@ -53,6 +53,6 @@ en:
53
53
  sign_in: Sign in
54
54
  sign_up: Sign up
55
55
  unlock: Didn't receive unlock instructions?
56
- unlock:
56
+ unlocks:
57
57
  new:
58
58
  resend: Resend unlock instructions
@@ -7,26 +7,26 @@ nl:
7
7
  resend: Opnieuw verzenden
8
8
  mailers:
9
9
  confirmation_instructions:
10
- welcome: Welkom %{email}!
10
+ welcome: 'Welkom %{email}!'
11
11
  confirm: Account bevestigen
12
- confirm_email: Je kan uw account bevestigen door op de onderstaande link te klikken":"
12
+ confirm_email: 'Je kan uw account bevestigen door op de onderstaande link te klikken:'
13
13
  email_changed:
14
- greeting: Hallo %{email}!
15
- email_is_changing_to: We contacteren u om uw te verwittigen dat uw email zal wijzigen naar %{email}.
16
- email_has_changed_to: We contacteren u om uw te verwittigen dat uw email gewijzigd is naar %{email}.
14
+ greeting: 'Hallo %{email}!'
15
+ email_is_changing_to: 'We contacteren u om uw te verwittigen dat uw email zal wijzigen naar %{email}.'
16
+ email_has_changed_to: 'We contacteren u om uw te verwittigen dat uw email gewijzigd is naar %{email}.'
17
17
  password_change:
18
- greeting: Hallo %{email}!
18
+ greeting: 'Hallo %{email}!'
19
19
  password_has_changed: We contacteren u om uw te verwittigen dat uw wachtwoord gewijzigd is.
20
20
  reset_password_instructions:
21
- greeting: Hallo %{email}!
21
+ greeting: 'Hallo %{email}!'
22
22
  change: Wachtwoord wijzigen
23
23
  someone_requested: Iemand heeft een link gevraagd om uw wachtwoord te veranderen. Je kan dit doen via onderstaande link.
24
24
  not_requested: Als je dit niet zelf gevraagd heeft, mag u deze email negeren.
25
25
  password_not_changed_until: Je wachtwoord verandert niet totdat je op de link klikt en uw wachtwoord wijzigt.
26
26
  unlock_instructions:
27
- greeting: Hallo %{email}!
27
+ greeting: 'Hallo %{email}!'
28
28
  account_locked: Uw account is vergrendeld door het hoge aantal van mislukte login pogingen.
29
- click_link: Klik op de onderstaande link om uw account te ontgrendelen":"
29
+ click_link: 'Klik op de onderstaande link om uw account te ontgrendelen:'
30
30
  unlock_account: Ontgrendel mijn account
31
31
  passwords:
32
32
  edit:
@@ -35,7 +35,7 @@ nl:
35
35
  send_instructions: Verzend reset instructies
36
36
  registrations:
37
37
  edit:
38
- waiting_confirmation: Wachten op bevestiging voor":" %{email}
38
+ waiting_confirmation: 'Wachten op bevestiging voor: %{email}'
39
39
  change: Wijzig mijn profiel
40
40
  unhappy: Niet tevreden?
41
41
  cancel: Verwijder mijn account
@@ -49,10 +49,10 @@ nl:
49
49
  links:
50
50
  confirmation: Geen bevestigingsmail ontvangen?
51
51
  forgot_password: Wachtwoord vergeten?
52
- omniauth: "Registreer met %{provider}"
52
+ omniauth: 'Registreer met %{provider}'
53
53
  sign_in: Aanmelden
54
54
  sign_up: Registeren
55
- unlock: Geen deblokkeermail ontvangen?
56
- unlock:
55
+ unlock: Geen ontgrendelinstructies ontvangen?
56
+ unlocks:
57
57
  new:
58
- resend: Verstuur ontgrendel instructies
58
+ resend: Verstuur ontgrendelinstructies
@@ -1,5 +1,2 @@
1
1
  nl:
2
2
  language_name: Nederlands
3
- headmin:
4
- popup:
5
- add: '%{name} toevoegen'
data/docs/blocks.md CHANGED
@@ -30,13 +30,6 @@ A hidden template form will be rendered for all types defined in `allow:`
30
30
  ```
31
31
 
32
32
  For each type of block you want to include, create a template in `views/admin/blocks`.
33
- Make sure to include a hidden field to store the name of the block.
34
-
35
- ```erb
36
- # app/views/admin/blocks/_contact.html.erb
37
- <%= form.hidden_field :name, value: :contact %>
38
- ...
39
- ```
40
33
 
41
34
  ### Usage in frontend
42
35
 
data/esbuild-css.js ADDED
@@ -0,0 +1,25 @@
1
+ const esbuild = require("esbuild");
2
+ const sassPlugin = require("esbuild-sass-plugin").sassPlugin;
3
+ const watch = process.argv.includes('-w')
4
+
5
+ // Used to skip external URLs in scss files
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
+ }
13
+ }
14
+
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));
data/esbuild-js.js ADDED
@@ -0,0 +1,11 @@
1
+ const esbuild = require("esbuild");
2
+ const watch = process.argv.includes('-w')
3
+
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));
data/headmin.gemspec CHANGED
@@ -29,7 +29,10 @@ Gem::Specification.new do |spec|
29
29
 
30
30
  # Uncomment to register a new dependency of your gem
31
31
  # spec.add_dependency "example-gem", "~> 1.0"
32
- spec.add_runtime_dependency 'closure_tree'
32
+ spec.add_runtime_dependency "closure_tree"
33
+ spec.add_runtime_dependency "inline_svg"
34
+ spec.add_runtime_dependency "redcarpet"
35
+ spec.add_runtime_dependency "rouge"
33
36
 
34
37
  # For more information and examples about making a new gem, checkout our
35
38
  # guide at: https://bundler.io/guides/creating_gem.html
@@ -4,8 +4,11 @@ module Headmin
4
4
 
5
5
  source_root File.expand_path('../../templates', __FILE__)
6
6
 
7
- def blocks
7
+ def copy_models
8
8
  template 'models/block.rb', 'app/models/block.rb'
9
+ end
10
+
11
+ def copy_migrations
9
12
  migration_template 'migrations/create_blocks.rb', 'db/migrate/create_blocks.rb'
10
13
  end
11
14
 
@@ -4,7 +4,11 @@ module Headmin
4
4
 
5
5
  source_root File.expand_path('../../templates', __FILE__)
6
6
 
7
- def blocks
7
+ def copy_controllers
8
+ directory 'controllers/auth', 'app/controllers/auth'
9
+ end
10
+
11
+ def copy_views
8
12
  directory 'views/auth', 'app/views/auth'
9
13
  copy_file 'views/layouts/auth.html.erb', 'app/views/layouts/auth.html.erb'
10
14
  end
@@ -4,8 +4,11 @@ module Headmin
4
4
 
5
5
  source_root File.expand_path('../../templates', __FILE__)
6
6
 
7
- def blocks
7
+ def copy_models
8
8
  template 'models/field.rb', 'app/models/field.rb'
9
+ end
10
+
11
+ def copy_migrations
9
12
  migration_template 'migrations/create_fields.rb', 'db/migrate/create_fields.rb'
10
13
  migration_template 'migrations/create_field_hierarchies.rb', 'db/migrate/create_field_hierarchies.rb'
11
14
  end
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ class Auth::ConfirmationsController < Devise::ConfirmationsController
4
+ layout 'auth'
5
+ # GET /resource/confirmation/new
6
+ # def new
7
+ # super
8
+ # end
9
+
10
+ # POST /resource/confirmation
11
+ # def create
12
+ # super
13
+ # end
14
+
15
+ # GET /resource/confirmation?confirmation_token=abcdef
16
+ # def show
17
+ # super
18
+ # end
19
+
20
+ # protected
21
+
22
+ # The path used after resending confirmation instructions.
23
+ # def after_resending_confirmation_instructions_path_for(resource_name)
24
+ # super(resource_name)
25
+ # end
26
+
27
+ # The path used after confirmation.
28
+ # def after_confirmation_path_for(resource_name, resource)
29
+ # super(resource_name, resource)
30
+ # end
31
+ end
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ class Auth::OmniauthCallbacksController < Devise::OmniauthCallbacksController
4
+ layout 'auth'
5
+ # You should configure your model like this:
6
+ # devise :omniauthable, omniauth_providers: [:twitter]
7
+
8
+ # You should also create an action method in this controller like this:
9
+ # def twitter
10
+ # end
11
+
12
+ # More info at:
13
+ # https://github.com/heartcombo/devise#omniauth
14
+
15
+ # GET|POST /resource/auth/twitter
16
+ # def passthru
17
+ # super
18
+ # end
19
+
20
+ # GET|POST /users/auth/twitter/callback
21
+ # def failure
22
+ # super
23
+ # end
24
+
25
+ # protected
26
+
27
+ # The path used when OmniAuth fails
28
+ # def after_omniauth_failure_path_for(scope)
29
+ # super(scope)
30
+ # end
31
+ end
@@ -0,0 +1,35 @@
1
+ # frozen_string_literal: true
2
+
3
+ class Auth::PasswordsController < Devise::PasswordsController
4
+ layout 'auth'
5
+ # GET /resource/password/new
6
+ # def new
7
+ # super
8
+ # end
9
+
10
+ # POST /resource/password
11
+ # def create
12
+ # super
13
+ # end
14
+
15
+ # GET /resource/password/edit?reset_password_token=abcdef
16
+ # def edit
17
+ # super
18
+ # end
19
+
20
+ # PUT /resource/password
21
+ # def update
22
+ # super
23
+ # end
24
+
25
+ # protected
26
+
27
+ # def after_resetting_password_path_for(resource)
28
+ # super(resource)
29
+ # end
30
+
31
+ # The path used after sending reset password instructions
32
+ # def after_sending_reset_password_instructions_path_for(resource_name)
33
+ # super(resource_name)
34
+ # end
35
+ end
@@ -0,0 +1,63 @@
1
+ # frozen_string_literal: true
2
+
3
+ class Auth::RegistrationsController < Devise::RegistrationsController
4
+ layout 'auth'
5
+ # before_action :configure_sign_up_params, only: [:create]
6
+ # before_action :configure_account_update_params, only: [:update]
7
+
8
+ # GET /resource/sign_up
9
+ # def new
10
+ # super
11
+ # end
12
+
13
+ # POST /resource
14
+ # def create
15
+ # super
16
+ # end
17
+
18
+ # GET /resource/edit
19
+ # def edit
20
+ # super
21
+ # end
22
+
23
+ # PUT /resource
24
+ # def update
25
+ # super
26
+ # end
27
+
28
+ # DELETE /resource
29
+ # def destroy
30
+ # super
31
+ # end
32
+
33
+ # GET /resource/cancel
34
+ # Forces the session data which is usually expired after sign
35
+ # in to be expired now. This is useful if the user wants to
36
+ # cancel oauth signing in/up in the middle of the process,
37
+ # removing all OAuth session data.
38
+ # def cancel
39
+ # super
40
+ # end
41
+
42
+ # protected
43
+
44
+ # If you have extra params to permit, append them to the sanitizer.
45
+ # def configure_sign_up_params
46
+ # devise_parameter_sanitizer.permit(:sign_up, keys: [:attribute])
47
+ # end
48
+
49
+ # If you have extra params to permit, append them to the sanitizer.
50
+ # def configure_account_update_params
51
+ # devise_parameter_sanitizer.permit(:account_update, keys: [:attribute])
52
+ # end
53
+
54
+ # The path used after sign up.
55
+ # def after_sign_up_path_for(resource)
56
+ # super(resource)
57
+ # end
58
+
59
+ # The path used after sign up for inactive accounts.
60
+ # def after_inactive_sign_up_path_for(resource)
61
+ # super(resource)
62
+ # end
63
+ end
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ class Auth::SessionsController < Devise::SessionsController
4
+ layout 'auth'
5
+ # before_action :configure_sign_in_params, only: [:create]
6
+
7
+ # GET /resource/sign_in
8
+ # def new
9
+ # super
10
+ # end
11
+
12
+ # POST /resource/sign_in
13
+ # def create
14
+ # super
15
+ # end
16
+
17
+ # DELETE /resource/sign_out
18
+ # def destroy
19
+ # super
20
+ # end
21
+
22
+ # protected
23
+
24
+ # If you have extra params to permit, append them to the sanitizer.
25
+ # def configure_sign_in_params
26
+ # devise_parameter_sanitizer.permit(:sign_in, keys: [:attribute])
27
+ # end
28
+ end
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ class Auth::UnlocksController < Devise::UnlocksController
4
+ layout 'auth'
5
+ # GET /resource/unlock/new
6
+ # def new
7
+ # super
8
+ # end
9
+
10
+ # POST /resource/unlock
11
+ # def create
12
+ # super
13
+ # end
14
+
15
+ # GET /resource/unlock?unlock_token=abcdef
16
+ # def show
17
+ # super
18
+ # end
19
+
20
+ # protected
21
+
22
+ # The path used after sending unlock password instructions
23
+ # def after_sending_unlock_instructions_path_for(resource)
24
+ # super(resource)
25
+ # end
26
+
27
+ # The path used after unlocking the resource
28
+ # def after_unlock_path_for(resource)
29
+ # super(resource)
30
+ # end
31
+ end