light_admin 1.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +7 -0
  3. data/CHANGELOG.md +5 -0
  4. data/CODE_OF_CONDUCT.md +74 -0
  5. data/Gemfile +5 -0
  6. data/Gemfile.lock +123 -0
  7. data/LICENSE.txt +21 -0
  8. data/README.md +122 -0
  9. data/Rakefile +2 -0
  10. data/app/assets/javascripts/light_admin/filters_toggle.js +21 -0
  11. data/app/assets/stylesheets/light_admin/_rules.scss +50 -0
  12. data/app/assets/stylesheets/light_admin/base.scss +34 -0
  13. data/app/assets/stylesheets/light_admin/components/_breadcrumbs.scss +3 -0
  14. data/app/assets/stylesheets/light_admin/components/_buttons.scss +358 -0
  15. data/app/assets/stylesheets/light_admin/components/_comments.scss +66 -0
  16. data/app/assets/stylesheets/light_admin/components/_datepicker_calendar.scss +29 -0
  17. data/app/assets/stylesheets/light_admin/components/_flash_messages.scss +23 -0
  18. data/app/assets/stylesheets/light_admin/components/_footer.scss +3 -0
  19. data/app/assets/stylesheets/light_admin/components/_forms.scss +242 -0
  20. data/app/assets/stylesheets/light_admin/components/_header.scss +149 -0
  21. data/app/assets/stylesheets/light_admin/components/_images.scss +21 -0
  22. data/app/assets/stylesheets/light_admin/components/_list.scss +5 -0
  23. data/app/assets/stylesheets/light_admin/components/_panels.scss +139 -0
  24. data/app/assets/stylesheets/light_admin/components/_sidebars.scss +49 -0
  25. data/app/assets/stylesheets/light_admin/components/_status_tag.scss +12 -0
  26. data/app/assets/stylesheets/light_admin/components/_tables.scss +144 -0
  27. data/app/assets/stylesheets/light_admin/components/_titles.scss +37 -0
  28. data/app/assets/stylesheets/light_admin/components/_toggle_filters.scss +20 -0
  29. data/app/assets/stylesheets/light_admin/variables/_borders.scss +14 -0
  30. data/app/assets/stylesheets/light_admin/variables/_colors.scss +32 -0
  31. data/app/assets/stylesheets/light_admin/variables/_font.scss +4 -0
  32. data/app/assets/stylesheets/light_admin/variables/_shadows.scss +4 -0
  33. data/app/assets/stylesheets/light_admin/views/_login.scss +108 -0
  34. data/app/assets/stylesheets/utilities/_flex.scss +18 -0
  35. data/app/assets/stylesheets/utilities/_sizing.scss +3 -0
  36. data/app/assets/stylesheets/utilities/_spacing.scss +22 -0
  37. data/app/views/active_admin/devise/sessions/new.html.erb +36 -0
  38. data/bin/console +14 -0
  39. data/bin/setup +8 -0
  40. data/doc/index-with-filter.png +0 -0
  41. data/doc/index-with-filter.png:Zone.Identifier +0 -0
  42. data/doc/index.png +0 -0
  43. data/doc/index.png:Zone.Identifier +0 -0
  44. data/doc/panel-with-link.png +0 -0
  45. data/doc/panel-with-link.png:Zone.Identifier +0 -0
  46. data/doc/show.png +0 -0
  47. data/doc/show.png:Zone.Identifier +0 -0
  48. data/lib/light_admin.rb +10 -0
  49. data/lib/light_admin/generators.rb +19 -0
  50. data/lib/light_admin/header.rb +30 -0
  51. data/lib/light_admin/panel_with_link.rb +17 -0
  52. data/lib/light_admin/version.rb +3 -0
  53. data/light_admin.gemspec +19 -0
  54. metadata +117 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 3eb9571e65a2f3ae314251f008e7ea059face2eba0a2321171b581fb5758472f
4
+ data.tar.gz: 642d2877aaf62e5aeeb7184c7128242c3630b2ed7faaf7022907f6e17b7bac4b
5
+ SHA512:
6
+ metadata.gz: 3ea1cfec7c8895d86479fddc8fa91d5ba6c26cf713888caea181869c10e8cbc66a7a51b1c003e0b17b5fbee799f7595ab35e500485c1835881d2578d9bfeb043
7
+ data.tar.gz: e53a064841b05f04dfa901614e8c7ef59ab166a8a3e421921c17fa1fcd5697738a947b540b238c572d226bfdc3b52bc5f2fa97108cf94b108787225afe07ae57
data/.gitignore ADDED
@@ -0,0 +1,7 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /pkg/
6
+ /spec/reports/
7
+ /tmp/
data/CHANGELOG.md ADDED
@@ -0,0 +1,5 @@
1
+ # Changelog
2
+
3
+ ## 1.0.5 [☰](https://github.com/Capsens/light_admin/tree/v1.0.5)
4
+
5
+ * First release of light_admin gem
@@ -0,0 +1,74 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as
6
+ contributors and maintainers pledge to making participation in our project and
7
+ our community a harassment-free experience for everyone, regardless of age, body
8
+ size, disability, ethnicity, gender identity and expression, level of experience,
9
+ nationality, personal appearance, race, religion, or sexual identity and
10
+ orientation.
11
+
12
+ ## Our Standards
13
+
14
+ Examples of behavior that contributes to creating a positive environment
15
+ include:
16
+
17
+ * Using welcoming and inclusive language
18
+ * Being respectful of differing viewpoints and experiences
19
+ * Gracefully accepting constructive criticism
20
+ * Focusing on what is best for the community
21
+ * Showing empathy towards other community members
22
+
23
+ Examples of unacceptable behavior by participants include:
24
+
25
+ * The use of sexualized language or imagery and unwelcome sexual attention or
26
+ advances
27
+ * Trolling, insulting/derogatory comments, and personal or political attacks
28
+ * Public or private harassment
29
+ * Publishing others' private information, such as a physical or electronic
30
+ address, without explicit permission
31
+ * Other conduct which could reasonably be considered inappropriate in a
32
+ professional setting
33
+
34
+ ## Our Responsibilities
35
+
36
+ Project maintainers are responsible for clarifying the standards of acceptable
37
+ behavior and are expected to take appropriate and fair corrective action in
38
+ response to any instances of unacceptable behavior.
39
+
40
+ Project maintainers have the right and responsibility to remove, edit, or
41
+ reject comments, commits, code, wiki edits, issues, and other contributions
42
+ that are not aligned to this Code of Conduct, or to ban temporarily or
43
+ permanently any contributor for other behaviors that they deem inappropriate,
44
+ threatening, offensive, or harmful.
45
+
46
+ ## Scope
47
+
48
+ This Code of Conduct applies both within project spaces and in public spaces
49
+ when an individual is representing the project or its community. Examples of
50
+ representing a project or community include using an official project e-mail
51
+ address, posting via an official social media account, or acting as an appointed
52
+ representative at an online or offline event. Representation of a project may be
53
+ further defined and clarified by project maintainers.
54
+
55
+ ## Enforcement
56
+
57
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
+ reported by contacting the project team at development@capsens.com. All
59
+ complaints will be reviewed and investigated and will result in a response that
60
+ is deemed necessary and appropriate to the circumstances. The project team is
61
+ obligated to maintain confidentiality with regard to the reporter of an incident.
62
+ Further details of specific enforcement policies may be posted separately.
63
+
64
+ Project maintainers who do not follow or enforce the Code of Conduct in good
65
+ faith may face temporary or permanent repercussions as determined by other
66
+ members of the project's leadership.
67
+
68
+ ## Attribution
69
+
70
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
+ available at [https://contributor-covenant.org/version/1/4][version]
72
+
73
+ [homepage]: https://contributor-covenant.org
74
+ [version]: https://contributor-covenant.org/version/1/4/
data/Gemfile ADDED
@@ -0,0 +1,5 @@
1
+ source "https://rubygems.org"
2
+
3
+ gemspec
4
+
5
+ gem "rake", "~> 12.0"
data/Gemfile.lock ADDED
@@ -0,0 +1,123 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ light_admin (1.0.5)
5
+ activeadmin (>= 1.1.0, < 3.0)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ actionpack (6.1.3.1)
11
+ actionview (= 6.1.3.1)
12
+ activesupport (= 6.1.3.1)
13
+ rack (~> 2.0, >= 2.0.9)
14
+ rack-test (>= 0.6.3)
15
+ rails-dom-testing (~> 2.0)
16
+ rails-html-sanitizer (~> 1.0, >= 1.2.0)
17
+ actionview (6.1.3.1)
18
+ activesupport (= 6.1.3.1)
19
+ builder (~> 3.1)
20
+ erubi (~> 1.4)
21
+ rails-dom-testing (~> 2.0)
22
+ rails-html-sanitizer (~> 1.1, >= 1.2.0)
23
+ activeadmin (2.9.0)
24
+ arbre (~> 1.2, >= 1.2.1)
25
+ formtastic (>= 3.1, < 5.0)
26
+ formtastic_i18n (~> 0.4)
27
+ inherited_resources (~> 1.7)
28
+ jquery-rails (~> 4.2)
29
+ kaminari (~> 1.0, >= 1.2.1)
30
+ railties (>= 5.2, < 6.2)
31
+ ransack (~> 2.1, >= 2.1.1)
32
+ activemodel (6.1.3.1)
33
+ activesupport (= 6.1.3.1)
34
+ activerecord (6.1.3.1)
35
+ activemodel (= 6.1.3.1)
36
+ activesupport (= 6.1.3.1)
37
+ activesupport (6.1.3.1)
38
+ concurrent-ruby (~> 1.0, >= 1.0.2)
39
+ i18n (>= 1.6, < 2)
40
+ minitest (>= 5.1)
41
+ tzinfo (~> 2.0)
42
+ zeitwerk (~> 2.3)
43
+ arbre (1.4.0)
44
+ activesupport (>= 3.0.0, < 6.2)
45
+ ruby2_keywords (>= 0.0.2, < 1.0)
46
+ builder (3.2.4)
47
+ concurrent-ruby (1.1.8)
48
+ crass (1.0.6)
49
+ erubi (1.10.0)
50
+ formtastic (4.0.0)
51
+ actionpack (>= 5.2.0)
52
+ formtastic_i18n (0.6.0)
53
+ has_scope (0.8.0)
54
+ actionpack (>= 5.2)
55
+ activesupport (>= 5.2)
56
+ i18n (1.8.10)
57
+ concurrent-ruby (~> 1.0)
58
+ inherited_resources (1.12.0)
59
+ actionpack (>= 5.2, < 6.2)
60
+ has_scope (~> 0.6)
61
+ railties (>= 5.2, < 6.2)
62
+ responders (>= 2, < 4)
63
+ jquery-rails (4.4.0)
64
+ rails-dom-testing (>= 1, < 3)
65
+ railties (>= 4.2.0)
66
+ thor (>= 0.14, < 2.0)
67
+ kaminari (1.2.1)
68
+ activesupport (>= 4.1.0)
69
+ kaminari-actionview (= 1.2.1)
70
+ kaminari-activerecord (= 1.2.1)
71
+ kaminari-core (= 1.2.1)
72
+ kaminari-actionview (1.2.1)
73
+ actionview
74
+ kaminari-core (= 1.2.1)
75
+ kaminari-activerecord (1.2.1)
76
+ activerecord
77
+ kaminari-core (= 1.2.1)
78
+ kaminari-core (1.2.1)
79
+ loofah (2.9.0)
80
+ crass (~> 1.0.2)
81
+ nokogiri (>= 1.5.9)
82
+ method_source (1.0.0)
83
+ minitest (5.14.4)
84
+ nokogiri (1.11.2-x86_64-linux)
85
+ racc (~> 1.4)
86
+ racc (1.5.2)
87
+ rack (2.2.3)
88
+ rack-test (1.1.0)
89
+ rack (>= 1.0, < 3)
90
+ rails-dom-testing (2.0.3)
91
+ activesupport (>= 4.2.0)
92
+ nokogiri (>= 1.6)
93
+ rails-html-sanitizer (1.3.0)
94
+ loofah (~> 2.3)
95
+ railties (6.1.3.1)
96
+ actionpack (= 6.1.3.1)
97
+ activesupport (= 6.1.3.1)
98
+ method_source
99
+ rake (>= 0.8.7)
100
+ thor (~> 1.0)
101
+ rake (12.3.3)
102
+ ransack (2.4.2)
103
+ activerecord (>= 5.2.4)
104
+ activesupport (>= 5.2.4)
105
+ i18n
106
+ responders (3.0.1)
107
+ actionpack (>= 5.0)
108
+ railties (>= 5.0)
109
+ ruby2_keywords (0.0.4)
110
+ thor (1.1.0)
111
+ tzinfo (2.0.4)
112
+ concurrent-ruby (~> 1.0)
113
+ zeitwerk (2.4.2)
114
+
115
+ PLATFORMS
116
+ ruby
117
+
118
+ DEPENDENCIES
119
+ light_admin!
120
+ rake (~> 12.0)
121
+
122
+ BUNDLED WITH
123
+ 2.1.4
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2021 CapSens
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,122 @@
1
+ # light_admin - A minimal theme for ActiveAdmin
2
+
3
+ ![Screenshot](doc/index.png)
4
+ ![Screenshot](doc/show.png)
5
+
6
+ Design by Marie Ishihara
7
+ Gem by CapSens
8
+
9
+ ## Installation
10
+
11
+ - Add this line to your application's Gemfile:
12
+ ```ruby
13
+ gem 'light_admin', git: 'git@github.com:CapSens/light_admin.git'
14
+ ```
15
+
16
+ - And then run:
17
+ ```
18
+ $ bundle install
19
+ ```
20
+
21
+ - Make sure you have no other ActiveAdmin them installed before installing this gem!
22
+
23
+ ## Pre-requisites
24
+ - This gem requires the activeadmin gem.
25
+
26
+ ## Set-up
27
+ - In `app/assets/javascripts/active_admin`, add the line:
28
+ ```
29
+ //= require light_admin/filters_toggle
30
+ ```
31
+ - In `app/assets/stylesheets`, add the line:
32
+ ```
33
+ @import 'light_admin/base';
34
+ ```
35
+ - Your `active_admin.scss` file should look like this: <br>
36
+ ```
37
+ @import 'active_admin/mixins';
38
+ @import 'active_admin/base';
39
+ @import 'light_admin/base';
40
+ ```
41
+ You are good to go !
42
+
43
+ ## Displaying a logo in the header
44
+ - Import the image of your logo in `app/assets/images`
45
+ - In `config/initializers/active_admin.rb` uncomment the following line: <br>
46
+ ```
47
+ # config.site_title_image = "logo.png"
48
+ ```
49
+ - In place of `logo.png`, specify the name of your image and its extension: <br>
50
+ ```
51
+ config.site_title_image = "name_of_your_image.png"
52
+ ```
53
+ > Restart your Rails server so the changes take effect.
54
+
55
+
56
+ ## Displaying a logo on the login page
57
+ - Place your image in `app/assets/images/devise/sessions`.
58
+ - Run:
59
+ ```
60
+ $ rails generate light_admin:new_session
61
+ ```
62
+ - Edit the commented lines in `app/views/active_admin/devise/sessions/new.html.erb`
63
+
64
+ ## Customizing variables
65
+ - By default, variables are stored within the gem. If you want to edit them:
66
+ ```
67
+ $ rails generate light_admin:variables
68
+ ```
69
+ - Then you can edit the variables in the following files: <br>
70
+ `app/assets/stylesheets/light_admin/custom_variables/_colors.scss`
71
+ `app/assets/stylesheets/light_admin/custom_variables/_font.scss`
72
+ `app/assets/stylesheets/light_admin/custom_variables/_borders.scss`
73
+ `app/assets/stylesheets/light_admin/custom_variables/_shadows.scss`
74
+
75
+ - Then, import your changed variables in `app/assets/stylesheets/active_admin.scss` above the light admin base scss file, it should look like this if you have changed only colors:
76
+ ```
77
+ @import 'active_admin/mixins';
78
+ @import 'active_admin/base';
79
+ @import 'light_admin/custom_variables/colors';
80
+ @import 'light_admin/base';
81
+ ```
82
+
83
+ ## Panel with link
84
+ ![Screenshot](doc/panel-with-link.png)
85
+ `panel_with_link` behaves the same of ActiveAdmin's `panel`, except that it can also display links.
86
+ - If you want to use `panel_with_link`, you only need to call the `panel_with_link` method where you need it (for example, in your show page) and define its attributes like usual with ActiveAdmin.
87
+
88
+ - Here is the code for the above screenshot:
89
+ ```
90
+ panel_with_link t('users'), 'Voir tous', admin_users_path do
91
+ table_for user do
92
+ column :id
93
+ column :email do
94
+ link_to user.email, admin_user_path
95
+ end
96
+ column :created_at
97
+ column :updated_at
98
+ column :first_name
99
+ column :last_name
100
+ end
101
+ end
102
+ ```
103
+
104
+ ## Contributing
105
+
106
+ Bug reports and pull requests are welcome on GitHub at https://github.com/CapSens/light_admin
107
+
108
+ 1. **Fork** the repo on GitHub
109
+ 2. **Clone** the project to your own machine
110
+ 3. **Commit** changes to your own branch
111
+ 4. **Push** your work back up to your fork
112
+ 5. Submit a **Pull request** so that we can review your changes
113
+
114
+ NOTE: Be sure to merge the latest from "upstream" before making a pull request!
115
+
116
+ ## License
117
+
118
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
119
+
120
+ ## Code of Conduct
121
+
122
+ Everyone interacting in the LightAdmin project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/Capsens/light_admin/blob/master/CODE_OF_CONDUCT.md).
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+ task :default => :spec
@@ -0,0 +1,21 @@
1
+ $(document).ready(function () {
2
+ $('#active_admin_content .table_tools').append('<a id="toggleFilters" href="#" class=\'epon\'>Filtres</a>');
3
+
4
+ if (!window.location.search.includes('Filter')) {
5
+ $('div#sidebar').hide();
6
+ $('#main_content').css({ 'margin-right': '0px' });
7
+ $('a#toggleFilters').removeClass('epon');
8
+ }
9
+
10
+ $('a#toggleFilters').click(function () {
11
+ $('div#sidebar').toggle();
12
+ $(this).toggleClass('epon');
13
+ if ($('div#sidebar').is(':hidden')) {
14
+ $('#main_content').css({ 'margin-right': '0px' });
15
+ $('body #collection_selection').css({ 'width': 'unset' });
16
+ } else {
17
+ $('#main_content').css({ 'margin-right': '0px' });
18
+ $('body #collection_selection').css({ 'width': 'calc(100% - 294px)', 'overflow': 'auto' });
19
+ }
20
+ })
21
+ })
@@ -0,0 +1,50 @@
1
+ body {
2
+ font-family: $font-family;
3
+ font-size: $font-size;
4
+ color: $global-text-color;
5
+ background-color: $bg-light;
6
+
7
+ #active_admin_content {
8
+ padding: 0 15px;
9
+
10
+ #main_content_wrapper {
11
+ #main_content {
12
+ margin-top: 30px;
13
+
14
+ .paginated_collection {
15
+ background: $bg-white;
16
+ border-radius: $global-border-radius;
17
+ overflow: auto;
18
+ }
19
+ }
20
+ }
21
+ }
22
+
23
+ #content_wrapper #active_admin_content {
24
+ border-radius: $global-border-radius;
25
+ border: none;
26
+ box-shadow: none;
27
+ background: none;
28
+ }
29
+
30
+ #collection_selection {
31
+ overflow-x: inherit;
32
+ background: $bg-white;
33
+ box-shadow: $global-shadow;
34
+ border-radius: $global-border-radius;
35
+ }
36
+
37
+ #index_footer {
38
+ padding: 24px;
39
+ margin: 0;
40
+ background: $bg-white;
41
+ border-top: $border-style-light;
42
+ border-radius: $global-border-radius-bottom;
43
+ }
44
+ }
45
+
46
+ .index {
47
+ #wrapper {
48
+ display: unset;
49
+ }
50
+ }