manage 1.3.17 → 1.3.18
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cbf1333fe8d95a22e52efbeb8fdd8d94aa6c9929
|
4
|
+
data.tar.gz: dd7f64df279e0c6b72b829d0353828a0e1aa4d47
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 77e331d86392ffbee92787ee73157a7ff282440902049b5bf386e6fd63af2d1253577b9071e88f05232e5e3ecee2b12d0517deb1ef2ff4b084eac50c22920db5
|
7
|
+
data.tar.gz: f95544838d8d9ec9cb4515eb5f405271ded04e7651e532031a7974a00a5aa35f81dfff14827ddc1d6cad51d7faefa6158cba67462168c0a6c4e111d155090306
|
data/README.rdoc
CHANGED
@@ -42,7 +42,7 @@ Create controller in your application yourapp/app/controllers/manage/cities_cont
|
|
42
42
|
# optional
|
43
43
|
def collection_actions collection
|
44
44
|
[
|
45
|
-
view_context.
|
45
|
+
view_context.button_to(t('manage.views.winners.export_as_bank_file'), [:export_as_bank_file, resource_class], method: :post, data: {handler: 'CollectionActions'}, class: 'button')
|
46
46
|
].join('').html_safe
|
47
47
|
end
|
48
48
|
|
@@ -2,27 +2,29 @@ class CollectionActions
|
|
2
2
|
constructor: (el) ->
|
3
3
|
$el = $(el)
|
4
4
|
|
5
|
-
$el.
|
5
|
+
$form = $el.closest('form')
|
6
|
+
|
7
|
+
$el.on 'click', (e) ->
|
6
8
|
e.stopPropagation()
|
7
9
|
e.preventDefault()
|
8
10
|
|
9
|
-
|
10
|
-
|
11
|
+
checkedCheckboxes = $('.rs:checked')
|
12
|
+
unless checkedCheckboxes.length
|
13
|
+
alert 'Select Items'
|
14
|
+
return false
|
15
|
+
|
16
|
+
# clear all hidden fields with class .hidden_selected_ids
|
17
|
+
$form.find('input[type="hidden"]').remove()
|
11
18
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
19
|
+
checkedCheckboxes.each ->
|
20
|
+
# create a new hidden
|
21
|
+
hidden_input = $('<input>').attr({
|
22
|
+
type: 'hidden',
|
23
|
+
name: 'selected_ids[]',
|
24
|
+
value: $(@).val()
|
25
|
+
}).appendTo($form)
|
16
26
|
|
17
|
-
|
18
|
-
alert 'Няма направвен избор'
|
19
|
-
return false
|
27
|
+
$form.submit()
|
20
28
|
|
21
|
-
$.ajax(
|
22
|
-
url: url
|
23
|
-
type: requestType
|
24
|
-
data: { selected_ids: dataParams }
|
25
|
-
).fail ->
|
26
|
-
alert('Възникна грешка')
|
27
29
|
|
28
30
|
Handlers.register 'CollectionActions', CollectionActions
|
data/lib/manage/version.rb
CHANGED