sinatra-hexacta 1.1.5 → 1.2.0

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: 600547c558970ce888f15fb4aa5822676f4099cbac81da59884aa166fc2d0ef1
4
- data.tar.gz: 9cac99f04d6b474da4e6a0f40352342350a68f7d6ef2e05a8fac48480e66fd44
3
+ metadata.gz: 8a6b195c0b2ef5829e35dd0ec3458064979c760097bffbce4e1eb5b6a1cc996b
4
+ data.tar.gz: fe3bd59f911cc1d9a74599ce47a3ba28dfc5ed768b38e627563ddb1f61dbca8f
5
5
  SHA512:
6
- metadata.gz: 90ecdf14c00ffd178ffeff95ea3ac28eb499df35fea02267a5656e1c520c247c65000fa130e1de6a0758c6daf84a3b05c7d1ddc10494ae1ab4f71eeb08e4b9a2
7
- data.tar.gz: 9b3bebb7422bb09f16f45cdd54a87a82c20a46a7e73ff9225b55536c32e17015529f46c5c906bdbf3bb778012b02598c2f94c3da0cb28d732943633642c8501e
6
+ metadata.gz: 74044e106888b58471dd347fc3db5c6d1279f3ed703aded8ca8d05c50ffa3e54b94dd6a60d2080c1684f7220bc64899f466151896c75f6226c18de9982aa278b
7
+ data.tar.gz: 60dad9caf89a4c0b451d87fb7c75c6362d6105132923ef5727335448413009c17609a957cdbb6f3b1425e7ca500aab82e5cd970a329101590002335acfbe4b62
@@ -5,3 +5,4 @@ require_relative 'params'
5
5
  require_relative 'reports'
6
6
  require_relative 'processes'
7
7
  require_relative 'constants'
8
+ require_relative 'user_configurations'
@@ -0,0 +1,26 @@
1
+ # encoding: utf-8
2
+ module Sinatra
3
+ module UserConfigurationHandler
4
+ extend Hexacta
5
+
6
+ def enable_user_configuration
7
+ p "Enabling user configurations..."
8
+
9
+ get '/user/configuration' do
10
+ user = authenticated(User)
11
+ slim :'users/configuration', locals: { :user => user }
12
+ end
13
+
14
+ post '/user/configuration' do
15
+ user_configuration_params = params.select { |attribute| UserConfiguration.columns.include?(attribute.to_sym) }
16
+ user_configuration = UserConfiguration.find_or_create(:user_id => authenticated(User).id)
17
+ user_configuration.update_fields(user_configuration_params, UserConfiguration.columns, :missing => :skip)
18
+ redirect back
19
+ end
20
+
21
+ end
22
+
23
+ end
24
+ register UserConfigurationHandler
25
+ end
26
+
@@ -7,3 +7,4 @@ require_relative 'schedule'
7
7
  require_relative 'alerts'
8
8
  require_relative 'reports'
9
9
  require_relative 'menu'
10
+ require_relative 'user_configurations'
@@ -0,0 +1,21 @@
1
+ # encoding: utf-8
2
+ module Sinatra
3
+ module UserConfigurationHelper
4
+ extend Hexacta
5
+
6
+ def include_user_configuration
7
+ slim "#{Hexacta::GEM_FILE_DIR}/user_configurations/include".to_sym
8
+ end
9
+
10
+ def edit_user_configuration
11
+ slim "#{Hexacta::GEM_FILE_DIR}/user_configurations/edit".to_sym
12
+ end
13
+
14
+ p "Setting up user configurations directory..."
15
+ copy_dir_structure("/lib/sinatra/public","/app/public/#{Hexacta::GEM_FILE_DIR}")
16
+ setup_dir("/app/views/#{Hexacta::GEM_FILE_DIR}/user_configurations")
17
+ copy_all_files("/lib/sinatra/views/user_configurations","/app/views/#{Hexacta::GEM_FILE_DIR}/libraries")
18
+ end
19
+
20
+ helpers UserConfigurationHelper
21
+ end
@@ -2972,10 +2972,6 @@ pre code {
2972
2972
  }
2973
2973
  }
2974
2974
 
2975
- table {
2976
- background-color: #ffffff;
2977
- }
2978
-
2979
2975
  caption {
2980
2976
  padding-top: 10px;
2981
2977
  padding-bottom: 10px;
@@ -0,0 +1,262 @@
1
+ body {
2
+ color: #eee;
3
+ background: #616161;
4
+ }
5
+
6
+ a {
7
+ color: #809fff !Important;
8
+ }
9
+
10
+ .sidebar {
11
+ background: #424242;
12
+ }
13
+
14
+ .main-menu > li > a {
15
+ color: #bdbdbd;
16
+ }
17
+
18
+ .main-menu > li > a:hover, .main-menu > li.active > a {
19
+ color: #e0e0e0;
20
+ background-color: #616161;
21
+ }
22
+
23
+ .sub-menu ul > li > a, .sub-menu > a:before, .sub-menu > a:after {
24
+ color: #bdbdbd;
25
+ }
26
+
27
+ .sub-menu ul > li > a.active, .sub-menu ul > li > a:hover {
28
+ color: #eeeeee;
29
+ }
30
+
31
+ .sub-menu ul > li ul {
32
+ background: #616161;
33
+ }
34
+
35
+ .card {
36
+ background: #424242;
37
+ }
38
+
39
+ #profile-main .pm-overview {
40
+ background: #757575;
41
+ border-right: 1px solid #757575;
42
+ }
43
+
44
+ .tab-nav {
45
+ box-shadow: inset 0 -2px 0 0 #616161;
46
+ }
47
+
48
+ .tab-nav li > a {
49
+ color: #9e9e9e;
50
+ }
51
+
52
+ .tab-nav li.active > a {
53
+ color: white;
54
+ }
55
+
56
+ .t-view .tv-header {
57
+ border-bottom: 1px solid #757575;
58
+ background: #616161;
59
+ }
60
+
61
+ .t-view {
62
+ border: 1px solid #757575;
63
+ }
64
+
65
+ .bgm-lightgray {
66
+ background: #757575 !Important;
67
+ }
68
+
69
+ h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
70
+ color: #fafafa;
71
+ }
72
+
73
+ .btn-default {
74
+ color: white;
75
+ background-color: #9e9e9e;
76
+ border-color: #cccccc;
77
+ }
78
+
79
+ .footer-text .text {
80
+ opacity: 0.8;
81
+ }
82
+
83
+ .block-header h2 {
84
+ color: #bdbdbd !Important;
85
+ }
86
+
87
+ #header .results, #header .results .card .card-header.ch-alt {
88
+ background: #424242 !Important;
89
+ }
90
+
91
+ #messages-main .ms-menu {
92
+ background: #757575;
93
+ border-right: 1px solid #757575;
94
+ }
95
+
96
+ .lvhs-input {
97
+ background: #424242;
98
+ border-bottom: 1px solid #757575;
99
+ }
100
+
101
+ .lvh-search {
102
+ background: #616161;
103
+ }
104
+
105
+ #messages-main .ms-menu .lv-item.active {
106
+ background: #616161;
107
+ }
108
+
109
+ #messages-main .ms-menu .lv-item:not(.active):hover {
110
+ background: #616161;
111
+ }
112
+
113
+ .chosen-container-multi .chosen-choices, .chosen-container-single .chosen-single {
114
+ border-bottom: 1px solid #616161 !Important;
115
+ }
116
+
117
+ .form-control, .pagination > li > a, .pagination > li > span {
118
+ background-color: transparent;
119
+ border: 1px solid #9e9e9e;
120
+ color: white;
121
+ }
122
+
123
+ .chosen-container .chosen-drop {
124
+ background: #757575;
125
+ }
126
+
127
+ .chosen-container .chosen-results {
128
+ color: white;
129
+ }
130
+
131
+ .chosen-container .chosen-results li.result-selected {
132
+ color: #bdbdbd;
133
+ }
134
+
135
+ .chosen-container .chosen-results li.highlighted {
136
+ color: #eeeeee;
137
+ }
138
+
139
+ .chosen-container-multi .chosen-choices li.search-choice {
140
+ background: #757575 !Important;
141
+ color: #bdbdbd !Important;
142
+ }
143
+
144
+ .chosen-container-single .chosen-search {
145
+ background: #9e9e9e;
146
+ }
147
+
148
+ .chosen-container-single .chosen-search {
149
+ -webkit-box-shadow: 0 1px 0 #757575 inset;
150
+ box-shadow: 0 1px 0 #757575 inset;
151
+ }
152
+
153
+ .chosen-container-single .chosen-single {
154
+ color: white;
155
+ }
156
+
157
+ .listview:not(.lv-message) .lv-title {
158
+ color: #eeeeee;
159
+ }
160
+
161
+ .listview a.lv-item:hover {
162
+ background: #757575;
163
+ }
164
+
165
+ .modal-content {
166
+ background-color: #424242;
167
+ }
168
+
169
+ .modal .modal-footer .btn-link {
170
+ color: white;
171
+ }
172
+
173
+ .modal:not([data-modal-color]) .modal-footer .btn-link:hover {
174
+ background-color: #9e9e9e;
175
+ }
176
+
177
+ .dropdown-menu {
178
+ background-color: #616161;
179
+ }
180
+
181
+ .lv-header {
182
+ border-bottom: 1px solid #424242;
183
+ color: white;
184
+ }
185
+
186
+ .lv-footer {
187
+ border-top: 1px solid #424242;
188
+ color: white;
189
+ }
190
+
191
+ .twitter-typeahead .tt-menu {
192
+ background: #757575;
193
+ }
194
+
195
+ .c-black {
196
+ color: white !Important;
197
+ }
198
+
199
+ .pt-inner .pti-header > h2 small {
200
+ border-left: 1px solid white !important;
201
+ }
202
+
203
+ .table-striped > tbody > tr:nth-of-type(odd) {
204
+ background-color: #757575;
205
+ }
206
+
207
+ .ct-label {
208
+ color: white;
209
+ }
210
+
211
+ .table {
212
+ background-color: #616161;
213
+ }
214
+
215
+ .table > thead > tr > th, .card-header h4 {
216
+ background-color: #424242;
217
+ color: white;
218
+ }
219
+
220
+ .listview:not(.lv-lg):not(.lv-message) .lv-item {
221
+ border-bottom: 1px solid #424242 !important;
222
+ }
223
+
224
+ .weekend {
225
+ background: #424242;
226
+ }
227
+
228
+ .table-hover > tbody > tr:hover {
229
+ background-color: #757575;
230
+ }
231
+
232
+ .listview.lv-bordered .lv-item:not(:last-child) {
233
+ border-bottom: 1px solid #757575;
234
+ }
235
+
236
+ .striped .row:nth-child(odd) {
237
+ background-color: #757575;
238
+ }
239
+
240
+ .striped .row:nth-child(even) {
241
+ background-color: #616161;
242
+ }
243
+
244
+ #notifications-list a.lv-item {
245
+ background-color: #616161 !important;
246
+ }
247
+
248
+ .hiring_semaphore div[status='pending'] {
249
+ background-color: #ff9800 !important
250
+ }
251
+
252
+ #best-selling {
253
+ background-color: #424242;
254
+ }
255
+
256
+ .role {
257
+ background-color: #424242 !Important;
258
+ }
259
+
260
+ .listview.lv-lg .lv-item:hover {
261
+ background-color: #243B53 !Important;
262
+ }
@@ -0,0 +1,121 @@
1
+
2
+ #header {
3
+ margin-top: 10px;
4
+ border-radius: 6px;
5
+ width: 95%;
6
+ left: 50%;
7
+ margin-left: -48%;
8
+ }
9
+
10
+ #sidebar {
11
+ overflow: visible;
12
+ margin-left: 2%;
13
+ margin-top: 30px;
14
+ border-radius: 6px;
15
+ overflow: hidden !Important;
16
+ height: auto;
17
+ max-height: calc(100% - 65px);
18
+ }
19
+
20
+ .card {
21
+ box-shadow: 0 0 5px 5px rgba(0, 0, 0, 0.03);
22
+ border-radius: 6px;
23
+ }
24
+
25
+ .card .tab-nav {
26
+ border-radius: 6px;
27
+ }
28
+
29
+
30
+ #profile-main {
31
+ background: none;
32
+ box-shadow: none;
33
+ }
34
+
35
+ @media (min-width: 1200px) {
36
+ #profile-main .pm-body {
37
+ padding-left: 220px;
38
+ }
39
+ }
40
+
41
+ @media (min-width: 768px) and (max-width: 1200px) {
42
+ #profile-main .pm-body {
43
+ padding-left: 220px;
44
+ }
45
+ }
46
+
47
+ @media (max-width: 767px) {
48
+ #profile-main .pm-body {
49
+ padding-left: 0;
50
+ }
51
+ }
52
+
53
+ #profile-main .pm-body .tab-nav {
54
+ box-shadow: 0 0 5px 5px rgba(0, 0, 0, 0.03);
55
+ border-radius: 6px;
56
+ margin-bottom: 10px;
57
+ }
58
+
59
+ #profile-main .pm-body .tab-content {
60
+ box-shadow: 0 0 5px 5px rgba(0, 0, 0, 0.03);
61
+ border-radius: 6px;
62
+ overflow: hidden;
63
+ }
64
+
65
+ #profile-main .pm-overview {
66
+ box-shadow: none;
67
+ border-radius: 6px;
68
+ background: none;
69
+ }
70
+
71
+ #profile-main .pmo-pic, #profile-main .pmo-block{
72
+ box-shadow: 0 0 5px 5px rgba(0, 0, 0, 0.03);
73
+ border-radius: 6px;
74
+ overflow: hidden;
75
+ margin-bottom: 10px;
76
+ }
77
+
78
+ #profile-main .pmo-contact {
79
+ margin-top: 10px;
80
+ }
81
+
82
+ .btn, .lv-item, .btn-group, .t-view, .tvb-stats li,
83
+ .footer-text .text, .t-view:before, .actions > li > a:before,
84
+ .actions > a:before, .pagination > li > a, .pagination > li > span,
85
+ .listview [class*="lv-img"], .profile-pic > img, .form-control,
86
+ #header input[type="text"], #header .results, .img-circle, .dropdown.open .dropdown-menu,
87
+ .modal .modal-content, .profile-view .pv-header > .pv-main, .pt-inner .pti-header, .ptih-title {
88
+ border-radius: 6px !Important;
89
+ }
90
+
91
+ .pagination > li > a, .pagination > li > span {
92
+ border: 0px;
93
+ width: 36px;
94
+ height: 35px;
95
+ line-height: 34px;
96
+ }
97
+
98
+ .form-control {
99
+ }
100
+
101
+ #loader {
102
+ top: 10px !Important;
103
+ left: 26px !Important;
104
+ }
105
+
106
+ .profile-pic > img {
107
+ border: 0px;
108
+ }
109
+
110
+ .profile-pic {
111
+ box-shadow: 0 0 5px 5px rgba(0, 0, 0, 0.03);
112
+ }
113
+
114
+ .results .card {
115
+ box-shadow: none;
116
+ }
117
+
118
+ .profile-view {
119
+ overflow: hidden;
120
+ }
121
+
@@ -0,0 +1,51 @@
1
+ -user_configuration = authenticated(User).user_configurations.last
2
+
3
+ .container
4
+ .block-header
5
+ h2
6
+ | Configuración
7
+
8
+ .card
9
+ form.card-body.card-padding action="/user/configuration" method="POST" data-toggle="validator"
10
+ .row
11
+ .col-xs-2
12
+ .pull-right
13
+ h5.c-gray Tema
14
+
15
+ .col-xs-4
16
+ == select_input({ :name => "css", :elements => [{ :text => "Default", :value => nil}, { :text => "Wieldy", :value => 'wieldy'}], :placeholder => "" , :chosen => user_configuration.nil?? nil : user_configuration.css })
17
+
18
+ .col-xs-6
19
+
20
+ .row
21
+ .col-xs-2
22
+ .pull-right
23
+ h5.c-gray Fuentes
24
+
25
+ .col-xs-4
26
+ -fonts = ['Roboto', 'Concert One','Lato','Montserrat', 'Nunito', 'Open Sans', 'Oswald', 'PT Sans', 'Quicksand', 'Raleway', 'Roboto', 'Rubik', 'Slabo 27px', 'Source Sans Pro', 'Ubuntu' ]
27
+ == select_input({ :name => "fonts", :elements => [{ :text => "Default", :value => nil} ] + fonts.collect { |font| { :text => font, :value => font } }, :placeholder => "" , :chosen => user_configuration.nil?? nil : user_configuration.fonts })
28
+
29
+ .col-xs-6
30
+
31
+ .row
32
+ .col-xs-2
33
+ .pull-right
34
+ h5.c-gray Darkmode
35
+
36
+ .col-xs-4
37
+ == radio_input({ :name => "dark_mode", :elements => [ { :name => "Deshabilitado", :value => 'disable'},{ :name => "Siempre", :value => 'always'},{ :name => "Habilitado", :value => 'enable'}], :filters => { 'dark_mode' => user_configuration.nil?? 'enable' : user_configuration.dark_mode }})
38
+
39
+ .col-xs-6
40
+
41
+ .footer-btn
42
+ button.btn.btn-float.bgm-green.m-btn.waves-effect.waves-circle.waves-float type="submit"
43
+ i.zmdi.zmdi-floppy
44
+ .footer-text
45
+ button.text.btn.bgm-white.c-gray type="submit" Guardar
46
+
47
+ css:
48
+ .radio-inline {
49
+ display: block;
50
+ margin-left: 0px !important;
51
+ }
@@ -0,0 +1,21 @@
1
+ link rel="preconnect" href="https://fonts.gstatic.com"
2
+
3
+ /https://fonts.google.com/specimen/Quicksand?selection.family=Concert+One|Lato:ital,wght@0,100;0,300;0,400;0,700;1,100;1,300;1,400;1,700|Montserrat:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;1,100;1,200;1,300;1,400;1,500;1,600;1,700|Nunito:ital,wght@0,200;0,300;0,400;0,600;0,700;1,200;1,300;1,400;1,600;1,700|Open+Sans:ital,wght@0,300;0,400;0,600;0,700;1,300;1,400;1,600;1,700|Oswald:wght@200;300;400;500;600;700|PT+Sans:ital,wght@0,400;0,700;1,400;1,700|Quicksand:wght@300;400;500;600;700|Raleway:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;1,100;1,200;1,300;1,400;1,500;1,600;1,700|Roboto:wght@100;400;500;700|Rubik:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500;1,600;1,700|Slabo+27px|Source+Sans+Pro:ital,wght@0,200;0,300;0,400;0,600;0,700;1,200;1,300;1,400;1,600;1,700|Ubuntu:ital,wght@0,300;0,400;0,500;0,700;1,300;1,400;1,500;1,700&sidebar.open=true
4
+
5
+ link href="https://fonts.googleapis.com/css2?family=Concert+One&family=Lato:ital,wght@0,100;0,300;0,400;0,700;1,100;1,300;1,400;1,700&family=Montserrat:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;1,100;1,200;1,300;1,400;1,500;1,600;1,700&family=Nunito:ital,wght@0,200;0,300;0,400;0,600;0,700;1,200;1,300;1,400;1,600;1,700&family=Open+Sans:ital,wght@0,300;0,400;0,600;0,700;1,300;1,400;1,600;1,700&family=Oswald:wght@200;300;400;500;600;700&family=PT+Sans:ital,wght@0,400;0,700;1,400;1,700&family=Quicksand:wght@300;400;500;600;700&family=Raleway:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;1,100;1,200;1,300;1,400;1,500;1,600;1,700&family=Roboto:wght@100;400;500;700&family=Rubik:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500;1,600;1,700&family=Slabo+27px&family=Source+Sans+Pro:ital,wght@0,200;0,300;0,400;0,600;0,700;1,200;1,300;1,400;1,600;1,700&family=Ubuntu:ital,wght@0,300;0,400;0,500;0,700;1,300;1,400;1,500;1,700&display=swap" rel="stylesheet"
6
+
7
+ -user_configuration = authenticated(User).user_configurations.last
8
+ -unless user_configuration.nil?
9
+
10
+ -unless user_configuration.css.blank?
11
+ link href="/css/#{user_configuration.css}.css?version=#{settings.version}" rel="stylesheet"
12
+
13
+ -unless user_configuration.fonts.blank?
14
+ css:
15
+ body {
16
+ font-family: "#{user_configuration.fonts}", sans-serif !important;
17
+ }
18
+
19
+ -if ((user_configuration.dark_mode == 'enable') && Time.now.hour > 16) || user_configuration.dark_mode == 'always'
20
+ link href="/css/darkmode.css?version=#{settings.version}" rel="stylesheet"
21
+
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sinatra-hexacta
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.5
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marco Zanger
@@ -90,6 +90,7 @@ files:
90
90
  - lib/sinatra/handlers/params.rb
91
91
  - lib/sinatra/handlers/processes.rb
92
92
  - lib/sinatra/handlers/reports.rb
93
+ - lib/sinatra/handlers/user_configurations.rb
93
94
  - lib/sinatra/helpers/alerts.rb
94
95
  - lib/sinatra/helpers/cas.rb
95
96
  - lib/sinatra/helpers/charts.rb
@@ -99,10 +100,13 @@ files:
99
100
  - lib/sinatra/helpers/menu.rb
100
101
  - lib/sinatra/helpers/reports.rb
101
102
  - lib/sinatra/helpers/schedule.rb
103
+ - lib/sinatra/helpers/user_configurations.rb
102
104
  - lib/sinatra/hexacta.rb
103
105
  - lib/sinatra/public/css/app.min.1.css
104
106
  - lib/sinatra/public/css/app.min.2.css
107
+ - lib/sinatra/public/css/darkmode.css
105
108
  - lib/sinatra/public/css/shell.css
109
+ - lib/sinatra/public/css/wieldy.css
106
110
  - lib/sinatra/public/fonts/montserrat/Montserrat-Black.otf
107
111
  - lib/sinatra/public/fonts/montserrat/Montserrat-ExtraLight.otf
108
112
  - lib/sinatra/public/fonts/montserrat/Montserrat-Light.otf
@@ -127,10 +131,11 @@ files:
127
131
  - lib/sinatra/public/fonts/roboto/Roboto-Thin-webfont.svg
128
132
  - lib/sinatra/public/fonts/roboto/Roboto-Thin-webfont.ttf
129
133
  - lib/sinatra/public/fonts/roboto/Roboto-Thin-webfont.woff
130
- - lib/sinatra/public/img/finder.jpg
134
+ - lib/sinatra/public/img/finder.png
131
135
  - lib/sinatra/public/img/noimage.jpg
132
136
  - lib/sinatra/public/img/select.png
133
137
  - lib/sinatra/public/img/select@2x.png
138
+ - lib/sinatra/public/img/teams.png
134
139
  - lib/sinatra/public/js/app.js
135
140
  - lib/sinatra/public/js/finder.js
136
141
  - lib/sinatra/public/js/process.js
@@ -219,6 +224,8 @@ files:
219
224
  - lib/sinatra/views/reports/pick_dates.slim
220
225
  - lib/sinatra/views/reports/pick_month.slim
221
226
  - lib/sinatra/views/reports/pick_year.slim
227
+ - lib/sinatra/views/user_configurations/edit.slim
228
+ - lib/sinatra/views/user_configurations/include.slim
222
229
  homepage: https://rubygems.org/gems/sinatra-hexacta
223
230
  licenses:
224
231
  - MIT