sinatra-hexacta 1.7.18 → 1.7.20
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ecde3cc838d34406b7de3616f0edf10e218901fddf8f55ed31e009bdb7cc136a
|
4
|
+
data.tar.gz: b4230c3af3f043fd7d51cdfcf606ee4f33366fdd50837a0492b9fb3a7e5cdcc0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3ca2a215abe86c3334b0b9bfbba929e6def9ad46dabc008bcfad5b49465fcfb10cb24c142fe773fdf87db1e2ecf28058c0ea74c1ce4ef46cc61f038af6efcf36
|
7
|
+
data.tar.gz: 296bc5fcdb94ae70ccfe642a88b798f636b59799a406aeb62633f592370fac15788c8b0937cc1f0d3c57243a4fc911c34d63539602e846425e3e74d6ee8afb69
|
@@ -37,7 +37,9 @@ module Sinatra
|
|
37
37
|
end
|
38
38
|
|
39
39
|
delete '/notifications/:id' do |id|
|
40
|
-
Notification.find(:user_id => authenticated(User).id, :id => id)
|
40
|
+
notification = Notification.find(:user_id => authenticated(User).id, :id => id)
|
41
|
+
error(404) if notification.nil?
|
42
|
+
notification.destroy.to_hash.to_json.to_s
|
41
43
|
end
|
42
44
|
|
43
45
|
delete '/notifications' do
|
@@ -60,11 +60,16 @@ module Sinatra
|
|
60
60
|
end
|
61
61
|
|
62
62
|
get '/reports/:report_name' do |report_name|
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
"Content-
|
67
|
-
|
63
|
+
begin
|
64
|
+
date = Date.parse(params[:date]) unless params[:date].nil?
|
65
|
+
date ||= Date.today
|
66
|
+
headers "Content-Disposition" => "attachment;filename=#{report_name}.#{date}.xls",
|
67
|
+
"Content-Type" => "application/octet-stream"
|
68
|
+
slim "reports/#{report_name}".to_sym, locals: { :date => date }, :stream => true, :layout => false
|
69
|
+
rescue Exception => e
|
70
|
+
NotificationSender.instance.send_error(authenticated(User),e.message,e.backtrace.join('\n'))
|
71
|
+
halt 400, e.message
|
72
|
+
end
|
68
73
|
end
|
69
74
|
end
|
70
75
|
|
@@ -192,6 +192,13 @@ function update_html_elements() {
|
|
192
192
|
e.stopPropagation();
|
193
193
|
});
|
194
194
|
|
195
|
+
$('.dropdown-menu').click(function(e) {
|
196
|
+
e.stopPropagation();
|
197
|
+
if ($(e.target).is('[data-toggle=modal]')) {
|
198
|
+
$($(e.target).data('target')).modal()
|
199
|
+
}
|
200
|
+
});
|
201
|
+
|
195
202
|
$('.dropdown').on('shown.bs.dropdown', function (e) {
|
196
203
|
if($(this).attr('data-animation')) {
|
197
204
|
$animArray = [];
|