Remove js with ban delete comfirm from style files

This commit is contained in:
Dmitriy Simushev 2014-10-10 10:57:00 +00:00
parent dd71e6bc70
commit 01e2d8f2a7
3 changed files with 6 additions and 10 deletions

View File

@ -18,12 +18,10 @@
(function(Mibew, $) { (function(Mibew, $) {
$(document).ready(function() { $(document).ready(function() {
$('a.removelink').click(function() { $('a.remove-link').click(function() {
var address = $.trim($("#t" + this.id).text());
return confirm(Mibew.Localization.trans( return confirm(Mibew.Localization.trans(
'Are you sure that you want to delete address {0} from the blocked list?', 'Are you sure that you want to delete address {0} from the blocked list?',
address $(this).data('ban-address')
)); ));
}); });
}); });

View File

@ -65,6 +65,8 @@ class BanController extends AbstractController
$page['pagination.items'] = $pagination['items']; $page['pagination.items'] = $pagination['items'];
$page = array_merge($page, prepare_menu($operator)); $page = array_merge($page, prepare_menu($operator));
$this->getAssetManager()->attachJs('js/compiled/bans.js');
return $this->render('bans', $page); return $this->render('bans', $page);
} }

View File

@ -1,10 +1,6 @@
{{#extends "_layout"}} {{#extends "_layout"}}
{{#override "menu"}}{{> _menu}}{{/override}} {{#override "menu"}}{{> _menu}}{{/override}}
{{#override "head"}}
<script type="text/javascript" src="{{asset "@CurrentStyle/js/bans.js"}}"></script>
{{/override}}
{{#override "content"}} {{#override "content"}}
{{l10n "Here you can block malicious visitors that affect your work with spam messages."}} {{l10n "Here you can block malicious visitors that affect your work with spam messages."}}
@ -34,7 +30,7 @@
{{#each [pagination.items]}} {{#each [pagination.items]}}
<tr> <tr>
<td class="notlast"> <td class="notlast">
<a href="{{route "history" q=address type="visitor"}}" class="man" id="ti{{banid}}"> <a href="{{route "history" q=address type="visitor"}}" class="man">
{{address}} {{address}}
</a> </a>
</td> </td>
@ -44,7 +40,7 @@
<td>{{cutString comment "30"}}</td> <td>{{cutString comment "30"}}</td>
<td> <td>
<a class="removelink" id="i{{banid}}" href="{{csrfProtectedRoute "ban_delete" ban_id=banid}}"> <a class="remove-link" data-ban-address="{{address}}" href="{{csrfProtectedRoute "ban_delete" ban_id=banid}}">
{{l10n "remove"}} {{l10n "remove"}}
</a>, </a>,
<a href="{{route "ban_edit" ban_id=banid}}" <a href="{{route "ban_edit" ban_id=banid}}"