madmin 1.2.11 → 2.0.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 (91) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +36 -7
  3. data/app/assets/config/madmin_manifest.js +3 -0
  4. data/app/assets/stylesheets/madmin/actiontext.css +31 -0
  5. data/app/assets/stylesheets/madmin/application-sprockets.css +11 -0
  6. data/app/assets/stylesheets/madmin/application.css +10 -0
  7. data/app/assets/stylesheets/madmin/base.css +117 -0
  8. data/app/assets/stylesheets/madmin/buttons.css +46 -0
  9. data/app/assets/stylesheets/madmin/forms.css +64 -0
  10. data/app/assets/stylesheets/madmin/pagination.css +59 -0
  11. data/app/assets/stylesheets/madmin/reset.css +242 -0
  12. data/app/assets/stylesheets/madmin/sidebar.css +80 -0
  13. data/app/assets/stylesheets/madmin/tables.css +56 -0
  14. data/app/controllers/madmin/application_controller.rb +7 -12
  15. data/app/controllers/madmin/base_controller.rb +1 -0
  16. data/app/controllers/madmin/resource_controller.rb +7 -1
  17. data/app/helpers/madmin/application_helper.rb +1 -12
  18. data/app/helpers/madmin/sort_helper.rb +17 -1
  19. data/app/javascript/madmin/application.js +4 -0
  20. data/app/javascript/madmin/controllers/application.js +12 -0
  21. data/app/javascript/madmin/controllers/index.js +5 -0
  22. data/app/javascript/madmin/controllers/nested_form_controller.js +34 -0
  23. data/app/javascript/madmin/controllers/select_controller.js +32 -0
  24. data/app/views/layouts/madmin/application.html.erb +12 -13
  25. data/app/views/madmin/application/_flash.html.erb +13 -0
  26. data/app/views/madmin/application/_form.html.erb +13 -12
  27. data/app/views/madmin/application/_javascript.html.erb +3 -136
  28. data/app/views/madmin/application/_navigation.html.erb +22 -27
  29. data/app/views/madmin/application/edit.html.erb +9 -5
  30. data/app/views/madmin/application/index.html.erb +37 -31
  31. data/app/views/madmin/application/new.html.erb +9 -5
  32. data/app/views/madmin/application/show.html.erb +28 -22
  33. data/app/views/madmin/dashboard/show.html.erb +4 -1
  34. data/app/views/madmin/fields/attachment/_form.html.erb +11 -4
  35. data/app/views/madmin/fields/attachment/_index.html.erb +5 -1
  36. data/app/views/madmin/fields/attachment/_show.html.erb +4 -4
  37. data/app/views/madmin/fields/attachments/_form.html.erb +1 -4
  38. data/app/views/madmin/fields/belongs_to/_form.html.erb +1 -4
  39. data/app/views/madmin/fields/belongs_to/_index.html.erb +2 -1
  40. data/app/views/madmin/fields/boolean/_form.html.erb +3 -4
  41. data/app/views/madmin/fields/currency/_form.html.erb +1 -0
  42. data/app/views/madmin/fields/currency/_index.html.erb +1 -0
  43. data/app/views/madmin/fields/currency/_show.html.erb +1 -0
  44. data/app/views/madmin/fields/date/_form.html.erb +1 -4
  45. data/app/views/madmin/fields/date_time/_form.html.erb +1 -4
  46. data/app/views/madmin/fields/decimal/_form.html.erb +1 -4
  47. data/app/views/madmin/fields/enum/_form.html.erb +1 -4
  48. data/app/views/madmin/fields/file/_form.html.erb +1 -4
  49. data/app/views/madmin/fields/float/_form.html.erb +1 -4
  50. data/app/views/madmin/fields/has_many/_form.html.erb +1 -4
  51. data/app/views/madmin/fields/has_many/_show.html.erb +7 -1
  52. data/app/views/madmin/fields/has_one/_form.html.erb +0 -3
  53. data/app/views/madmin/fields/integer/_form.html.erb +1 -4
  54. data/app/views/madmin/fields/integer/_index.html.erb +1 -5
  55. data/app/views/madmin/fields/json/_form.html.erb +1 -4
  56. data/app/views/madmin/fields/nested_has_many/_fields.html.erb +4 -5
  57. data/app/views/madmin/fields/nested_has_many/_form.html.erb +0 -4
  58. data/app/views/madmin/fields/nested_has_many/_show.html.erb +7 -1
  59. data/app/views/madmin/fields/password/_form.html.erb +1 -4
  60. data/app/views/madmin/fields/polymorphic/_form.html.erb +1 -4
  61. data/app/views/madmin/fields/rich_text/_form.html.erb +1 -6
  62. data/app/views/madmin/fields/select/_form.html.erb +1 -0
  63. data/app/views/madmin/fields/select/_index.html.erb +1 -0
  64. data/app/views/madmin/fields/select/_show.html.erb +1 -0
  65. data/app/views/madmin/fields/string/_form.html.erb +1 -4
  66. data/app/views/madmin/fields/text/_form.html.erb +1 -4
  67. data/app/views/madmin/shared/_label.html.erb +2 -2
  68. data/config/importmap.rb +10 -0
  69. data/lib/generators/madmin/field/templates/_form.html.erb +1 -4
  70. data/lib/generators/madmin/install/templates/controller.rb.tt +5 -12
  71. data/lib/generators/madmin/resource/resource_generator.rb +1 -1
  72. data/lib/generators/madmin/resource/templates/resource.rb.tt +12 -10
  73. data/lib/madmin/engine.rb +26 -0
  74. data/lib/madmin/field.rb +21 -5
  75. data/lib/madmin/fields/belongs_to.rb +10 -5
  76. data/lib/madmin/fields/currency.rb +15 -0
  77. data/lib/madmin/fields/has_many.rb +17 -0
  78. data/lib/madmin/fields/nested_has_many.rb +5 -1
  79. data/lib/madmin/fields/polymorphic.rb +1 -1
  80. data/lib/madmin/fields/select.rb +9 -0
  81. data/lib/madmin/generator_helpers.rb +6 -2
  82. data/lib/madmin/menu.rb +70 -0
  83. data/lib/madmin/resource.rb +56 -24
  84. data/lib/madmin/search.rb +1 -1
  85. data/lib/madmin/version.rb +1 -1
  86. data/lib/madmin.rb +23 -1
  87. metadata +61 -13
  88. data/app/assets/config/manifest.js +0 -2
  89. data/app/assets/stylesheets/actiontext.scss +0 -36
  90. data/app/assets/stylesheets/application.css +0 -15
  91. data/app/views/madmin/application/_menu_resources.html.erb +0 -7
@@ -1,36 +0,0 @@
1
- //
2
- // Provides a drop-in pointer for the default Trix stylesheet that will format the toolbar and
3
- // the trix-editor content (whether displayed or under editing). Feel free to incorporate this
4
- // inclusion directly in any other asset bundle and remove this file.
5
- //
6
- //= require trix/dist/trix
7
-
8
- // We need to override trix.css’s image gallery styles to accommodate the
9
- // <action-text-attachment> element we wrap around attachments. Otherwise,
10
- // images in galleries will be squished by the max-width: 33%; rule.
11
- .trix-content {
12
- .attachment-gallery {
13
- > action-text-attachment,
14
- > .attachment {
15
- flex: 1 0 33%;
16
- padding: 0 0.5em;
17
- max-width: 33%;
18
- }
19
-
20
- &.attachment-gallery--2,
21
- &.attachment-gallery--4 {
22
- > action-text-attachment,
23
- > .attachment {
24
- flex-basis: 50%;
25
- max-width: 50%;
26
- }
27
- }
28
- }
29
-
30
- action-text-attachment {
31
- .attachment {
32
- padding: 0 !important;
33
- max-width: 100% !important;
34
- }
35
- }
36
- }
@@ -1,15 +0,0 @@
1
- /*
2
- * This is a manifest file that'll be compiled into application.css, which will include all the files
3
- * listed below.
4
- *
5
- * Any CSS and SCSS file within this directory, lib/assets/stylesheets, or any plugin's
6
- * vendor/assets/stylesheets directory can be referenced here using a relative path.
7
- *
8
- * You're free to add application-wide styles to this file and they'll appear at the bottom of the
9
- * compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
10
- * files in this directory. Styles in this file should be added after the last require_* statement.
11
- * It is generally better to create a new file per style scope.
12
- *
13
- *= require_tree .
14
- *= require_self
15
- */
@@ -1,7 +0,0 @@
1
- <% Madmin.resources.each do |resource| %>
2
- <%= nav_link_to resource.friendly_name.pluralize, resource.index_path, class: "block p-2 rounded hover:bg-gray-100", starts_with: resource.index_path, active_class: "font-bold text-black" %>
3
- <% end %>
4
-
5
- <div class="mt-auto">
6
- <%= link_to "View Madmin on GitHub", "https://github.com/excid3/madmin", target: :_blank, class: "block p-2 rounded text-gray-500 hover:bg-gray-100" %>
7
- </div>