Remove js with operator delete comfirm from style files

This commit is contained in:
Dmitriy Simushev 2014-10-10 11:24:54 +00:00
parent ed6252bb38
commit 3339153ad3
3 changed files with 6 additions and 10 deletions

View File

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

View File

@ -90,6 +90,8 @@ class ManagementController extends AbstractController
$page['menuid'] = 'operators';
$page = array_merge($page, prepare_menu($operator));
$this->getAssetManager()->attachJs('js/compiled/operators.js');
return $this->render('operators', $page);
}

View File

@ -1,10 +1,6 @@
{{#extends "_layout"}}
{{#override "menu"}}{{> _menu}}{{/override}}
{{#override "head"}}
<script type="text/javascript" src="{{asset "@CurrentStyle/js/operators.js"}}"></script>
{{/override}}
{{#override "content"}}
{{l10n "This page displays a list of company operators."}}
@ -75,7 +71,7 @@
{{#each allowedAgents}}
<tr>
<td class="notlast">
<a id="ti{{operatorid}}" href="{{route "operator_edit" operator_id=operatorid}}" class="man">
<a href="{{route "operator_edit" operator_id=operatorid}}" class="man">
{{vclogin}}
</a>
</td>
@ -106,7 +102,7 @@
</td>
<td>
<a class="removelink" id="i{{operatorid}}" href="{{csrfProtectedRoute "operator_delete" operator_id=operatorid}}">
<a class="remove-link" href="{{csrfProtectedRoute "operator_delete" operator_id=operatorid}}" data-operator-login="{{vclogin}}">
{{l10n "remove"}}
</a>
</td>