@@ -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') | ||||
@@ -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> | ||||
@@ -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: | ||||