@@ -168,6 +168,7 @@ def main(global_config, **settings): | |||||
# HTML Routes - Logged | # HTML Routes - Logged | ||||
#config.add_route('profil', 'MesJM2L') | #config.add_route('profil', 'MesJM2L') | ||||
config.add_route('jm2l', '/MesJM2L') | config.add_route('jm2l', '/MesJM2L') | ||||
config.add_route('drop_sejour', '/DropSejour') | |||||
config.add_route('miam', '/MonMiam') | config.add_route('miam', '/MonMiam') | ||||
config.add_route('sejour', '/MonSejour') | config.add_route('sejour', '/MonSejour') | ||||
config.add_route('orga', '/MonOrga') | config.add_route('orga', '/MonOrga') | ||||
@@ -66,7 +66,7 @@ elif Type=='M': | |||||
<a class="btn btn-small dropdown-toggle" data-toggle="dropdown" href="#"><span class="caret"></span></a> | <a class="btn btn-small dropdown-toggle" data-toggle="dropdown" href="#"><span class="caret"></span></a> | ||||
<ul class="dropdown-menu"> | <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}/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> | </ul> | ||||
% elif getattr(item, Me)==request.user.uid and item.exch_state==CurKind: | % elif getattr(item, Me)==request.user.uid and item.exch_state==CurKind: | ||||
Je ${What} <br> | 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}/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><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 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> | </ul> | ||||
% elif getattr(item, Me)==request.user.uid: | % elif getattr(item, Me)==request.user.uid: | ||||
Je ${What} <br> | Je ${What} <br> | ||||
@@ -128,9 +128,9 @@ ${helpers.DisplayRespForm(profil_form, DicFormB)} | |||||
value="" /> | value="" /> | ||||
</td> | </td> | ||||
<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. | <i class="icon-remove-sign icon-white"> </i> Suppr. | ||||
</span> | |||||
</a> | |||||
</td> | </td> | ||||
</tr> | </tr> | ||||
% for num, dicdata in enumerate(profil_form._fields.get("tiersship").data): | % for num, dicdata in enumerate(profil_form._fields.get("tiersship").data): | ||||
@@ -158,9 +158,9 @@ ${helpers.DisplayRespForm(profil_form, DicFormB)} | |||||
value="${dicdata.get('role')}" /> | value="${dicdata.get('role')}" /> | ||||
</td> | </td> | ||||
<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. | <i class="icon-remove-sign icon-white"></i> Suppr. | ||||
</span> | |||||
</a> | |||||
</td> | </td> | ||||
</tr> | </tr> | ||||
% endfor | % endfor | ||||
@@ -4,6 +4,21 @@ fieldset:disabled { | |||||
color:#CCC; | color:#CCC; | ||||
} | } | ||||
</style> | </style> | ||||
% if mytrip.Sejour: | |||||
<div class="pull-right"> | |||||
<span style="line-height: 30px;">Ooops !! J'ai rendez-vous pour un poney-piscine...</span><br /> | |||||
<a class="btn btn-small btn-danger" href="/DropSejour"/> | |||||
<i class="icon-remove icon-white"></i> J'annule ma venue en ${CurrentYear}. | |||||
</a> | |||||
</div> | |||||
% else: | |||||
<legend class="lowshadow"> | |||||
<img style="max-height:50px;" src="/img/warn.png" alt="Attention !"> | |||||
Vous n'avez pas confirmé votre venue aux JM2L ${CurrentYear} | |||||
</legend> | |||||
<h4 class="lowshadow">Complétez et validez vite ce formulaire !</h4> | |||||
% endif | |||||
<form id="ProfilForm" action="/MonSejour" method="POST"> | <form id="ProfilForm" action="/MonSejour" method="POST"> | ||||
<fieldset class="ComeToJM2L"> | <fieldset class="ComeToJM2L"> | ||||
<legend>Arrivée</legend> | <legend>Arrivée</legend> | ||||
@@ -18,7 +18,7 @@ | |||||
<i class="icon-arrow-left"></i> Retour à la liste | <i class="icon-arrow-left"></i> Retour à la liste | ||||
</a> | </a> | ||||
% if 'salle_id' in form._fields.keys(): | % 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 | <i class="icon-remove icon-white"></i> Supprimer cette salle | ||||
</a> | </a> | ||||
%endif | %endif | ||||
@@ -23,7 +23,7 @@ | |||||
<i class="icon-arrow-left"></i> Retour à la liste | <i class="icon-arrow-left"></i> Retour à la liste | ||||
</a> | </a> | ||||
% if 'uid' in form._fields.keys(): | % 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 | <i class="icon-remove icon-white"></i> Supprimer ce pôle | ||||
</a> | </a> | ||||
<h3>Editer un Pôle</h3> | <h3>Editer un Pôle</h3> | ||||
@@ -33,7 +33,7 @@ | |||||
<i class="icon-arrow-left"></i> Retour à la liste | <i class="icon-arrow-left"></i> Retour à la liste | ||||
</a> | </a> | ||||
% if 'uid' in form._fields.keys(): | % 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 | <i class="icon-remove icon-white"></i> Supprimer cette tâche | ||||
</a> | </a> | ||||
%endif | %endif | ||||
@@ -24,7 +24,7 @@ | |||||
${helpers.show_salles( Salles, form.salle_uid.data or form.salle_uid.choices and form.salle_uid.choices[0][0] )} | ${helpers.show_salles( Salles, form.salle_uid.data or form.salle_uid.choices and form.salle_uid.choices[0][0] )} | ||||
</div> | </div> | ||||
% if event.for_year==CurrentYear and request.user and (request.user.Staff or request.user in event.intervenants): | % 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 | <i class="icon-remove icon-white"></i> Supprimer | ||||
</a> | </a> | ||||
%endif | %endif | ||||
@@ -110,7 +110,7 @@ DicForm = { | |||||
% endif | % endif | ||||
<%def name="callback_Del_Summary(Entity)"> \ | <%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> | <i class="icon-remove icon-white"></i> | ||||
</a> | </a> | ||||
</%def> | </%def> | ||||
@@ -170,7 +170,7 @@ DicForm = { | |||||
(${iterv.pseudo}) | (${iterv.pseudo}) | ||||
%endif | %endif | ||||
% if iterv!=request.user: | % 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> | <i class="icon-remove icon-white"></i> | ||||
</a> | </a> | ||||
%endif | %endif | ||||
@@ -13,7 +13,7 @@ | |||||
<div class="span10 offset1"> | <div class="span10 offset1"> | ||||
% if 'uid' in form._fields.keys(): | % 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ée | <i class="icon-remove icon-white"></i> Supprimer cette entitée | ||||
</a> | </a> | ||||
%endif | %endif | ||||
@@ -214,6 +214,9 @@ ${helpers.uploader_js()} | |||||
${self.jsAddOn()} | ${self.jsAddOn()} | ||||
## Then Handle Javascript | ## Then Handle Javascript | ||||
<script> | <script> | ||||
function confirm_click() { | |||||
return confirm("Confirmer la suppression ?") | |||||
} | |||||
% for jsitem in context._kwargs['postpone_js']: | % for jsitem in context._kwargs['postpone_js']: | ||||
${jsitem | n} | ${jsitem | n} | ||||
% endfor | % endfor | ||||
@@ -20,7 +20,7 @@ ${The_entity_type.entity_subtype} | |||||
<a href="/entity/${entity.get_entity_type.slug_entity_type}/${entity.slug}/edit">Editer</a> | <a href="/entity/${entity.get_entity_type.slug_entity_type}/${entity.slug}/edit">Editer</a> | ||||
% endif | % endif | ||||
% if request.user and (request.user.Staff or request.user in entity.members): | % 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ée | <i class="icon-remove icon-white"></i> Supprimer cette entitée | ||||
</a> | </a> | ||||
% endif | % endif | ||||
@@ -1031,6 +1031,21 @@ def list_orga(request): | |||||
.all() | .all() | ||||
return { 'Users':Data } | return { 'Users':Data } | ||||
@view_config(route_name='drop_sejour') | |||||
def drop_sejour(request): | |||||
if request.user is None: | |||||
# Don't answer to users that aren't logged | |||||
raise HTTPForbidden(u'Vous devez vous identifier pour obtenir une réponse.') | |||||
# Feed FicheSejour if any | |||||
FicheSejour = Sejour.by_user(request.user.uid, CurrentYear) | |||||
if FicheSejour: | |||||
DBSession.delete(FicheSejour) | |||||
request.session.flash(('warning', u'Votre participation %s a été supprimé avec succès.' % CurrentYear )) | |||||
else: | |||||
raise HTTPNotFound() | |||||
return HTTPFound(location='/MesJM2L#Sejour') | |||||
@view_config(route_name='jm2l', renderer="jm2l:templates/jm2l.mako") | @view_config(route_name='jm2l', renderer="jm2l:templates/jm2l.mako") | ||||
def jm2l_page(request): | def jm2l_page(request): | ||||
if request.user is None: | if request.user is None: | ||||