captive_admin 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +22 -17
- data/app/assets/stylesheets/captive_admin/components/_tables.scss +42 -0
- data/app/assets/stylesheets/captive_admin/mixins/_all.scss +1 -0
- data/app/assets/stylesheets/captive_admin/mixins/_buttons.scss +50 -0
- data/app/assets/stylesheets/captive_admin/mixins/_sections.scss +17 -0
- data/app/assets/stylesheets/captive_admin/mixins/_shadows.scss +3 -0
- data/app/assets/stylesheets/captive_admin/mixins/_variables.scss +17 -1
- data/app/assets/stylesheets/captive_admin/structure/_title_bar.scss +1 -0
- data/doc/screenshot.png +0 -0
- data/lib/captive_admin/version.rb +1 -1
- data/renovate.json +6 -0
- data/script/release +66 -0
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6ddcd4b44250598d163ee0ed11b88e4259337de716ddad97e3c8a46ca561f8f6
|
4
|
+
data.tar.gz: d007d5611d9fa1451ffba1a449f16889a1e27b9be9da69886e25a202d9bdc317
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ff3bad67b2e852971b5ad10b1313dafc8f246d96c9362fddd6df6db9e6668c0c8439d250ae2d25ddb1ee2d8e5038c6d202d53acd3ee68c2857fa6f3bec23c384
|
7
|
+
data.tar.gz: 6448cce4015aee08996a6f8e7378b87eb42bb24d1c5f31771798a6dd3f2bb5737c0876d371040129b4e798a1b5ae4fbc5502e20f893c734a88049cc918bf1b67
|
data/README.md
CHANGED
@@ -1,32 +1,37 @@
|
|
1
1
|
# CaptiveAdmin
|
2
2
|
|
3
|
-
|
3
|
+
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
|
4
|
+
[![Gem Version](https://img.shields.io/gem/v/captive_admin.svg)](https://rubygems.org/gems/captive_admin)
|
4
5
|
|
5
|
-
|
6
|
+
A UI theme for ActiveAdmin that follows [Captive](https://captive.fr)'s Design System
|
6
7
|
|
7
|
-
|
8
|
-
|
9
|
-
Install the gem and add to the application's Gemfile by executing:
|
10
|
-
|
11
|
-
$ bundle add captive_admin
|
8
|
+
![Screenshot](doc/screenshot.png)
|
12
9
|
|
13
|
-
|
14
|
-
|
15
|
-
$ gem install captive_admin
|
16
|
-
|
17
|
-
## Usage
|
10
|
+
## Installation
|
18
11
|
|
19
|
-
|
12
|
+
- Add this to you Gemfile:
|
20
13
|
|
21
|
-
|
14
|
+
```ruby
|
15
|
+
gem 'captive_admin'
|
16
|
+
```
|
22
17
|
|
23
|
-
|
18
|
+
- Run `bundle install`
|
24
19
|
|
25
|
-
|
20
|
+
- Edit `active_admin.scss` file
|
21
|
+
- Remove these two lines
|
22
|
+
```scss
|
23
|
+
@import "active_admin/mixins";
|
24
|
+
@import "active_admin/base";
|
25
|
+
```
|
26
|
+
- Replace with these two lines
|
27
|
+
```scss
|
28
|
+
@import "captive_admin/mixins";
|
29
|
+
@import "captive_admin/base";
|
30
|
+
```
|
26
31
|
|
27
32
|
## Contributing
|
28
33
|
|
29
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
34
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/Captive-Studio/captive_admin.
|
30
35
|
|
31
36
|
## License
|
32
37
|
|
@@ -2,5 +2,47 @@
|
|
2
2
|
|
3
3
|
|
4
4
|
table.index_table {
|
5
|
+
@include shadow-xs;
|
6
|
+
border-radius: $border-radius-s;
|
7
|
+
|
8
|
+
th {
|
9
|
+
a, a:link, a:visited {
|
10
|
+
color: $fg-muted;
|
11
|
+
}
|
12
|
+
|
13
|
+
&.sorted-asc, &.sorted-desc {
|
14
|
+
background: $bg-default;
|
15
|
+
border-bottom: 2px solid $border-color-emphasis;
|
16
|
+
}
|
17
|
+
|
18
|
+
&:first-child {
|
19
|
+
border-top-left-radius: $border-radius-s;
|
20
|
+
}
|
21
|
+
|
22
|
+
&:last-child {
|
23
|
+
border-right: none;
|
24
|
+
border-top-right-radius: $border-radius-s;
|
25
|
+
}
|
26
|
+
}
|
27
|
+
|
28
|
+
tr {
|
29
|
+
&:last-child {
|
30
|
+
td {
|
31
|
+
&:first-child {
|
32
|
+
border-bottom-left-radius: $border-radius-s;
|
33
|
+
}
|
34
|
+
|
35
|
+
&:last-child {
|
36
|
+
border-bottom-right-radius: $border-radius-s;
|
37
|
+
}
|
38
|
+
}
|
39
|
+
}
|
40
|
+
}
|
41
|
+
|
5
42
|
tr.even td { background: $bg-subtle; }
|
43
|
+
|
44
|
+
td {
|
45
|
+
border-bottom: none;
|
46
|
+
vertical-align: middle;
|
47
|
+
}
|
6
48
|
}
|
@@ -1,14 +1,64 @@
|
|
1
|
+
@mixin basic-button {
|
2
|
+
//default AA style
|
3
|
+
@include rounded(200px);
|
4
|
+
display: inline-block;
|
5
|
+
font-weight: bold;
|
6
|
+
font-size: 1.0em;
|
7
|
+
@include sans-family;
|
8
|
+
line-height: 12px;
|
9
|
+
margin-right: 3px;
|
10
|
+
text-decoration: none;
|
11
|
+
|
12
|
+
&.disabled {
|
13
|
+
opacity: 0.5;
|
14
|
+
cursor: default;
|
15
|
+
}
|
16
|
+
//End default AA style
|
17
|
+
padding: $spacer-2 $spacer-4;
|
18
|
+
transition: background-color .3s;
|
19
|
+
box-shadow: $shadow-xs;
|
20
|
+
}
|
1
21
|
@mixin primary-button {
|
2
22
|
background-color: $primary-emphasis;
|
3
23
|
background-image: none;
|
4
24
|
color: $primary-onEmphasis;
|
5
25
|
border: none;
|
6
26
|
text-shadow: none;
|
27
|
+
box-shadow: $shadow-s;
|
7
28
|
|
8
29
|
&:not(.disabled) {
|
9
30
|
&:hover{
|
10
31
|
background-color: $primary-muted;
|
11
32
|
background-image: none;
|
12
33
|
}
|
34
|
+
|
35
|
+
&:active {
|
36
|
+
box-shadow: $shadow-xs;
|
37
|
+
background-image: none;
|
38
|
+
}
|
13
39
|
}
|
14
40
|
}
|
41
|
+
|
42
|
+
@mixin outline-button {
|
43
|
+
// style AA
|
44
|
+
@include basic-button;
|
45
|
+
outline: solid 1px;
|
46
|
+
color: $fg-muted;
|
47
|
+
background-color: $bg-subtle;
|
48
|
+
|
49
|
+
&:not(.disabled) {
|
50
|
+
&:hover {
|
51
|
+
background-color: $bg-default;
|
52
|
+
}
|
53
|
+
|
54
|
+
&:active {
|
55
|
+
background-color: $bg-emphasis;
|
56
|
+
color: $fg-onEmphasis
|
57
|
+
}
|
58
|
+
}
|
59
|
+
}
|
60
|
+
|
61
|
+
|
62
|
+
@mixin light-button {
|
63
|
+
@include outline-button;
|
64
|
+
}
|
@@ -1,3 +1,20 @@
|
|
1
|
+
@mixin section-header {
|
2
|
+
// héritage AA
|
3
|
+
|
4
|
+
font-size: 1em;
|
5
|
+
font-weight: bold;
|
6
|
+
line-height: 18px;
|
7
|
+
margin-bottom: 0.5em;
|
8
|
+
|
9
|
+
// Fin héritage AA
|
10
|
+
padding: $spacer-2 $spacer-4;
|
11
|
+
|
12
|
+
color: $fg-muted;
|
13
|
+
background: $bg-subtle;
|
14
|
+
border-bottom: 1px solid $border-color;
|
15
|
+
// @include shadow-xs;
|
16
|
+
}
|
17
|
+
|
1
18
|
@mixin section-background {
|
2
19
|
background: $bg-subtle;
|
3
20
|
|
@@ -5,6 +5,7 @@ $white: #FFFFFF;
|
|
5
5
|
$blue-grey-900: #102A43;
|
6
6
|
$blue-grey-600: #486581;
|
7
7
|
$blue-grey-500: #5E7997;
|
8
|
+
$blue-grey-200: #BCCCDC;
|
8
9
|
$blue-grey-050: #F5F7FA;
|
9
10
|
|
10
11
|
$pink-vivid-500: #D9127C;
|
@@ -74,6 +75,9 @@ $support-emphasis: $purple-700;
|
|
74
75
|
$support-muted: $purple-500;
|
75
76
|
$support-subtle: $purple-050;
|
76
77
|
|
78
|
+
$border-color: $blue-grey-200;
|
79
|
+
$border-color-emphasis: $blue-grey-900;
|
80
|
+
|
77
81
|
|
78
82
|
// Espacements
|
79
83
|
// Cf https://www.notion.so/captive/UI-Espacement-du-Design-System-Captive-cc192b02b57d453fa0da9fdc6d1234c2
|
@@ -94,7 +98,19 @@ $spacer-12: 256px;
|
|
94
98
|
|
95
99
|
// Fonts
|
96
100
|
// https://www.notion.so/captive/Typographie-Captive-85c60f5a849f4adaacaf18cc4aff2cea
|
97
|
-
@import url('https://fonts.googleapis.com/css2?family=Open+Sans&family=Barlow:wght@400;600&display=swap');
|
101
|
+
@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600&family=Barlow:wght@400;600&display=swap');
|
98
102
|
|
99
103
|
$default-font-family: "Open Sans", -apple-system, Segoe UI, Roboto, Noto Sans, Ubuntu, Cantarell, Helvetica Neue;
|
100
104
|
$title-font-family: "Barlow", -apple-system, Segoe UI, Roboto, Noto Sans, Ubuntu, Cantarell, Helvetica Neue;
|
105
|
+
|
106
|
+
|
107
|
+
// Shadows
|
108
|
+
$shadow-xs: 0 1px 3px rgba(0,0,0,.12), 0 1px 2px rgba(0,0,0,.24);
|
109
|
+
$shadow-s: 0 3px 6px rgba(0,0,0,.15), 0 2px 4px rgba(0,0,0,.12);
|
110
|
+
$shadow-m: 0 10px 20px rgba(0,0,0,.15), 0 3px 6px rgba(0,0,0,.10);
|
111
|
+
$shadow-l: 0 15px 25px rgba(0,0,0,.15), 0 5px 10px rgba(0,0,0,.05);
|
112
|
+
$shadow-xl: 0 20px 40px rgba(0,0,0,.2);
|
113
|
+
|
114
|
+
|
115
|
+
// radius
|
116
|
+
$border-radius-s: 12px
|
data/doc/screenshot.png
ADDED
Binary file
|
data/renovate.json
ADDED
data/script/release
ADDED
@@ -0,0 +1,66 @@
|
|
1
|
+
#!/bin/sh
|
2
|
+
|
3
|
+
##
|
4
|
+
# This script creates a new version of a gem on a GitHub repository.
|
5
|
+
# You can run it with 'script/release major', 'script/release minor', or 'script/release patch' to create the corresponding release.
|
6
|
+
# You can also add a second optional argument for the version suffix.
|
7
|
+
#
|
8
|
+
#
|
9
|
+
# Tradeoffs of this solutions :
|
10
|
+
# Advantages
|
11
|
+
# - Captive still have its ownership of the repository: every rule is explicit in its configuration
|
12
|
+
# - Captive can disable the sync script if there is a problem with @w5s/eslint-config
|
13
|
+
#
|
14
|
+
# Drawbacks
|
15
|
+
# - When pulling changes, semantic versioning information is lost (breaking changes, etc)
|
16
|
+
#
|
17
|
+
cd $(dirname $(dirname $0))
|
18
|
+
ROOT=`pwd`
|
19
|
+
cd $ROOT;
|
20
|
+
|
21
|
+
|
22
|
+
# Check if the current branch is the main branch
|
23
|
+
branch=$(git branch --show-current)
|
24
|
+
if [ "$branch" != "main" ]; then
|
25
|
+
echo "You are not on the main branch"
|
26
|
+
exit 1
|
27
|
+
fi
|
28
|
+
|
29
|
+
# Get the latest version of the code
|
30
|
+
git pull origin main
|
31
|
+
|
32
|
+
# Determine the current version of the gem
|
33
|
+
version=$(grep -E "VERSION = '[0-9]+\.[0-9]+\.[0-9]+" lib/captive_admin/version.rb | cut -d "'" -f 2)
|
34
|
+
echo "Current version is ${version}"
|
35
|
+
|
36
|
+
# Determine the version to release
|
37
|
+
if [ "$1" == "major" ]; then
|
38
|
+
new_version=$(echo "${version}" | awk -F. '{$1++; print $1"."0"."0}')
|
39
|
+
elif [ "$1" == "minor" ]; then
|
40
|
+
new_version=$(echo "${version}" | awk -F. '{$2++; print $1"."$2"."0}')
|
41
|
+
elif [ "$1" == "patch" ]; then
|
42
|
+
new_version=$(echo "${version}" | awk -F. '{$3++; print $1"."$2"."$3}')
|
43
|
+
else
|
44
|
+
echo "Usage : script/release (major|minor|patch) [version-suffix]"
|
45
|
+
exit 1
|
46
|
+
fi
|
47
|
+
|
48
|
+
# Add suffix to the new version, if specified
|
49
|
+
if [ ! -z "$2" ]; then
|
50
|
+
new_version="${new_version}-${2}"
|
51
|
+
fi
|
52
|
+
|
53
|
+
echo "Creating version ${new_version} ..."
|
54
|
+
|
55
|
+
# Update the version in captive_admin/version.rb
|
56
|
+
sed -i '' "s/VERSION = '${version}'/VERSION = '${new_version}'/" lib/captive_admin/version.rb
|
57
|
+
|
58
|
+
# Add the modified file and create a commit
|
59
|
+
git add lib/captive_admin/version.rb
|
60
|
+
git commit -m "🔖 Publish version ${new_version}"
|
61
|
+
|
62
|
+
# Create a new release on GitHub
|
63
|
+
git tag ${new_version}
|
64
|
+
git push origin ${new_version}
|
65
|
+
|
66
|
+
echo "Version ${new_version} created."
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: captive_admin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Captive
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2023-07-
|
12
|
+
date: 2023-07-18 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: Un thème pour ActiveAdmin aux couleurs de Captive.
|
15
15
|
email:
|
@@ -36,12 +36,16 @@ files:
|
|
36
36
|
- app/assets/stylesheets/captive_admin/mixins/_all.scss
|
37
37
|
- app/assets/stylesheets/captive_admin/mixins/_buttons.scss
|
38
38
|
- app/assets/stylesheets/captive_admin/mixins/_sections.scss
|
39
|
+
- app/assets/stylesheets/captive_admin/mixins/_shadows.scss
|
39
40
|
- app/assets/stylesheets/captive_admin/mixins/_typography.scss
|
40
41
|
- app/assets/stylesheets/captive_admin/mixins/_variables.scss
|
41
42
|
- app/assets/stylesheets/captive_admin/pages/_logged_out.scss
|
42
43
|
- app/assets/stylesheets/captive_admin/structure/_title_bar.scss
|
44
|
+
- doc/screenshot.png
|
43
45
|
- lib/captive_admin.rb
|
44
46
|
- lib/captive_admin/version.rb
|
47
|
+
- renovate.json
|
48
|
+
- script/release
|
45
49
|
- sig/captive_admin.rbs
|
46
50
|
homepage: https://github.com/Captive-Studio/captive_admin
|
47
51
|
licenses:
|