trestle 0.9.8 → 0.10.0.pre

Sign up to get free protection for your applications and to get access to all the features.
Files changed (347) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/rspec.yml +34 -4
  3. data/.gitignore +7 -0
  4. data/Gemfile +5 -1
  5. data/README.md +2 -1
  6. data/app/assets/bundle/trestle/admin.css +23 -0
  7. data/app/assets/bundle/trestle/admin.js +83 -0
  8. data/app/assets/bundle/trestle/fa-brands-400.ttf +0 -0
  9. data/app/assets/bundle/trestle/fa-brands-400.woff2 +0 -0
  10. data/app/assets/bundle/trestle/fa-regular-400.ttf +0 -0
  11. data/app/assets/bundle/trestle/fa-regular-400.woff2 +0 -0
  12. data/app/assets/bundle/trestle/fa-solid-900.ttf +0 -0
  13. data/app/assets/bundle/trestle/fa-solid-900.woff2 +0 -0
  14. data/app/assets/bundle/trestle/locale/cs.js +110 -0
  15. data/app/assets/bundle/trestle/locale/de.js +116 -0
  16. data/app/assets/bundle/trestle/locale/en.js +329 -0
  17. data/app/assets/bundle/trestle/locale/es-MX.js +109 -0
  18. data/app/assets/bundle/trestle/locale/es.js +109 -0
  19. data/app/assets/bundle/trestle/locale/fr.js +111 -0
  20. data/app/assets/bundle/trestle/locale/ko.js +111 -0
  21. data/app/assets/bundle/trestle/locale/lv.js +109 -0
  22. data/app/assets/bundle/trestle/locale/nl.js +96 -0
  23. data/app/assets/bundle/trestle/locale/pl.js +99 -0
  24. data/app/assets/bundle/trestle/locale/pt-BR.js +98 -0
  25. data/app/assets/bundle/trestle/locale/vi.js +116 -0
  26. data/app/assets/bundle/trestle/locale/zh-CN.js +109 -0
  27. data/app/assets/bundle/trestle/photoswipe-7aa1aec9c3c1fd65c382.digested.js +6 -0
  28. data/app/assets/sprockets/trestle/custom.css +1 -0
  29. data/app/assets/sprockets/trestle/icons/font-awesome.css.erb +32 -0
  30. data/app/assets/sprockets/trestle/manifest.js +4 -0
  31. data/app/assets/stylesheets/trestle/custom.css +6 -1
  32. data/app/controllers/concerns/trestle/controller/helpers.rb +2 -0
  33. data/app/controllers/concerns/trestle/controller/location.rb +1 -6
  34. data/app/controllers/concerns/trestle/controller/modal.rb +23 -0
  35. data/app/controllers/concerns/trestle/controller/toolbars.rb +1 -1
  36. data/app/controllers/concerns/trestle/controller/turbo.rb +21 -0
  37. data/app/controllers/concerns/trestle/resource/controller/actions.rb +40 -29
  38. data/app/controllers/concerns/trestle/resource/controller/redirection.rb +7 -5
  39. data/app/controllers/trestle/admin_controller.rb +4 -0
  40. data/app/controllers/trestle/application_controller.rb +2 -1
  41. data/app/helpers/trestle/card_helper.rb +2 -2
  42. data/app/helpers/trestle/flash_helper.rb +10 -0
  43. data/app/helpers/trestle/form_helper.rb +3 -2
  44. data/app/helpers/trestle/format_helper.rb +2 -1
  45. data/app/helpers/trestle/i18n_helper.rb +46 -7
  46. data/app/helpers/trestle/modal_helper.rb +34 -0
  47. data/app/helpers/trestle/navigation_helper.rb +3 -1
  48. data/app/helpers/trestle/tab_helper.rb +1 -1
  49. data/app/helpers/trestle/toolbars_helper.rb +1 -1
  50. data/app/helpers/trestle/turbo_frame_helper.rb +34 -0
  51. data/app/helpers/trestle/url_helper.rb +7 -4
  52. data/app/views/layouts/trestle/admin.html.erb +16 -18
  53. data/app/views/layouts/trestle/admin.turbo_stream.erb +11 -0
  54. data/app/views/layouts/trestle/modal.html.erb +5 -0
  55. data/app/views/trestle/_i18n.html.erb +12 -0
  56. data/app/views/trestle/_theme.html.erb +15 -0
  57. data/app/views/trestle/application/_header.html.erb +1 -1
  58. data/app/views/trestle/application/_layout.html.erb +6 -3
  59. data/app/views/trestle/application/_modal.html.erb +36 -0
  60. data/app/views/trestle/application/_tabs.html.erb +4 -4
  61. data/app/views/trestle/flash/_alert.html.erb +1 -1
  62. data/app/views/trestle/flash/_debug.html.erb +1 -1
  63. data/app/views/trestle/resource/_form.html.erb +5 -0
  64. data/app/views/trestle/resource/_scopes.html.erb +1 -1
  65. data/app/views/trestle/resource/create.turbo_stream.erb +5 -0
  66. data/app/views/trestle/resource/destroy.turbo_stream.erb +1 -0
  67. data/app/views/trestle/resource/edit.html.erb +4 -2
  68. data/app/views/trestle/resource/index.html.erb +12 -10
  69. data/app/views/trestle/resource/new.html.erb +4 -2
  70. data/app/views/trestle/resource/show.html.erb +4 -2
  71. data/app/views/trestle/resource/update.turbo_stream.erb +5 -0
  72. data/app/views/trestle/shared/_sidebar.html.erb +9 -9
  73. data/config/locales/vi.yml +1 -1
  74. data/frontend/css/components/_alerts.scss +19 -17
  75. data/frontend/css/components/_background.scss +7 -35
  76. data/frontend/css/components/_badges.scss +31 -0
  77. data/frontend/css/components/_breadcrumbs.scss +4 -4
  78. data/frontend/css/components/_buttons.scss +5 -4
  79. data/frontend/css/components/_datepicker.scss +12 -8
  80. data/frontend/css/components/_dropdown.scss +23 -3
  81. data/frontend/css/components/{_fields.scss → _forms.scss} +16 -3
  82. data/frontend/css/components/_media-grid.scss +52 -44
  83. data/frontend/css/components/_modal.scss +33 -4
  84. data/frontend/css/components/_pagination.scss +1 -1
  85. data/frontend/css/components/_photoswipe.scss +8 -0
  86. data/frontend/css/components/_popover.scss +1 -0
  87. data/frontend/css/components/_scopes.scss +1 -1
  88. data/frontend/css/components/_select.scss +161 -31
  89. data/frontend/css/components/_table.scss +60 -65
  90. data/frontend/css/components/_tabs.scss +10 -3
  91. data/frontend/css/components/_tags.scss +71 -16
  92. data/frontend/css/components/_toolbars.scss +18 -31
  93. data/frontend/css/components/_turbo.scss +3 -0
  94. data/frontend/css/core/_bootstrap.scss +46 -0
  95. data/frontend/css/core/_dependencies.scss +4 -3
  96. data/frontend/css/core/_functions.scss +39 -0
  97. data/frontend/css/core/_mixins.scss +3 -40
  98. data/frontend/css/core/_theme.scss +258 -0
  99. data/frontend/css/core/_typography.scss +10 -1
  100. data/frontend/css/icons/_fontawesome.scss +3 -15
  101. data/frontend/css/index.scss +12 -6
  102. data/frontend/css/layout/_base.scss +3 -3
  103. data/frontend/css/layout/_content.scss +11 -7
  104. data/frontend/css/layout/_footer.scss +1 -1
  105. data/frontend/css/layout/_header.scss +5 -3
  106. data/frontend/css/layout/_navigation.scss +2 -2
  107. data/frontend/css/layout/_sidebar.scss +19 -9
  108. data/frontend/css/support/_sprockets.scss +2 -0
  109. data/frontend/css/support/_webpack.scss +2 -0
  110. data/frontend/css/variables/_bootstrap.scss +134 -40
  111. data/frontend/css/variables/_maps.scss +15 -0
  112. data/frontend/css/variables/_trestle.scss +55 -26
  113. data/frontend/js/controllers/application_controller.js +17 -0
  114. data/frontend/js/controllers/checkbox_select_controller.js +43 -0
  115. data/frontend/js/controllers/confirm_controller.js +115 -0
  116. data/frontend/js/controllers/confirm_delete_controller.js +11 -0
  117. data/frontend/js/controllers/datepicker_controller.js +12 -0
  118. data/frontend/js/controllers/datetimepicker_controller.js +13 -0
  119. data/frontend/js/controllers/deprecated/init_controller.js +9 -0
  120. data/frontend/js/controllers/flatpickr_controller.js +50 -0
  121. data/frontend/js/controllers/follow_url_controller.js +36 -0
  122. data/frontend/js/controllers/form_error_controller.js +24 -0
  123. data/frontend/js/controllers/form_loading_controller.js +50 -0
  124. data/frontend/js/controllers/gallery_controller.js +10 -0
  125. data/frontend/js/controllers/index.js +19 -0
  126. data/frontend/js/controllers/keyboard_submit_controller.js +25 -0
  127. data/frontend/js/controllers/lightbox_controller.js +160 -0
  128. data/frontend/js/controllers/mobile_sidebar_controller.js +30 -0
  129. data/frontend/js/controllers/modal_controller.js +36 -0
  130. data/frontend/js/controllers/modal_frame_controller.js +11 -0
  131. data/frontend/js/controllers/modal_trigger_controller.js +74 -0
  132. data/frontend/js/{components/navigation.js → controllers/navigation_controller.js} +14 -10
  133. data/frontend/js/controllers/navigation_tooltip_controller.js +32 -0
  134. data/frontend/js/controllers/popover_controller.js +87 -0
  135. data/frontend/js/controllers/reloadable_controller.js +34 -0
  136. data/frontend/js/controllers/select_controller.js +49 -0
  137. data/frontend/js/controllers/sidebar_controller.js +33 -0
  138. data/frontend/js/controllers/tab_errors_controller.js +45 -0
  139. data/frontend/js/controllers/tabs_controller.js +45 -0
  140. data/frontend/js/controllers/timepicker_controller.js +14 -0
  141. data/frontend/js/controllers/toggle_attr_controller.js +27 -0
  142. data/frontend/js/controllers/toggle_class_controller.js +27 -0
  143. data/frontend/js/controllers/tooltip_controller.js +13 -0
  144. data/frontend/js/controllers/wrapper_controller.js +43 -0
  145. data/frontend/js/core/backdrop.js +100 -0
  146. data/frontend/js/core/error_modal.js +65 -0
  147. data/frontend/js/core/fetch.js +32 -0
  148. data/frontend/js/core/i18n.js +24 -10
  149. data/frontend/js/core/modal.js +52 -0
  150. data/frontend/js/core/stream_actions.js +56 -0
  151. data/frontend/js/core/turbo_errors.js +9 -0
  152. data/frontend/js/{core → deprecated}/events.js +1 -8
  153. data/frontend/js/deprecated/tooltip.js +8 -0
  154. data/frontend/js/index.js +28 -40
  155. data/frontend/js/mixins/index.js +5 -0
  156. data/frontend/js/mixins/photoswipe.js +10 -0
  157. data/frontend/js/util/bootstrap.js +93 -0
  158. data/i18n/config.yml +14 -0
  159. data/i18n/environment.rb +8 -0
  160. data/i18n/export +3 -0
  161. data/i18n/template.erb +1 -0
  162. data/lib/generators/trestle/install/install_generator.rb +3 -8
  163. data/lib/generators/trestle/install/templates/trestle.rb.erb +5 -5
  164. data/lib/trestle/adapters/active_record_adapter.rb +1 -1
  165. data/lib/trestle/admin/builder.rb +7 -0
  166. data/lib/trestle/admin.rb +12 -6
  167. data/lib/trestle/color.rb +113 -0
  168. data/lib/trestle/configurable.rb +2 -2
  169. data/lib/trestle/configuration.rb +16 -8
  170. data/lib/trestle/engine.rb +23 -17
  171. data/lib/trestle/form/automatic.rb +3 -1
  172. data/lib/trestle/form/fields/check_box_helpers.rb +7 -18
  173. data/lib/trestle/form/fields/collection_select.rb +1 -1
  174. data/lib/trestle/form/fields/color_field.rb +4 -0
  175. data/lib/trestle/form/fields/date_field.rb +4 -0
  176. data/lib/trestle/form/fields/date_picker.rb +10 -4
  177. data/lib/trestle/form/fields/date_select.rb +1 -1
  178. data/lib/trestle/form/fields/datetime_field.rb +4 -0
  179. data/lib/trestle/form/fields/datetime_select.rb +1 -1
  180. data/lib/trestle/form/fields/file_field.rb +3 -28
  181. data/lib/trestle/form/fields/form_control.rb +2 -2
  182. data/lib/trestle/form/fields/form_group.rb +1 -1
  183. data/lib/trestle/form/fields/grouped_collection_select.rb +1 -1
  184. data/lib/trestle/form/fields/radio_button_helpers.rb +5 -17
  185. data/lib/trestle/form/fields/range_field.rb +1 -5
  186. data/lib/trestle/form/fields/select.rb +17 -1
  187. data/lib/trestle/form/fields/time_field.rb +4 -0
  188. data/lib/trestle/form/fields/time_select.rb +1 -1
  189. data/lib/trestle/form/fields/time_zone_select.rb +1 -1
  190. data/lib/trestle/form/renderer.rb +3 -0
  191. data/lib/trestle/form.rb +16 -1
  192. data/lib/trestle/hook/helpers.rb +1 -1
  193. data/lib/trestle/reloader.rb +2 -11
  194. data/lib/trestle/resource/builder.rb +1 -8
  195. data/lib/trestle/resource/toolbar.rb +2 -2
  196. data/lib/trestle/resource.rb +2 -2
  197. data/lib/trestle/scopes/block.rb +7 -7
  198. data/lib/trestle/scopes/definition.rb +2 -2
  199. data/lib/trestle/scopes/scope.rb +4 -0
  200. data/lib/trestle/table/actions_column.rb +2 -2
  201. data/lib/trestle/table/row.rb +2 -1
  202. data/lib/trestle/table/select_column.rb +3 -6
  203. data/lib/trestle/table.rb +6 -1
  204. data/lib/trestle/toolbar/item.rb +1 -1
  205. data/lib/trestle/toolbar/menu.rb +3 -6
  206. data/lib/trestle/version.rb +1 -1
  207. data/lib/trestle.rb +3 -20
  208. data/package.json +31 -27
  209. data/trestle.gemspec +9 -10
  210. data/webpack.config.js +18 -11
  211. data/yarn.lock +1934 -2819
  212. metadata +181 -179
  213. data/app/assets/bundle/trestle/bundle.css +0 -12
  214. data/app/assets/bundle/trestle/bundle.js +0 -103
  215. data/app/assets/bundle/trestle/fa-brands-400.eot +0 -0
  216. data/app/assets/bundle/trestle/fa-brands-400.svg +0 -3717
  217. data/app/assets/bundle/trestle/fa-brands-400.woff +0 -0
  218. data/app/assets/bundle/trestle/fa-regular-400.eot +0 -0
  219. data/app/assets/bundle/trestle/fa-regular-400.svg +0 -801
  220. data/app/assets/bundle/trestle/fa-regular-400.woff +0 -0
  221. data/app/assets/bundle/trestle/fa-solid-900.eot +0 -0
  222. data/app/assets/bundle/trestle/fa-solid-900.svg +0 -5034
  223. data/app/assets/bundle/trestle/fa-solid-900.woff +0 -0
  224. data/app/assets/javascripts/trestle/admin.js +0 -3
  225. data/app/assets/javascripts/trestle/i18n.js.erb +0 -8
  226. data/app/assets/stylesheets/trestle/admin.css +0 -2
  227. data/app/assets/stylesheets/trestle/icons/_font-awesome.css.erb +0 -40
  228. data/app/controllers/concerns/trestle/controller/dialog.rb +0 -16
  229. data/app/views/trestle/application/_dialog.html.erb +0 -34
  230. data/frontend/css/components/_color-vars.scss +0 -10
  231. data/frontend/css/components/_custom-forms.scss +0 -35
  232. data/frontend/css/components/_magnific-popup.scss +0 -36
  233. data/frontend/css/components/_turbolinks.scss +0 -3
  234. data/frontend/js/components/confirmation.js +0 -32
  235. data/frontend/js/components/datepicker.js +0 -69
  236. data/frontend/js/components/dialog.js +0 -149
  237. data/frontend/js/components/file.js +0 -7
  238. data/frontend/js/components/form.js +0 -100
  239. data/frontend/js/components/gallery.js +0 -33
  240. data/frontend/js/components/pagination.js +0 -51
  241. data/frontend/js/components/select.js +0 -18
  242. data/frontend/js/components/sidebar.js +0 -75
  243. data/frontend/js/components/table.js +0 -61
  244. data/frontend/js/components/tabs.js +0 -59
  245. data/frontend/js/components/tooltips.js +0 -25
  246. data/frontend/js/core/contexts.js +0 -17
  247. data/frontend/js/core/turbolinks.js +0 -3
  248. data/frontend/js/core/visit.js +0 -16
  249. data/frontend/theme/trestle/_theme.scss +0 -4
  250. data/frontend/theme/trestle/_variables.scss +0 -4
  251. data/frontend/theme/trestle/theme/_defaults.scss +0 -152
  252. data/frontend/theme/trestle/theme/_functions.scss +0 -44
  253. data/frontend/theme/trestle/theme/_variables.scss +0 -15
  254. data/frontend/theme/trestle/theme/bootstrap/_alert.scss +0 -19
  255. data/frontend/theme/trestle/theme/bootstrap/_badge.scss +0 -25
  256. data/frontend/theme/trestle/theme/bootstrap/_buttons.scss +0 -93
  257. data/frontend/theme/trestle/theme/bootstrap/_color-vars.scss +0 -11
  258. data/frontend/theme/trestle/theme/bootstrap/_custom-forms.scss +0 -93
  259. data/frontend/theme/trestle/theme/bootstrap/_dropdown.scss +0 -6
  260. data/frontend/theme/trestle/theme/bootstrap/_forms.scss +0 -6
  261. data/frontend/theme/trestle/theme/bootstrap/_links.scss +0 -7
  262. data/frontend/theme/trestle/theme/bootstrap/_list-group.scss +0 -31
  263. data/frontend/theme/trestle/theme/bootstrap/_nav.scss +0 -6
  264. data/frontend/theme/trestle/theme/bootstrap/_pagination.scss +0 -18
  265. data/frontend/theme/trestle/theme/bootstrap/_progress.scss +0 -3
  266. data/frontend/theme/trestle/theme/bootstrap/_tables.scss +0 -41
  267. data/frontend/theme/trestle/theme/bootstrap/_utilities.scss +0 -3
  268. data/frontend/theme/trestle/theme/bootstrap/utilities/_background.scss +0 -17
  269. data/frontend/theme/trestle/theme/bootstrap/utilities/_borders.scss +0 -5
  270. data/frontend/theme/trestle/theme/bootstrap/utilities/_text.scss +0 -18
  271. data/frontend/theme/trestle/theme/trestle/_background.scss +0 -61
  272. data/frontend/theme/trestle/theme/trestle/_datepicker.scss +0 -58
  273. data/frontend/theme/trestle/theme/trestle/_headers.scss +0 -4
  274. data/frontend/theme/trestle/theme/trestle/_navbar.scss +0 -15
  275. data/frontend/theme/trestle/theme/trestle/_navigation.scss +0 -5
  276. data/frontend/theme/trestle/theme/trestle/_select2.scss +0 -22
  277. data/frontend/theme/trestle/theme/trestle/_tags.scss +0 -12
  278. data/frontend/theme/trestle/theme/trestle/_turbolinks.scss +0 -3
  279. data/frontend/theme/trestle/theme.scss +0 -29
  280. data/lib/generators/trestle/install/templates/_theme.scss +0 -13
  281. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/ar-dz.js +0 -0
  282. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/ar.js +0 -0
  283. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/at.js +0 -0
  284. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/az.js +0 -0
  285. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/be.js +0 -0
  286. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/bg.js +0 -0
  287. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/bn.js +0 -0
  288. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/bs.js +0 -0
  289. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/cat.js +0 -0
  290. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/ckb.js +0 -0
  291. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/cs.js +0 -0
  292. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/cy.js +0 -0
  293. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/da.js +0 -0
  294. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/de.js +0 -0
  295. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/default.js +0 -0
  296. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/eo.js +0 -0
  297. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/es.js +0 -0
  298. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/et.js +0 -0
  299. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/fa.js +0 -0
  300. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/fi.js +0 -0
  301. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/fo.js +0 -0
  302. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/fr.js +0 -0
  303. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/ga.js +0 -0
  304. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/gr.js +0 -0
  305. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/he.js +0 -0
  306. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/hi.js +0 -0
  307. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/hr.js +0 -0
  308. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/hu.js +0 -0
  309. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/hy.js +0 -0
  310. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/id.js +0 -0
  311. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/is.js +0 -0
  312. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/it.js +0 -0
  313. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/ja.js +0 -0
  314. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/ka.js +0 -0
  315. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/km.js +0 -0
  316. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/ko.js +0 -0
  317. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/kz.js +0 -0
  318. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/lt.js +0 -0
  319. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/lv.js +0 -0
  320. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/mk.js +0 -0
  321. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/mn.js +0 -0
  322. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/ms.js +0 -0
  323. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/my.js +0 -0
  324. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/nl.js +0 -0
  325. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/nn.js +0 -0
  326. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/no.js +0 -0
  327. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/pa.js +0 -0
  328. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/pl.js +0 -0
  329. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/pt.js +0 -0
  330. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/ro.js +0 -0
  331. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/ru.js +0 -0
  332. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/si.js +0 -0
  333. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/sk.js +0 -0
  334. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/sl.js +0 -0
  335. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/sq.js +0 -0
  336. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/sr-cyr.js +0 -0
  337. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/sr.js +0 -0
  338. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/sv.js +0 -0
  339. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/th.js +0 -0
  340. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/tr.js +0 -0
  341. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/uk.js +0 -0
  342. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/uz.js +0 -0
  343. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/uz_latn.js +0 -0
  344. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/vn.js +0 -0
  345. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/zh-tw.js +0 -0
  346. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/zh.js +0 -0
  347. /data/app/assets/{stylesheets → sprockets}/trestle/_custom.css +0 -0
@@ -1,13 +1,20 @@
1
+ @use "sass:math";
2
+
1
3
  .app-sidebar {
2
4
  background: $sidebar-bg;
3
5
 
4
6
  width: $sidebar-width;
7
+ padding: 0;
8
+
5
9
  flex-shrink: 0;
6
10
 
7
11
  position: relative;
8
12
 
9
13
  display: flex;
10
14
  flex-direction: column;
15
+ flex-wrap: nowrap;
16
+
17
+ align-items: stretch;
11
18
  }
12
19
 
13
20
  .app-sidebar-header {
@@ -19,24 +26,27 @@
19
26
  align-items: stretch;
20
27
 
21
28
  .navbar-toggler {
29
+ --bs-navbar-toggler-bg: #{$sidebar-mobile-toggle-bg};
30
+ --bs-navbar-toggler-color: #{$sidebar-mobile-toggle-border-color};
31
+ --bs-navbar-toggler-border-color: #{$sidebar-mobile-toggle-border-color};
32
+
22
33
  outline: none;
23
34
 
24
35
  align-self: center;
25
36
 
26
- margin-left: $grid-gutter-width / 2;
27
- margin-right: $grid-gutter-width / 2;
37
+ margin-left: math.div($grid-gutter-width, 2);
38
+ margin-right: math.div($grid-gutter-width, 2);
28
39
 
29
- background: $sidebar-mobile-toggle-bg;
30
- border: $sidebar-mobile-toggle-border;
40
+ background: var(--bs-navbar-toggler-bg);
31
41
 
32
42
  &:hover, &:focus {
33
- background: $sidebar-mobile-toggle-active-bg;
34
- border: $sidebar-mobile-toggle-active-border;
43
+ --bs-navbar-toggler-border-color: #{$sidebar-mobile-toggle-active-border-color};
44
+ --bs-navbar-toggler-bg: #{$sidebar-mobile-toggle-active-bg};
35
45
  }
36
46
  }
37
47
 
38
48
  .navbar-toggler-icon {
39
- background-image: $sidebar-mobile-toggle-icon-bg;
49
+ --bs-navbar-toggler-icon-bg: #{$sidebar-mobile-toggle-icon-bg};
40
50
  }
41
51
  }
42
52
 
@@ -122,7 +132,7 @@
122
132
  }
123
133
  }
124
134
 
125
- @include media-breakpoint-down(sm) {
135
+ @include media-breakpoint-down(md) {
126
136
  html, body {
127
137
  overflow-x: hidden;
128
138
  }
@@ -170,7 +180,7 @@
170
180
  }
171
181
  }
172
182
 
173
- @include media-breakpoint-between(md, lg) {
183
+ @include media-breakpoint-between(md, xl) {
174
184
  .app-sidebar {
175
185
  width: $sidebar-width-collapsed;
176
186
 
@@ -3,6 +3,7 @@
3
3
  // Mixins & functions
4
4
  @import "bootstrap/scss/functions";
5
5
  @import "bootstrap/scss/mixins";
6
+ @import "trestle/frontend/css/core/functions";
6
7
  @import "trestle/frontend/css/core/mixins";
7
8
 
8
9
  // Variables
@@ -11,4 +12,5 @@
11
12
  @import "bootstrap/scss/variables";
12
13
 
13
14
  // Icon variables
15
+ @import "@fortawesome/fontawesome-free/scss/functions";
14
16
  @import "@fortawesome/fontawesome-free/scss/variables";
@@ -3,6 +3,7 @@
3
3
  // Mixins & functions
4
4
  @import "~bootstrap/scss/functions";
5
5
  @import "~bootstrap/scss/mixins";
6
+ @import "../core/functions";
6
7
  @import "../core/mixins";
7
8
 
8
9
  // Variables
@@ -11,4 +12,5 @@
11
12
  @import "~bootstrap/scss/variables";
12
13
 
13
14
  // Icon variables
15
+ @import "~@fortawesome/fontawesome-free/scss/functions";
14
16
  @import "~@fortawesome/fontawesome-free/scss/variables";
@@ -1,17 +1,13 @@
1
1
  // Color system
2
2
 
3
- $theme-colors: (
4
- "primary": #4d6bb2,
5
- "success": #7dc67d,
6
- "info": #7ccde5,
7
- "warning": #f3bd71,
8
- "danger": #e17572,
9
- "light": #bbbbbb,
10
- "dark": #444444,
11
-
12
- // Backwards compatibility
13
- "default": #bbbbbb
14
- );
3
+ $primary: #4d6bb2;
4
+ $secondary: #6c757d;
5
+ $success: #7dc67d;
6
+ $info: #7ccde5;
7
+ $warning: #f3bd71;
8
+ $danger: #e17572;
9
+ $light: #bbbbbb;
10
+ $dark: #444444;
15
11
 
16
12
 
17
13
  // Body
@@ -20,21 +16,36 @@ $body-bg: #f3f3f3;
20
16
  $body-color: #333333;
21
17
 
22
18
 
23
- // Set a specific jump point for requesting color jumps
24
- $theme-color-interval: 5% !default;
25
-
26
- // Increase default color threshold for light vs dark
27
- $yiq-contrasted-threshold: 200;
19
+ // The contrast ratio to reach against white, to determine if color changes from "light" to "dark".
20
+ $min-contrast-ratio: 1.7;
28
21
 
29
22
  // Enable box shadows
30
23
  $enable-shadows: true;
31
24
 
32
25
  // Decrease default grid spacing
33
- $grid-gutter-width: 10px * 2;
26
+ $grid-gutter-width: 1.375rem;
27
+
28
+
29
+ // Characters which are escaped by the escape-svg function
30
+ $escaped-characters: (
31
+ ("<", "%3c"),
32
+ (">", "%3e"),
33
+ ("#", "%23"),
34
+ ("(", "%28"),
35
+ (")", "%29"),
36
+ ) !default;
37
+
38
+
39
+ // Components
40
+
41
+ $box-shadow: soft-shadow(1rem, 1.5em, rgba(black, 0.25));
42
+ $box-shadow-sm: soft-shadow(0.5rem, 0.75em, rgba(black, 0.075), $layers: 4);
34
43
 
35
44
 
36
45
  // Typography
37
46
 
47
+ $link-decoration: none;
48
+
38
49
  $headings-font-weight: 400;
39
50
  $headings-margin-bottom: 1rem;
40
51
 
@@ -45,18 +56,25 @@ $h4-font-size: 1.25rem;
45
56
  $h5-font-size: 1.1rem;
46
57
  $h6-font-size: 1rem;
47
58
 
59
+ $hr-color: rgba(black, 0.375);
48
60
  $hr-margin-y: 1.5rem;
49
61
 
50
62
 
51
63
  // Navs
52
64
 
65
+ $nav-pills-link-active-bg: var(--primary);
66
+
53
67
  $nav-tabs-border-radius: 0;
54
68
  $nav-tabs-border-width: 0;
55
69
 
56
- $nav-tabs-link-bg: #eeeeee;
57
- $nav-tabs-link-color: #555555;
70
+ // (non-Bootstrap variables)
71
+ $nav-tabs-link-bg: #eeeeee;
72
+ $nav-tabs-link-color: #555555;
73
+ $nav-tabs-link-hover-bg: #eaeaea;
74
+ $nav-tabs-link-hover-color: #505050;
75
+ $nav-tabs-link-transition: color .1s ease-in-out, background-color .1s ease-in-out;
58
76
 
59
- $nav-tabs-link-active-bg: white;
77
+ $nav-tabs-link-active-bg: white;
60
78
  $nav-tabs-link-active-color: $body-color;
61
79
 
62
80
 
@@ -70,21 +88,20 @@ $navbar-dark-color: rgba(white, 0.75);
70
88
 
71
89
  $breadcrumb-padding-y: 0;
72
90
  $breadcrumb-padding-x: 0;
73
- $breadcrumb-bg: transparent;
74
91
  $breadcrumb-active-color: #777777;
75
92
  $breadcrumb-divider-color: #cccccc;
76
93
 
77
94
 
78
95
  // Tables
79
96
 
80
- $table-cell-padding: 6px 8px;
81
- $table-accent-bg: rgba(black, 0.02);
97
+ $table-cell-padding-x: 0.625rem;
98
+ $table-cell-padding-y: 0.375rem;
99
+
100
+ $table-bg: transparent;
101
+ $table-striped-bg: rgba(black, 0.02);
82
102
  $table-hover-bg: rgba(black, 0.04);
83
103
  $table-border-color: rgba(black, 0.13);
84
104
 
85
- $table-bg-level: -11;
86
- $table-border-level: -7;
87
-
88
105
 
89
106
  // Alerts
90
107
 
@@ -92,6 +109,23 @@ $alert-padding-y: 1.5rem;
92
109
  $alert-border-radius: 0.1rem;
93
110
 
94
111
 
112
+ // Progress bars
113
+
114
+ $progress-bar-bg: var(--primary);
115
+
116
+
117
+ // List group
118
+
119
+ $list-group-bg: white;
120
+ $list-group-active-bg: var(--primary);
121
+
122
+
123
+ // Close
124
+
125
+ $btn-close-color: white;
126
+ $btn-close-bg: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='#{$btn-close-color}'><path d='M.293.293a1 1 0 011.414 0L8 6.586 14.293.293a1 1 0 111.414 1.414L9.414 8l6.293 6.293a1 1 0 01-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 01-1.414-1.414L6.586 8 .293 1.707a1 1 0 010-1.414z'/></svg>");
127
+
128
+
95
129
  // Badges
96
130
 
97
131
  $badge-padding-y: 0.35em;
@@ -105,40 +139,55 @@ $btn-padding-x-sm: 0.65rem;
105
139
 
106
140
  // Forms
107
141
 
108
- $input-border-color: #cccccc;
142
+ $input-bg: white;
109
143
  $input-disabled-bg: #fafafa;
110
144
 
111
- $input-box-shadow: none;
145
+ $input-border-color: #cccccc;
112
146
 
113
147
  $input-placeholder-color: #999999;
114
148
 
115
149
  $input-group-addon-bg: #eeeeee;
116
150
 
117
- $form-feedback-invalid-color: darken(theme-color("danger"), 20%);
151
+ $form-feedback-invalid-color: shade-color($danger, 10%);
118
152
 
119
153
  $form-feedback-margin-top: 0.5rem;
120
154
  $form-feedback-font-size: 90%;
121
155
 
156
+ $form-label-font-weight: bold;
157
+
122
158
  $form-text-color: #666666;
123
159
 
124
- $custom-control-indicator-size: 1.15rem;
125
- $custom-control-indicator-border-width: 1px;
160
+ $form-check-input-width: 1.25em;
161
+ $form-check-padding-start: $form-check-input-width + 0.6em;
126
162
 
127
- $custom-control-gutter: 0.6rem;
163
+ $form-switch-width: 2.25em;
164
+ $form-switch-focus-color: #aaaaaa;
128
165
 
129
- $custom-switch-width: 2.25rem;
130
- $custom-switch-indicator-size: calc(#{em($custom-control-indicator-size)} - #{$custom-control-indicator-border-width * 4}) !default;
166
+ $form-select-padding-x-sm: 0.62rem;
167
+ $form-select-padding-x-lg: 0.75rem;
131
168
 
132
169
 
133
170
  // Dropdowns
134
171
 
172
+ $dropdown-bg: white;
135
173
  $dropdown-spacer: 0.5rem;
136
- $dropdown-box-shadow: 0 3px 6px rgba(black, 0.175);
174
+ $dropdown-box-shadow: $box-shadow-sm;
137
175
  $dropdown-arrow-width: 7px;
138
176
  $dropdown-arrow-outer-width: $dropdown-arrow-width + 1px;
139
177
  $dropdown-header-color: #111111;
140
178
  $dropdown-font-size: 0.9rem;
141
179
 
180
+ $dropdown-link-active-bg: var(--primary);
181
+
182
+ $dropdown-dark-bg: #222222;
183
+ $dropdown-dark-divider-bg: rgba(white, 0.15);
184
+
185
+
186
+ // Pagination
187
+
188
+ $pagination-bg: white;
189
+ $pagination-disabled-bg: white;
190
+
142
191
 
143
192
  // Cards
144
193
 
@@ -146,11 +195,29 @@ $card-bg: rgba(white, 0.5);
146
195
  $card-border-radius: 0;
147
196
 
148
197
 
198
+ // Accordion
199
+
200
+ $accordion-bg: white;
201
+ $accordion-icon-active-color: #111111;
202
+
203
+
204
+ // Tooltips
205
+
206
+ $tooltip-color: white;
207
+
208
+
149
209
  // Popovers
150
210
 
151
- $popover-box-shadow: $dropdown-box-shadow;
152
- $popover-arrow-width: $dropdown-arrow-width;
153
- $popover-font-size: 0.9rem;
211
+ $popover-font-size: 0.9rem;
212
+ $popover-box-shadow: $dropdown-box-shadow;
213
+
214
+ $popover-header-bg: #f7f7f7;
215
+ $popover-header-border: #ebebeb;
216
+
217
+ $popover-body-padding-y: 0.5rem;
218
+ $popover-body-padding-x: 0.75rem;
219
+
220
+ $popover-arrow-width: $dropdown-arrow-width;
154
221
 
155
222
 
156
223
  // Modals
@@ -160,6 +227,7 @@ $modal-inner-padding: 1.5rem;
160
227
  $modal-header-padding-x: 1.5rem;
161
228
  $modal-header-padding-y: 1.05rem;
162
229
 
230
+ $modal-content-bg: white;
163
231
  $modal-content-border-radius: 0;
164
232
  $modal-content-border-width: 0;
165
233
 
@@ -172,4 +240,30 @@ $modal-lg: 900px;
172
240
 
173
241
  // Select2 Bootstrap Theme
174
242
 
175
- $s2bs-btn-default-border: #cccccc;
243
+ $s2bs5-border-color: #ced4da;
244
+
245
+ $s2bs5-item-active-bg: tint-color($primary, 90%);
246
+
247
+ $s2b25-clear-width: 0.5rem;
248
+ $s2b25-clear-height: 0.5rem;
249
+ $s2b25-clear-height-sm: 0.5rem;
250
+ $s2b25-clear-height-lg: 1rem;
251
+
252
+ $s2bs5-clear-icon: str-replace($btn-close-bg, #{$btn-close-color}, #{shade-color($s2bs5-border-color, 50%)});
253
+ $s2bs5-clear-bg: transparent escape-svg($s2bs5-clear-icon) center / $s2b25-clear-height auto no-repeat;
254
+ $s2bs5-clear-hover-bg: $s2bs5-clear-bg;
255
+
256
+ $s2bs5-clear-bg-sm: transparent escape-svg($s2bs5-clear-icon) center / $s2b25-clear-height-sm auto no-repeat;
257
+ $s2bs5-clear-hover-bg-sm: $s2bs5-clear-bg-sm;
258
+
259
+ $s2bs5-clear-bg-lg: transparent escape-svg($s2bs5-clear-icon) center / $s2b25-clear-height-lg auto no-repeat;
260
+ $s2bs5-clear-hover-bg-lg: $s2bs5-clear-bg-lg;
261
+
262
+ $s2bs5-clear-tag-icon: $btn-close-bg;
263
+ $s2bs5-clear-tag-bg: transparent escape-svg($s2bs5-clear-tag-icon) center / $s2b25-clear-height-sm auto no-repeat;
264
+
265
+ $s2bs5-padding-x: 0.75rem;
266
+ $s2bs5-padding-y: 0.375rem;
267
+
268
+ $s2bs5-multi-item-padding-x: 0.375rem;
269
+ $s2bs5-multi-item-padding-y: 0;
@@ -0,0 +1,15 @@
1
+ // Update color maps
2
+
3
+ $custom-colors: (
4
+ // Backwards compatibility
5
+ "default": #bbbbbb
6
+ );
7
+
8
+ $theme-colors: map-merge($theme-colors, $custom-colors);
9
+
10
+
11
+ // Disable box shadows on form controls.
12
+ // This is done after importing the default Bootstrap variables as a null value would be overwritten.
13
+
14
+ $input-box-shadow: null;
15
+ $form-select-box-shadow: null;
@@ -1,7 +1,19 @@
1
1
  // Default theme
2
2
 
3
- $theme-bg: theme-color("primary");
4
- $error-bg: theme-color("danger");
3
+ $theme-bg: $primary;
4
+ $error-bg: $danger;
5
+
6
+ $theme-bg-variations: (
7
+ default: -20%,
8
+
9
+ dark: -35%,
10
+ darker: -50%,
11
+ darkest: -65%,
12
+
13
+ light: 0,
14
+ lighter: 15%,
15
+ lightest: 30%
16
+ );
5
17
 
6
18
 
7
19
  // Header
@@ -31,22 +43,24 @@ $sidebar-group-color: #595959;
31
43
  $sidebar-toggle-bg: rgba(black, 0.25);
32
44
  $sidebar-toggle-color: rgba(white, 0.5);
33
45
 
34
- $sidebar-mobile-toggle-bg: transparent;
35
- $sidebar-mobile-toggle-color: white;
36
- $sidebar-mobile-toggle-border: 1px solid rgba($sidebar-mobile-toggle-color, 0.15);
46
+ $sidebar-mobile-toggle-color: white;
47
+ $sidebar-mobile-toggle-icon-bg: str-replace(url("data:image/svg+xml,%3csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3e%3cpath stroke='#{$sidebar-mobile-toggle-color}' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e"), "#", "%23");
37
48
 
38
- $sidebar-mobile-toggle-active-bg: rgba($sidebar-mobile-toggle-color, 0.1);
39
- $sidebar-mobile-toggle-active-border: $sidebar-mobile-toggle-border;
49
+ $sidebar-mobile-toggle-bg: transparent;
50
+ $sidebar-mobile-toggle-border-width: 1px;
51
+ $sidebar-mobile-toggle-border-color: rgba($sidebar-mobile-toggle-color, 0.15);
52
+ $sidebar-mobile-toggle-border: $sidebar-mobile-toggle-border-width solid $sidebar-mobile-toggle-border-color;
40
53
 
41
- $sidebar-mobile-toggle-icon-bg: str-replace(url("data:image/svg+xml,%3csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3e%3cpath stroke='#{$sidebar-mobile-toggle-color}' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e"), "#", "%23");
54
+ $sidebar-mobile-toggle-active-bg: rgba($sidebar-mobile-toggle-color, 0.1);
55
+ $sidebar-mobile-toggle-active-border-width: $sidebar-mobile-toggle-border-width;
56
+ $sidebar-mobile-toggle-active-border-color: $sidebar-mobile-toggle-border-color;
57
+ $sidebar-mobile-toggle-active-border: $sidebar-mobile-toggle-border-width solid $sidebar-mobile-toggle-active-border-color;
42
58
 
43
59
  $sidebar-width: 250px;
44
60
  $sidebar-width-collapsed: 54px;
45
61
 
46
62
  $sidebar-transition-duration: 250ms;
47
63
 
48
- $sidebar-font-size-scale: 0.925;
49
-
50
64
 
51
65
  // Content
52
66
 
@@ -64,15 +78,26 @@ $main-content-footer-padding: 12px 20px;
64
78
  $main-content-footer-border: 1px solid rgba(black, 0.1);
65
79
 
66
80
 
81
+ // Typography
82
+
83
+ $headings-border: 1px solid rgba(black, 0.1);
84
+
85
+ $header-font-size-scale: 0.925;
86
+ $sidebar-font-size-scale: 0.925;
87
+
88
+ $badge-hover-scale: -15%;
89
+
90
+
67
91
  // Tags
68
92
 
69
- $tag-color: white;
70
- $tag-bg: lighten(theme-color("primary"), 10%);
71
- $tag-border: theme-color("primary");
93
+ $tag-bg-scale: -30%;
94
+ $tag-border-scale: 0;
95
+
96
+ $tag-hover-bg-scale: -15%;
97
+ $tag-hover-border-scale: 15%;
72
98
 
73
- $tag-hover-color: white;
74
- $tag-hover-bg: theme-color("primary");
75
- $tag-hover-border: darken(theme-color("primary"), 10%);
99
+ $tag-spacing-x: 0.325rem;
100
+ $tag-spacing-y: 0.25rem;
76
101
 
77
102
 
78
103
  // Scopes
@@ -101,25 +126,29 @@ $alert-danger-bg: #de7471;
101
126
  $alert-danger-color: white;
102
127
  $alert-danger-border: #d85956;
103
128
 
104
- $alert-info-bg: darken(theme-color("info"), 10%);
129
+ $alert-info-bg: shade-color($info, 10%);
105
130
  $alert-info-color: white;
106
- $alert-info-border: darken($alert-info-bg, 10%);
131
+ $alert-info-border: shade-color($alert-info-bg, 5%);
107
132
 
108
- $alert-warning-bg: darken(theme-color("warning"), 5%);
133
+ $alert-warning-bg: shade-color($warning, 5%);
109
134
  $alert-warning-color: white;
110
- $alert-warning-border: darken($alert-warning-bg, 5%);
135
+ $alert-warning-border: shade-color($alert-warning-bg, 5%);
111
136
 
112
- $alert-light-bg: theme-color("light");
137
+ $alert-light-bg: $light;
113
138
  $alert-light-color: $body-color;
114
- $alert-light-border: darken($alert-light-bg, 5%);
139
+ $alert-light-border: shade-color($alert-light-bg, 5%);
115
140
 
116
- $alert-dark-bg: theme-color("dark");
141
+ $alert-dark-bg: $dark;
117
142
  $alert-dark-color: white;
118
- $alert-dark-border: darken($alert-dark-bg, 10%);
143
+ $alert-dark-border: shade-color($alert-dark-bg, 20%);
119
144
 
120
- $alert-primary-bg: darken(theme-color("primary"), 5%);
145
+ $alert-primary-bg: shade-color($primary, 10%);
121
146
  $alert-primary-color: white;
122
- $alert-primary-border: darken($alert-primary-bg, 10%);
147
+ $alert-primary-border: shade-color($alert-primary-bg, 10%);
148
+
149
+ $alert-secondary-bg: shade-color($secondary, 10%);
150
+ $alert-secondary-color: white;
151
+ $alert-secondary-border: shade-color($alert-secondary-bg, 10%);
123
152
 
124
153
 
125
154
  // Modals
@@ -0,0 +1,17 @@
1
+ import { Controller } from '@hotwired/stimulus'
2
+
3
+ import { fetchWithErrorHandling, fetchTurboStream } from '../core/fetch'
4
+
5
+ export default class extends Controller {
6
+ fetch (url, options = {}) {
7
+ return fetchWithErrorHandling(url, options)
8
+ }
9
+
10
+ fetchTurboStream (url, options = {}) {
11
+ return fetchTurboStream(url, options)
12
+ }
13
+
14
+ get csrfToken () {
15
+ return document.querySelector("[name='csrf-token']").content
16
+ }
17
+ }
@@ -0,0 +1,43 @@
1
+ import ApplicationController from './application_controller'
2
+
3
+ export default class extends ApplicationController {
4
+ static targets = ['checkbox', 'selectAll']
5
+
6
+ toggle () {
7
+ this.updateSelectAllState()
8
+ }
9
+
10
+ toggleAll () {
11
+ const isChecked = this.selectAllTarget.checked
12
+
13
+ this.checkboxTargets.forEach((checkbox) => {
14
+ checkbox.checked = isChecked
15
+ })
16
+ }
17
+
18
+ updateSelectAllState () {
19
+ const checked = this.checked
20
+ const checkboxes = this.checkboxTargets
21
+
22
+ if (checked.length === checkboxes.length) {
23
+ // All checked
24
+ this.selectAllTarget.indeterminate = false
25
+ this.selectAllTarget.checked = true
26
+ } else if (checked.length == 0) {
27
+ // None checked
28
+ this.selectAllTarget.indeterminate = false
29
+ this.selectAllTarget.checked = false
30
+ } else {
31
+ // Some checked
32
+ this.selectAllTarget.indeterminate = true
33
+ }
34
+ }
35
+
36
+ get checked () {
37
+ return this.checkboxTargets.filter((checkbox) => checkbox.checked)
38
+ }
39
+
40
+ get unchecked () {
41
+ return this.checkboxTargets.filter((checkbox) => !checkbox.checked)
42
+ }
43
+ }