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,75 +0,0 @@
1
- import $ from 'jquery'
2
-
3
- import { ready } from '../core/events'
4
- import cookie from '../core/cookie'
5
-
6
- import Navigation from './navigation'
7
-
8
- ready(function () {
9
- const $body = $('body')
10
- const $wrapper = $('.app-wrapper')
11
- const $sidebar = $('.app-sidebar')
12
-
13
- // Toggle mobile navigation using menu button
14
-
15
- $sidebar.find('.navbar-toggler').on('click', function (e) {
16
- e.preventDefault()
17
-
18
- $wrapper.addClass('animate')
19
- $body.toggleClass('mobile-nav-expanded')
20
- })
21
-
22
- $wrapper.on('transitionend webkitTransitionEnd', function () {
23
- $(this).removeClass('animate')
24
- })
25
-
26
- // Interacting outside of the sidebar closes the navigation
27
-
28
- $wrapper.on('click touchstart', function (e) {
29
- const navExpanded = $('body').hasClass('mobile-nav-expanded')
30
-
31
- const clickInHeader = $(e.target).closest('.app-header').length
32
- const clickInSidebar = $(e.target).closest('.app-sidebar').length
33
-
34
- if (navExpanded && !clickInHeader && !clickInSidebar) {
35
- e.stopPropagation()
36
- e.preventDefault()
37
-
38
- $wrapper.addClass('animate')
39
- $body.removeClass('mobile-nav-expanded')
40
- }
41
- })
42
-
43
- // Toggle sidebar expand/collapse
44
-
45
- $sidebar.find('.toggle-sidebar').on('click', function (e) {
46
- e.preventDefault()
47
-
48
- if ($body.hasClass('sidebar-expanded') || $body.hasClass('sidebar-collapsed')) {
49
- $body.removeClass('sidebar-expanded').removeClass('sidebar-collapsed')
50
- cookie.delete('trestle:sidebar')
51
- } else if ($(document).width() >= 1200) {
52
- $body.addClass('sidebar-collapsed')
53
- cookie.set('trestle:sidebar', 'collapsed')
54
- } else if ($(document).width() >= 768) {
55
- $body.addClass('sidebar-expanded')
56
- cookie.set('trestle:sidebar', 'expanded')
57
- }
58
- })
59
-
60
- // Toggle navigation groups
61
-
62
- $sidebar.find('.nav-header a').on('click', function (e) {
63
- e.preventDefault()
64
-
65
- const list = $(this).closest('ul')
66
- Navigation.toggle(list)
67
- })
68
-
69
- // Scroll sidebar to active item
70
-
71
- const $active = $sidebar.find('.active')
72
- if ($active.length) {
73
- $sidebar.find('.app-sidebar-inner').scrollTop($active.offset().top - 100)
74
- }
75
- })
@@ -1,61 +0,0 @@
1
- import $ from 'jquery'
2
-
3
- import visit from '../core/visit'
4
-
5
- // Allow clicking on any part of a table row to follow either the table's data-url
6
- // or the first link within the row (that is not in the actions column).
7
- $(document).on('click', 'tr[data-url]:not([data-behavior="dialog"])', function (e) {
8
- const row = $(e.currentTarget)
9
-
10
- let url
11
-
12
- if (row.data('url') === 'auto') {
13
- url = row.find('td:not(.actions) a:first').attr('href')
14
- } else {
15
- url = row.data('url')
16
- }
17
-
18
- if (url) {
19
- if (e.metaKey || e.ctrlKey) {
20
- window.open(url, '_blank')
21
- } else {
22
- visit(url)
23
- }
24
- }
25
- })
26
-
27
- // Ignore the above event handler when clicking directly on a link or input element
28
- $(document).on('click', 'tr[data-url] a, tr[data-url] input, .select-row', function (e) {
29
- e.stopPropagation()
30
- })
31
-
32
- // Handle clicking on select all checkbox in table header
33
- $(document).on('click', 'th.select-row input', function (e) {
34
- const table = $(this).closest('table')
35
- const checked = $(this).is(':checked')
36
-
37
- table.find('td.select-row input').prop('checked', checked)
38
- })
39
-
40
- // Handle single row selection to update header row status
41
- $(document).on('click', 'td.select-row input', function (e) {
42
- const table = $(this).closest('table')
43
-
44
- const checkboxes = table.find('td.select-row input')
45
- const selectedCheckboxes = checkboxes.filter(':checked')
46
-
47
- const header = table.find('th.select-row input')
48
-
49
- if (checkboxes.length === selectedCheckboxes.length) {
50
- // All checked
51
- header.prop('indeterminate', false)
52
- header.prop('checked', true)
53
- } else if (selectedCheckboxes.length === 0) {
54
- // None checked
55
- header.prop('indeterminate', false)
56
- header.prop('checked', false)
57
- } else {
58
- // Some checked
59
- header.prop('indeterminate', true)
60
- }
61
- })
@@ -1,59 +0,0 @@
1
- /* global history, location */
2
-
3
- import $ from 'jquery'
4
-
5
- import { init } from '../core/events'
6
-
7
- const TAB_SELECTOR = 'a[data-toggle="tab"]'
8
- const TAB_PANE_SELECTOR = '.tab-pane'
9
- const ERROR_SELECTOR = '.has-error'
10
-
11
- // Save active tab to URL hash
12
- init(function (root) {
13
- $(root).find(TAB_SELECTOR).on('shown.bs.tab', function (e) {
14
- const hash = $(this).attr('href')
15
- const withinModal = $(this).closest('.modal').length > 0
16
-
17
- if (hash.substr(0, 1) === '#' && !withinModal) {
18
- history.replaceState({ turbolinks: {} }, '', '#!' + hash.substr(1))
19
- }
20
- })
21
- })
22
-
23
- // Restore active tab when loading
24
- init(function () {
25
- focusActiveTab()
26
- })
27
-
28
- // Add error count to tabs
29
- init(function (root) {
30
- $(root).find(TAB_PANE_SELECTOR).each(function () {
31
- const errorCount = $(this).find(ERROR_SELECTOR).length
32
-
33
- if (errorCount > 0) {
34
- const badge = $('<span>').addClass('badge badge-danger badge-pill').text(errorCount)
35
- const id = $(this).attr('id')
36
- const selector = `${TAB_SELECTOR}[href='#${id}']`
37
-
38
- $(selector).append(badge)
39
- }
40
- })
41
- })
42
-
43
- export function focusTab (id) {
44
- const selector = `${TAB_SELECTOR}[href='#${id}']`
45
- $(selector).tab('show')
46
- }
47
-
48
- export function focusActiveTab () {
49
- if (location.hash.substr(0, 2) === '#!') {
50
- // Focus on active tab from URL
51
- focusTab(location.hash.substr(2))
52
- } else {
53
- const $errorTabs = $(`${TAB_PANE_SELECTOR}:has(${ERROR_SELECTOR})`)
54
-
55
- if ($errorTabs.length) {
56
- focusTab($errorTabs.first().attr('id'))
57
- }
58
- }
59
- }
@@ -1,25 +0,0 @@
1
- import $ from 'jquery'
2
-
3
- import { init, ready } from '../core/events'
4
-
5
- // Enable general tooltips and popovers
6
- init(function (root) {
7
- $(root).find('[data-toggle="tooltip"]').tooltip()
8
- $(root).find('[data-toggle="popover"]').popover()
9
- })
10
-
11
- // Enable navigation tooltips for non-touch devices
12
- if (!('ontouchstart' in window)) {
13
- ready(function () {
14
- $(document).tooltip({
15
- selector: '.app-nav a',
16
- trigger: 'hover',
17
- placement: 'right',
18
- boundary: 'window',
19
- template: '<div class="tooltip nav-tooltip" role="tooltip"><div class="arrow"></div><div class="tooltip-inner"></div></div>',
20
- title: function () {
21
- return $(this).find('.nav-label').text()
22
- }
23
- })
24
- })
25
- };
@@ -1,17 +0,0 @@
1
- import $ from 'jquery'
2
-
3
- import { triggerInit } from './events'
4
-
5
- export function refreshContext ($context) {
6
- const url = $context.data('context')
7
-
8
- $.get(url, function (data) {
9
- $context.html(data)
10
- triggerInit($context)
11
- })
12
- }
13
-
14
- export function refreshMainContext () {
15
- const $context = $('.app-main[data-context]')
16
- refreshContext($context)
17
- }
@@ -1,3 +0,0 @@
1
- /* global Turbolinks */
2
-
3
- export default typeof Turbolinks !== 'undefined' && Turbolinks.supported
@@ -1,16 +0,0 @@
1
- /* global Turbolinks */
2
-
3
- import turbolinks from './turbolinks'
4
-
5
- // The visit function is used to direct the user to the given URL. It is provided as an abstraction as the redirection
6
- // is handled differently depending on whether or not Turbolinks is enabled.
7
- //
8
- // Trestle.visit("/admin/pages");
9
- //
10
- export default function (url) {
11
- if (turbolinks) {
12
- Turbolinks.visit(url)
13
- } else {
14
- document.location = url
15
- }
16
- }
@@ -1,4 +0,0 @@
1
- // This file is left as an extension point for user configuration.
2
- //
3
- // It will be overridden by the similarly named file within
4
- // the app/assets folder of the Rails application.
@@ -1,4 +0,0 @@
1
- // This file is left as a (deprecated) extension point for user configuration.
2
- //
3
- // It will be overridden by the similarly named file within
4
- // the app/assets folder of the Rails application.
@@ -1,152 +0,0 @@
1
- // Theme colors to override
2
-
3
- $theme-colors: (
4
- "primary": #4d6bb2
5
- ) !default;
6
-
7
- // Set a specific jump point for requesting color jumps
8
- $theme-color-interval: 8% !default;
9
-
10
- // The yiq lightness value that determines when the lightness of color changes from "dark" to "light". Acceptable values are between 0 and 255.
11
- $yiq-contrasted-threshold: 175 !default;
12
-
13
- // Customize the light and dark text colors for use in our YIQ color contrast function.
14
- $yiq-text-dark: #212529 !default;
15
- $yiq-text-light: #ffffff !default;
16
-
17
-
18
- // Links
19
-
20
- $link-color: theme-color("primary") !default;
21
- $link-hover-color: darken($link-color, 15%) !default;
22
-
23
- // Darken percentage for links with `.text-*` class (e.g. `.text-success`)
24
- $emphasized-link-hover-darken-percentage: 15% !default;
25
-
26
-
27
- // Components
28
-
29
- $component-active-bg: theme-color("primary") !default;
30
-
31
-
32
- // Tables
33
-
34
- $table-bg-level: -11 !default;
35
- $table-border-level: -7 !default;
36
-
37
-
38
- // Buttons + Forms
39
-
40
- $input-btn-focus-width: .2rem !default;
41
- $input-btn-focus-color: rgba($component-active-bg, 0.25) !default;
42
- $input-btn-focus-box-shadow: 0 0 0 $input-btn-focus-width $input-btn-focus-color !default;
43
-
44
- $btn-focus-width: $input-btn-focus-width !default;
45
-
46
-
47
- // Forms
48
-
49
- $input-focus-border-color: lighten($component-active-bg, 25%) !default;
50
- $input-focus-width: $input-btn-focus-width !default;
51
- $input-focus-box-shadow: $input-btn-focus-box-shadow !default;
52
-
53
- $custom-control-indicator-checked-bg: $component-active-bg !default;
54
- $custom-control-indicator-checked-disabled-bg: rgba(theme-color("primary"), 0.5) !default;
55
- $custom-control-indicator-checked-border-color: $custom-control-indicator-checked-bg !default;
56
-
57
- $custom-control-indicator-focus-box-shadow: $input-focus-box-shadow !default;
58
- $custom-control-indicator-focus-border-color: $input-focus-border-color !default;
59
-
60
- $custom-control-indicator-active-bg: lighten($component-active-bg, 35%) !default;
61
- $custom-control-indicator-active-border-color: $custom-control-indicator-active-bg !default;
62
-
63
- $custom-checkbox-indicator-indeterminate-bg: $component-active-bg !default;
64
- $custom-checkbox-indicator-indeterminate-border-color: $custom-checkbox-indicator-indeterminate-bg !default;
65
-
66
- $custom-select-focus-border-color: $input-focus-border-color !default;
67
- $custom-select-focus-width: $input-focus-width !default;
68
- $custom-select-focus-box-shadow: 0 0 0 $custom-select-focus-width $input-btn-focus-color !default;
69
-
70
- $custom-range-thumb-bg: $component-active-bg !default;
71
- $custom-range-thumb-active-bg: lighten($component-active-bg, 35%) !default;
72
-
73
- $custom-file-focus-border-color: $input-focus-border-color !default;
74
- $custom-file-focus-box-shadow: $input-focus-box-shadow !default;
75
-
76
-
77
- // Navs
78
-
79
- $nav-pills-link-active-bg: $component-active-bg !default;
80
-
81
-
82
- // Navbar
83
-
84
- $sidebar-mobile-toggle-bg: transparent !default;
85
- $sidebar-mobile-toggle-color: white !default;
86
- $sidebar-mobile-toggle-border: 1px solid rgba($sidebar-mobile-toggle-color, 0.15) !default;
87
-
88
- $sidebar-mobile-toggle-active-bg: rgba($sidebar-mobile-toggle-color, 0.1) !default;
89
- $sidebar-mobile-toggle-active-border: $sidebar-mobile-toggle-border !default;
90
-
91
- $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") !default;
92
-
93
-
94
- // Dropdowns
95
-
96
- $dropdown-link-active-bg: $component-active-bg !default;
97
-
98
-
99
- // Pagination
100
-
101
- $pagination-color: $link-color !default;
102
-
103
- $pagination-focus-box-shadow: $input-btn-focus-box-shadow !default;
104
-
105
- $pagination-hover-color: $link-hover-color !default;
106
-
107
- $pagination-active-bg: $component-active-bg !default;
108
- $pagination-active-border-color: $pagination-active-bg !default;
109
-
110
-
111
- // Badges
112
-
113
- $badge-focus-width: $input-btn-focus-width !default;
114
-
115
-
116
- // Alerts
117
-
118
- $alert-bg-level: 2 !default;
119
- $alert-border-level: 3 !default;
120
- $alert-color-level: -12 !default;
121
-
122
-
123
- // Progress bars
124
-
125
- $progress-bar-bg: theme-color("primary") !default;
126
-
127
-
128
- // List group
129
-
130
- $list-group-active-bg: $component-active-bg !default;
131
- $list-group-active-border-color: $list-group-active-bg !default;
132
-
133
-
134
- // Select2
135
-
136
- $s2bs-input-border-focus: $input-focus-border-color !default;
137
- $s2bs-form-control-focus-box-shadow: $input-focus-box-shadow !default;
138
- $s2bs-dropdown-link-active-bg: $dropdown-link-active-bg !default;
139
-
140
-
141
- // Trestle
142
-
143
- $theme-bg: null !default;
144
- $theme-bg-color: darken(theme-color("primary"), 15%) !default;
145
-
146
- $sidebar-active-border-color: theme-color("primary") !default;
147
-
148
- $tag-bg: lighten(theme-color("primary"), 10%) !default;
149
- $tag-border: theme-color("primary") !default;
150
-
151
- $tag-hover-bg: theme-color("primary") !default;
152
- $tag-hover-border: darken(theme-color("primary"), 10%) !default;
@@ -1,44 +0,0 @@
1
- // Replace `$search` with `$replace` in `$string`
2
- @function str-replace($string, $search, $replace: "") {
3
- $index: str-index($string, $search);
4
-
5
- @if $index {
6
- @return str-slice($string, 1, $index - 1) + $replace + str-replace(str-slice($string, $index + str-length($search)), $search, $replace);
7
- }
8
-
9
- @return $string;
10
- }
11
-
12
- // Color contrast
13
- @function color-yiq($color, $dark: $yiq-text-dark, $light: $yiq-text-light) {
14
- $r: red($color);
15
- $g: green($color);
16
- $b: blue($color);
17
-
18
- $yiq: (($r * 299) + ($g * 587) + ($b * 114)) / 1000;
19
-
20
- @if ($yiq >= $yiq-contrasted-threshold) {
21
- @return $dark;
22
- } @else {
23
- @return $light;
24
- }
25
- }
26
-
27
- // Retrieve color Sass maps
28
- @function theme-color($key: "primary") {
29
- @return map-get($theme-colors, $key);
30
- }
31
-
32
- // Request a theme color level
33
- @function theme-color-level($color-name: "primary", $level: 0) {
34
- $color: theme-color($color-name);
35
- $color-base: if($level > 0, black, white);
36
- $level: abs($level);
37
-
38
- @return mix($color-base, $color, $level * $theme-color-interval);
39
- }
40
-
41
- @function gradient-mask($color, $alpha) {
42
- $mask: rgba($color, $alpha);
43
- @return linear-gradient($mask, $mask);
44
- }
@@ -1,15 +0,0 @@
1
- $theme-colors: null !default;
2
-
3
- // Import deprecated user-defined variables
4
- @import "trestle/_variables";
5
-
6
- $brand-primary: false !default;
7
-
8
- @if $brand-primary != false {
9
- $theme-colors: (
10
- "primary": $brand-primary
11
- );
12
- }
13
-
14
- // Import user-defined theme variables
15
- @import "trestle/_theme";
@@ -1,19 +0,0 @@
1
- @mixin alert-variant($background, $border, $color) {
2
- color: $color;
3
- background-color: $background;
4
- border-color: $border;
5
-
6
- hr {
7
- border-top-color: darken($border, 5%);
8
- }
9
-
10
- .alert-link {
11
- color: darken($color, 10%);
12
- }
13
- }
14
-
15
- @each $color, $value in $theme-colors {
16
- .alert-#{$color} {
17
- @include alert-variant(theme-color-level($color, $alert-bg-level), theme-color-level($color, $alert-border-level), theme-color-level($color, $alert-color-level));
18
- }
19
- }
@@ -1,25 +0,0 @@
1
- @mixin badge-variant($bg) {
2
- color: color-yiq($bg);
3
- background-color: $bg;
4
-
5
- @at-root a#{&} {
6
- &:hover,
7
- &:focus {
8
- color: color-yiq($bg);
9
- background-color: darken($bg, 10%);
10
- }
11
-
12
- &:focus,
13
- &.focus {
14
- outline: 0;
15
- box-shadow: 0 0 0 $badge-focus-width rgba($bg, .5);
16
- }
17
- }
18
- }
19
-
20
-
21
- @each $color, $value in $theme-colors {
22
- .badge-#{$color} {
23
- @include badge-variant($value);
24
- }
25
- }
@@ -1,93 +0,0 @@
1
- @mixin button-variant($background, $border, $hover-background: darken($background, 7.5%), $hover-border: darken($border, 10%), $active-background: darken($background, 10%), $active-border: darken($border, 12.5%)) {
2
- color: color-yiq($background);
3
- background-color: $background;
4
- border-color: $border;
5
-
6
- &:hover {
7
- color: color-yiq($hover-background);
8
- background-color: $hover-background;
9
- border-color: $hover-border;
10
- }
11
-
12
- &:focus,
13
- &.focus {
14
- color: color-yiq($hover-background);
15
- background-color: $hover-background;
16
- border-color: $hover-border;
17
- box-shadow: 0 0 0 $btn-focus-width rgba(mix(color-yiq($background), $border, 15%), .5);
18
- }
19
-
20
- // Disabled comes first so active can properly restyle
21
- &.disabled,
22
- &:disabled {
23
- color: color-yiq($background);
24
- background-color: $background;
25
- border-color: $border;
26
- }
27
-
28
- &:not(:disabled):not(.disabled):active,
29
- &:not(:disabled):not(.disabled).active,
30
- .show > &.dropdown-toggle {
31
- color: color-yiq($active-background);
32
- background-color: $active-background;
33
- border-color: $active-border;
34
-
35
- &:focus {
36
- box-shadow: 0 0 0 $btn-focus-width rgba(mix(color-yiq($background), $border, 15%), .5);
37
- }
38
- }
39
- }
40
-
41
- @mixin button-outline-variant($color, $color-hover: color-yiq($color), $active-background: $color, $active-border: $color) {
42
- color: $color;
43
- border-color: $color;
44
-
45
- &:hover {
46
- color: $color-hover;
47
- background-color: $active-background;
48
- border-color: $active-border;
49
- }
50
-
51
- &:focus,
52
- &.focus {
53
- box-shadow: 0 0 0 $btn-focus-width rgba($color, .5);
54
- }
55
-
56
- &.disabled,
57
- &:disabled {
58
- color: $color;
59
- background-color: transparent;
60
- }
61
-
62
- &:not(:disabled):not(.disabled):active,
63
- &:not(:disabled):not(.disabled).active,
64
- .show > &.dropdown-toggle {
65
- color: color-yiq($active-background);
66
- background-color: $active-background;
67
- border-color: $active-border;
68
-
69
- &:focus {
70
- box-shadow: 0 0 0 $btn-focus-width rgba($color, .5);
71
- }
72
- }
73
- }
74
-
75
- @each $color, $value in $theme-colors {
76
- .btn-#{$color} {
77
- @include button-variant($value, $value);
78
- }
79
- }
80
-
81
- @each $color, $value in $theme-colors {
82
- .btn-outline-#{$color} {
83
- @include button-outline-variant($value);
84
- }
85
- }
86
-
87
- .btn-link {
88
- color: $link-color;
89
-
90
- &:hover {
91
- color: $link-hover-color;
92
- }
93
- }
@@ -1,11 +0,0 @@
1
- :root {
2
- @each $color, $value in $theme-colors {
3
- --#{$color}: #{$value};
4
-
5
- --#{$color}-rgb: #{red($value), green($value), blue($value)};
6
-
7
- --#{$color}-hue: #{hue($value)};
8
- --#{$color}-saturation: #{saturation($value)};
9
- --#{$color}-lightness: #{lightness($value)};
10
- }
11
- }