administrate-bootstrap-theme 0.2.2 → 1.0.0

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 (66) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +64 -32
  3. data/app/assets/javascripts/administrate-bootstrap-theme/{bootstrap/bootstrap.bundle.js → bootstrap.bundle.js} +910 -857
  4. data/app/assets/stylesheets/administrate-bootstrap-theme/_base.scss +2 -14
  5. data/app/assets/stylesheets/administrate-bootstrap-theme/_variables.scss +4 -0
  6. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_card.scss +7 -6
  7. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_carousel.scss +2 -2
  8. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_dropdown.scss +4 -4
  9. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_functions.scss +94 -3
  10. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_grid.scss +11 -0
  11. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_helpers.scss +2 -0
  12. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_images.scss +1 -1
  13. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_mixins.scss +1 -0
  14. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_modal.scss +5 -15
  15. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_navbar.scss +30 -1
  16. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_offcanvas.scss +8 -2
  17. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_placeholders.scss +51 -0
  18. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_popover.scss +10 -10
  19. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_reboot.scss +12 -8
  20. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_root.scss +39 -2
  21. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_tables.scss +1 -1
  22. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_toasts.scss +3 -3
  23. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_tooltip.scss +4 -4
  24. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_transitions.scss +6 -0
  25. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_utilities.scss +44 -8
  26. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_variables.scss +189 -24
  27. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/bootstrap-grid.scss +1 -1
  28. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/bootstrap-reboot.scss +1 -1
  29. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/bootstrap-utilities.scss +1 -1
  30. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/bootstrap.scss +2 -1
  31. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/forms/_floating-labels.scss +3 -1
  32. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/forms/_form-check.scss +1 -1
  33. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/forms/_form-control.scss +1 -1
  34. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/forms/_form-range.scss +1 -1
  35. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/forms/_form-select.scss +3 -0
  36. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/helpers/_stacks.scss +15 -0
  37. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/helpers/_vr.scss +8 -0
  38. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/mixins/_backdrop.scss +14 -0
  39. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/mixins/_buttons.scss +1 -1
  40. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/mixins/_grid.scss +33 -8
  41. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/mixins/_utilities.scss +27 -6
  42. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/vendor/_rfs.scss +55 -13
  43. data/app/assets/stylesheets/administrate-bootstrap-theme/colors/_autumn.scss +8 -0
  44. data/app/assets/stylesheets/administrate-bootstrap-theme/colors/_default.scss +8 -0
  45. data/app/assets/stylesheets/administrate-bootstrap-theme/colors/_forest.scss +9 -0
  46. data/app/assets/stylesheets/administrate-bootstrap-theme/colors/_industrial.scss +8 -0
  47. data/app/assets/stylesheets/administrate-bootstrap-theme/colors/_water.scss +8 -0
  48. data/app/assets/stylesheets/administrate-bootstrap-theme/components/_content_body.scss +21 -1
  49. data/app/assets/stylesheets/administrate-bootstrap-theme/components/_content_header.scss +1 -1
  50. data/app/assets/stylesheets/administrate-bootstrap-theme/components/_form.scss +2 -0
  51. data/app/assets/stylesheets/administrate-bootstrap-theme/components/_navigation.scss +26 -3
  52. data/app/assets/stylesheets/administrate-bootstrap-theme/components/_pagination.scss +1 -1
  53. data/app/assets/stylesheets/administrate-bootstrap-theme/fonts/_lato.scss +5 -0
  54. data/app/assets/stylesheets/administrate-bootstrap-theme/fonts/_montserrat.scss +5 -0
  55. data/app/assets/stylesheets/administrate-bootstrap-theme/fonts/_open_sans.scss +5 -0
  56. data/app/assets/stylesheets/administrate-bootstrap-theme/fonts/_roboto.scss +5 -0
  57. data/app/assets/stylesheets/administrate-bootstrap-theme/fonts/_source_sans_pro.scss +5 -0
  58. data/app/assets/stylesheets/administrate-bootstrap-theme/theme.scss +10 -61
  59. data/lib/administrate-bootstrap-theme/version.rb +2 -1
  60. data/lib/generators/administrate_bootstrap_theme/install/USAGE +10 -0
  61. data/lib/generators/administrate_bootstrap_theme/install/install_generator.rb +33 -0
  62. data/package.json +2 -3
  63. metadata +38 -10
  64. data/app/assets/javascripts/administrate-bootstrap-theme/flatpickr/flatpickr.js +0 -2673
  65. data/app/assets/javascripts/administrate-bootstrap-theme/theme.js +0 -22
  66. data/app/assets/stylesheets/administrate-bootstrap-theme/flatpickr/flatpickr.scss +0 -791
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7f5c9e7796dff0685744b42182407312126a508ea641a1160f751fbef5c1bf9f
4
- data.tar.gz: d978d2e0541202ea70fc6f950eb9206e4f4bd91a4dcf95fed51d1e9f1f59e981
3
+ metadata.gz: d1492386198ceaae235aab382f3e29d5afb4b3182c58b3b0d3414c020a8bd36b
4
+ data.tar.gz: c76a13626f1f7144fcc9a0ab045feebef89496620955fd1af71f230a02d33888
5
5
  SHA512:
6
- metadata.gz: 7a710260a02ce0c73a8be1dfc7c34feb095088b777d3f402b0e8882748d5c3e131cf2ac79b3ab7dec0e9254ca97bd26c3a3608e9b91d1eb0c849b9b907581e78
7
- data.tar.gz: 695d8e6a10925f2567016f443135ac9ed3ebeb821419b63f148d5a63a9d28f3082d67f3ecb9e0ec6e2de76f3b78019b6554c29823e584a55d4353cafac15e93c
6
+ metadata.gz: 21452eb50afdd29d1ed61c3badda42e3470150c4234e41761f6bc9cf9183b7b650f7c6e89f847a48a0ae1c1fa025be8292ad7e377b7efadfb7c20fe4c8074f89
7
+ data.tar.gz: 2bfe2c0f41a090560c16959ef1263502f9f733fa69d6d18ad86578b1642a6c81dd3ddd3506e26c329b53a4d979131f995dd267c9d18657d1f35a762951a03ebe
data/README.md CHANGED
@@ -1,63 +1,95 @@
1
- # Administrate Bootstrap Theme [![Gem Version](https://badge.fury.io/rb/administrate-bootstrap-theme.svg)](https://badge.fury.io/rb/administrate-bootstrap-theme) [![linters](https://github.com/blocknotes/administrate-bootstrap-theme/actions/workflows/linters.yml/badge.svg)](https://github.com/blocknotes/administrate-bootstrap-theme/actions/workflows/linters.yml) [![Specs](https://github.com/blocknotes/administrate-bootstrap-theme/actions/workflows/specs.yml/badge.svg)](https://github.com/blocknotes/administrate-bootstrap-theme/actions/workflows/specs.yml)
1
+ # Administrate Bootstrap Theme
2
+ [![gem version](https://badge.fury.io/rb/administrate-bootstrap-theme.svg)](https://badge.fury.io/rb/administrate-bootstrap-theme)
3
+ [![gem downloads](https://badgen.net/rubygems/dt/administrate-bootstrap-theme)](https://rubygems.org/gems/administrate-bootstrap-theme)
4
+ [![linters](https://github.com/blocknotes/administrate-bootstrap-theme/actions/workflows/linters.yml/badge.svg)](https://github.com/blocknotes/administrate-bootstrap-theme/actions/workflows/linters.yml)
5
+ [![specs](https://github.com/blocknotes/administrate-bootstrap-theme/actions/workflows/specs.yml/badge.svg)](https://github.com/blocknotes/administrate-bootstrap-theme/actions/workflows/specs.yml)
2
6
 
3
7
  A Bootstrap 5 theme for [Administrate](https://github.com/thoughtbot/administrate).
4
8
 
5
9
  Features:
6
- - easy to install, just include CSS/JS to apply the theme to a default Administrate structure;
10
+ - easy to install: just run the generator installer;
7
11
  - customizable via SASS variables;
8
12
  - allow to use *Bootstrap* components in the admin.
9
13
 
10
14
  See some [screenshots](#screenshots).
11
15
 
12
- ## Installation
16
+ Please :star: if you like it.
13
17
 
14
- - Add to *Gemfile* (of an Administrate project): `gem 'administrate-bootstrap-theme'` (and execute `bundle`)
15
- - Add to *app/assets/config/manifest.js*:
18
+ ## Installation
16
19
 
17
- ```js
18
- //= link administrate-bootstrap-theme/theme.css
19
- //= link administrate-bootstrap-theme/theme.js
20
- ```
20
+ - Add to *Gemfile* (of an Administrate project): `gem 'administrate-bootstrap-theme', '~> 1.0'` (and execute `bundle`)
21
+ - Run the installer: `bin/rails generate administrate_bootstrap_theme:install`
21
22
 
22
- - Generate the layout views if they are missing: `rails generate administrate:views:layout` (only **_stylesheet** and **_javascript** partials are needed)
23
- - Update *app/views/admin/application/_stylesheet.html.erb*, leaving only:
23
+ ## Customizations
24
24
 
25
- ```erb
26
- <%= stylesheet_link_tag 'administrate-bootstrap-theme/theme', media: 'all' %>
27
- <%= yield :stylesheet %>
28
- ```
25
+ Edit the variables defined in *app/assets/stylesheets/administrate-bootstrap-theme.scss*:
29
26
 
30
- - Update *app/views/admin/application/_javascript.html.erb*, leaving only:
27
+ ```scss
28
+ $navigation-width: 250px;
29
+ $navigation-bg: #055160;
30
+ $navigation-bg-active: #d51;
31
+ $navigation-fg: #eee;
32
+ $primary: #0d6ecd;
33
+ $secondary: #666;
34
+ $main-content-bg: #f4f8fb;
35
+ $main-content-fg: #222;
31
36
 
32
- ```erb
33
- <%= javascript_include_tag 'administrate-bootstrap-theme/theme' %>
34
- <%= yield :javascript %>
37
+ @import 'administrate-bootstrap-theme/theme'; // required after the variables setup
35
38
  ```
36
39
 
37
- ## Customizations
40
+ ### Extra improvements
38
41
 
39
- To change variables it's necessary to create a new *.scss* (or *.sass*) file like this one (ex. *admin.scss*):
42
+ Choose a predefined color schema - *app/assets/stylesheets/administrate-bootstrap-theme.scss*:
40
43
 
41
44
  ```scss
42
- // app/assets/stylesheets/admin.scss
43
- $navigation-bg: #055160;
44
- $navigation-bg-active: #d51;
45
- $navigation-width: 300px;
46
- $primary: #087990;
47
-
45
+ @import 'administrate-bootstrap-theme/colors/default';
46
+ // @import 'administrate-bootstrap-theme/colors/autumn';
47
+ // @import 'administrate-bootstrap-theme/colors/forest';
48
+ // @import 'administrate-bootstrap-theme/colors/industrial';
49
+ // @import 'administrate-bootstrap-theme/colors/water';
48
50
  @import 'administrate-bootstrap-theme/theme';
49
51
  ```
50
52
 
51
- And replace the link tag in the *application.html.erb* with: `<%= stylesheet_link_tag 'admin', media: 'all' %>`
53
+ Set a UI font:
54
+
55
+ - you can of course import any font from Google fonts (or other providers);
56
+ - to use a pre-configured one - *app/assets/stylesheets/administrate-bootstrap-theme.scss*:
57
+ ```scss
58
+ @import 'administrate-bootstrap-theme/fonts/roboto';
59
+ // @import 'administrate-bootstrap-theme/fonts/lato';
60
+ // @import 'administrate-bootstrap-theme/fonts/montserrat';
61
+ // @import 'administrate-bootstrap-theme/fonts/open_sans';
62
+ // @import 'administrate-bootstrap-theme/fonts/source_sans_pro';
63
+ @import 'administrate-bootstrap-theme/theme';
64
+ ```
52
65
 
53
- For the complete list of options take a look [here](app/assets/stylesheets/administrate-bootstrap-theme/_variables.scss).
66
+ For more improvements to the sidebar:
67
+
68
+ - generate the navigation partial: `bin/rails generate administrate:views:navigation`
69
+ - edit the partial *app/views/admin/application/_navigation.html.erb*
70
+ - to change the _Back to app_ button to a title component: replace the classes for the first link (_back_to_app_) with `button--title`
71
+ - update the translation button title editing *config/locales/en.yml*:
72
+ ```yml
73
+ en:
74
+ administrate:
75
+ navigation:
76
+ back_to_app: 'MyAdmin'
77
+ ```
78
+ - to add a copyright line at the bottom, update the links part with:
79
+ ```erb
80
+ <div class="mb-auto">
81
+ <% Administrate::Namespace.new(namespace).resources_with_index_route.each do |resource| %>
82
+ ...
83
+ <% end %>
84
+ </div>
85
+ <div class="copy">by Mat</div>
86
+ ```
54
87
 
55
88
  ## Screenshots
56
89
 
57
- - Index page: ![Administrate Bootstrap Theme index page](extra/screenshot_index.png)
58
- - Show page: ![Administrate Bootstrap Theme show page](extra/screenshot_show.png)
59
- - Form page: ![Administrate Bootstrap Theme edit page](extra/screenshot_edit.png)
90
+ - Index, show and edit pages: ![Administrate Bootstrap Theme sections](extra/screenshot_sections.png)
60
91
  - Index page with some customized colors: ![Administrate Bootstrap Theme index page customized](extra/screenshot_index_alt.png)
92
+ - Color schemas (none, default, autumn, forest, water, industrial): ![Administrate Bootstrap Theme colors](extra/screenshot_colors.png)
61
93
 
62
94
  ## Do you like it? Star it!
63
95