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, $) { (function(Mibew, $) {
$(document).ready(function(){ $(document).ready(function(){
$('a.removelink').click(function(){ $('a.remove-link').click(function(){
var login = $.trim($("#t" + this.id).text());
return confirm(Mibew.Localization.trans( return confirm(Mibew.Localization.trans(
'Are you sure that you want to delete operator "{0}"?', '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['menuid'] = 'operators';
$page = array_merge($page, prepare_menu($operator)); $page = array_merge($page, prepare_menu($operator));
$this->getAssetManager()->attachJs('js/compiled/operators.js');
return $this->render('operators', $page); return $this->render('operators', $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/operators.js"}}"></script>
{{/override}}
{{#override "content"}} {{#override "content"}}
{{l10n "This page displays a list of company operators."}} {{l10n "This page displays a list of company operators."}}
@ -75,7 +71,7 @@
{{#each allowedAgents}} {{#each allowedAgents}}
<tr> <tr>
<td class="notlast"> <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}} {{vclogin}}
</a> </a>
</td> </td>
@ -106,7 +102,7 @@
</td> </td>
<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"}} {{l10n "remove"}}
</a> </a>
</td> </td>