-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbatch_actions.html
79 lines (66 loc) · 2.84 KB
/
batch_actions.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<cms:capture into='my_batch_actions' >
<div class='row'>
<div class='col-xs-4'>
<div class="form-group">
<select name="sel-bulk-action" id="sel-bulk-action" class="form-control">
<option value="-" selected="selected">Bulk action with selected</option>
<cms:admin_actions childof='batch'>
<option value="<cms:show k_action_name />"><cms:show k_action_title /></option>
<cms:set has_batch_action='1' 'global' />
</cms:admin_actions>
</select>
</div>
</div>
<div class='col-xs-3'>
<a class="btn btn-app inline-app" id="btn_bulk_submit" href="#">
<i class="btn-icon"><cms:show_icon 'check' /></i>
Apply
</a>
</div>
</div>
</cms:capture>
<cms:if has_batch_action>
<cms:show my_batch_actions />
<cms:admin_add_js>
$(function(){
$('#btn_bulk_submit').on('click', function(e){
bulk_val = $('#sel-bulk-action').val();
if( bulk_val === "-" ) return false;
var col = $( ".page-selector:checked" ).not( ":disabled" );
if( !col.length ) return false;
for( var x=0; x<col.length; x++ ){
switch( bulk_val ){
<cms:admin_actions childof='batch'>
<cms:capture into='my_code'>
<cms:if k_action_is_custom >
<cms:if k_action_render>
<cms:render k_action_render />
<cms:else />
<cms:show k_action_html />
</cms:if>
<cms:else />
$('body').css('cursor', 'wait');
var form = $('#<cms:show k_cur_form />');
form.find('#k_bulk_action').val('<cms:show k_action_name />');
form.submit();
</cms:if>
</cms:capture>
case '<cms:show k_action_name />':
<cms:if k_action_confirmation_msg >
var msg = "<cms:addslashes><cms:show k_action_confirmation_msg /></cms:addslashes>";
if( confirm(msg) ){
<cms:show my_code />
}
<cms:else />
<cms:show my_code />
</cms:if>
break;
</cms:admin_actions>
}
return false;
}
return false;
});
});
</cms:admin_add_js>
</cms:if>