administrate-bootstrap-theme 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: c0396fa4e9ab92f78876de55aa3ccf3af5ebbe66a014a746dbed2f97554c2ffb
4
+ data.tar.gz: 05f582a06a3b2861dc395104c6b62e6e092031d7d185167fba1bf07a65f20ea7
5
+ SHA512:
6
+ metadata.gz: 1b6fdd711e9935f557014cd8f82d53578d360c96efc76c076ad768e093ac6014247b26b669156cac266ee01dd06b2a0cc0377454b5a65fbb527feedb25bd06db
7
+ data.tar.gz: 108fe161bd0edf8113c4d62954af9c66c623cac765950f7121f0cbacf566ff7fc3e744aaf5c3c73de85fe6ae34b06da23c6411ad66f15971342f564210eea0e5
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright 2021 Mattia Roccoberton
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,51 @@
1
+ # Administrate Bootstrap Theme [![Gem Version](https://badge.fury.io/rb/administrate-bootstrap-theme.svg)](https://badge.fury.io/rb/administrate-bootstrap-theme)
2
+ A Bootstrap 5 (_beta_) theme for [Administrate](https://github.com/thoughtbot/administrate).
3
+
4
+ Features:
5
+ - easy to install, just include CSS to apply the theme to a default Administrate structure;
6
+ - customizable via SASS variables;
7
+ - allow to use *Bootstrap* components in the admin.
8
+
9
+ ![screenshot](screenshot.png)
10
+
11
+ ## Installation
12
+ - Add to the *Gemfile* (of an Administrate project): `gem 'administrate-bootstrap-theme'` (and execute `bundle`)
13
+ - Modify *app/assets/config/manifest.js*, replacing the administrate assets with:
14
+
15
+ ```js
16
+ //= link administrate-bootstrap-theme/theme.css
17
+
18
+ // OFF link administrate/application.css
19
+ // OFF link administrate/application.js
20
+ ```
21
+
22
+ - Edit *app/views/layouts/admin/application.html.erb* (you can generate it using `rails generate administrate:views:layout`),
23
+ adding before head closing tag:
24
+
25
+ ```html
26
+ <%= stylesheet_link_tag 'administrate-bootstrap-theme/theme', media: 'all' %>
27
+ ```
28
+
29
+ ## Customizations
30
+ To change variables it's necessary to create a new *.scss* (or *.sass*) file like this one (ex. *admin.scss*):
31
+
32
+ ```scss
33
+ // app/assets/stylesheets/admin.scss
34
+ $navigation-width: 300px;
35
+ @import 'administrate-bootstrap-theme/theme';
36
+ ```
37
+
38
+ And replace the link tag in the *application.html.erb* with: `<%= stylesheet_link_tag 'admin', media: 'all' %>`
39
+
40
+ For the complete list of options take a look [here](app/assets/stylesheets/administrate-bootstrap-theme/_variables.scss).
41
+
42
+ ## Do you like it? Star it!
43
+ If you use this component just star it. A developer is more motivated to improve a project when there is some interest.
44
+
45
+ Or consider offering me a coffee, it's a small thing but it is greatly appreciated: [about me](https://www.blocknot.es/about-me).
46
+
47
+ ## Contributors
48
+ - [Mattia Roccoberton](https://blocknot.es/): author
49
+
50
+ ## License
51
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
data/Rakefile ADDED
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/setup"
4
+
5
+ APP_RAKEFILE = File.expand_path("test/dummy/Rakefile", __dir__)
6
+ load "rails/tasks/engine.rake"
7
+
8
+ load "rails/tasks/statistics.rake"
9
+
10
+ require "bundler/gem_tasks"
11
+
12
+ require "rake/testtask"
13
+
14
+ Rake::TestTask.new(:test) do |t|
15
+ t.libs << 'test'
16
+ t.pattern = 'test/**/*_test.rb'
17
+ t.verbose = false
18
+ end
19
+
20
+ task default: :test
@@ -0,0 +1 @@
1
+ //= link_directory ../stylesheets/administrate-bootstrap-theme .css
@@ -0,0 +1,21 @@
1
+ @import "../../../node_modules/bootstrap/scss/bootstrap";
2
+
3
+ @import "variables";
4
+
5
+ @import "components/navigation";
6
+ @import "components/content_header";
7
+ @import "components/content_body";
8
+ @import "components/pagination";
9
+
10
+ .app-container {
11
+ display: flex;
12
+ flex-wrap: nowrap;
13
+ height: 100vh;
14
+ }
15
+
16
+ .main-content {
17
+ @extend .d-flex, .flex-column;
18
+
19
+ overflow-y: scroll;
20
+ width: calc(100% - #{$navigation-width});
21
+ }
@@ -0,0 +1,2 @@
1
+
2
+ $navigation-width: 250px !default;
@@ -0,0 +1,54 @@
1
+ .main-content__body {
2
+ @extend .container-fluid;
3
+
4
+ @import "form";
5
+
6
+ > dl {
7
+ @extend .row;
8
+
9
+ dt {
10
+ @extend .col-2, .text-end;
11
+ }
12
+
13
+ dd {
14
+ @extend .col-10;
15
+ }
16
+ }
17
+
18
+ a {
19
+ text-decoration: none;
20
+ }
21
+
22
+ table {
23
+ @extend .table;
24
+ }
25
+
26
+ .cell-label__sort-indicator > svg {
27
+ height: 20px;
28
+ width: 20px;
29
+ }
30
+
31
+ .cell-label__sort-indicator--desc > svg {
32
+ transform: rotate(180deg);
33
+ }
34
+
35
+ .js-table-row {
36
+ > td {
37
+ padding: 0.25rem 0.25rem;
38
+ text-align: center;
39
+
40
+ &.cell-data {
41
+ padding: 0.5rem 0.5rem;
42
+ text-align: left;
43
+ }
44
+ }
45
+
46
+ .action-edit {
47
+ @extend .btn, .btn-sm;
48
+ }
49
+
50
+ [data-method="delete"] {
51
+ @extend .btn, .btn-sm;
52
+ }
53
+ }
54
+ }
@@ -0,0 +1,37 @@
1
+ .main-content__header {
2
+ @extend .p-3, .mb-3, .border-bottom;
3
+ @extend .d-flex, .flex-wrap, .align-items-center, .justify-content-center, .justify-content-lg-start;
4
+
5
+ > div:last-child {
6
+ @extend .text-end;
7
+ }
8
+
9
+ > form {
10
+ @extend .d-flex, .col-12, .col-lg-auto, .mb-3, .mb-lg-0, .me-md-4;
11
+
12
+ input {
13
+ @extend .form-control, .form-control-sm;
14
+ }
15
+ }
16
+
17
+ > h1 {
18
+ @extend .nav, .col-12, .col-lg-auto, .me-lg-auto, .mb-2, .justify-content-center, .mb-md-0;
19
+
20
+ font-size: 1.6rem;
21
+ }
22
+
23
+ svg {
24
+ &.search__eyeglass-icon, &.search__clear-icon {
25
+ height: 20px;
26
+ width: 20px;
27
+ }
28
+ }
29
+
30
+ .button {
31
+ @extend .btn, .btn-sm;
32
+ }
33
+
34
+ .search__input {
35
+ @extend .mx-2;
36
+ }
37
+ }
@@ -0,0 +1,25 @@
1
+ // Imported in content_body
2
+
3
+ .form-actions > input {
4
+ @extend .btn;
5
+ }
6
+
7
+ .field-unit {
8
+ @extend .row;
9
+ }
10
+
11
+ .field-unit__field {
12
+ @extend .col-10;
13
+
14
+ > input[type="text"], > textarea {
15
+ @extend .form-control;
16
+ }
17
+ }
18
+
19
+ .field-unit__label {
20
+ @extend .col-2;
21
+
22
+ > label {
23
+ @extend .col-form-label;
24
+ }
25
+ }
@@ -0,0 +1,17 @@
1
+ nav.navigation {
2
+ @extend .nav, .nav-pills, .flex-column, .p-3;
3
+
4
+ width: $navigation-width;
5
+
6
+ .button--alt {
7
+ @extend .btn, .btn-outline-light, .mb-2;
8
+ }
9
+
10
+ .navigation__link {
11
+ @extend .nav-link;
12
+ }
13
+
14
+ .navigation__link--active {
15
+ @extend .active;
16
+ }
17
+ }
@@ -0,0 +1,7 @@
1
+ nav.pagination {
2
+ @extend .justify-content-center, .mb-3;
3
+
4
+ > span {
5
+ @extend .nav-link;
6
+ }
7
+ }
@@ -0,0 +1,43 @@
1
+ @import "base";
2
+
3
+ nav.navigation {
4
+ @extend .text-white, .bg-dark;
5
+
6
+ .button--alt {
7
+ @extend .btn-outline-light;
8
+ }
9
+
10
+ .navigation__link {
11
+ @extend .btn-outline-light;
12
+ }
13
+ }
14
+
15
+ nav.pagination {
16
+ @extend .border;
17
+ }
18
+
19
+ .main-content {
20
+ @extend .bg-light;
21
+ }
22
+
23
+ .main-content__body {
24
+ .form-actions > input {
25
+ @extend .btn-primary;
26
+ }
27
+
28
+ .js-table-row {
29
+ .action-edit {
30
+ @extend .btn-secondary;
31
+ }
32
+
33
+ [data-method="delete"] {
34
+ @extend .btn-danger;
35
+ }
36
+ }
37
+ }
38
+
39
+ .main-content__header {
40
+ .button {
41
+ @extend .btn-primary;
42
+ }
43
+ }
@@ -0,0 +1,4 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'administrate-bootstrap-theme/version'
4
+ require 'administrate-bootstrap-theme/engine'
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ module AdministrateBootstrapTheme
4
+ class Engine < ::Rails::Engine
5
+ isolate_namespace AdministrateBootstrapTheme
6
+ end
7
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module AdministrateBootstrapTheme
4
+ VERSION = '0.1.0'
5
+ end
metadata ADDED
@@ -0,0 +1,88 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: administrate-bootstrap-theme
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Mattia Roccoberton
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2021-04-18 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: administrate
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '0.15'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '0.15'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rubocop
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '0.90'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '0.90'
41
+ description: A Bootstrap theme for Administrate
42
+ email:
43
+ - mat@blocknot.es
44
+ executables: []
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - MIT-LICENSE
49
+ - README.md
50
+ - Rakefile
51
+ - app/assets/config/administrate-bootstrap-theme_manifest.js
52
+ - app/assets/stylesheets/administrate-bootstrap-theme/_base.scss
53
+ - app/assets/stylesheets/administrate-bootstrap-theme/_variables.scss
54
+ - app/assets/stylesheets/administrate-bootstrap-theme/components/_content_body.scss
55
+ - app/assets/stylesheets/administrate-bootstrap-theme/components/_content_header.scss
56
+ - app/assets/stylesheets/administrate-bootstrap-theme/components/_form.scss
57
+ - app/assets/stylesheets/administrate-bootstrap-theme/components/_navigation.scss
58
+ - app/assets/stylesheets/administrate-bootstrap-theme/components/_pagination.scss
59
+ - app/assets/stylesheets/administrate-bootstrap-theme/theme.scss
60
+ - lib/administrate-bootstrap-theme.rb
61
+ - lib/administrate-bootstrap-theme/engine.rb
62
+ - lib/administrate-bootstrap-theme/version.rb
63
+ homepage: https://github.com/blocknotes/administrate-bootstrap-theme
64
+ licenses:
65
+ - MIT
66
+ metadata:
67
+ homepage_uri: https://github.com/blocknotes/administrate-bootstrap-theme
68
+ source_code_uri: https://github.com/blocknotes/administrate-bootstrap-theme
69
+ post_install_message:
70
+ rdoc_options: []
71
+ require_paths:
72
+ - lib
73
+ required_ruby_version: !ruby/object:Gem::Requirement
74
+ requirements:
75
+ - - ">="
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
78
+ required_rubygems_version: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ requirements: []
84
+ rubygems_version: 3.1.4
85
+ signing_key:
86
+ specification_version: 4
87
+ summary: Bootstrap Administrate Theme
88
+ test_files: []