sinatra-hexacta 1.4.4 → 1.5.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sinatra/handlers/constants.rb +1 -1
- data/lib/sinatra/handlers/errors.rb +1 -1
- data/lib/sinatra/handlers/reports.rb +1 -1
- data/lib/sinatra/helpers/cas.rb +1 -1
- data/lib/sinatra/public/js/app.js +26 -10
- data/lib/sinatra/public/vendors/bootstrap-validator/validator.js +16 -2
- data/lib/sinatra/views/notifications.slim +3 -3
- data/lib/sinatra/views/notifications/view.slim +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d436b67b99f2e22625502a87ab2b868f0d22553ca1dc733ff7bbcbe51afc018a
|
4
|
+
data.tar.gz: bf9b4ea91736f8b2d3ae1c9cb1400d3cbb3cc53b6516a12352d306b82f866a15
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c53eac3ff50f3851fbb4d5e7165f39bd8db517e517b92c47225ecaac7f382f26ffaa3789adc2c0b6e500f2209154b8b97fe253168f983e654b1dc636a20f9a30
|
7
|
+
data.tar.gz: 0be9f14b04525f8e5ff56b2894941f1f48e81a3b6b1c2e050f63599a6351f9ecd472a2bce0b867407a792a15e0d2dfd36f78010afa5e2a7bc254a28196e623f6
|
@@ -9,7 +9,7 @@ module Sinatra
|
|
9
9
|
ConstantHandler.copy_all_files("/lib/sinatra/views/constants","/app/views/#{Hexacta::GEM_FILE_DIR}/constants")
|
10
10
|
|
11
11
|
before '/constant*' do
|
12
|
-
error(403)
|
12
|
+
error(403) unless authenticated(User).admin?
|
13
13
|
end
|
14
14
|
|
15
15
|
get '/constants' do
|
@@ -23,7 +23,7 @@ module Sinatra
|
|
23
23
|
ErrorHandler.copy_file("/lib/sinatra/views/errors/#{template_code}.slim","/app/views/#{Hexacta::GEM_FILE_DIR}/errors/#{template_code}.slim")
|
24
24
|
error code do
|
25
25
|
if code == 500
|
26
|
-
title = env['sinatra.error'].message
|
26
|
+
title = env['sinatra.error'].message
|
27
27
|
message = (["in #{request.url}"] + env['sinatra.error'].backtrace).join(',');
|
28
28
|
NotificationSender.instance.send_error(authenticated(User),title,message)
|
29
29
|
end
|
data/lib/sinatra/helpers/cas.rb
CHANGED
@@ -82,7 +82,7 @@ module Sinatra
|
|
82
82
|
if logged_in?(request, session)
|
83
83
|
url = CAS_CLIENT.logout_url()
|
84
84
|
session.clear
|
85
|
-
str = request.referer
|
85
|
+
str = request.referer || ''
|
86
86
|
comeback = "=" + (str.include?("?")? str.slice(0..(str.index('?')-1)) : str) #Hack mal!
|
87
87
|
redirect url + (url.include?("?service")? "" : "?service") + comeback
|
88
88
|
end
|
@@ -5,7 +5,25 @@ if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(naviga
|
|
5
5
|
$('html').addClass('ismobile');
|
6
6
|
}
|
7
7
|
|
8
|
+
// create a new instance of `MutationObserver` named `observer`,
|
9
|
+
// passing it a callback function
|
10
|
+
const observer = new MutationObserver(function() {
|
11
|
+
update_html_elements();
|
12
|
+
});
|
13
|
+
|
8
14
|
$(document).ready(function(){
|
15
|
+
/*
|
16
|
+
* Waves Animation
|
17
|
+
*/
|
18
|
+
(function(){
|
19
|
+
Waves.attach('.btn:not(.btn-icon):not(.btn-float)');
|
20
|
+
Waves.attach('.btn-icon, .btn-float', ['waves-circle', 'waves-float']);
|
21
|
+
Waves.init();
|
22
|
+
})();
|
23
|
+
update_html_elements();
|
24
|
+
});
|
25
|
+
|
26
|
+
function update_html_elements() {
|
9
27
|
|
10
28
|
// Fix modal inside other components
|
11
29
|
$('.modal').appendTo("body");
|
@@ -340,15 +358,6 @@ $(document).ready(function(){
|
|
340
358
|
});
|
341
359
|
}
|
342
360
|
|
343
|
-
/*
|
344
|
-
* Waves Animation
|
345
|
-
*/
|
346
|
-
(function(){
|
347
|
-
Waves.attach('.btn:not(.btn-icon):not(.btn-float)');
|
348
|
-
Waves.attach('.btn-icon, .btn-float', ['waves-circle', 'waves-float']);
|
349
|
-
Waves.init();
|
350
|
-
})();
|
351
|
-
|
352
361
|
/*
|
353
362
|
* Lightbox
|
354
363
|
*/
|
@@ -499,7 +508,14 @@ $(document).ready(function(){
|
|
499
508
|
$(this).find(':submit').attr("disabled",false);
|
500
509
|
});
|
501
510
|
|
502
|
-
}
|
511
|
+
}
|
512
|
+
|
513
|
+
const elementToObserve = document.querySelector("body");
|
514
|
+
|
515
|
+
if (elementToObserve != null) {
|
516
|
+
observer.observe(elementToObserve, {subtree: true, childList: true});
|
517
|
+
}
|
518
|
+
|
503
519
|
|
504
520
|
function start_load() {
|
505
521
|
if (!$("#loader")[0]) {
|
@@ -394,12 +394,26 @@
|
|
394
394
|
|
395
395
|
// VALIDATOR DATA-API
|
396
396
|
// ==================
|
397
|
+
const elementToObserve = document.querySelector("body");
|
397
398
|
|
398
|
-
|
399
|
+
// create a new instance of `MutationObserver` named `observer`,
|
400
|
+
// passing it a callback function
|
401
|
+
const observer = new MutationObserver(function() {
|
399
402
|
$('form[data-toggle="validator"]').each(function () {
|
400
403
|
var $form = $(this)
|
401
404
|
Plugin.call($form, $form.data())
|
402
405
|
})
|
403
|
-
})
|
406
|
+
});
|
407
|
+
|
408
|
+
// call `observe()` on that MutationObserver instance,
|
409
|
+
// passing it the element to observe, and the options object
|
410
|
+
observer.observe(elementToObserve, {subtree: true, childList: true});
|
411
|
+
|
412
|
+
//$(window).on('load', function () {
|
413
|
+
// $('form[data-toggle="validator"]').each(function () {
|
414
|
+
// var $form = $(this)
|
415
|
+
// Plugin.call($form, $form.data())
|
416
|
+
// })
|
417
|
+
//})
|
404
418
|
|
405
419
|
}(jQuery);
|
@@ -45,7 +45,7 @@
|
|
45
45
|
-total_pending = Notification.pending.for(authenticated(User)).exclude_message.count
|
46
46
|
|
47
47
|
.footer-btn
|
48
|
-
-
|
48
|
+
-if authenticated(User).admin?
|
49
49
|
a.btn.btn-float.bgm-blue.m-btn.waves-effect.waves-circle.waves-float data-toggle="modal" data-target="#new-notification"
|
50
50
|
i.zmdi.zmdi-notifications-active
|
51
51
|
-if total_pending > 0
|
@@ -55,13 +55,13 @@
|
|
55
55
|
i.zmdi.zmdi-delete
|
56
56
|
|
57
57
|
.footer-text
|
58
|
-
-
|
58
|
+
-if authenticated(User).admin?
|
59
59
|
a.text.btn.bgm-white.c-gray data-toggle="modal" data-target="#new-notification" Nueva notificación
|
60
60
|
-if total_pending > 0
|
61
61
|
a.text.btn.bgm-white.c-gray onclick="read_all_notifications(#{{Notification.pending.for(authenticated(User)).exclude_message.all.collect { |notification| notification.id}}});this.onclick='';" Marcar como leidas
|
62
62
|
a.text.btn.bgm-white.c-gray.delete-notifications.hidden.animated.bounceIn onclick="delete_all_notifications();this.onclick='';" Borrar notificaciones
|
63
63
|
|
64
|
-
-
|
64
|
+
-if authenticated(User).admin?
|
65
65
|
== slim :'sinatra-hexacta/notifications/new'
|
66
66
|
|
67
67
|
javascript:
|
@@ -48,7 +48,7 @@
|
|
48
48
|
.media-body
|
49
49
|
.lv-title Fecha de lectura
|
50
50
|
small.lv-small #{notification.read_date.display}
|
51
|
-
-
|
51
|
+
-if authenticated(User).superadmin?
|
52
52
|
a.lv-item
|
53
53
|
.media
|
54
54
|
.media-body
|
metadata
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sinatra-hexacta
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.5.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marco Zanger
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
date: 2021-05-07 00:00:00.000000000 Z
|
@@ -250,7 +250,7 @@ homepage: https://rubygems.org/gems/sinatra-hexacta
|
|
250
250
|
licenses:
|
251
251
|
- MIT
|
252
252
|
metadata: {}
|
253
|
-
post_install_message:
|
253
|
+
post_install_message:
|
254
254
|
rdoc_options: []
|
255
255
|
require_paths:
|
256
256
|
- lib
|
@@ -266,7 +266,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
266
266
|
version: '0'
|
267
267
|
requirements: []
|
268
268
|
rubygems_version: 3.0.6
|
269
|
-
signing_key:
|
269
|
+
signing_key:
|
270
270
|
specification_version: 4
|
271
271
|
summary: Hexacta general tools!
|
272
272
|
test_files: []
|