sinatra-hexacta 1.5.0 → 1.6.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 +4 -4
- data/lib/sinatra/handlers/errors.rb +1 -1
- data/lib/sinatra/helpers/cas.rb +1 -1
- data/lib/sinatra/public/js/app.js +21 -59
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4a9dc56be12a60357e82d8279807d2553afc0ad376e430bcfbdf18efc49b74ca
|
4
|
+
data.tar.gz: 2bb9c311849b822ccbc6f36a92c3d989bf36a8a851df97793d01e91d7cafab67
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2d2d8812917f8d26437c9b461b7fe59ae7685922075e2cb29be86d7f3b684c5894c563162a86d915898d97075e861956acc9af8b43a3d17c1a240f401789dec0
|
7
|
+
data.tar.gz: c99a0226bf62c3b1408e4936197b3570e39ea5596a4b53b1fc3184fb519ce4a02397bc52c89eba104d1fabfc090158fe608ba46df5da479095a0e0dbecc05ee8
|
@@ -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
|
@@ -20,10 +20,28 @@ $(document).ready(function(){
|
|
20
20
|
Waves.attach('.btn-icon, .btn-float', ['waves-circle', 'waves-float']);
|
21
21
|
Waves.init();
|
22
22
|
})();
|
23
|
+
update_html_elements();
|
23
24
|
});
|
24
25
|
|
25
26
|
function update_html_elements() {
|
26
27
|
|
28
|
+
$("form.async").submit(function(e){
|
29
|
+
e.preventDefault();
|
30
|
+
var datastring = $(this).serialize();
|
31
|
+
var url = $(this).attr('action');
|
32
|
+
$(this).closest('.modal').modal('hide');
|
33
|
+
$('body').append('<div aria-labelledby="loading" class="modal bounceIn animated" id="loading-modal" role="dialog" tabindex="-1" data-backdrop="static" data-keyboard="false"><div class="modal-dialog modal-sm" style="width:150px !Important;"><div class="modal-content"><div class="modal-body p-20 text-center"><div class="preloader pl-lg"><svg class="pl-circular" viewBox="25 25 50 50"><circle class="plc-path" cx="50" cy="50" r="20"></circle></svg></div></div><div class="modal-footer" style="text-align: center !Important;"><div class="btn btn-link waves-effect c-gray">Espere...</div></div></div></div></div>');
|
34
|
+
$('#loading-modal').modal('show');
|
35
|
+
$.ajax({
|
36
|
+
type: "POST",
|
37
|
+
url: url,
|
38
|
+
data: datastring,
|
39
|
+
success: function(data) {
|
40
|
+
location.reload();
|
41
|
+
}
|
42
|
+
});
|
43
|
+
});
|
44
|
+
|
27
45
|
// Fix modal inside other components
|
28
46
|
$('.modal').appendTo("body");
|
29
47
|
|
@@ -537,76 +555,20 @@ $( document ).ajaxStop(function() {
|
|
537
555
|
stop_load();
|
538
556
|
});
|
539
557
|
|
540
|
-
function rm(url) {
|
541
|
-
disableButtons();
|
542
|
-
if (confirm('¿Estás seguro que deseas realizar esta operación?')) {
|
543
|
-
$.ajax({
|
544
|
-
url: url,
|
545
|
-
type: 'DELETE',
|
546
|
-
done: function(result) {
|
547
|
-
location.reload();
|
548
|
-
},
|
549
|
-
success: function(result) {
|
550
|
-
location.reload();
|
551
|
-
},
|
552
|
-
error: function(error) {
|
553
|
-
alert("Ha ocurrido un error, intentalo nuevamente!");
|
554
|
-
enableButtons();
|
555
|
-
}
|
556
|
-
});
|
557
|
-
} else {
|
558
|
-
enableButtons();
|
559
|
-
}
|
560
|
-
}
|
561
|
-
|
562
558
|
|
563
559
|
function rm_object(object,id) {
|
564
|
-
|
560
|
+
$(".modal").modal('hide');
|
561
|
+
$('body').append('<div aria-labelledby="loading" class="modal bounceIn animated" id="loading-modal" role="dialog" tabindex="-1" data-backdrop="static" data-keyboard="false"><div class="modal-dialog modal-sm" style="width:150px !Important;"><div class="modal-content"><div class="modal-body p-20 text-center"><div class="preloader pl-lg"><svg class="pl-circular" viewBox="25 25 50 50"><circle class="plc-path" cx="50" cy="50" r="20"></circle></svg></div></div><div class="modal-footer" style="text-align: center !Important;"><div class="btn btn-link waves-effect c-gray">Espere...</div></div></div></div></div>');
|
562
|
+
$('#loading-modal').modal('show');
|
565
563
|
$.ajax({
|
566
564
|
url: '/' + object + '/' + id,
|
567
565
|
type: 'DELETE',
|
568
|
-
data: {},
|
569
566
|
success: function(result) {
|
570
567
|
location.reload();
|
571
568
|
}
|
572
569
|
});
|
573
570
|
}
|
574
571
|
|
575
|
-
function post(url) {
|
576
|
-
disableButtons();
|
577
|
-
if (confirm('¿Estás seguro que deseas realizar esta operación?')) {
|
578
|
-
$.ajax({
|
579
|
-
url: url,
|
580
|
-
type: 'POST',
|
581
|
-
done: function(result) {
|
582
|
-
location.reload();
|
583
|
-
},
|
584
|
-
success: function(result) {
|
585
|
-
location.reload();
|
586
|
-
},
|
587
|
-
error: function(error) {
|
588
|
-
alert("Ha ocurrido un error, intentalo nuevamente!");
|
589
|
-
enableButtons();
|
590
|
-
}
|
591
|
-
});
|
592
|
-
} else {
|
593
|
-
enableButtons();
|
594
|
-
}
|
595
|
-
}
|
596
|
-
|
597
|
-
function disableButtons() {
|
598
|
-
$(".btn").each(function() {
|
599
|
-
$(this).data("temp",$(this).val());
|
600
|
-
$(this).attr("disabled",true);
|
601
|
-
});
|
602
|
-
return true
|
603
|
-
}
|
604
|
-
function enableButtons() {
|
605
|
-
$(".btn").each(function() {
|
606
|
-
$(this).attr("disabled",false);
|
607
|
-
});
|
608
|
-
return true
|
609
|
-
}
|
610
572
|
(function( $ ){
|
611
573
|
$.fn.disableSelect = function() {
|
612
574
|
$(this).prop("disabled", true);
|