Browse Source

Fix for Issue #16

master
tr4ck3ur des JM2L 3 years ago
parent
commit
9ca738716e
4 changed files with 31 additions and 0 deletions
  1. +1
    -0
      jm2l/__init__.py
  2. BIN
      jm2l/static/img/warn.png
  3. +15
    -0
      jm2l/templates/Profil/Sejour.mako
  4. +15
    -0
      jm2l/views.py

+ 1
- 0
jm2l/__init__.py View File

@@ -168,6 +168,7 @@ def main(global_config, **settings):
# HTML Routes - Logged
#config.add_route('profil', 'MesJM2L')
config.add_route('jm2l', '/MesJM2L')
config.add_route('drop_sejour', '/DropSejour')
config.add_route('miam', '/MonMiam')
config.add_route('sejour', '/MonSejour')
config.add_route('orga', '/MonOrga')


BIN
jm2l/static/img/warn.png View File

Before After
Width: 893  |  Height: 900  |  Size: 58 KiB

+ 15
- 0
jm2l/templates/Profil/Sejour.mako View File

@@ -4,6 +4,21 @@ fieldset:disabled {
color:#CCC;
}
</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&eacute; votre venue aux JM2L ${CurrentYear}
</legend>
<h4 class="lowshadow">Compl&eacute;tez et validez vite ce formulaire !</h4>
% endif

<form id="ProfilForm" action="/MonSejour" method="POST">
<fieldset class="ComeToJM2L">
<legend>Arriv&eacute;e</legend>


+ 15
- 0
jm2l/views.py View File

@@ -1031,6 +1031,21 @@ def list_orga(request):
.all()
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")
def jm2l_page(request):
if request.user is None:


Loading…
Cancel
Save