Lines 105-125
Link Here
|
105 |
[% END # / TAGLOOP%] |
105 |
[% END # / TAGLOOP%] |
106 |
[% IF ( add_op ) %] |
106 |
[% IF ( add_op ) %] |
107 |
[% IF ( added_count ) %] |
107 |
[% IF ( added_count ) %] |
108 |
<div class="dialog message">[% added_count %] [% IF ( added_count ==1 ) %] tag[% ELSE %]tags[% END %] successfully added.</div> |
108 |
<div class="dialog message">[% added_count %] [% IF ( added_count == 1 ) %]tag[% ELSE %]tags[% END %] successfully added.</div> |
109 |
[% END %] |
109 |
[% END %] |
110 |
[% IF ( deleted_count ) %] |
110 |
[% IF ( deleted_count ) %] |
111 |
<div class="dialog message">[% deleted_count %][% IF ( deleted_count ==1 ) %] tag[% ELSE %]tags[% END %] successfully deleted.</div> |
111 |
<div class="dialog message">[% deleted_count %] [% IF ( deleted_count == 1 ) %]tag[% ELSE %]tags[% END %] successfully deleted.</div> |
112 |
[% END %] |
112 |
[% END %] |
113 |
[% END # /add_op %] |
113 |
[% END # /add_op %] |
114 |
|
114 |
|
115 |
[% IF ( MY_TAGS ) %] |
115 |
[% IF ( MY_TAGS ) %] |
116 |
<form method="post" action="opac-tags.pl"> |
116 |
<form id="deletetags" method="post" action="opac-tags.pl"> |
117 |
<h2>Your tags</h2> |
117 |
<h2>Your tags</h2> |
118 |
<table id="mytagst" class="table table-bordered table-striped"> |
118 |
<table id="mytagst" class="table table-bordered table-striped"> |
119 |
<thead><tr><th>Term</th><th>Title</th><th>Date added</th><th>Delete</th></tr></thead> |
119 |
<thead><tr><th> </th><th>Term</th><th>Title</th><th>Date added</th></tr></thead> |
120 |
<tbody> |
120 |
<tbody> |
121 |
[% FOREACH MY_TAG IN MY_TAGS %] |
121 |
[% FOREACH MY_TAG IN MY_TAGS %] |
122 |
<tr> |
122 |
<tr> |
|
|
123 |
<td> |
124 |
<input type="checkbox" name="del[% MY_TAG.tag_id %]" value="del[% MY_TAG.tag_id %]"> |
125 |
</td> |
123 |
<td class="tagterm"> |
126 |
<td class="tagterm"> |
124 |
<span class="tdlabel">Tag:</span> |
127 |
<span class="tdlabel">Tag:</span> |
125 |
[% IF MY_TAG.approved == 1 %] |
128 |
[% IF MY_TAG.approved == 1 %] |
Lines 128-134
Link Here
|
128 |
[% MY_TAG.term |html %] (not approved) |
131 |
[% MY_TAG.term |html %] (not approved) |
129 |
[% END %] |
132 |
[% END %] |
130 |
</td> |
133 |
</td> |
131 |
|
|
|
132 |
<td> |
134 |
<td> |
133 |
[% IF ( MY_TAG.XSLTBloc ) %] |
135 |
[% IF ( MY_TAG.XSLTBloc ) %] |
134 |
[% MY_TAG.XSLTBloc %] |
136 |
[% MY_TAG.XSLTBloc %] |
Lines 153-163
Link Here
|
153 |
[% MY_TAG.date_created | $KohaDates %] |
155 |
[% MY_TAG.date_created | $KohaDates %] |
154 |
</span> |
156 |
</span> |
155 |
</td> |
157 |
</td> |
156 |
<td><input type="submit" name="del[% MY_TAG.tag_id %]" value="Delete" class="btn btn-danger btn-mini delete" /></td> |
|
|
157 |
</tr> |
158 |
</tr> |
158 |
[% END %] |
159 |
[% END %] |
159 |
</tbody> |
160 |
</tbody> |
160 |
</table> |
161 |
</table> |
|
|
162 |
<input type="submit" value="Delete selected tags" class="btn btn-danger btn-sm delete"> |
161 |
</form> |
163 |
</form> |
162 |
[% END # /MY_TAGS %] |
164 |
[% END # /MY_TAGS %] |
163 |
</div> <!-- / .usertags --> |
165 |
</div> <!-- / .usertags --> |
Lines 171-187
Link Here
|
171 |
[% INCLUDE 'datatables.inc' %] |
173 |
[% INCLUDE 'datatables.inc' %] |
172 |
<script type="text/javascript"> |
174 |
<script type="text/javascript"> |
173 |
//<![CDATA[ |
175 |
//<![CDATA[ |
|
|
176 |
function checkboxesChecked() { |
177 |
if ($("#deletetags input:checkbox:checked").length > 0) { |
178 |
return 1; |
179 |
} else { |
180 |
return 0; |
181 |
} |
182 |
} |
174 |
|
183 |
|
175 |
$(document).ready(function(){ |
184 |
$(document).ready(function(){ |
176 |
var MSG_DELETE_TAG = _("Are you sure you want to delete this tag?"); |
185 |
var MSG_DELETE_TAG = _("Are you sure you want to delete the selected tag(s)?"); |
177 |
$(".delete").on("click", function(){ |
186 |
$(".delete").on("click", function(e){ |
178 |
return confirmDelete(MSG_DELETE_TAG); |
187 |
if ( checkboxesChecked() == 1 ) { |
|
|
188 |
return confirmDelete(MSG_DELETE_TAG); |
189 |
} else { |
190 |
alert(_("Please select a tag to delete.")); |
191 |
e.preventDefault(); |
192 |
} |
179 |
}); |
193 |
}); |
180 |
|
194 |
|
181 |
$("#mytagst").dataTable($.extend(true, {}, dataTablesDefaults, { |
195 |
$("#mytagst").dataTable($.extend(true, {}, dataTablesDefaults, { |
182 |
"aaSorting": [[ 2, "asc" ]], |
196 |
"aaSorting": [[ 2, "asc" ]], |
183 |
"aoColumnDefs": [ |
197 |
"aoColumnDefs": [ |
184 |
{ "aTargets": [ -1 ], "bSortable": false, "bSearchable": false } |
198 |
{ "aTargets": [ 0 ], "bSortable": false, "bSearchable": false } |
185 |
], |
199 |
], |
186 |
"aoColumns": [ |
200 |
"aoColumns": [ |
187 |
null, |
201 |
null, |
188 |
- |
|
|