Browse Source

Merge branch 'tr4ck3ur/various_fixes_2017' of JM2L/jm2l into master

master
JM2L 7 years ago
committed by Gogs
parent
commit
41c516b210
5 changed files with 128 additions and 10 deletions
  1. +1
    -0
      jm2l/__init__.py
  2. +67
    -0
      jm2l/templates/Salles/list_phy.mako
  3. +35
    -0
      jm2l/templates/helpers.mako
  4. +11
    -10
      jm2l/templates/layout.mako
  5. +14
    -0
      jm2l/views.py

+ 1
- 0
jm2l/__init__.py View File

@@ -121,6 +121,7 @@ def main(global_config, **settings):
config.add_route('action_task_area', '/{year:\d+}/Staff/pole/{action:(\w+)}/{pole_id:(\d+)}')

config.add_route('list_salles', '/ListSalles')
config.add_route('list_salles_phy', '/ListSallesPhy')
config.add_route('handle_salle', '/Salles{sep:/*}{salle_id:(\d+)?}')
config.add_route('handle_salle_phy', '/PhySalles{sep:/*}{salle_id:(\d+)?}')
config.add_route('action_salle', '/Salles/{action:(\w+)}/{salle_id:(\d+)}')


+ 67
- 0
jm2l/templates/Salles/list_phy.mako View File

@@ -0,0 +1,67 @@
# -*- coding: utf-8 -*-
<%inherit file="jm2l:templates/layout.mako"/>
<%namespace name="helpers" file="jm2l:templates/helpers.mako"/>
<%
from slugify import slugify
%>
<a style="float:right;" class="btn btn-mini btn-info" role="button" href="/Salles">
<i class="icon-plus-sign icon-white"></i> Ajouter une Salle
</a>
<h3>Gestion des salles physique aux JM2L</h3>

<div class="row-fluid">
<div class="span10 offset1">

<table class="table table-striped table-bordered table-hover">
<thead>
<tr>
<th colspan="2" style="text-align:center;">
Liste des salles physique
</th>
</tr>
</thead>
<tbody>
% if len(DicSallePhy)==0:
<tr>
<td style="text-align:center;">
<i>Il n'y a pas de salle définie pour le moment.</i>
</td>
</tr>
% endif
% for SallePhy in DicSallePhy:
<tr>
<td>
<div class="media">
<div class="pull-left" style="min-width: 300px;">
${helpers.show_salles_phy(SallePhy)}
</div>
<div class="pull-right">
<div class="pull-right">
<a href="/PhySalles/${SallePhy.uid}">Modifier</a>
</div>
<br />
% if SallePhy.uid:
[ ${SallePhy.nb_places} places ]
% else:
[ <a href="/PhySalles">Créer</a> ]
% endif
</div>

<div class="media-body">
<h4 class="media-heading">${SallePhy.name | n}</h4>
% if SallePhy.description:
${SallePhy.description | n}
% endif
</div>
</div>
</td>
</tr>
% endfor
</tbody>
</table>

</div>
</div>
<%def name="jsAddOn()">

</%def>

+ 35
- 0
jm2l/templates/helpers.mako View File

@@ -555,6 +555,41 @@ TabJs = {'select':[], 'desc':[]}
</div>
</div>
</%def> \
## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
<%def name="show_salles_phy(SallePhy)"> \
<div class="profile-icon text-center" style="padding: 0 15px;">
<%
photos = SallePhy.PhotosLinks
%>
<div id="CarName${SallePhy.uid}" style="text-align: center;line-height:20px;"><strong>${len(photos)} Photo(s)</strong></div>
<div id="MyPictureCarousel${SallePhy.uid}" class="carousel slide">
% if len(photos)>1:
<!-- Carousel nav -->
<a class="Ucarousel-control left" href="#MyPictureCarousel${SallePhy.uid}" data-slide="prev">&lsaquo;</a>
<a class="Ucarousel-control right" href="#MyPictureCarousel${SallePhy.uid}" data-slide="next">&rsaquo;</a>
% endif
<!-- Carousel items -->
<div class="carousel-inner">
% if len(photos):
% for num, link in enumerate(photos):
<div class="${['','active '][num==0]}item" id="UserPic${num}">
<div style="margin:auto;">
<img src="${link}" class="img-polaroid" style="max-height:205px;max-width:235px;" alt="Photo ${SallePhy.name}" />
</div>
</div>
% endfor
% else:
<div class="active item" id="UserPic0">
<div class="center" style="margin:auto;width:170px;">
<img src="/img/no-image.jpg" class="img-polaroid" alt="Photo ${SallePhy.name}" style="max-height:130px;" />
</div>
</div>
% endif
</div>
</div>
</div>
</%def> \

## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
## Wrapper pour les photos de l'année
## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=


+ 11
- 10
jm2l/templates/layout.mako View File

@@ -126,16 +126,17 @@ ${helpers.uploader_js()}
% if request.user:
% if request.user.Staff:
<li><a href="/${DisplayYear}/Staff">Partie Staff</a></li>
<li><a href="/${DisplayYear}/ListParticipant">Gérer les intervenants</a></li>
<li><a href="/ListSalles">Gérer les salles</a></li>
<li><a href="/entities">Gérer les entités</a></li>
<li><a href="/${DisplayYear}/ListOrga">Participations à l'orga</a></li>
<li><a href="/${DisplayYear}/Staff/compta">Comptabilité</a></li>
<li><a href="/${DisplayYear}/ListParticipant">G&eacute;rer les intervenants</a></li>
<li><a href="/ListSalles">G&eacute;rer les salles</a></li>
<li><a href="/entities">G&eacute;rer les entit&eacute;s</a></li>
<li><a href="/${DisplayYear}/ListOrga">Participations &agrave; l'orga</a></li>
<li><a href="/${DisplayYear}/Staff/compta">Comptabilit&eacute;</a></li>
<li><a href="/ListSallesPhy">Les salles &agrave; Poly'tech</a></li>
<li role="separator" class="divider"></li>
% endif
<li><a href="/MesJM2L">Mon profil</a></li>
<li><a href="/user/${request.user.slug}">Mon profil public</a></li>
<li><a href="/sign/out">Me déconnecter</a></li>
<li><a href="/sign/out">Me d&eacute;connecter</a></li>
% else:
<li><a href="/participer-l-evenement#inscription">Je m'inscris</a></li>
<li><a href="/sign/login">Je m'identifie</a></li>
@@ -190,7 +191,7 @@ ${helpers.uploader_js()}
<div class="container">
<h4>JM2L 2005-2017</h4>
<p>
Concocté par <a href="http://www.linux-azur.org/">Linux Azur</a> ~
Concoct&eacute; par <a href="http://www.linux-azur.org/">Linux Azur</a> ~
<a href="http://creativecommons.org/licenses/by-sa/4.0/">CopyFriendly</a>
</p>
<p>
@@ -198,10 +199,10 @@ ${helpers.uploader_js()}
</p>
<p>
Conception et construction en <a href="http://git.linux-azur.org/JM2L/jm2l/src/master">DIY</a> ~
Hébergé par <a href="http://www.heberg-24.com/"> Heberg24 </a>
H&eacute;berg&eacute; par <a href="http://www.heberg-24.com/"> Heberg24 </a>
</p>
<p>
Vous avez trouvé un bug ? <a href="http://git.linux-azur.org/JM2L/jm2l/issues">Reportez-le ici</a>
Vous avez trouv&eacute; un bug ? <a href="http://git.linux-azur.org/JM2L/jm2l/issues">Reportez-le ici</a>
</p>
</div>
</footer>
@@ -247,7 +248,7 @@ function handlevote() {
$('.carousel-vote a').attr('href', "/vote_logo/" + currentIndex )
if (currentIndex==${request.user.vote_logo or 0}) {
$('.carousel-vote a').removeClass('btn-primary').addClass('btn-success')
$('.carousel-vote a').html("<i class='icon-ok icon-white'></i> Mon préféré ! ");
$('.carousel-vote a').html("<i class='icon-ok icon-white'></i> Mon pr&eacute;f&eacute;r&eacute; ! ");
} else {
$('.carousel-vote a').removeClass('btn-success').addClass('btn-primary');
$('.carousel-vote a').html("<i class='icon-star icon-white'></i> Je vote pour ce logo ! ");


+ 14
- 0
jm2l/views.py View File

@@ -686,6 +686,20 @@ def list_salles(request):
DicSalle[year] = salles
return {'DicSalle': DicSalle }


@view_config(route_name='list_salles_phy', renderer='jm2l:templates/Salles/list_phy.mako')
def list_salles_phy(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.')
if not request.user.Staff:
# Don't answer to users that aren't logged
raise HTTPForbidden(u'Vous n\'avez pas l\'autorité suffisante pour effectuer cette action.')
salles_phy = DBSession.query( SallePhy )\
.order_by(SallePhy.name).all()
return {'DicSallePhy': salles_phy }


@view_config(route_name='handle_salle', renderer='jm2l:templates/Salles/salle.mako')
def handle_salle(request):
if request.user is None:


Loading…
Cancel
Save