light_admin 1.0.5

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 (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
@@ -0,0 +1,32 @@
1
+ /* COLORS LIST */
2
+ $black: #000000 !default;
3
+ $white: #FFFFFF !default;
4
+ $white-20: rgba($white, .2) !default;
5
+ $gray: #4B5563 !default;
6
+ $light-gray: #D9D7DD !default;
7
+ $charcoal: #374151 !default;
8
+ $primary: #0c81e4 !default;
9
+ $secondary: #0c4e8c !default;
10
+ $info: #11c4d4 !default;
11
+ $light: #F3F4F6 !default;
12
+ $dark: #526469 !default;
13
+ $success: #66bb6a !default;
14
+ $danger: #bb4678 !default;
15
+
16
+ /* BACKGROUNDS COLOR */
17
+ $bg-white: $white !default;
18
+ $bg-buttons: $charcoal !default;
19
+ $bg-light: $light !default;
20
+ $bg-danger: $danger !default;
21
+
22
+ /* FONTS COLOR */
23
+ $global-text-color: $gray !default;
24
+ $text-white: $white !default;
25
+ $header-item-li-color: rgba($white, 0.8) !default;
26
+ $text-info: $info !default;
27
+ $text-dark: $dark !default;
28
+ $text-success: $success !default;
29
+ $text-danger: $danger !default;
30
+ $title-login: $black !default;
31
+ $text-buttons: $charcoal !default;
32
+ $attributes-table-th-text-color: rgba($gray, .7) !default;
@@ -0,0 +1,4 @@
1
+ @import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,400;0,500;1,400&display=swap');
2
+
3
+ $font-size: .875rem !default;
4
+ $font-family: 'Montserrat', sans-serif !default;
@@ -0,0 +1,4 @@
1
+ $global-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06) !default;
2
+ $buttons-shadow: 0 1px 2px 0 rgba($black, 0.05) !default;
3
+ $dropdown-shadow: 0 10px 15px -3px rgba($black, 0.1), 0 4px 6px -2px rgba($black, 0.05) !default;
4
+ $field-shadow: 0 1px 2px 0 rgba($black, .05) !default;
@@ -0,0 +1,108 @@
1
+ /* LOGIN TITLE */
2
+ #login h2 {
3
+ background: none;
4
+ border-bottom: none;
5
+ text-shadow: none;
6
+ box-shadow: none;
7
+ font-family: $font-family;
8
+ font-size: 1.875rem;
9
+ font-weight: bold;
10
+ line-height: initial;
11
+ text-align: center;
12
+ color: $title-login;
13
+ padding: 0;
14
+ margin-top: 1.5rem;
15
+ padding: 0 30px;
16
+ }
17
+
18
+ /* LOGIN FORM */
19
+ #login {
20
+ margin-top: 2rem;
21
+
22
+ form {
23
+ ol {
24
+ margin: 0;
25
+ }
26
+
27
+ fieldset.actions {
28
+ ol {
29
+ margin-top: 3rem;
30
+
31
+ li {
32
+ margin-right: 0;
33
+ width: 100%;
34
+
35
+ input {
36
+ width: 100%;
37
+ }
38
+ }
39
+ }
40
+ }
41
+
42
+ input[type=submit] {
43
+ background: $secondary;
44
+ font-size: 100%;
45
+ border: none;
46
+ box-shadow: $buttons-shadow;
47
+ padding: 1rem 2rem;
48
+ }
49
+
50
+ input[type=submit]:not(.disabled):hover {
51
+ background: $info;
52
+ color: $text-white;
53
+ border: none;
54
+ }
55
+
56
+ input[type='checkbox'] {
57
+ margin-right: 5px;
58
+ }
59
+ }
60
+
61
+ form ol > li {
62
+ border-bottom: none;
63
+ padding: 0;
64
+ margin-top: 1.5rem;
65
+
66
+ &:first-child {
67
+ margin-top: 0;
68
+ }
69
+ }
70
+
71
+ form fieldset.inputs {
72
+ padding: 2.5rem;
73
+ }
74
+ }
75
+
76
+ body.logged_out {
77
+ #login {
78
+ a {
79
+ margin-top: 10px;
80
+ margin-right: 0;
81
+ }
82
+
83
+ form {
84
+ fieldset {
85
+ input[type=email],
86
+ input[type=password] {
87
+ width: calc(100% - 24px);
88
+ }
89
+ }
90
+ }
91
+ }
92
+
93
+ .actions {
94
+ float: unset;
95
+ margin-left: 0;
96
+ }
97
+
98
+ .flash {
99
+ box-shadow: $global-shadow;
100
+ text-shadow: none;
101
+ background: rgba($primary, .2);
102
+ border: 1px solid $primary;
103
+ color: $primary;
104
+ padding: 24px;
105
+ margin-bottom: 24px;
106
+ border-radius: $global-border-radius;
107
+ }
108
+ }
@@ -0,0 +1,18 @@
1
+ .d-flex {
2
+ display: -ms-flexbox !important;
3
+ display: flex !important;
4
+ }
5
+
6
+ .justify-content-between {
7
+ -ms-flex-pack: justify !important;
8
+ justify-content: space-between !important;
9
+ }
10
+
11
+ .align-items-center {
12
+ -ms-flex-align: center !important;
13
+ align-items: center !important;
14
+ }
15
+
16
+ .text-center {
17
+ text-align: center !important;
18
+ }
@@ -0,0 +1,3 @@
1
+ .w-100 {
2
+ width: 100% !important;
3
+ }
@@ -0,0 +1,22 @@
1
+ .px-4 {
2
+ padding-right: 1.5rem !important;
3
+ padding-left: 1.5rem !important;
4
+ }
5
+
6
+ .py-2 {
7
+ padding-top: 0.5rem !important;
8
+ padding-bottom: 0.5rem !important;
9
+ }
10
+
11
+ .mx-4 {
12
+ margin-right: 1.5rem !important;
13
+ margin-left: 1.5rem !important;
14
+ }
15
+
16
+ .ml-auto {
17
+ margin-left: auto !important;
18
+ }
19
+
20
+ .mt-4 {
21
+ margin-top: 1.5rem !important;
22
+ }
@@ -0,0 +1,36 @@
1
+ <div id="login">
2
+ <!-- If you want to add a logo to the admin login page, change # to = and link to your image. -->
3
+ <!--
4
+ <div class="text-center">
5
+ <%# image_tag('devise/sessions/image.png', height: '40px') %>
6
+ </div>
7
+ -->
8
+
9
+ <h2>
10
+ <%= active_admin_application.site_title(self) %>
11
+ <%= title t('active_admin.devise.login.title') %>
12
+ </h2>
13
+
14
+ <% scope = Devise::Mapping.find_scope!(resource_name) %>
15
+
16
+ <div class="login-form">
17
+ <%= active_admin_form_for(resource, as: resource_name, url: send(:"#{scope}_session_path"), html: { id: "session_new" }) do |f|
18
+ f.inputs do
19
+ resource.class.authentication_keys.each_with_index { |key, index|
20
+ f.input key, label: t("active_admin.devise.#{key}.title"), input_html: { autofocus: index.zero? }
21
+ }
22
+ f.input :password, label: t('active_admin.devise.password.title')
23
+
24
+ div class: 'd-flex justify-content-between mt-4' do
25
+ f.input :remember_me, label: t('active_admin.devise.login.remember_me'), as: :boolean if devise_mapping.rememberable?
26
+ render partial: "active_admin/devise/shared/links"
27
+ end
28
+
29
+ f.actions do
30
+ f.action :submit, label: t('active_admin.devise.login.submit'), button_html: { value: t('active_admin.devise.login.submit') }
31
+ end
32
+ end
33
+ end
34
+ %>
35
+ </div>
36
+ </div>
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "light_admin"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start(__FILE__)
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
Binary file
File without changes
data/doc/index.png ADDED
Binary file
File without changes
Binary file
File without changes
data/doc/show.png ADDED
Binary file
File without changes
@@ -0,0 +1,10 @@
1
+ require 'activeadmin'
2
+ require "light_admin/version"
3
+ require "light_admin/header"
4
+ require "light_admin/panel_with_link"
5
+ require "light_admin/generators"
6
+
7
+ module LightAdmin
8
+ class Engine < ::Rails::Engine
9
+ end
10
+ end
@@ -0,0 +1,19 @@
1
+ require 'rails/generators'
2
+
3
+ module LightAdmin
4
+ class VariablesGenerator < ::Rails::Generators::Base
5
+ source_root File.expand_path('../../app/assets/stylesheets/light_admin', __dir__)
6
+
7
+ def add_variables
8
+ directory "variables", "app/assets/stylesheets/light_admin/custom_variables"
9
+ end
10
+ end
11
+
12
+ class NewSessionGenerator < ::Rails::Generators::Base
13
+ source_root File.expand_path('../../', __dir__)
14
+
15
+ def add_new
16
+ directory 'app/views/active_admin/devise/sessions/', 'app/views/active_admin/devise/sessions'
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,30 @@
1
+ ActiveAdmin::Views::Header.class_eval do
2
+ def build(namespace, menu)
3
+ super(id: 'header')
4
+
5
+ @namespace = namespace
6
+ @menu = menu
7
+ @utility_menu = @namespace.fetch_menu(:utility_navigation)
8
+
9
+ build_site_header
10
+ end
11
+
12
+ def build_site_header
13
+ div class: 'w-100' do
14
+ div class: 'd-flex justify-content-between px-4 py-2' do
15
+ div do
16
+ site_title @namespace
17
+ end
18
+
19
+ insert_tag view_factory.global_navigation, @utility_menu, id: 'utility_nav', class: 'header-item tabs'
20
+ end
21
+
22
+ div class: 'border-bottom-white-50 mx-4' do
23
+ end
24
+
25
+ div class: 'px-4 py-2' do
26
+ insert_tag view_factory.global_navigation, @menu, class: 'header-item tabs'
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+ module Admin
3
+ module Components
4
+ class PanelWithLink < Arbre::Component
5
+ builder_method :panel_with_link
6
+ def build(title, link_text, link_url, attributes = {})
7
+ super(attributes)
8
+ div class: 'd-flex justify-content-between align-items-center title-panel-wrap' do
9
+ h3(title, class: 'panel-title panel-with-link')
10
+ div class: 'ml-auto' do
11
+ link_to(link_text, link_url)
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,3 @@
1
+ module LightAdmin
2
+ VERSION = "1.0.5"
3
+ end
@@ -0,0 +1,19 @@
1
+ require_relative 'lib/light_admin/version'
2
+
3
+ Gem::Specification.new do |spec|
4
+ spec.name = "light_admin"
5
+ spec.version = LightAdmin::VERSION
6
+ spec.authors = ["Marie Ishihara", "Antoine Goeuriot", "CapSens"]
7
+
8
+ spec.summary = 'Simple, minimal theme for activeadmin.'
9
+ spec.description = 'At CapSens - Paris-based RoR agency - we like ActiveAdmin very much. So we made this theme.'
10
+ spec.license = "MIT"
11
+
12
+ spec.files = Dir.chdir(File.expand_path(__dir__)) do
13
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
14
+ end
15
+ spec.bindir = "exe"
16
+ spec.require_paths = ["lib"]
17
+
18
+ spec.add_dependency 'activeadmin', ['>= 1.1.0', '< 3.0']
19
+ end
metadata ADDED
@@ -0,0 +1,117 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: light_admin
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.5
5
+ platform: ruby
6
+ authors:
7
+ - Marie Ishihara
8
+ - Antoine Goeuriot
9
+ - CapSens
10
+ autorequire:
11
+ bindir: exe
12
+ cert_chain: []
13
+ date: 2021-05-03 00:00:00.000000000 Z
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: activeadmin
17
+ requirement: !ruby/object:Gem::Requirement
18
+ requirements:
19
+ - - ">="
20
+ - !ruby/object:Gem::Version
21
+ version: 1.1.0
22
+ - - "<"
23
+ - !ruby/object:Gem::Version
24
+ version: '3.0'
25
+ type: :runtime
26
+ prerelease: false
27
+ version_requirements: !ruby/object:Gem::Requirement
28
+ requirements:
29
+ - - ">="
30
+ - !ruby/object:Gem::Version
31
+ version: 1.1.0
32
+ - - "<"
33
+ - !ruby/object:Gem::Version
34
+ version: '3.0'
35
+ description: At CapSens - Paris-based RoR agency - we like ActiveAdmin very much.
36
+ So we made this theme.
37
+ email:
38
+ executables: []
39
+ extensions: []
40
+ extra_rdoc_files: []
41
+ files:
42
+ - ".gitignore"
43
+ - CHANGELOG.md
44
+ - CODE_OF_CONDUCT.md
45
+ - Gemfile
46
+ - Gemfile.lock
47
+ - LICENSE.txt
48
+ - README.md
49
+ - Rakefile
50
+ - app/assets/javascripts/light_admin/filters_toggle.js
51
+ - app/assets/stylesheets/light_admin/_rules.scss
52
+ - app/assets/stylesheets/light_admin/base.scss
53
+ - app/assets/stylesheets/light_admin/components/_breadcrumbs.scss
54
+ - app/assets/stylesheets/light_admin/components/_buttons.scss
55
+ - app/assets/stylesheets/light_admin/components/_comments.scss
56
+ - app/assets/stylesheets/light_admin/components/_datepicker_calendar.scss
57
+ - app/assets/stylesheets/light_admin/components/_flash_messages.scss
58
+ - app/assets/stylesheets/light_admin/components/_footer.scss
59
+ - app/assets/stylesheets/light_admin/components/_forms.scss
60
+ - app/assets/stylesheets/light_admin/components/_header.scss
61
+ - app/assets/stylesheets/light_admin/components/_images.scss
62
+ - app/assets/stylesheets/light_admin/components/_list.scss
63
+ - app/assets/stylesheets/light_admin/components/_panels.scss
64
+ - app/assets/stylesheets/light_admin/components/_sidebars.scss
65
+ - app/assets/stylesheets/light_admin/components/_status_tag.scss
66
+ - app/assets/stylesheets/light_admin/components/_tables.scss
67
+ - app/assets/stylesheets/light_admin/components/_titles.scss
68
+ - app/assets/stylesheets/light_admin/components/_toggle_filters.scss
69
+ - app/assets/stylesheets/light_admin/variables/_borders.scss
70
+ - app/assets/stylesheets/light_admin/variables/_colors.scss
71
+ - app/assets/stylesheets/light_admin/variables/_font.scss
72
+ - app/assets/stylesheets/light_admin/variables/_shadows.scss
73
+ - app/assets/stylesheets/light_admin/views/_login.scss
74
+ - app/assets/stylesheets/utilities/_flex.scss
75
+ - app/assets/stylesheets/utilities/_sizing.scss
76
+ - app/assets/stylesheets/utilities/_spacing.scss
77
+ - app/views/active_admin/devise/sessions/new.html.erb
78
+ - bin/console
79
+ - bin/setup
80
+ - doc/index-with-filter.png
81
+ - doc/index-with-filter.png:Zone.Identifier
82
+ - doc/index.png
83
+ - doc/index.png:Zone.Identifier
84
+ - doc/panel-with-link.png
85
+ - doc/panel-with-link.png:Zone.Identifier
86
+ - doc/show.png
87
+ - doc/show.png:Zone.Identifier
88
+ - lib/light_admin.rb
89
+ - lib/light_admin/generators.rb
90
+ - lib/light_admin/header.rb
91
+ - lib/light_admin/panel_with_link.rb
92
+ - lib/light_admin/version.rb
93
+ - light_admin.gemspec
94
+ homepage:
95
+ licenses:
96
+ - MIT
97
+ metadata: {}
98
+ post_install_message:
99
+ rdoc_options: []
100
+ require_paths:
101
+ - lib
102
+ required_ruby_version: !ruby/object:Gem::Requirement
103
+ requirements:
104
+ - - ">="
105
+ - !ruby/object:Gem::Version
106
+ version: '0'
107
+ required_rubygems_version: !ruby/object:Gem::Requirement
108
+ requirements:
109
+ - - ">="
110
+ - !ruby/object:Gem::Version
111
+ version: '0'
112
+ requirements: []
113
+ rubygems_version: 3.1.2
114
+ signing_key:
115
+ specification_version: 4
116
+ summary: Simple, minimal theme for activeadmin.
117
+ test_files: []