arctic_admin 3.3.0 → 4.1.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f6941e04a5fe35cb8dfb68e36db36ab2099a29c556b2bfb439442c87387c6827
4
- data.tar.gz: d6723be6be3dbbf41c762bf864408a902c989229ad6ea527a6619094b4f04d28
3
+ metadata.gz: 4f527d7e2caa4c8209125ef8b4e0819d9dfac5056622e62fbb78f2bfc7950028
4
+ data.tar.gz: c137632694ed36dc983279e9e161b2415d4100b7c6daef0bcc8353f7d7514a4f
5
5
  SHA512:
6
- metadata.gz: 3f4305722258dc1735b389db444cb32cf987818b6ee9e110353b814a4245a2930ac234c714f147dd4dab4fc73734e0f6e69bcff4c3c4b892bd165afbf07be1f9
7
- data.tar.gz: 25ea935c291845e8d52ec6e34689785ca1e13866e6b4a4994ac68129bda1b9311ea47f1f46a628ef2305ad6f5ee6b928d4bda40494d1461476a6d965a382f3db
6
+ metadata.gz: 81d7c39c6fc5201af8f6543dc8033d642782489bcca767a6da9ab1badc108f546e34d9260750e1c4d46bc67dc938c84e393b4b930f1ba00915a7d49654c061a9
7
+ data.tar.gz: ab34c1df077f84627182680c0686986204c0636ea4d0e668ea9921c17136088b652933e388b90c504081be9b35e642ae72057362ac1a93a43d724cd3b82c9cb1
@@ -14,7 +14,7 @@ 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**
17
+ ### For Sprockets users
18
18
 
19
19
  - Add this to your Gemfile:
20
20
 
@@ -32,9 +32,17 @@ config.meta_tags = meta_tags_options
32
32
  config.meta_tags_for_logged_out_pages = meta_tags_options
33
33
  ```
34
34
 
35
- ## Usage
35
+ ### For webpacker / jsbundling-rails or other JS-based asset solutions
36
36
 
37
- ### CSS
37
+ Install the needed assets with npm or yarn:
38
+
39
+ ```bash
40
+ yarn add arctic_admin @fortawesome/fontawesome-free
41
+ ```
42
+
43
+ ## Use with Sprockets
44
+
45
+ ### 1a - CSS
38
46
 
39
47
  In your `active_admin.css`, include the css file:
40
48
 
@@ -48,7 +56,7 @@ In your `active_admin.css`, include the css file:
48
56
 
49
57
  Then restart your webserver if it was previously running.
50
58
 
51
- ### Sass Support
59
+ ### 1b - Sass Support
52
60
 
53
61
  :exclamation: **Remove the line `@import "active_admin/base"`**
54
62
 
@@ -67,7 +75,7 @@ add this to your `active_admin.sass` file:
67
75
  @import arctic_admin/base
68
76
  ```
69
77
 
70
- ### JS
78
+ ### 2 - JS
71
79
 
72
80
  In your `active_admin.js`, include the js file:
73
81
 
@@ -79,16 +87,7 @@ In your `active_admin.js`, include the js file:
79
87
 
80
88
  ## Use with webpacker
81
89
 
82
- ### 1 - Preparation
83
-
84
- Install the needed assets with npm or yarn:
85
-
86
- ```
87
- yarn add arctic_admin @fortawesome/fontawesome-free
88
- ```
89
-
90
-
91
- ### 2 - CSS
90
+ ### 1 - CSS
92
91
 
93
92
  In your `app/javascript/stylesheets/active_admin.scss`, add the line:
94
93
 
@@ -103,7 +102,7 @@ Remove:
103
102
  @import "~@activeadmin/activeadmin/src/scss/base";
104
103
  ```
105
104
 
106
- ### 3 - JS
105
+ ### 2 - JS
107
106
 
108
107
  Search for `app/javascript/packs/active_admin.js` in your rails project and add the following lines:
109
108
 
@@ -1,4 +1,2 @@
1
- //= require jquery
2
- //= require jquery_ujs
3
1
  //= require active_admin/base
4
2
  //= require ./main
@@ -1,99 +1,52 @@
1
- $(function () {
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
- }
1
+ document.addEventListener('DOMContentLoaded', () => {
2
+
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)) && event.target.className != "select2-selection__choice__remove") {
9
+ sidebar.classList.toggle('sidebar_open')
37
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')
38
27
  }
39
28
  })
40
29
 
41
- var animationDone = true
42
- $(document).on('click touchstart', '#utility_nav', function (e) {
43
- var position = $(this).position()
44
- var tabs = $('#tabs')
45
- var width = (tabs.length==0)? 0 : Math.round(tabs[0].getBoundingClientRect().width)
46
- if (e.pageX < position.left + 40) {
47
- if (animationDone == true) {
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
- }
70
- }
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')
71
38
  }
72
39
  })
73
40
 
74
- $(document).on('click touchstart', 'body', function (e) {
75
- var tabs = $('#tabs')
76
- var width = (tabs.length==0)? 0 : Math.round(tabs[0].getBoundingClientRect().width)
77
- if (tabs.css('left') == '0px') {
78
- if (e.pageX > width && e.pageY > 60) {
79
- if (animationDone == true) {
80
- animationDone = false
81
- tabs.animate(
82
- {
83
- left: '-=' + width
84
- },
85
- 400,
86
- function () {
87
- animationDone = true
88
- }
89
- )
90
- }
91
- }
41
+ // toggle of nested menu items
42
+ const nestedMenuItems = document.querySelectorAll('#tabs .has_nested')
43
+ nestedMenuItems.forEach(
44
+ (nestedMenuItem) => {
45
+ nestedMenuItem.addEventListener('click', (e) => {
46
+ e.stopPropagation()
47
+ nestedMenuItem.classList.toggle('open')
48
+ })
92
49
  }
93
- })
50
+ )
94
51
 
95
- $(document).on('click', '#tabs .has_nested', function (e) {
96
- e.stopPropagation()
97
- $(this).toggleClass('open')
98
- })
99
52
  })
@@ -62,7 +62,7 @@ input[type="checkbox"] {
62
62
 
63
63
  &:checked {
64
64
  border-color: $primary-color;
65
- background-color: $primary-color;
65
+ background-color: $primary-color !important;
66
66
  }
67
67
  }
68
68
 
@@ -34,7 +34,7 @@
34
34
  }
35
35
 
36
36
  .select2-container--default .select2-results__option[aria-selected=true]{
37
- background_color: $body-background;
37
+ background-color: $body-background;
38
38
  }
39
39
 
40
40
  .select2-search--dropdown .select2-search__field{
@@ -47,4 +47,4 @@
47
47
 
48
48
  .select2-results__option{
49
49
  padding-left: 12px;
50
- }
50
+ }
@@ -39,12 +39,6 @@ thead th {
39
39
  }
40
40
 
41
41
  tbody tr {
42
- border: 1px solid $border-color;
43
-
44
- &:hover {
45
- background-color: rgba(228, 234, 236, 0.3);
46
- }
47
-
48
42
  th {
49
43
  font-size: $font-size;
50
44
  }
@@ -64,3 +58,14 @@ tbody tr {
64
58
  }
65
59
  }
66
60
  }
61
+
62
+ // style only for table
63
+ .index_as_table {
64
+ tbody tr {
65
+ border: 1px solid $border-color;
66
+
67
+ &:hover {
68
+ background-color: rgba(228, 234, 236, 0.3);
69
+ }
70
+ }
71
+ }
@@ -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;
@@ -37,6 +37,7 @@
37
37
  background-color: #fff;
38
38
  color: $color;
39
39
  border: 1px solid $color;
40
+ padding: 4px 8px;
40
41
  @include button();
41
42
 
42
43
  &:hover {
@@ -117,4 +118,4 @@
117
118
 
118
119
  @mixin little-button() {
119
120
  padding: 6px 12px;
120
- }
121
+ }
@@ -1,3 +1,5 @@
1
+ @use "sass:math";
2
+
1
3
  body.index {
2
4
 
3
5
  .resource_selection_toggle_cell, .resource_selection_cell {
@@ -41,7 +43,19 @@ body.index {
41
43
  }
42
44
 
43
45
  .indexes.table_tools_segmented_control {
44
- text-align: right;
46
+ display: flex;
47
+ justify-content: right;
48
+
49
+ a {
50
+ @include secondary-button($primary-color);
51
+ }
52
+
53
+ .index {
54
+ margin-right: 4px;
55
+ &:last-child {
56
+ margin-right: 0;
57
+ }
58
+ }
45
59
  }
46
60
  }
47
61
 
@@ -66,7 +80,7 @@ body.index {
66
80
  @include transform(translateY(-50%));
67
81
 
68
82
  @media screen and (min-width: $md-width) {
69
- font-size: $font-size/1;
83
+ // font-size: math.div($font-size, 1px);
70
84
  }
71
85
  }
72
86
 
@@ -102,8 +116,14 @@ body.index {
102
116
 
103
117
  #sidebar {
104
118
  position: fixed;
119
+ transition: .5s;
120
+ transition-timing-function: ease-in-out;
105
121
  right: - $filter-width;
106
122
 
123
+ &.sidebar_open {
124
+ right: 0;
125
+ }
126
+
107
127
  @media screen and (min-width: $x-lg-width) {
108
128
  right: - $lg-filter-width;
109
129
  }
@@ -1,3 +1,3 @@
1
1
  module ArcticAdmin
2
- VERSION = "3.3.0"
2
+ VERSION = "4.1.0"
3
3
  end
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: 3.3.0
4
+ version: 4.1.0
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-12-07 00:00:00.000000000 Z
11
+ date: 2023-03-23 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
@@ -93,7 +79,7 @@ extensions: []
93
79
  extra_rdoc_files: []
94
80
  files:
95
81
  - LICENCE.txt
96
- - Readme.md
82
+ - README.md
97
83
  - app/assets/fonts/Lato-Bold.eot
98
84
  - app/assets/fonts/Lato-Bold.ttf
99
85
  - app/assets/fonts/Lato-Bold.woff
@@ -172,7 +158,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
172
158
  - !ruby/object:Gem::Version
173
159
  version: '0'
174
160
  requirements: []
175
- rubygems_version: 3.0.3
161
+ rubygems_version: 3.3.26
176
162
  signing_key:
177
163
  specification_version: 4
178
164
  summary: Arctic Admin theme for ActiveAdmin