arctic_admin 3.3.0 → 4.0.0.alpha
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.
- checksums.yaml +4 -4
- data/Readme.md +10 -10
- data/app/assets/javascripts/arctic_admin/base.js +0 -2
- data/app/assets/javascripts/arctic_admin/main.js +41 -90
- data/app/assets/stylesheets/arctic_admin/layouts/_filter.scss +18 -1
- data/app/assets/stylesheets/arctic_admin/layouts/_sidebar.scss +7 -1
- data/app/assets/stylesheets/arctic_admin/pages/_index.scss +6 -8
- data/lib/arctic_admin/version.rb +1 -1
- metadata +4 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d80f79149e44a52c1d586e425e82313f2d83aea8455d59eaba12a72fb94abc30
|
4
|
+
data.tar.gz: ff9b250756327bb54eb0ee374d4cacb0a9cb7b6090da861ee85beceda2534f62
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6844d6c0fbd22ce592aa64c9f5f27e93033564f44bd7856a3e9d2f3f0ab52ffb5c8a44c106ec9eac85e7dd50c6213649930bfa303a451b4ea867405bc9ded0fd
|
7
|
+
data.tar.gz: 159bce7c3570d89754af6964c035497b6adbc0a87f6f709a06fa556c4ddfdd924a48866518336e6424a81cd0efa6ae87df472c3e9f8442d10bf4ef846bb62548
|
data/Readme.md
CHANGED
@@ -14,8 +14,6 @@ Simple theme for ActiveAdmin :ok_hand:
|
|
14
14
|
|
15
15
|
## Installation
|
16
16
|
|
17
|
-
>**⚠️ If you are using webpacker (Standard with Rails 6) look below**
|
18
|
-
|
19
17
|
- Add this to your Gemfile:
|
20
18
|
|
21
19
|
```ruby
|
@@ -81,10 +79,10 @@ In your `active_admin.js`, include the js file:
|
|
81
79
|
|
82
80
|
### 1 - Preparation
|
83
81
|
|
84
|
-
Install the
|
82
|
+
Install the assets from npm or yarn
|
85
83
|
|
86
84
|
```
|
87
|
-
yarn add arctic_admin
|
85
|
+
yarn add arctic_admin
|
88
86
|
```
|
89
87
|
|
90
88
|
|
@@ -105,24 +103,26 @@ Remove:
|
|
105
103
|
|
106
104
|
### 3 - JS
|
107
105
|
|
108
|
-
|
106
|
+
In your `app/javascript/packs/active_admin.js`, add the line:
|
109
107
|
|
110
108
|
```js
|
111
|
-
import "@fortawesome/fontawesome-free/css/all.css";
|
112
109
|
import 'arctic_admin'
|
113
110
|
```
|
114
111
|
|
115
112
|
|
116
113
|
### Customization
|
117
114
|
|
118
|
-
For this, you need to use
|
115
|
+
For this, you need to use sass to custom the theme.
|
116
|
+
|
117
|
+
You can even change basic color of the theme by placing some other variables:
|
119
118
|
|
120
|
-
|
119
|
+
If you use the [SCSS](http://sass-lang.com/documentation/file.SASS_REFERENCE.html), add this to your
|
120
|
+
`active_admin.scss` file:
|
121
121
|
|
122
122
|
```scss
|
123
123
|
$primary-color: #2dbb43;
|
124
124
|
|
125
|
-
@import "
|
125
|
+
@import "arctic_admin/base";
|
126
126
|
```
|
127
127
|
|
128
128
|
If you use the
|
@@ -132,7 +132,7 @@ add this to your `active_admin.sass` file:
|
|
132
132
|
```sass
|
133
133
|
$primary-color: #2dbb43
|
134
134
|
|
135
|
-
@import
|
135
|
+
@import arctic_admin/base
|
136
136
|
```
|
137
137
|
|
138
138
|
Then restart your webserver if it was previously running.
|
@@ -1,99 +1,50 @@
|
|
1
|
-
|
2
|
-
var animationFilterDone = true
|
3
|
-
$(document).on('click touchstart', '#sidebar', function (e) {
|
4
|
-
if (animationFilterDone == true) {
|
5
|
-
var position = $(this).position()
|
6
|
-
var width = $(this).width()
|
7
|
-
var target = e.target
|
8
|
-
if (
|
9
|
-
e.pageX < position.left &&
|
10
|
-
target.tagName != 'SELECT' &&
|
11
|
-
target.tagName != 'OPTION'
|
12
|
-
) {
|
13
|
-
if ($(this).css('right') == '0px') {
|
14
|
-
$(this).css('position', 'fixed')
|
15
|
-
$(this).animate(
|
16
|
-
{
|
17
|
-
right: '-=' + width
|
18
|
-
},
|
19
|
-
600,
|
20
|
-
function () {
|
21
|
-
$(this).removeAttr('style')
|
22
|
-
animationFilterDone = true
|
23
|
-
}
|
24
|
-
)
|
25
|
-
} else {
|
26
|
-
$(this).animate(
|
27
|
-
{
|
28
|
-
right: '+=' + width
|
29
|
-
},
|
30
|
-
600,
|
31
|
-
function () {
|
32
|
-
$(this).css('position', 'absolute')
|
33
|
-
animationFilterDone = true
|
34
|
-
}
|
35
|
-
)
|
36
|
-
}
|
37
|
-
}
|
38
|
-
}
|
39
|
-
})
|
1
|
+
document.addEventListener('DOMContentLoaded', () => {
|
40
2
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
animationDone = false
|
49
|
-
if (tabs.css('left') == '0px') {
|
50
|
-
tabs.animate(
|
51
|
-
{
|
52
|
-
left: '-=' + width
|
53
|
-
},
|
54
|
-
400,
|
55
|
-
function () {
|
56
|
-
animationDone = true
|
57
|
-
}
|
58
|
-
)
|
59
|
-
} else {
|
60
|
-
tabs.animate(
|
61
|
-
{
|
62
|
-
left: '+=' + width
|
63
|
-
},
|
64
|
-
400,
|
65
|
-
function () {
|
66
|
-
animationDone = true
|
67
|
-
}
|
68
|
-
)
|
69
|
-
}
|
3
|
+
// right filter sidebar
|
4
|
+
const sidebar = document.querySelector('#sidebar')
|
5
|
+
if (sidebar) {
|
6
|
+
sidebar.addEventListener('click', event => {
|
7
|
+
const insideSection = document.querySelector('#filters_sidebar_section')
|
8
|
+
if (!(event.target === insideSection || insideSection.contains(event.target))) {
|
9
|
+
sidebar.classList.toggle('sidebar_open')
|
70
10
|
}
|
11
|
+
})
|
12
|
+
}
|
13
|
+
|
14
|
+
const menuButton = document.querySelector('#utility_nav')
|
15
|
+
const menu = document.querySelector('#tabs')
|
16
|
+
|
17
|
+
// toggle menu sidebar with the menu button
|
18
|
+
menuButton.addEventListener('click', event => {
|
19
|
+
const currentUser = document.querySelector('#current_user')
|
20
|
+
const logout = document.querySelector('#logout')
|
21
|
+
const forbiddenLinks = event.target === logout ||
|
22
|
+
logout.contains(event.target) ||
|
23
|
+
event.target === currentUser ||
|
24
|
+
currentUser.contains(event.target)
|
25
|
+
if (!forbiddenLinks) {
|
26
|
+
menu.classList.toggle('tabs_open')
|
71
27
|
}
|
72
28
|
})
|
73
29
|
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
{
|
83
|
-
left: '-=' + width
|
84
|
-
},
|
85
|
-
400,
|
86
|
-
function () {
|
87
|
-
animationDone = true
|
88
|
-
}
|
89
|
-
)
|
90
|
-
}
|
91
|
-
}
|
30
|
+
// close left menu sidebar on any click outside
|
31
|
+
document.body.addEventListener('click', event => {
|
32
|
+
const forbiddenLinks = event.target === menu ||
|
33
|
+
menu.contains(event.target) ||
|
34
|
+
event.target === menuButton ||
|
35
|
+
menuButton.contains(event.target)
|
36
|
+
if (menu.classList.contains('tabs_open') && !forbiddenLinks) {
|
37
|
+
menu.classList.remove('tabs_open')
|
92
38
|
}
|
93
39
|
})
|
94
40
|
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
41
|
+
// toggle of nested menu items
|
42
|
+
const nestedMenuItem = document.querySelector('#tabs .has_nested')
|
43
|
+
if (nestedMenuItem) {
|
44
|
+
nestedMenuItem.addEventListener('click', (e) => {
|
45
|
+
e.stopPropagation()
|
46
|
+
nestedMenuItem.classList.toggle('open')
|
47
|
+
})
|
48
|
+
}
|
49
|
+
|
99
50
|
})
|
@@ -49,6 +49,11 @@
|
|
49
49
|
.filter_date_range input {
|
50
50
|
width: 45%;
|
51
51
|
display: inline-block;
|
52
|
+
|
53
|
+
// consistent look of all filters
|
54
|
+
&:nth-child(2) {
|
55
|
+
float: right;
|
56
|
+
}
|
52
57
|
}
|
53
58
|
|
54
59
|
input[type="submit"] {
|
@@ -56,9 +61,21 @@
|
|
56
61
|
line-height: 31px;
|
57
62
|
margin-right: 10px;
|
58
63
|
}
|
64
|
+
|
65
|
+
&.panel {
|
66
|
+
position: relative;
|
67
|
+
}
|
59
68
|
}
|
60
69
|
|
61
70
|
#search-status-_sidebar_section {
|
62
71
|
font-size: 14px;
|
63
72
|
}
|
64
|
-
|
73
|
+
|
74
|
+
// 'Filter' and 'Clear Filters' buttons
|
75
|
+
.buttons {
|
76
|
+
display: flex;
|
77
|
+
justify-content: space-between;
|
78
|
+
align-items: center;
|
79
|
+
margin-top: 1rem;
|
80
|
+
}
|
81
|
+
}
|
@@ -8,6 +8,12 @@
|
|
8
8
|
z-index: 1;
|
9
9
|
overflow: auto;
|
10
10
|
left: - $header-width;
|
11
|
+
transition: .5s;
|
12
|
+
transition-timing-function: ease-in-out;
|
13
|
+
|
14
|
+
&.tabs_open {
|
15
|
+
left: 0;
|
16
|
+
}
|
11
17
|
|
12
18
|
@media screen and (min-width: $sm-width) {
|
13
19
|
top: 60px;
|
@@ -95,7 +101,7 @@
|
|
95
101
|
}
|
96
102
|
}
|
97
103
|
|
98
|
-
|
104
|
+
ul {
|
99
105
|
display: block;
|
100
106
|
}
|
101
107
|
}
|
@@ -39,10 +39,6 @@ body.index {
|
|
39
39
|
position: absolute;
|
40
40
|
z-index: 1;
|
41
41
|
}
|
42
|
-
|
43
|
-
.indexes.table_tools_segmented_control {
|
44
|
-
text-align: right;
|
45
|
-
}
|
46
42
|
}
|
47
43
|
|
48
44
|
.paginated_collection_contents {
|
@@ -93,17 +89,19 @@ body.index {
|
|
93
89
|
.scopes {
|
94
90
|
.scope {
|
95
91
|
@include group-button($primary-color);
|
96
|
-
|
97
|
-
a {
|
98
|
-
margin-right: .25rem;
|
99
|
-
}
|
100
92
|
}
|
101
93
|
}
|
102
94
|
|
103
95
|
#sidebar {
|
104
96
|
position: fixed;
|
97
|
+
transition: .5s;
|
98
|
+
transition-timing-function: ease-in-out;
|
105
99
|
right: - $filter-width;
|
106
100
|
|
101
|
+
&.sidebar_open {
|
102
|
+
right: 0;
|
103
|
+
}
|
104
|
+
|
107
105
|
@media screen and (min-width: $x-lg-width) {
|
108
106
|
right: - $lg-filter-width;
|
109
107
|
}
|
data/lib/arctic_admin/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: arctic_admin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 4.0.0.alpha
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Clément Prod'homme
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-10-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -58,20 +58,6 @@ dependencies:
|
|
58
58
|
- - "<"
|
59
59
|
- !ruby/object:Gem::Version
|
60
60
|
version: '3.0'
|
61
|
-
- !ruby/object:Gem::Dependency
|
62
|
-
name: jquery-rails
|
63
|
-
requirement: !ruby/object:Gem::Requirement
|
64
|
-
requirements:
|
65
|
-
- - ">="
|
66
|
-
- !ruby/object:Gem::Version
|
67
|
-
version: '0'
|
68
|
-
type: :runtime
|
69
|
-
prerelease: false
|
70
|
-
version_requirements: !ruby/object:Gem::Requirement
|
71
|
-
requirements:
|
72
|
-
- - ">="
|
73
|
-
- !ruby/object:Gem::Version
|
74
|
-
version: '0'
|
75
61
|
- !ruby/object:Gem::Dependency
|
76
62
|
name: font-awesome-sass
|
77
63
|
requirement: !ruby/object:Gem::Requirement
|
@@ -168,9 +154,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
168
154
|
version: '0'
|
169
155
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
170
156
|
requirements:
|
171
|
-
- - "
|
157
|
+
- - ">"
|
172
158
|
- !ruby/object:Gem::Version
|
173
|
-
version:
|
159
|
+
version: 1.3.1
|
174
160
|
requirements: []
|
175
161
|
rubygems_version: 3.0.3
|
176
162
|
signing_key:
|