egov_utils 0.5.2 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/views/common/_grid.html.coffee +13 -0
- data/lib/egov_utils/version.rb +1 -1
- 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: 2dea4fb2c51dec77f9cf9c497124b654263c6bcca1a6d407b7df8967d2d996ca
|
4
|
+
data.tar.gz: b600a26f595cbf04e750fdbfbe54cd68aafbc02187b57af58b0ad47a960e0192
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5b8ae83c1052f8a9b8a96959240b7422b304d26981c933ab1a935970780e824e1045931270c9a090e9ce8afd9421e2246fb2ae563ca4a6eaba348f2f6d0302db
|
7
|
+
data.tar.gz: fe5c7cf049accc507c2f0caa718fbf10db566942d281b6790e8513d033eeb7c78eef2fc3ee21b98d4021f997a6bc35db2042a8965840e501124338d193c1756c
|
@@ -19,6 +19,14 @@ $ ->
|
|
19
19
|
item = grid.dataItem(index)
|
20
20
|
$.ajax('<%= polymorphic_path(schema.model) %>/'+item.id+'/edit.js')
|
21
21
|
|
22
|
+
prepareDownload = (format) ->
|
23
|
+
return (index) -> downloadRecord(format, index)
|
24
|
+
|
25
|
+
downloadRecord = (format, index) ->
|
26
|
+
grid = $("#<%= grid_id %>").swidget()
|
27
|
+
item = grid.dataItem(index)
|
28
|
+
window.location.href = '<%= polymorphic_path(schema.model) %>/'+item.id+'.'+format
|
29
|
+
|
22
30
|
<% if local_assigns[:detail_for] %>
|
23
31
|
<% detail_col = schema.column(detail_for) %>
|
24
32
|
detailCreated = (evt)->
|
@@ -95,6 +103,11 @@ $ ->
|
|
95
103
|
width: 150
|
96
104
|
title: "<%= t('label_actions') %>"
|
97
105
|
buttons: [
|
106
|
+
<% if can?(:read, schema.model) %>
|
107
|
+
<% local_assigns.fetch(:downloads, {}).each do |format, label| %>
|
108
|
+
{ cls: 'btn btn-sm btn-secondary', caption: '<%= label %>', click: prepareDownload('<%= format %>') },
|
109
|
+
<% end %>
|
110
|
+
<% end %>
|
98
111
|
<% if can?(:update, schema.model) %>
|
99
112
|
{cls: 'btn btn-sm btn-primary', caption: '<%= t('label_edit') %>', click: editRecord},
|
100
113
|
<% end %>
|
data/lib/egov_utils/version.rb
CHANGED