thecore_ui_rails_admin 3.0.14 → 3.0.16

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e361f68568a7a8a7f014519a72f3b66dd61eecde84b9d65b7d6e9721f6317601
4
- data.tar.gz: e42960b81b4412b886043aa870b2de6683d1c8525bac5909b0ec2ae7590ba9a3
3
+ metadata.gz: 076d9b03596e0d703df184be8980fe202fbfb627e15361d6cd5ce56174365bdf
4
+ data.tar.gz: 55ac3031b57ef446ddfc430a846350a41101f97fee1cd3a26a56dfbcc0ad0e6e
5
5
  SHA512:
6
- metadata.gz: d3b99fc8d9e67f863f0d3b22d35304dac6b0c240e82c3a90d718a3f58f0a67de58db64680ef2f343ae2a4c5acc73f4b4602a6c9891f6fc09cd080ef56cb70414
7
- data.tar.gz: 7994615a20b163b5af4fde34ed0d577ecc86acdad999a5e7b7970fb32ea7297a8a07a739d0308528db865014d04b42b88c260c6d0e4214c8625646fc72d38eb9
6
+ metadata.gz: 1b8e8c94db0459f7c276ed713f67a673ce69cf49bb8746f42efd1731404421202dc179113d2e657355f451003449f1a356621959b64651698c89e45c468ee86f
7
+ data.tar.gz: cbd6d28b4ddfac6da452a03735929d67cb9f0e458bd8f4f73b8986e37fc9811e299abff9826adcad80c93da9ae98fd1a47e3a8db530b5e3b70524b06d6109580
@@ -0,0 +1,2 @@
1
+ document.querySelector("input#user_email").placeholder='E-Mail';
2
+ document.querySelector("input#user_password").placeholder='Password';
@@ -0,0 +1,65 @@
1
+ // override this file in your application to add custom behaviour
2
+
3
+ //= require 'selectize.min'
4
+ //= require 'thecore_ui_commons'
5
+ //= require 'rails_admin/custom/thecore/ui'
6
+
7
+ const adjustIframe = function (obj) {
8
+ console.log("Resizing");
9
+ obj.style.height = obj.contentWindow.document.body.scrollHeight + 'px';
10
+ };
11
+
12
+ let currentURL = new URL(window.location.href);
13
+
14
+ $(document).on('turbo:load', function (event) {
15
+ currentURL = new URL(event.originalEvent.detail.url);
16
+ console.log("Page loaded listening to turbo:load event", currentURL.href);
17
+ console.log(" - Protocol:", currentURL.protocol);
18
+ console.log(" - Username:", currentURL.username);
19
+ console.log(" - Password:", currentURL.password);
20
+ console.log(" - Host:", currentURL.host);
21
+ console.log(" - Hostname:", currentURL.hostname);
22
+ console.log(" - Port:", currentURL.port);
23
+ console.log(" - Pathname:", currentURL.pathname);
24
+ console.log(" - Search:", currentURL.search);
25
+ currentURL.searchParams.forEach((v, k) => {
26
+ console.log(` - ${k}: ${v}`);
27
+ })
28
+ console.log(" - Hash:", currentURL.hash);
29
+
30
+ // Add the customer_logo before the Title
31
+ const customer_logo_path = "<%= asset_path('customer_logo.png') %>";
32
+ $(".navbar-brand").prepend(`<img class="navbar-brand-logo" alt="Customer Logo" src="${customer_logo_path}"/>`);
33
+ });
34
+
35
+ const sidepanel = "body > div.container-fluid > div > div.col-sm-3.col-md-2.flex-wrap.p-0"
36
+ const mainpanel = "body > div.container-fluid > div > div.col-sm-9.col-sm-offset-3.col-md-10.col-md-offset-2";
37
+
38
+ // JavaScript functions to open the sidebar
39
+ function sideOpen() {
40
+ /* Sidebar takes 25% of the total width
41
+ of main container in open state */
42
+ document.querySelector(
43
+ sidepanel).style.width = "16.66666667%";
44
+
45
+ document.querySelector(
46
+ mainpanel).style.width = "83.33333333%";
47
+ document.querySelector(
48
+ sidepanel).style.display = "block";
49
+ // document.querySelector(
50
+ // "openNav").style.display = "none";
51
+ }
52
+ // JavaScript functions to close the sidebar
53
+ function sideClose() {
54
+ // Sidebar takes 0% of the total width
55
+ // of main container in open state
56
+ document.querySelector(
57
+ mainpanel).style.marginLeft = "0%";
58
+ document.querySelector(
59
+ mainpanel).style.width = "100%";
60
+ // Visibility is hidden
61
+ document.querySelector(
62
+ sidepanel).style.display = "none";
63
+ // document.querySelector(
64
+ // "openNav").style.display = "inline-block";
65
+ }
@@ -0,0 +1,160 @@
1
+ @import 'thecore_ui_commons/variables';
2
+
3
+ body {
4
+ background: none;
5
+ background-color:$primary;
6
+ font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
7
+ }
8
+
9
+ form.new_user {
10
+ display: flex;
11
+ flex-direction: column;
12
+ }
13
+
14
+ label {
15
+
16
+ &[for=user_email],
17
+ &[for=user_password],
18
+ &+br {
19
+ display: none;
20
+ }
21
+ }
22
+
23
+ .contained {
24
+ flex-direction: row;
25
+ height: 55vh;
26
+ width: 85vw;
27
+ border: 2px solid lightgrey;
28
+ border-radius: 2em;
29
+ padding: 0px;
30
+ background-color: white !important;
31
+ max-width: 1136px;
32
+
33
+ .field,
34
+ .actions {
35
+ width: 70%;
36
+
37
+ input {
38
+ box-sizing: border-box;
39
+
40
+ &:focus {
41
+ border-color: $primary!important;
42
+ outline: 0;
43
+ -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba($primary, 0.6)!important;
44
+ box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba($primary, 0.6)!important;
45
+ }
46
+ }
47
+
48
+ #user_email,
49
+ #user_password,
50
+ input[type=submit] {
51
+ width: 100%;
52
+ }
53
+ }
54
+
55
+ input[type=submit] {
56
+ border-radius: 2em;
57
+ }
58
+
59
+ .logos,
60
+ .new_user {
61
+ display: flex;
62
+ flex-direction: column;
63
+ align-items: center;
64
+ justify-content: center;
65
+ flex-basis: 50%;
66
+ flex-grow: 0;
67
+ }
68
+ }
69
+
70
+ .supplier {
71
+ display: flex;
72
+ align-items: center;
73
+ justify-content: center;
74
+ flex-direction: row;
75
+ background-color: #fff;
76
+ border-top-left-radius: 15px;
77
+ border-top-right-radius: 15px;
78
+ border-top: 1px solid lightgray;
79
+ position: absolute;
80
+ bottom: 0px;
81
+ left: 0px;
82
+ right: 0px;
83
+ height: 3em;
84
+ color: gray;
85
+
86
+ .supplier-image {
87
+ height: 98%;
88
+ margin-right: 1em;
89
+ }
90
+ }
91
+
92
+
93
+ // Copy rails_Admin style for alerts
94
+
95
+ .alert {
96
+ padding: 1rem 1rem;
97
+ margin-bottom: 1rem;
98
+ border: 1px solid transparent;
99
+ }
100
+
101
+ .alert-dismissible {
102
+ padding-right: 3rem;
103
+ }
104
+
105
+ .alert-dismissible .btn-close {
106
+ position: absolute;
107
+ top: 0;
108
+ right: 0;
109
+ z-index: 2;
110
+ padding: 1.25rem 1rem;
111
+ }
112
+
113
+ button:not(:disabled),
114
+ [type="button"]:not(:disabled),
115
+ [type="reset"]:not(:disabled),
116
+ [type="submit"]:not(:disabled) {
117
+ cursor: pointer;
118
+ }
119
+
120
+ $x_icon: "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23000'%3e%3cpath d='M.293.293a1 1 0 011.414 0L8 6.586 14.293.293a1 1 0 111.414 1.414L9.414 8l6.293 6.293a1 1 0 01-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 01-1.414-1.414L6.586 8 .293 1.707a1 1 0 010-1.414z'/%3e%3c/svg%3e";
121
+
122
+ .btn-close {
123
+ box-sizing: content-box;
124
+ width: 1em;
125
+ height: 1em;
126
+ padding: 0.25em 0.25em;
127
+ color: #000;
128
+ background: transparent url($x_icon) center/1em auto no-repeat;
129
+ border: 0;
130
+ border-radius: 0.25rem;
131
+ opacity: 0.5;
132
+ }
133
+
134
+ #main-menu-app-logo {
135
+ width: 20vw;
136
+ max-width: 300px;
137
+ }
138
+
139
+ @media screen and (max-width: 992px) {
140
+ .contained {
141
+ flex-direction: column;
142
+ }
143
+
144
+ #main-menu-app-logo {
145
+ height: 100%;
146
+ width: auto;
147
+ }
148
+
149
+ .contained .logos,
150
+ .contained .new_user {
151
+ flex-basis: auto;
152
+ flex-grow: auto;
153
+ }
154
+
155
+ form.new_user {
156
+ width: 70%;
157
+ }
158
+ }
159
+
160
+ @import 'devise/custom/thecore/sessions'
@@ -0,0 +1,150 @@
1
+ @import 'thecore_ui_commons/variables';
2
+
3
+ // Dashboard
4
+ .box {
5
+ color: inherit;
6
+ }
7
+
8
+ .box {
9
+ border-radius: 1em;
10
+ display: block;
11
+ padding: 15px;
12
+ margin-bottom: 30px;
13
+ border: 1px solid $element-border;
14
+ position: relative;
15
+ min-height: 15em;
16
+ transition: all 0.3s ease;
17
+ background-color: lighten($element, 25%);
18
+ color: $element-text;
19
+ overflow: hidden;
20
+
21
+ &:hover,
22
+ &:focus {
23
+ border-color: $shadows;
24
+
25
+ .icon-bg {
26
+ transform: scale(1.5) rotate(20deg);
27
+ }
28
+ }
29
+
30
+ p {
31
+ min-height: 30px;
32
+ font-size: 15px;
33
+ font-weight: 600;
34
+
35
+ a.btn {
36
+ border-radius: 3px;
37
+ color: rgba($text-highlight, 0.7) !important;
38
+ display: inline-block;
39
+ margin-bottom: 0;
40
+ font-weight: normal;
41
+ text-align: center;
42
+ vertical-align: middle;
43
+ cursor: pointer;
44
+ background-color: rgba($shadows, 0.19);
45
+ border: 1px solid transparent;
46
+ white-space: nowrap;
47
+ padding: 6px 12px;
48
+ font-size: 14px;
49
+ line-height: 1.42857143;
50
+ border-radius: 4px;
51
+ -webkit-user-select: none;
52
+ -moz-user-select: none;
53
+ -ms-user-select: none;
54
+ user-select: none;
55
+ }
56
+ }
57
+
58
+ strong.count {
59
+ font-size: 10em;
60
+ font-weight: 600;
61
+ }
62
+
63
+ p.model,
64
+ strong.count {
65
+ color: $element-text;
66
+
67
+ &:hover {
68
+ color: $element-text-highlight;
69
+ }
70
+ }
71
+
72
+ .icon-bg {
73
+ position: absolute;
74
+ right: 0;
75
+ bottom: 0;
76
+ font-size: 15em;
77
+ color: $element-text;
78
+ opacity: 0.20;
79
+ filter: alpha(opacity=20);
80
+ transition: all 1s ease;
81
+ }
82
+
83
+ &.bg-info {
84
+ background-color: $info;
85
+ }
86
+
87
+ &.bg-success {
88
+ background-color: $success;
89
+ }
90
+
91
+ &.bg-warning {
92
+ background-color: $warning;
93
+ }
94
+
95
+ &.bg-danger {
96
+ background-color: $danger;
97
+ }
98
+
99
+ &.bg-clear {
100
+ background-color: $neutral;
101
+ }
102
+ }
103
+
104
+ .box,
105
+ #bulk_form .panel:nth-of-type(1),
106
+ #bulk_form .panel {
107
+ border: none;
108
+ border-radius: 2em;
109
+ }
110
+
111
+ .box:hover .icon-block {
112
+ transform: scale(1.2) rotate(20deg);
113
+ }
114
+
115
+ .box.first {
116
+ color: #fad23c !important;
117
+ }
118
+
119
+ .box.second {
120
+ color: #e68c00 !important;
121
+ }
122
+
123
+ .box.third {
124
+ color: #c82823 !important;
125
+ }
126
+
127
+ .box.fourth {
128
+ color: #a02319 !important;
129
+ }
130
+
131
+ .box p.model,
132
+ .box strong.count {
133
+ color: inherit !important;
134
+ }
135
+
136
+ .box .text-center p.model {
137
+ text-transform: uppercase;
138
+ font-size: x-large;
139
+ font-weight: bold;
140
+ }
141
+
142
+ .box .text-center i.icon-block {
143
+ font-size: 8em;
144
+ transition: all .5s ease;
145
+ }
146
+
147
+ .dashboard-element {
148
+ padding-right: 15px !important;
149
+ padding-left: 15px !important;
150
+ }
@@ -18,5 +18,58 @@
18
18
  @import 'rails_admin/custom/variables';
19
19
  @import 'rails_admin/custom/mixins';
20
20
  @import 'thecore_ui_commons/alerts';
21
+ @import 'rails_admin/custom/dashboard';
22
+
23
+ header h1,
24
+ .nav li[class$="_root_link"] {
25
+ display: none;
26
+ }
27
+
28
+ header.py-2.m-2.border-bottom {
29
+ border-bottom: none !important;
30
+ }
31
+
32
+ .breadcrumb {
33
+ background-color: $primary;
34
+ text-transform: uppercase;
35
+ color: $body-bg !important;
36
+ border-radius: 2em;
37
+ padding: 8px 15px;
38
+ margin-bottom: 20px;
39
+ list-style: none;
40
+
41
+ .breadcrumb-item {
42
+
43
+ a,
44
+ &.active,
45
+ &+.breadcrumb-item::before {
46
+ color: white !important;
47
+ }
48
+ }
49
+ }
50
+
51
+ .card.bg-light {
52
+ background-color: $body-bg !important;
53
+ border:none!important;
54
+ }
55
+
56
+ input, select, textarea {
57
+ &.form-control, &.form-check-input {
58
+ background-color: $background!important;
59
+ }
60
+ }
61
+
62
+ body > div.container-fluid > div > div.col-sm-3.col-md-2.flex-wrap.p-0,
63
+ body > div.container-fluid > div > div.col-sm-9.col-sm-offset-3.col-md-10.col-md-offset-2 {
64
+ -webkit-transition: all 1s ease-in-out;
65
+ -moz-transition: all 1s ease-in-out;
66
+ -o-transition: all 1s ease-in-out;
67
+ -ms-transition: all 1s ease-in-out;
68
+ transition: all 1s ease-in-out;
69
+ }
70
+
71
+ .navbar-brand-logo {
72
+ height: 1.7em;
73
+ }
21
74
 
22
75
  @import 'rails_admin/custom/thecore/theming';
@@ -0,0 +1,25 @@
1
+ <% colors = [ :first, :second, :third, :fourth ] %>
2
+ <% index = 0 %>
3
+ <% allowed_models = Settings.models_in_dashboard %>
4
+ <% allowed_models_cleaned = allowed_models.split.join.split(",") %>
5
+ <% @abstract_models.each do |abstract_model| %>
6
+ <% if allowed_models.blank? || allowed_models_cleaned.include?(abstract_model.model_name) %>
7
+ <% index_path = index_path(model_name: abstract_model.to_param) %>
8
+ <% if authorized?(:index, abstract_model) %>
9
+ <% if index == colors.length %>
10
+ <% index = 0 %>
11
+ <% end %>
12
+ <div class="col-sm-4 dashboard-element">
13
+ <a class="box pjax <%= colors[index] %>" href="<%= index_path %>">
14
+ <div class="text-center">
15
+ <p class="model">
16
+ <%= abstract_model.config.label_plural %>
17
+ </p>
18
+ <i class="icon-block <%= abstract_model.config.navigation_icon.present? ? abstract_model.config.navigation_icon : 'file' %>"></i>
19
+ </div>
20
+ </a>
21
+ </div>
22
+ <% index += 1 %>
23
+ <% end %>
24
+ <% end %>
25
+ <% end %>
@@ -0,0 +1,18 @@
1
+ <% # Instruct javascript to skip toolbar or breadcrumb %>
2
+ <span class="hide-toolbar"></span>
3
+ <% # =render partial: 'rails_admin/main/dashboard_analytics' %>
4
+ <% if @abstract_models %>
5
+ <div class="row">
6
+ <%= render partial: 'rails_admin/main/dashboard_block' %>
7
+ </div>
8
+ <% end %>
9
+ <% if @auditing_adapter && authorized?(:history_index) %>
10
+ <div class="block" id="block-tables">
11
+ <div class="content">
12
+ <h2>
13
+ <%= t("admin.actions.history_index.menu") %>
14
+ </h2>
15
+ <%= render partial: 'rails_admin/main/dashboard_history' %>
16
+ </div>
17
+ </div>
18
+ <% end %>
@@ -6,4 +6,6 @@ Rails.application.config.assets.precompile += %w(
6
6
  rails_admin/custom/thecore/theming.css
7
7
  rails_admin/custom/ui.js
8
8
  rails_admin/custom/thecore/ui.js
9
+ rails_admin/custom/dashboard.css
10
+ devise/custom/thecore/sessions.scss
9
11
  )
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: thecore_ui_rails_admin
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.14
4
+ version: 3.0.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gabriele Tassoni
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-02-13 00:00:00.000000000 Z
11
+ date: 2023-02-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thecore_ui_commons
@@ -63,9 +63,13 @@ files:
63
63
  - README.md
64
64
  - Rakefile
65
65
  - app/assets/config/thecore_ui_rails_admin_manifest.js
66
+ - app/assets/javascripts/devise/sessions.js
66
67
  - app/assets/javascripts/rails_admin/custom/thecore/ui.js
67
- - app/assets/javascripts/rails_admin/custom/ui.js
68
+ - app/assets/javascripts/rails_admin/custom/ui.js.erb
68
69
  - app/assets/javascripts/selectize.min.js
70
+ - app/assets/stylesheets/devise/custom/sessions.scss
71
+ - app/assets/stylesheets/devise/custom/thecore/sessions.scss
72
+ - app/assets/stylesheets/rails_admin/custom/dashboard.scss
69
73
  - app/assets/stylesheets/rails_admin/custom/mixins.scss
70
74
  - app/assets/stylesheets/rails_admin/custom/thecore/mixins.scss
71
75
  - app/assets/stylesheets/rails_admin/custom/thecore/selectize.default.min.scss
@@ -73,7 +77,9 @@ files:
73
77
  - app/assets/stylesheets/rails_admin/custom/thecore/variables.scss
74
78
  - app/assets/stylesheets/rails_admin/custom/theming.scss
75
79
  - app/assets/stylesheets/rails_admin/custom/variables.scss
80
+ - app/views/rails_admin/main/_dashboard_block.html.erb
76
81
  - app/views/rails_admin/main/active_job_monitor.html.erb
82
+ - app/views/rails_admin/main/dashboard.html.erb
77
83
  - config/initializers/abilities.rb
78
84
  - config/initializers/add_to_db_migrations.rb
79
85
  - config/initializers/after_initialize.rb
@@ -1,29 +0,0 @@
1
- // override this file in your application to add custom behaviour
2
-
3
- //= require 'selectize.min'
4
- //= require 'thecore_ui_commons'
5
- //= require 'rails_admin/custom/thecore/ui'
6
-
7
- const adjustIframe = function(obj) {
8
- console.log("Resizing");
9
- obj.style.height = obj.contentWindow.document.body.scrollHeight + 'px';
10
- };
11
-
12
- let currentURL = new URL(window.location.href);
13
-
14
- $(document).on('turbo:load', function (event) {
15
- currentURL = new URL(event.originalEvent.detail.url);
16
- console.log("Page loaded listening to turbo:load event", currentURL.href);
17
- console.log(" - Protocol:", currentURL.protocol);
18
- console.log(" - Username:", currentURL.username);
19
- console.log(" - Password:", currentURL.password);
20
- console.log(" - Host:", currentURL.host);
21
- console.log(" - Hostname:", currentURL.hostname);
22
- console.log(" - Port:", currentURL.port);
23
- console.log(" - Pathname:", currentURL.pathname);
24
- console.log(" - Search:", currentURL.search);
25
- currentURL.searchParams.forEach((v, k) => {
26
- console.log(` - ${k}: ${v}`);
27
- })
28
- console.log(" - Hash:", currentURL.hash);
29
- });