@@ -18,12 +18,14 @@ from apscheduler.schedulers.background import BackgroundScheduler | |||
from pyramid.request import Request | |||
from mako.template import Template | |||
from .models import User | |||
import logging | |||
from jm2l.const import CurrentYear | |||
import logging | |||
def add_renderer_globals(event): | |||
event['mytrip'] = Sejour_helpers(event) | |||
event['myorga'] = Orga_helpers(event) | |||
event['CurrentYear'] = CurrentYear | |||
#@sched.scheduled_job('cron', day_of_week='sun', hour=22, minute=07) | |||
def mailer_tasks(config): | |||
@@ -0,0 +1 @@ | |||
CurrentYear = 2017 |
@@ -2,6 +2,7 @@ | |||
from .models import DBSession, JM2L_Year, Sejour | |||
from datetime import timedelta, datetime | |||
import itertools | |||
from jm2l.const import CurrentYear | |||
class DummySejour(object): | |||
@@ -31,12 +31,11 @@ from sqlalchemy.orm import ( | |||
) | |||
from zope.sqlalchemy import ZopeTransactionExtension | |||
from jm2l.const import CurrentYear | |||
DBSession = scoped_session(sessionmaker(extension=ZopeTransactionExtension())) | |||
Base = declarative_base() | |||
CurrentYear = 2015 | |||
class TasksArea(Base): | |||
__tablename__ = 'staff_tasks_area' | |||
uid = Column(Integer, primary_key=True) | |||
@@ -174,19 +173,19 @@ class User(Base): | |||
return None | |||
@property | |||
def is_Intervenant(self, year=2015): | |||
def is_Intervenant(self, year=CurrentYear): | |||
""" This property will return if User do an event on specified year """ | |||
return DBSession.query(Event).join(User_Event) \ | |||
.filter(User_Event.user_uid==self.uid) \ | |||
.filter(Event.for_year==year).count() | |||
@property | |||
def is_crew(self, year=2015): | |||
def is_crew(self, year=CurrentYear): | |||
""" This property will return if User subscribe orga task on specified year """ | |||
return DBSession.query(User,Sejour.orga_part).outerjoin(Sejour).filter(User.uid == self.uid).one()[1] | |||
def year_events(self, EventType='All', year=2015): | |||
def year_events(self, EventType='All', year=CurrentYear): | |||
if EventType=='All': | |||
return filter(lambda e: e.for_year==year, self.events) | |||
else: | |||
@@ -490,13 +489,13 @@ class Exchange(Base): | |||
@classmethod | |||
def get_counters(cls): | |||
return DBSession.query(cls.exch_state, cls.exch_type, cls.exch_done, func.count(cls.exch_id))\ | |||
.filter(cls.for_year==2015)\ | |||
.filter(cls.for_year==CurrentYear)\ | |||
.group_by(cls.exch_state, cls.exch_type, cls.exch_done) | |||
@classmethod | |||
def get_my_counters(cls, uid): | |||
return DBSession.query(cls.exch_state, cls.exch_type, cls.exch_done, func.count(cls.exch_id))\ | |||
.filter(cls.for_year==2015)\ | |||
.filter(cls.for_year==CurrentYear)\ | |||
.filter( or_(cls.asker_id==uid, cls.provider_id==uid) )\ | |||
.group_by(cls.exch_state, cls.exch_type, cls.exch_done) | |||
@@ -510,7 +509,7 @@ class Exchange(Base): | |||
DicResult[extype][exstate]=[] | |||
DicResult[extype]['Counters']={'AllAsk':0, 'AllProp':0, 'AllAgree':0} | |||
Query = DBSession.query(cls)\ | |||
.filter(cls.for_year==2015)\ | |||
.filter(cls.for_year==CurrentYear)\ | |||
.order_by(cls.start_time).all() | |||
for item in Query: | |||
if item.exch_done: | |||
@@ -537,7 +536,7 @@ class Exchange(Base): | |||
@classmethod | |||
def get_pub_list(cls, exch_type): | |||
return DBSession.query(cls).filter(cls.for_year==2015 and cls.exch_state in ['Ask','Proposal'])\ | |||
return DBSession.query(cls).filter(cls.for_year==CurrentYear and cls.exch_state in ['Ask','Proposal'])\ | |||
.filter(cls.exch_type=='%s' % exch_type)\ | |||
.filter(cls.exch_done==False)\ | |||
.all() | |||
@@ -546,13 +545,13 @@ class Exchange(Base): | |||
def get_my_list(cls, uid, exch_type): | |||
DicResult = {} | |||
DicResult['Ask']=DBSession.query(cls)\ | |||
.filter(cls.for_year==2015)\ | |||
.filter(cls.for_year==CurrentYear)\ | |||
.filter( or_(cls.asker_id==uid, cls.provider_id==uid) )\ | |||
.filter(cls.exch_type=='%s' % exch_type)\ | |||
.filter(cls.exch_state=='Ask')\ | |||
.order_by(cls.start_time).all() | |||
DicResult['Proposal']=DBSession.query(cls)\ | |||
.filter(cls.for_year==2015)\ | |||
.filter(cls.for_year==CurrentYear)\ | |||
.filter( or_(cls.asker_id==uid, cls.provider_id==uid) )\ | |||
.filter(cls.exch_type=='%s' % exch_type)\ | |||
.filter(cls.exch_state=='Proposal')\ | |||
@@ -106,9 +106,9 @@ elif Type=='T': | |||
%> | |||
% if Type!='O': | |||
<fieldset> | |||
<legend class="lowshadow">Vos ${CurTitles} programmés pour 2015</legend> | |||
<legend class="lowshadow">Vos ${CurTitles} programmés pour ${CurrentYear}</legend> | |||
<% | |||
Selection = filter(lambda x:(x.event_type==CurEventType and x.for_year==2015), uprofil.events) | |||
Selection = filter(lambda x:(x.event_type==CurEventType and x.for_year==CurrentYear), uprofil.events) | |||
HeadHistTitle = u"L'historique de vos %s ( %d ) " % ( CurTitles, len(Selection) ) | |||
NothingTitle = u"Vous n'avez pas sollicité d'intervention %s." % CurEvent | |||
%> | |||
@@ -200,12 +200,12 @@ NothingTitle = u"Vous n'avez pas sollicité d'intervention %s." % CurEvent | |||
% endif | |||
% if Type!='O': | |||
<a href="/MesJM2L/2015/${CurEventType.replace(' ','_')}">Je souhaite ajouter ${CurTitle} pour les JM2L 2015 !</a> | |||
<a href="/MesJM2L/${CurrentYear}/${CurEventType.replace(' ','_')}">Je souhaite ajouter ${CurTitle} pour les JM2L ${CurrentYear} !</a> | |||
<fieldset> | |||
<legend class="lowshadow">Historique</legend> | |||
<% | |||
Selection = filter(lambda x:(x.event_type==CurEventType and x.for_year!=2015), uprofil.events) | |||
Selection = filter(lambda x:(x.event_type==CurEventType and x.for_year!=CurrentYear), uprofil.events) | |||
HeadHistTitle = u"L'historique de vos %s ( %d ) " % ( CurTitles, len(Selection) ) | |||
NothingTitle = u"Désolé, Il n'y a rien dans l'historique vous concernant." | |||
%> | |||
@@ -23,9 +23,9 @@ elif Type=='M': | |||
</div> | |||
<div class="modal-body"> | |||
%if 'exch_id' in form._fields.keys(): | |||
<form id="ModalForm" action="javascript:DoPost('/2015/modal/Prop${Type}/${form.exch_id.data}');"> | |||
<form id="ModalForm" action="javascript:DoPost('/${CurrentYear}/modal/Prop${Type}/${form.exch_id.data}');"> | |||
%else: | |||
<form id="ModalForm" action="javascript:DoPost('/2015/modal/Prop${Type}/0');"> | |||
<form id="ModalForm" action="javascript:DoPost('/${CurrentYear}/modal/Prop${Type}/0');"> | |||
%endif | |||
<p>Je propose mes service pour ${CurTitle}</p> | |||
% if Type=='H': | |||
@@ -65,9 +65,9 @@ elif Type=='M': | |||
</div> | |||
<div class="modal-body"> | |||
% if 'exch_id' in form._fields.keys(): | |||
<form id="ModalForm" action="javascript:DoPost('/2015/modal/Ask${Type}/${form.exch_id.data}');"> | |||
<form id="ModalForm" action="javascript:DoPost('/${CurrentYear}/modal/Ask${Type}/${form.exch_id.data}');"> | |||
% else: | |||
<form id="ModalForm" action="javascript:DoPost('/2015/modal/Ask${Type}/0');"> | |||
<form id="ModalForm" action="javascript:DoPost('/${CurrentYear}/modal/Ask${Type}/0');"> | |||
%endif | |||
<p>Je demande ${CurTitle}</p> | |||
% if Type=='H': | |||
@@ -114,9 +114,9 @@ elif Exch.exch_type=='M': | |||
${dialogM.ShowM(Exch)} | |||
% endif | |||
% if Exch.exch_state=='Ask': | |||
<form id="ModalForm" action="javascript:DoPost('/2015/exchange/Ask${Type}/${Exch.exch_id}/deal');"></form> | |||
<form id="ModalForm" action="javascript:DoPost('/${CurrentYear}/exchange/Ask${Type}/${Exch.exch_id}/deal');"></form> | |||
% elif Exch.exch_state=='Proposal': | |||
<form id="ModalForm" action="javascript:DoPost('/2015/exchange/Prop${Type}/${Exch.exch_id}/deal');"></form> | |||
<form id="ModalForm" action="javascript:DoPost('/${CurrentYear}/exchange/Prop${Type}/${Exch.exch_id}/deal');"></form> | |||
% endif | |||
</div> | |||
<div class="modal-footer"> | |||
@@ -100,7 +100,7 @@ | |||
<small style="color:#999">Si je n´ai pas trouvé le lieu dont j´ai besoin dans ces listes...</small> | |||
<br /> | |||
<small style="color:#999">Je peux </small> | |||
<a class="btn btn-mini btn-info" role="button" href="javascript:DoGetLieu('/2015/modal/Place/0');"> | |||
<a class="btn btn-mini btn-info" role="button" href="javascript:DoGetLieu('/${CurrentYear}/modal/Place/0');"> | |||
<i class="icon-plus-sign icon-white"></i> Ajouter un lieu | |||
</a> | |||
</div> | |||
@@ -124,7 +124,7 @@ | |||
<small style="color:#999">Si je n´ai pas trouvé le lieu dont j´ai besoin dans ces listes...</small> | |||
<br /> | |||
<small style="color:#999">Je peux </small> | |||
<a class="btn btn-mini btn-info" role="button" href="javascript:DoGetLieu('/2015/modal/Place/0');"> | |||
<a class="btn btn-mini btn-info" role="button" href="javascript:DoGetLieu('/${CurrentYear}/modal/Place/0');"> | |||
<i class="icon-plus-sign icon-white"></i> Ajouter un lieu | |||
</a> | |||
</div> | |||
@@ -33,7 +33,7 @@ | |||
${helper.DisplayForm(form, DicFormat)} | |||
NB: Vous devez faire une proposition différente pour chaque nuit que vous proposez. | |||
<br> | |||
<a class="btn btn-mini btn-info" role="button" href="javascript:DoGetLieu('/2015/modal/Place/0');"> | |||
<a class="btn btn-mini btn-info" role="button" href="javascript:DoGetLieu('/${CurrentYear}/modal/Place/0');"> | |||
<i class="icon-plus-sign icon-white"></i> Indiquer l'adresse proposée. | |||
</a> | |||
</%def> \ | |||
@@ -156,8 +156,8 @@ elif Type=='M': | |||
% endif | |||
% if item.exch_type=="C": | |||
un co-voiturage le ${item.start_time.strftime('%a %d %b vers %Hh%M').decode('utf-8')} | |||
de <a href="javascript:DoGetLieu('/2015/modal/Place/${item.Itin.start.place_id}')">${item.Itin.start.display_name}</a> | |||
à <a href="javascript:DoGetLieu('/2015/modal/Place/${item.Itin.arrival.place_id}')">${item.Itin.arrival.display_name}</a> | |||
de <a href="javascript:DoGetLieu('/${CurrentYear}/modal/Place/${item.Itin.start.place_id}')">${item.Itin.start.display_name}</a> | |||
à <a href="javascript:DoGetLieu('/${CurrentYear}/modal/Place/${item.Itin.arrival.place_id}')">${item.Itin.arrival.display_name}</a> | |||
% elif item.exch_type=="M": | |||
% if item.Category: | |||
<i>${item.Category.exch_subtype}</i> | |||
@@ -181,12 +181,12 @@ elif Type=='M': | |||
<td style="vertical-align: middle;"> | |||
% if item.provider_id==request.user.uid or item.asker_id==request.user.uid: | |||
<a class="btn btn-mini btn-primary" style="float:right" | |||
href="javascript:DoGet('/2015/modal/Show${Type}/${item.exch_id}')"> | |||
href="javascript:DoGet('/${CurrentYear}/modal/Show${Type}/${item.exch_id}')"> | |||
<i class="icon-search icon-white"></i> | |||
</a> | |||
% elif (item.provider_id and item.asker_id): | |||
<a class="btn btn-mini btn-primary" style="float:right" | |||
href="javascript:DoGet('/2015/modal/Show${Type}/${item.exch_id}')"> | |||
href="javascript:DoGet('/${CurrentYear}/modal/Show${Type}/${item.exch_id}')"> | |||
<i class="icon-search icon-white"></i> | |||
</a> <br/> <br/> | |||
## <a id="Ask${Type}-${item.exch_id}" | |||
@@ -200,11 +200,11 @@ elif Type=='M': | |||
## <script>$("#Ask${Type}-${item.exch_id}").popover();</script> | |||
% else: | |||
<a class="btn btn-mini btn-primary" style="float:right" | |||
href="javascript:DoGet('/2015/modal/Show${Type}/${item.exch_id}')"> | |||
href="javascript:DoGet('/${CurrentYear}/modal/Show${Type}/${item.exch_id}')"> | |||
<i class="icon-search icon-white"></i> | |||
</a> <br/> <br/> | |||
## <a class="btn btn-mini btn-primary" style="float:right" | |||
## href="javascript:DoGet('/2015/exchange/Ask${Type}/${item.exch_id}/deal')"> | |||
## href="javascript:DoGet('/${CurrentYear}/exchange/Ask${Type}/${item.exch_id}/deal')"> | |||
## <i class="icon-random icon-white"></i> | |||
## </a> | |||
% endif | |||
@@ -24,7 +24,7 @@ elif Type=='M': | |||
<thead> | |||
<tr> | |||
<th colspan="3"><i class="${CurIcon}"></i> ${What}s ${CurTitle} | |||
<a class="btn btn-mini btn-primary" Myhref="/2015/modal/${Form}${Type}/0" | |||
<a class="btn btn-mini btn-primary" Myhref="/${CurrentYear}/modal/${Form}${Type}/0" | |||
role="button" data-target="#AjaxModal" style="float:right" handle="modal"> | |||
<i class="icon-plus-sign icon-white"></i> Ajouter | |||
</a> | |||
@@ -53,44 +53,44 @@ elif Type=='M': | |||
<td> | |||
% if item.exch_done: | |||
<div class="btn-group"> | |||
<a class="btn btn-small btn-success" href="javascript:DoGet('/2015/modal/Show${Type}/${item.exch_id}')"><i class="icon-ok icon-white"></i> Validé</a> | |||
<a class="btn btn-small btn-success" href="javascript:DoGet('/${CurrentYear}/modal/Show${Type}/${item.exch_id}')"><i class="icon-ok icon-white"></i> Validé</a> | |||
<a class="btn btn-small btn-success dropdown-toggle" data-toggle="dropdown" href="#"><span class="caret"></span></a> | |||
<ul class="dropdown-menu"> | |||
<li><a href="javascript:DoGet('/2015/modal/Show${Type}/${item.exch_id}')"><i class="icon-search"></i> Détails</a></li> | |||
<li><a href="javascript:DoGet('/${CurrentYear}/modal/Show${Type}/${item.exch_id}')"><i class="icon-search"></i> Détails</a></li> | |||
<li class="divider"></li> | |||
<li><a href="javascript:DoGet('/2015/exchange/${Form}${Type}/${item.exch_id}/refuse')"><i class="icon-remove"></i> Annuler</a></li> | |||
<li><a href="javascript:DoGet('/${CurrentYear}/exchange/${Form}${Type}/${item.exch_id}/refuse')"><i class="icon-remove"></i> Annuler</a></li> | |||
</ul> | |||
% elif getattr(item, You) is None: | |||
<div class="btn-group"> | |||
<a class="btn btn-small"><i class="icon-signal"></i> Publié</a> | |||
<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('/2015/modal/${Form}${Type}/${item.exch_id}')"><i class="icon-pencil"></i> Modifier</a></li> | |||
<li><a href="javascript:DoGet('/2015/exchange/${Form}${Type}/${item.exch_id}/delete')"><i class="icon-trash"></i> Supprimer</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> | |||
</ul> | |||
% elif getattr(item, Me)==request.user.uid and item.exch_state==CurKind: | |||
Je ${What} <br> | |||
<div class="btn-group"> | |||
<a class="btn btn-small btn-warning" href="javascript:DoGet('/2015/modal/Show${Type}/${item.exch_id}')"><i class="icon-question-sign icon-white"></i> Proposition</a> | |||
<a class="btn btn-small btn-warning" href="javascript:DoGet('/${CurrentYear}/modal/Show${Type}/${item.exch_id}')"><i class="icon-question-sign icon-white"></i> Proposition</a> | |||
<a class="btn btn-small btn-warning dropdown-toggle" data-toggle="dropdown" href="#"><span class="caret"></span></a> | |||
<ul class="dropdown-menu"> | |||
<li><a href="javascript:DoGet('/2015/modal/Show${Type}/${item.exch_id}')"><i class="icon-search"></i> Détails</a></li> | |||
<li><a href="javascript:DoGet('/${CurrentYear}/modal/Show${Type}/${item.exch_id}')"><i class="icon-search"></i> Détails</a></li> | |||
<li class="divider"></li> | |||
<li><a href="javascript:DoGet('/2015/exchange/${Form}${Type}/${item.exch_id}/accept')"><i class="icon-ok"></i> Accepter</a></li> | |||
<li><a href="javascript:DoGet('/2015/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}/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('/2015/exchange/${Form}${Type}/${item.exch_id}/delete')"><i class="icon-trash"></i> Supprimer</a></li> | |||
<li><a 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> | |||
<div class="btn-group"> | |||
<a class="btn btn-small btn-info" href="javascript:DoGet('/2015/modal/Show${Type}/${item.exch_id}')"><i class="icon-question-sign icon-white"></i> Négociation</a> | |||
<a class="btn btn-small btn-info" href="javascript:DoGet('/${CurrentYear}/modal/Show${Type}/${item.exch_id}')"><i class="icon-question-sign icon-white"></i> Négociation</a> | |||
<a class="btn btn-small btn-info dropdown-toggle" data-toggle="dropdown" href="#"><span class="caret"></span></a> | |||
<ul class="dropdown-menu"> | |||
<li><a href="javascript:DoGet('/2015/modal/Show${Type}/${item.exch_id}')"><i class="icon-search"></i> Détails</a></li> | |||
<li><a href="javascript:DoGet('/${CurrentYear}/modal/Show${Type}/${item.exch_id}')"><i class="icon-search"></i> Détails</a></li> | |||
<li><a href="#"><i class="icon-question-sign"></i> En Attente de réponse </a></li> | |||
<li><a href="javascript:DoGet('/2015/exchange/${Form}${Type}/${item.exch_id}/refuse')"><i class="icon-remove"></i> Se désister </a></li> | |||
</ul> | |||
<li><a href="javascript:DoGet('/${CurrentYear}/exchange/${Form}${Type}/${item.exch_id}/refuse')"><i class="icon-remove"></i> Se désister </a></li> | |||
</ul> | |||
% endif | |||
</div> | |||
</div> | |||
@@ -98,8 +98,8 @@ elif Type=='M': | |||
<td> | |||
%if Type=='C': | |||
${item.start_time.strftime('%A %d %b %Y').decode('utf-8')} vers ${item.start_time.strftime('%Hh%M')} | |||
de <a href="javascript:DoGetLieu('/2015/modal/Place/${item.Itin.start.place_id}')">${item.Itin.start.display_name}</a> | |||
à <a href="javascript:DoGetLieu('/2015/modal/Place/${item.Itin.arrival.place_id}')">${item.Itin.arrival.display_name}</a> | |||
de <a href="javascript:DoGetLieu('/${CurrentYear}/modal/Place/${item.Itin.start.place_id}')">${item.Itin.start.display_name}</a> | |||
à <a href="javascript:DoGetLieu('/${CurrentYear}/modal/Place/${item.Itin.arrival.place_id}')">${item.Itin.arrival.display_name}</a> | |||
%elif Type=='H': | |||
% if item.Category: | |||
<i>${item.Category.exch_subtype}</i>, | |||
@@ -15,9 +15,9 @@ | |||
<br> | |||
<div class="center"> | |||
% if request.user and request.user.Staff: | |||
<a href="/${year or 2015}/edit">Editer cette page</a> - | |||
<a href="/${year or CurrentYear}/edit">Editer cette page</a> - | |||
% endif | |||
<h4><a href="/${year or 2015}/le-programme">Le programme des événements ${year or 2015 }</a></h4> | |||
<h4><a href="/${year or CurrentYear}/le-programme">Le programme des événements ${year or CurrentYear }</a></h4> | |||
</div> | |||
<div class="row-fluid"> | |||
<div class="span10 offset1"> | |||
@@ -105,7 +105,7 @@ ${helpers.DisplayRespForm(profil_form, DicFormB)} | |||
<tr class="row template" style="line-height:2.2em;"> | |||
<td style="text-align:center;"> | |||
<input type="hidden" style="width:20em;" class="form-control" name="tiersship-{{row-count-placeholder}}-year_uid" | |||
value="2015" /> 2015 | |||
value="${CurrentYear}" /> ${CurrentYear} | |||
</td> | |||
<td style="text-align: center;"> | |||
<input type="hidden" class="form-control" name="tiersship-{{row-count-placeholder}}-user_uid" | |||
@@ -150,7 +150,7 @@ fieldset:disabled { | |||
</button> | |||
% else: | |||
<button type="submit" class="btn btn-large btn-primary" /> | |||
<i class="icon-ok icon-white"></i> Je viens aux JM2L 2015 | |||
<i class="icon-ok icon-white"></i> Je viens aux JM2L ${CurrentYear} | |||
</button> | |||
% endif | |||
</div> | |||
@@ -14,7 +14,7 @@ | |||
<h2 class="shadow">Nous rejoindre ou nous joindre...</h2> | |||
<div class="span10 offset1"> | |||
<p>Le samedi 28 novembre 2015 d’où que vous veniez, tout est mis en place pour que vous | |||
<p>Le samedi 28 novembre ${CurrentYear} d’où que vous veniez, tout est mis en place pour que vous | |||
puissiez vous rendre en toute simplicité sur les lieux de l’événement. | |||
<br> N'hésitez pas à utiliser la section covoiturage de votre profil. Et | |||
pas de panique ! Demain, ce sera pire... </p> | |||
@@ -1,7 +1,7 @@ | |||
<%inherit file="jm2l:templates/layout.mako"/> | |||
<%namespace name="helpers" file="jm2l:templates/helpers.mako"/> | |||
<% | |||
DisplayYear = request.session.get('year',2015) | |||
DisplayYear = request.session.get('year',CurrentYear) | |||
%> | |||
% if request.user and request.user.Staff: | |||
<a href="dossier-de-presse/edit">Modifier</a><br> | |||
@@ -50,7 +50,7 @@ DicForm = { | |||
'name': {'PlaceHolder':u"Nom de la tâche", "FieldStyle":"width:90%;" }, | |||
'area_uid': {"FieldStyle":"width:16em;", 'ContainerStyle':"float:left;" }, | |||
'closed_by': {"FieldStyle":"width:16em;", 'ContainerStyle':"float:left;" }, | |||
'due_date': {'PlaceHolder':u"27/11/2015", "FieldStyle":"width:8em;"}, | |||
'due_date': {'PlaceHolder':u"27/11/2017", "FieldStyle":"width:8em;"}, | |||
'description': {'PlaceHolder':u"Description", "FieldStyle":"width:95%;min-height:150px;", "ckeditor":"1" }, | |||
} | |||
%> | |||
@@ -23,7 +23,7 @@ | |||
<div id="SalleCarousel"> | |||
${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==2015 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"> | |||
<i class="icon-remove icon-white"></i> Supprimer | |||
</a> | |||
@@ -54,7 +54,7 @@ DicForm = { | |||
<td> | |||
<select class="form-control" style="width:5em;" name="membership-{{row-count-placeholder}}-year_uid" | |||
id="membership-{{row-count-placeholder}}-year_uid"> | |||
% for year in range(2015, 2005, -1): | |||
% for year in range(CurrentYear, 2005, -1): | |||
<% | |||
if year in [2014]: | |||
continue | |||
@@ -141,7 +141,7 @@ DicForm = { | |||
<td> | |||
<select class="form-control" style="width:5em;" name="roles-{{row-count-placeholder}}-year_uid" | |||
id="roles-{{row-count-placeholder}}-year_uid"> | |||
% for year in range(2015, 2005, -1): | |||
% for year in range(CurrentYear, 2005, -1): | |||
<% | |||
if year in [2014]: | |||
continue | |||
@@ -187,7 +187,7 @@ TabJs = {'select':[], 'desc':[]} | |||
<small style="color:#999">Si je n´ai pas trouvé le lieu dont j´ai besoin dans ces listes...</small> | |||
<br /> | |||
<small style="color:#999">Je peux </small> | |||
<a class="btn btn-mini btn-info" role="button" href="javascript:DoGetLieu('/2015/modal/Place/0');"> | |||
<a class="btn btn-mini btn-info" role="button" href="javascript:DoGetLieu('/${CurrentYear}/modal/Place/0');"> | |||
<i class="icon-plus-sign icon-white"></i> Ajouter un lieu | |||
</a> | |||
</div> | |||
@@ -453,7 +453,7 @@ TabJs = {'select':[], 'desc':[]} | |||
<% photos = uprofil.PhotosLinks %> | |||
<div style="text-align: center;line-height:20px;"><b>${request.user.slug}</b></div> | |||
<div style="text-align: center;line-height:20px;"> | |||
<a data-target="#AjaxModal" Myhref="/2015/modal/Password/1" role="button" handle="modal">Changer mon mot de passe</a> | |||
<a data-target="#AjaxModal" Myhref="/${CurrentYear}/modal/Password/1" role="button" handle="modal">Changer mon mot de passe</a> | |||
</div> | |||
<div id="MyPictureCarousel" class="carousel slide"> | |||
% if len(photos)>1: | |||
@@ -481,7 +481,7 @@ TabJs = {'select':[], 'desc':[]} | |||
</div> | |||
</div> | |||
<div style="text-align: center;line-height:20px;"> | |||
<a data-target="#AjaxModal" Myhref="/2015/modal/UserPicture/${uprofil.uid}" handle="modal">Changer ma photo</a> | |||
<a data-target="#AjaxModal" Myhref="/${CurrentYear}/modal/UserPicture/${uprofil.uid}" handle="modal">Changer ma photo</a> | |||
</div> | |||
</div> | |||
</%def> \ | |||
@@ -1,6 +1,6 @@ | |||
<%inherit file="jm2l:templates/layout.mako"/> | |||
<p> | |||
Pour que l'évenement JM2L 2015 se passe dans les meilleures conditions | |||
Pour que l'évenement JM2L 2017 se passe dans les meilleures conditions | |||
possible. | |||
Il s'agit ici pour toi de te connecter et de compléter les formulaires, | |||
d'essayer de les tenir à jour au fur et à meusure, de les compléter | |||
@@ -121,7 +121,7 @@ | |||
L'équipe des JM2L participe aux <u>frais de transport</u> des intervenants !<br /><br /> | |||
Et bien oui, mais cette participation ne sera effective que si vous remplissez <u>toutes les conditions</u> suivantes: | |||
<ul style="list-style:circle;"> | |||
<li>Vous animez <strong>un atelier, une conférence ou une table ronde</strong> aux JM2L 2015.</li> | |||
<li>Vous animez <strong>un atelier, une conférence ou une table ronde</strong> aux JM2L ${CurrentYear}.</li> | |||
<li>Votre fiche est renseignée avec <strong>votre RIB</strong>.</li> | |||
<li>Votre fiche est renseignée avec <strong>les preuves</strong> de vos achats.</li> | |||
<li>Vous <strong>présentez l'original de vos tickets</strong> à l'accueil pendant l'évènement.</li> | |||
@@ -2,7 +2,7 @@ | |||
<html> | |||
<%namespace name="helpers" file="jm2l:templates/helpers.mako"/> | |||
<head> | |||
<title>JM2L 2015</title> | |||
<title>JM2L 2017</title> | |||
<meta charset="utf-8"> | |||
<meta name="keywords" content="python web application" /> | |||
<meta name="description" content="jm2l LinuxAzur journée méditéranéenne logiciel libre" /> | |||
@@ -28,7 +28,7 @@ | |||
<body> | |||
<% | |||
context._kwargs['postpone_js']=[] | |||
DisplayYear = request.session.get('year', 2015) | |||
DisplayYear = request.session.get('year', 2017) | |||
%> | |||
<%def name="jsAddOn_head()"></%def> | |||
<%def name="jsAddOn()"></%def> | |||
@@ -37,7 +37,7 @@ ${helpers.uploader_js()} | |||
<div id="wrap"> | |||
<div id="top"> | |||
% if DisplayYear!=2015: | |||
% if DisplayYear!=2017: | |||
<div class="align-center" style="background: url( ${'/img/%s/headerbg.png' % DisplayYear} ) repeat-x scroll 0 top #ffffff;"> | |||
<a href="${"/%s/" % DisplayYear}"> | |||
<div style="height:215px;background: url( ${"/img/%s/logo.png" % DisplayYear} ) no-repeat scroll center center transparent"> | |||
@@ -52,32 +52,24 @@ ${helpers.uploader_js()} | |||
<div class="carousel-inner" role="listbox"> | |||
<div class="item ${["","active"][request.user and request.user.vote_logo==1 or request.user is None]}"> | |||
<a href="/"> | |||
<div style="height:215px;background: url(/img/2015/logo.png) no-repeat scroll center transparent"></div> | |||
<div style="height:215px;background: url(/img/2017/logo.png) no-repeat scroll center transparent"></div> | |||
</a> | |||
</div> | |||
<div class="item ${["","active"][request.user and request.user.vote_logo==2 or 0]}"> | |||
<a href="/"> | |||
<div style="height:215px;background: url(/img/2015/logo_1.png) no-repeat scroll center transparent"></div> | |||
<div style="height:215px;background: url(/img/2017/logo_1.png) no-repeat scroll center transparent"></div> | |||
</a> | |||
</div> | |||
<div class="item ${["","active"][request.user and request.user.vote_logo==3 or 0]}"> | |||
<a href="/"> | |||
<div style="height:215px;background: url(/img/2015/logo_2.png) no-repeat scroll center transparent"></div> | |||
</a> | |||
</div> | |||
<div class="item ${["","active"][request.user and request.user.vote_logo==4 or 0]}"> | |||
<a href="/"> | |||
<div style="height:215px;background: url(/img/2015/logo_3.png) no-repeat scroll center transparent"></div> | |||
</a> | |||
</div> | |||
% if request.user and request.user.vote_logo not in [1,2,3,4]: | |||
% if request.user and request.user.vote_logo not in [1,2]: | |||
<div class="item active"> | |||
<div class="align-center"> | |||
<H1>JM2L 2015</H1> | |||
<H1>JM2L 2017</H1> | |||
<H2> « Do It Yourself »</H2> | |||
<h3>Choisissez ici votre logo préféré !</h3> | |||
<p>Utilisez les flèches pour choisir et voter !<br> | |||
Vous pouvez changer à tout moment, mais vous n'aurez droit qu'a un seul choix, le vôtre ;)</p> | |||
<p>Vous souhaitez proposer le vôtre ? <br> | |||
N'hésitez pas à envoyer vos propositions par mail à l'équipe !</p> | |||
</div> | |||
</div> | |||
% endif | |||
@@ -109,8 +101,8 @@ ${helpers.uploader_js()} | |||
<a class="btn dropdown-toggle" data-toggle="dropdown" href="#"> | |||
Archives <span class="caret"></span></a> | |||
<ul class="dropdown-menu pull-right" style="min-width:0"> | |||
% for tmpyear in range(2015, 2005, -1): | |||
% if tmpyear!=2014: | |||
% for tmpyear in range(2017, 2005, -1): | |||
% if tmpyear!=2014 and tmpyear!=2016: | |||
<li><a href="/year/${tmpyear}">${tmpyear}</a></li> | |||
% endif | |||
% endfor | |||
@@ -192,7 +184,7 @@ ${helpers.uploader_js()} | |||
<footer class="footer"> | |||
<div class="container"> | |||
<h4>JM2L 2005-2015</h4> | |||
<h4>JM2L 2005-2017</h4> | |||
<p> | |||
Concocté par <a href="http://www.linux-azur.org/">Linux Azur</a> ~ | |||
<a href="http://creativecommons.org/licenses/by-sa/4.0/">CopyFriendly</a> | |||
@@ -25,11 +25,11 @@ | |||
<div class="tab-content"> | |||
<div class="tab-pane fade active in" id="Place_Address"> | |||
% if update: | |||
<form id="ModalPlaceForm" action="javascript:DoPostLieu('/2015/modal/Place/${form.place_id.data}');" style='margin:0;'> | |||
<form id="ModalPlaceForm" action="javascript:DoPostLieu('/${CurrentYear}/modal/Place/${form.place_id.data}');" style='margin:0;'> | |||
${form.place_id()} | |||
${form.csrf_token} | |||
% else: | |||
<form id="ModalPlaceForm" action="javascript:DoPostLieu('/2015/modal/Place/0');" style='margin:0;'> | |||
<form id="ModalPlaceForm" action="javascript:DoPostLieu('/${CurrentYear}/modal/Place/0');" style='margin:0;'> | |||
${form.csrf_token} | |||
% endif | |||
@@ -153,7 +153,7 @@ | |||
</div> | |||
<div class="modal-footer"> | |||
<button class="btn" data-dismiss="modal" aria-hidden="true">Annuler</button> | |||
<button class="btn btn-primary" onclick="javascript:DoPost('/2015/modal/UserPicture/${uid}');">Enregistrer les modifications</button> | |||
<button class="btn btn-primary" onclick="javascript:DoPost('/${CurrentYear}/modal/UserPicture/${uid}');">Enregistrer les modifications</button> | |||
</div> | |||
</div> | |||
</%def> \ | |||
@@ -165,7 +165,7 @@ | |||
<h3>Changer mon mot de passe</h3> | |||
</div> | |||
<div class="modal-body"> | |||
<form id="ModalForm" action="javascript:DoPost('/2015/modal/Password/${uid}');" style='margin:0;'> | |||
<form id="ModalForm" action="javascript:DoPost('/${CurrentYear}/modal/Password/${uid}');" style='margin:0;'> | |||
<div class="description">Votre identifiant est <b>${request.user.slug}</b> | |||
<div class="description">Pour modifier le mot de passe actuel, | |||
entrez un nouveau mot de passe dans chacune des deux zones de texte. | |||
@@ -7,7 +7,7 @@ $('#AjaxModal').modal("hide"); | |||
% if modtype in ['AskC', 'PropC', 'ShowC']: | |||
$.ajax({ | |||
url:'/2015/exchange/AskC/0/refresh', | |||
url:'/${CurrentYear}/exchange/AskC/0/refresh', | |||
success:function(result, status, jqXHR){ | |||
var pubresult = $('<div />').append(result).find('#MissingCTable').html(); | |||
$('#MissingCTable').html(pubresult); | |||
@@ -27,7 +27,7 @@ $.ajax({ | |||
}); | |||
% elif modtype in ['AskM', 'PropM', 'ShowM']: | |||
$.ajax({ | |||
url:'/2015/exchange/AskM/0/refresh', | |||
url:'/${CurrentYear}/exchange/AskM/0/refresh', | |||
success:function(result, status, jqXHR){ | |||
var pubresult = $('<div />').append(result).find('#MissingMTable').html(); | |||
$('#MissingCTable').html(pubresult); | |||
@@ -46,7 +46,7 @@ $.ajax({ | |||
}); | |||
% elif modtype in ['AskH', 'PropH', 'ShowH']: | |||
$.ajax({ | |||
url:'/2015/exchange/AskH/0/refresh', | |||
url:'/${CurrentYear}/exchange/AskH/0/refresh', | |||
success:function(result, status, jqXHR){ | |||
var pubresult = $('<div />').append(result).find('#MissingHTable').html(); | |||
$('#MissingHTable').html(pubresult); | |||
@@ -16,7 +16,7 @@ | |||
${event.start_time.strftime('%d %b %Y').decode('utf-8')} - | |||
${event.start_time.strftime('%H:%M')} à ${event.end_time.strftime('%H:%M')} | |||
</div> | |||
% if event.for_year==2015 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 href="/MesJM2L/${event.for_year}/${event.event_type.replace(' ', '_')}/${event.slug}">Modifier</a> | |||
% elif request.user and request.user.Staff: | |||
<a href="/MesJM2L/${event.for_year}/${event.event_type.replace(' ', '_')}/${event.slug}">Editer</a> | |||
@@ -8,8 +8,8 @@ from reportlab.pdfbase import pdfmetrics | |||
from reportlab.pdfbase.ttfonts import TTFont | |||
from reportlab.lib.units import mm | |||
from .upload import MediaPath | |||
from jm2l.const import CurrentYear | |||
CurrentYear = 2015 | |||
# Create PDF container | |||
EXPIRATION_TIME = 300 # seconds | |||
WIDTH = 210 * mm | |||
@@ -13,8 +13,8 @@ import cStringIO as StringIO | |||
# Database access imports | |||
from .models import User, Place, Tiers, Event, SallePhy | |||
from .blenderthumbnailer import blend_extract_thumb, write_png | |||
from jm2l.const import CurrentYear | |||
CurrentYear = 2015 | |||
MIN_FILE_SIZE = 1 # bytes | |||
MAX_FILE_SIZE = 500000000 # bytes | |||
IMAGE_TYPES = re.compile('image/(gif|p?jpeg|(x-)?png)') | |||
@@ -5,6 +5,7 @@ from pyramid.renderers import render_to_response | |||
from pyramid.view import notfound_view_config, forbidden_view_config | |||
from pyramid.view import view_config | |||
from mako.template import Template | |||
from pyramid_mailer.message import Message | |||
from .upload import IMAGEPATH | |||
# Import Web Forms | |||
from .forms import * | |||
@@ -26,8 +27,7 @@ import datetime | |||
import re | |||
import shutil | |||
import glob | |||
CurrentYear = 2015 | |||
from jm2l.const import CurrentYear | |||
## =-=- Here, We keep some usefull function -=-= | |||
def remove_accents(input_str): | |||
@@ -359,6 +359,8 @@ def index_page(request): | |||
return {'year': year, 'content':content, 'edition':u"1<sup>ère</sup>" } | |||
elif year==2015: | |||
return {'year': year, 'content':content, 'edition':u"9<sup>ème</sup>" } | |||
elif year==2017: | |||
return {'year': year, 'content':content, 'edition':u"10<sup>ème</sup>" } | |||
else: | |||
edition = year - 2005 | |||
return {'year': year, 'content':content, 'edition':u"%d<sup>ème</sup>" % edition } | |||
@@ -366,13 +368,13 @@ def index_page(request): | |||
raise HTTPNotFound() | |||
else: | |||
content = DBSession.query(JM2L_Year).filter(JM2L_Year.year_uid==CurrentYear).first().description | |||
TargetDir = "jm2l/static/img/%s/Photos" % (year or 2015) | |||
TargetUrl = "/static/img/%s/Photos/" % (year or 2015) | |||
TargetDir = "jm2l/static/img/%s/Photos" % (year or CurrentYear) | |||
TargetUrl = "/static/img/%s/Photos/" % (year or CurrentYear) | |||
if path.isdir(TargetDir): | |||
ListPhotos = map(lambda x: TargetUrl + x, listdir(TargetDir)) | |||
else: | |||
ListPhotos = [] | |||
return {'year': CurrentYear, 'content':content, 'edition':u"9<sup>ème</sup>", 'ListPhotos': ListPhotos} | |||
return {'year': CurrentYear, 'content':content, 'edition':u"10<sup>ème</sup>", 'ListPhotos': ListPhotos} | |||
@view_config(route_name='edit_index', renderer="jm2l:templates/Staff/EditIndex.mako") | |||
def edit_index(request): | |||
@@ -438,7 +440,7 @@ def edit_presse(request): | |||
@view_config(route_name='plan', renderer="jm2l:templates/Public/Plan.mako") | |||
def static_plan(request): | |||
session = request.session | |||
session['year'] = 2015 | |||
session['year'] = CurrentYear | |||
MainTab = {'plan':'active', "logged_in":request.authenticated_userid } | |||
return MainTab | |||
@@ -1202,7 +1204,7 @@ def Modal(request): | |||
@view_config(route_name='participer', renderer="jm2l:templates/Participer.mako") | |||
def participer(request): | |||
session = request.session | |||
session['year'] = 2015 | |||
session['year'] = CurrentYear | |||
TmpUsr = User() | |||
form = UserRegisterForm(request.POST, TmpUsr, meta={'csrf_context': request.session}) | |||
MyLink=None | |||