Browse Source

Add javascript confirmation before deletion

master
tr4ck3ur des JM2L 4 years ago
parent
commit
084ac8d13e
9 changed files with 17 additions and 14 deletions
  1. +2
    -2
      jm2l/templates/Logistique/Tables.mako
  2. +4
    -4
      jm2l/templates/Profil/Profil.mako
  3. +1
    -1
      jm2l/templates/Salles/salle.mako
  4. +1
    -1
      jm2l/templates/Staff/pole.mako
  5. +1
    -1
      jm2l/templates/Staff/tasks.mako
  6. +3
    -3
      jm2l/templates/edit_event.mako
  7. +1
    -1
      jm2l/templates/edit_tiers.mako
  8. +3
    -0
      jm2l/templates/layout.mako
  9. +1
    -1
      jm2l/templates/view_tiers.mako

+ 2
- 2
jm2l/templates/Logistique/Tables.mako View File

@@ -66,7 +66,7 @@ elif Type=='M':
<a class="btn btn-small dropdown-toggle" data-toggle="dropdown" href="#"><span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="javascript:DoGet('/${CurrentYear}/modal/${Form}${Type}/${item.exch_id}')"><i class="icon-pencil"></i> Modifier</a></li>
<li><a href="javascript:DoGet('/${CurrentYear}/exchange/${Form}${Type}/${item.exch_id}/delete')"><i class="icon-trash"></i> Supprimer</a></li>
<li><a onclick="return confirm_click();" href="javascript:DoGet('/${CurrentYear}/exchange/${Form}${Type}/${item.exch_id}/delete')"><i class="icon-trash"></i> Supprimer</a></li>
</ul>
% elif getattr(item, Me)==request.user.uid and item.exch_state==CurKind:
Je ${What} <br>
@@ -79,7 +79,7 @@ elif Type=='M':
<li><a href="javascript:DoGet('/${CurrentYear}/exchange/${Form}${Type}/${item.exch_id}/accept')"><i class="icon-ok"></i> Accepter</a></li>
<li><a href="javascript:DoGet('/${CurrentYear}/exchange/${Form}${Type}/${item.exch_id}/refuse')"><i class="icon-remove"></i> Refuser</a></li>
<li class="divider"></li>
<li><a href="javascript:DoGet('/${CurrentYear}/exchange/${Form}${Type}/${item.exch_id}/delete')"><i class="icon-trash"></i> Supprimer</a></li>
<li><a onclick="return confirm_click();" href="javascript:DoGet('/${CurrentYear}/exchange/${Form}${Type}/${item.exch_id}/delete')"><i class="icon-trash"></i> Supprimer</a></li>
</ul>
% elif getattr(item, Me)==request.user.uid:
Je ${What} <br>


+ 4
- 4
jm2l/templates/Profil/Profil.mako View File

@@ -128,9 +128,9 @@ ${helpers.DisplayRespForm(profil_form, DicFormB)}
value="" />
</td>
<td>
<span class="remove btn btn-mini btn-danger">
<a class="remove btn btn-mini btn-danger">
<i class="icon-remove-sign icon-white"> </i> Suppr.
</span>
</a>
</td>
</tr>
% for num, dicdata in enumerate(profil_form._fields.get("tiersship").data):
@@ -158,9 +158,9 @@ ${helpers.DisplayRespForm(profil_form, DicFormB)}
value="${dicdata.get('role')}" />
</td>
<td>
<span class="remove btn btn-mini btn-danger">
<a class="remove btn btn-mini btn-danger">
<i class="icon-remove-sign icon-white"></i> Suppr.
</span>
</a>
</td>
</tr>
% endfor


+ 1
- 1
jm2l/templates/Salles/salle.mako View File

@@ -18,7 +18,7 @@
<i class="icon-arrow-left"></i> Retour à la liste
</a>
% if 'salle_id' in form._fields.keys():
<a class="btn btn-danger btn-mini pull-right" href="${request.route_path('action_salle', action='delete', salle_id=form.salle_id.data)}">
<a class="btn btn-danger btn-mini pull-right" onclick="return confirm_click();" href="${request.route_path('action_salle', action='delete', salle_id=form.salle_id.data)}">
<i class="icon-remove icon-white"></i> Supprimer cette salle
</a>
%endif


+ 1
- 1
jm2l/templates/Staff/pole.mako View File

@@ -23,7 +23,7 @@
<i class="icon-arrow-left"></i> Retour à la liste
</a>
% if 'uid' in form._fields.keys():
<a class="btn btn-danger btn-mini pull-right" href="${request.route_path('action_task_area', year=year, action='delete', pole_id=form.uid.data)}">
<a class="btn btn-danger btn-mini pull-right" onclick="return confirm_click();" href="${request.route_path('action_task_area', year=year, action='delete', pole_id=form.uid.data)}">
<i class="icon-remove icon-white"></i> Supprimer ce pôle
</a>
<h3>Editer un Pôle</h3>


+ 1
- 1
jm2l/templates/Staff/tasks.mako View File

@@ -33,7 +33,7 @@
<i class="icon-arrow-left"></i> Retour à la liste
</a>
% if 'uid' in form._fields.keys():
<a class="btn btn-danger btn-mini pull-right" href="${request.route_path('action_task', year=year, action='delete', task_id=form.uid.data)}">
<a class="btn btn-danger btn-mini pull-right" onclick="return confirm_click();" href="${request.route_path('action_task', year=year, action='delete', task_id=form.uid.data)}">
<i class="icon-remove icon-white"></i> Supprimer cette tâche
</a>
%endif


+ 3
- 3
jm2l/templates/edit_event.mako View File

@@ -24,7 +24,7 @@
${helpers.show_salles( Salles, form.salle_uid.data or form.salle_uid.choices and form.salle_uid.choices[0][0] )}
</div>
% if event.for_year==CurrentYear and request.user and (request.user.Staff or request.user in event.intervenants):
<a class="btn btn-danger pull-right" type="button" href="${event.uid}/delete">
<a class="btn btn-danger pull-right" type="button" onclick="return confirm_click();" href="${event.uid}/delete">
<i class="icon-remove icon-white"></i> Supprimer
</a>
%endif
@@ -110,7 +110,7 @@ DicForm = {
% endif

<%def name="callback_Del_Summary(Entity)"> \
<a class="btn btn-danger btn-mini pull-right" type="button" href="delete_link_tiers?tid=${Entity.uid}&uid=${event.uid}">
<a class="btn btn-danger btn-mini pull-right" type="button" onclick="return confirm_click();" href="delete_link_tiers?tid=${Entity.uid}&uid=${event.uid}">
<i class="icon-remove icon-white"></i>
</a>
</%def>
@@ -170,7 +170,7 @@ DicForm = {
(${iterv.pseudo})
%endif
% if iterv!=request.user:
<a class="btn btn-danger btn-mini" type="button" href="delete_link_user?uid=${iterv.uid}&eid=${event.uid}">
<a class="btn btn-danger btn-mini" type="button" onclick="return confirm_click();" href="delete_link_user?uid=${iterv.uid}&eid=${event.uid}">
<i class="icon-remove icon-white"></i>
</a>
%endif


+ 1
- 1
jm2l/templates/edit_tiers.mako View File

@@ -13,7 +13,7 @@
<div class="span10 offset1">
% if 'uid' in form._fields.keys():
<a class="btn btn-danger btn-mini pull-right" href="${request.route_path('delete_entity', action='delete_entity', entity_id=form.uid.data)}">
<a class="btn btn-danger btn-mini pull-right" onclick="return confirm_click();" href="${request.route_path('delete_entity', action='delete_entity', entity_id=form.uid.data)}">
<i class="icon-remove icon-white"></i> Supprimer cette entit&eacute;e
</a>
%endif


+ 3
- 0
jm2l/templates/layout.mako View File

@@ -214,6 +214,9 @@ ${helpers.uploader_js()}
${self.jsAddOn()}
## Then Handle Javascript
<script>
function confirm_click() {
return confirm("Confirmer la suppression ?")
}
% for jsitem in context._kwargs['postpone_js']:
${jsitem | n}
% endfor


+ 1
- 1
jm2l/templates/view_tiers.mako View File

@@ -20,7 +20,7 @@ ${The_entity_type.entity_subtype}
<a href="/entity/${entity.get_entity_type.slug_entity_type}/${entity.slug}/edit">Editer</a>
% endif
% if request.user and (request.user.Staff or request.user in entity.members):
<a class="btn btn-danger btn-mini pull-right" href="${request.route_path('delete_entity', action='delete_entity', entity_id=entity.uid)}">
<a class="btn btn-danger btn-mini pull-right" onclick="return confirm_click();" href="${request.route_path('delete_entity', action='delete_entity', entity_id=entity.uid)}">
<i class="icon-remove icon-white"></i> Supprimer cette entit&eacute;e
</a>
% endif


Loading…
Cancel
Save