diff --git a/jm2l/__init__.py b/jm2l/__init__.py index ce22a61..6bab5f0 100644 --- a/jm2l/__init__.py +++ b/jm2l/__init__.py @@ -12,7 +12,7 @@ from .security import EntryFactory, groupfinder from pyramid_mailer import mailer_factory_from_settings from pyramid_mailer.message import Attachment, Message import locale -from .helpers import Sejour_helpers +from .helpers import Sejour_helpers, Orga_helpers from apscheduler.schedulers.background import BackgroundScheduler # Database access imports from pyramid.request import Request @@ -23,6 +23,7 @@ import logging def add_renderer_globals(event): event['mytrip'] = Sejour_helpers(event) + event['myorga'] = Orga_helpers(event) #@sched.scheduled_job('cron', day_of_week='sun', hour=22, minute=07) def mailer_tasks(config): @@ -119,6 +120,7 @@ def main(global_config, **settings): config.add_route('pict_salle', '/salle_picture/{salle_id:(\d+)}') config.add_route('list_users', '/ListParticipant') + config.add_route('list_orga', '/ListOrga') # HTML Routes - Public config.add_route('home', '/{year:(\d+/)?}') @@ -133,8 +135,10 @@ def main(global_config, **settings): ## Events config.add_route('event', '/event/{year:\d+}/{event_id:([\w-]+)?}') config.add_route('link_event_user', '/MesJM2L/{year:\d+}/{intervention:[\s\w]+}/link_user') - config.add_route('link_event_tiers', '/MesJM2L/{year:\d+}/{intervention:[\s\w]+}/link_tiers') + config.add_route('link_event_tiers', '/MesJM2L/{year:\d+}/{intervention:[\s\w]+}/link_tiers') + config.add_route('delete_link', '/MesJM2L/{year:\d+}/{intervention:[\s\w]+}/delete_link') config.add_route('edit_event', '/MesJM2L/{year:\d+}/{intervention:[\s\w]+}{sep:/*}{event_id:([\w-]+)?}') + config.add_route('delete_event', '/MesJM2L/{year:\d+}/{intervention:[\s\w]+}{sep:/*}{event_id:([\w-]+)?}/delete') ## Entities config.add_route('entities', '/entities') #{sep:/*}{Nature:\w+?}') @@ -156,6 +160,7 @@ def main(global_config, **settings): config.add_route('jm2l', '/MesJM2L') config.add_route('miam', '/MonMiam') config.add_route('sejour', '/MonSejour') + config.add_route('orga', '/MonOrga') config.add_route('modal', '/{year:\d+}/modal/{modtype:\w+}/{id:(\d+)}') # Handle exchanges diff --git a/jm2l/auth.py b/jm2l/auth.py index b9cb640..d64c4e6 100644 --- a/jm2l/auth.py +++ b/jm2l/auth.py @@ -11,7 +11,7 @@ import re @view_config(route_name='auth', match_param="action=login", renderer="jm2l:templates/login.mako") def login(request): - return {} + return {"comefrom":request.GET.get('from', "")} @view_config(route_name='auth', match_param="action=forgot", renderer="jm2l:templates/login.mako") def forgot(request): @@ -75,6 +75,9 @@ def sign_in_out(request): user.last_logged=datetime.datetime.now() DBSession.merge(user) headers = remember(request, user.uid) + if request.POST.get('redirect'): + return HTTPFound(location=request.POST.get('redirect'), + headers=headers) return HTTPFound(location=request.route_url('jm2l'), headers=headers) else: diff --git a/jm2l/badge.py b/jm2l/badge.py index 7f620e2..f63c625 100644 --- a/jm2l/badge.py +++ b/jm2l/badge.py @@ -4,17 +4,19 @@ from pyramid.response import Response import cStringIO as StringIO from pyramid.view import view_config from .models import User - from reportlab.pdfgen import canvas -from reportlab.pdfbase import pdfmetrics -from reportlab.pdfbase.ttfonts import TTFont -from reportlab.lib.units import mm +from reportlab.pdfbase import pdfmetrics +from reportlab.pdfbase.ttfonts import TTFont +from reportlab.lib.units import mm import qrcode +import subprocess +from .upload import MediaPath # Create PDF container +EXPIRATION_TIME = 300 # seconds WIDTH = 85 * mm HEIGHT = 60 * mm -ICONSIZE = 8 * mm +ICONSIZE = 9 * mm def Ribbon35(DispUser, canvas): canvas.saveState() @@ -140,34 +142,48 @@ def JM2L_Logo(canvas, Position="Up"): yearobject.textLines("2 0 1 5") canvas.drawText(yearobject) -def Tiers_Logo(canvas, DispUser, LWidth=4, StartPos=None): - Border = 1 +def Tiers_Logo(canvas, DispUser, StartPos=None): + Border = 0 if StartPos is None: - StartPos = ( WIDTH -70, 0 ) + StartPos = ( 30 * mm, 2 ) StartX, StartY = StartPos + MaxX, MaxY = 34*mm, 18*mm num = 0 canvas.setStrokeColorRGB(0.5,0.5,0.5) - Logos = filter(lambda x:x.ThumbLinks, DispUser.tiers) + Logos = filter(lambda x:x.ThumbLinks, DispUser.tiers)[:3] + # Should We compute a better positionning for logos ? + DicPos = {} + DicPos[1] = { 0:(1./2, 1./2) } + DicPos[2] = { 0:(1./3, 1./2), 1:(2./3, 1./2) } + DicPos[3] = { 0:(1./2, 1./4), 1:(1./3, 3./4), 2:(2./3, 3./4) } + DicPos[4] = { 0:(1./3, 1./4), 1:(2./3, 1./4), 2:(1./3, 3./4), + 3:(2./3, 3./4) } + DicPos[5] = { 0:(1./3, 1./4), 1:(2./3, 1./4), 2:(1./6, 3./4), + 3:(3./6, 3./4), 4:(5./6, 3./4) } + DicPos[6] = { 0:(1./6, 1./4), 1:(3./6, 1./4), 2:(5./6, 1./4), + 3:(1./6, 3./4), 4:(3./6, 3./4), 5:(5./6, 3./4) } + DicPos[7] = { 0:(1./6, 1./4), 1:(3./6, 1./4), 2:(5./6, 1./4), + 3:(1./8, 3./4), 4:(3./8, 3./4), 5:(5./8, 3./4), + 6:(7./8, 3./4) } + DicPos[8] = { 0:(1./8, 1./4), 1:(3./8, 1./4), 2:(5./8, 1./4), + 3:(7./8, 1./4), 4:(1./8, 3./4), 5:(3./8, 3./4), + 6:(5./8, 3./4), 7:(7./8, 3./4) } + # draw overall border + # canvas.roundRect(StartX, StartY, MaxX, MaxY, radius=2, stroke=True) for tiers in Logos: FileName = tiers.ThumbLinks.pop().split("/")[-1] - ImagePath = "jm2l/upload/images/tiers/%s/%s" % (tiers.slug, FileName) - # Should We compute a better positionning for logos ? - #PosX = StartX + (( (2.0*num+1) / 2*len(Logos) )*(ICONSIZE+Border) - ((ICONSIZE+Border)/2)) - PosX = StartX + (num % LWidth) * (ICONSIZE+Border) - if len(Logos)<=LWidth: - # Middle of line - PosY = StartY + 0.5 * (ICONSIZE+Border) - else: - # in two or more lines - PosY = StartY + (num / LWidth) * (ICONSIZE+Border) + ImagePath = "jm2l/upload/images/tiers/%s/%s" % (tiers.slug, FileName) + PosX = StartX + DicPos[len(Logos)][num][0] * MaxX - (ICONSIZE+Border)/2 + PosY = StartY + DicPos[len(Logos)][num][1] * MaxY - (ICONSIZE+Border)/2 canvas.setLineWidth(.1) canvas.drawImage(ImagePath, PosX, PosY, ICONSIZE, ICONSIZE,\ preserveAspectRatio=True, anchor='c', - mask=[0,3,0,3,0,3] + mask='auto' ) - canvas.roundRect(PosX, PosY, ICONSIZE, ICONSIZE, radius=2, stroke=True) + # draw icon border + # canvas.roundRect(PosX, PosY, ICONSIZE, ICONSIZE, radius=2, stroke=True) num+=1 def QRCode(DispUser): @@ -183,8 +199,10 @@ def QRCode(DispUser): return qr.make_image() -@view_config(route_name='badge_user') + +@view_config(route_name='badge_user', http_cache = (EXPIRATION_TIME, {'public':True})) def badge_user(request): + isoutpng = request.params.get('png') user_slug = request.matchdict.get('user_slug', None) if user_slug is None or len(user_slug)==0: raise HTTPNotFound(u"Cet utilisateur n'a pas été reconnu") @@ -200,6 +218,7 @@ def badge_user(request): pdfmetrics.registerFont(TTFont("Liberation", ttfFile)) pdf = StringIO.StringIO() + out_img = StringIO.StringIO() c = canvas.Canvas( pdf, pagesize=(WIDTH, HEIGHT) ) c.translate(mm, mm) @@ -215,24 +234,24 @@ def badge_user(request): if DispUser.Staff: # Staff c.setFillColorRGB(.83,0,.33) - c.rect(-3, HEIGHT-30, WIDTH, HEIGHT, fill=1) + c.rect(-3, HEIGHT-30, WIDTH, HEIGHT, fill=1, stroke=0) c.setFillColorRGB(1,1,1) c.setFont('Liberation', 30) c.drawCentredString(WIDTH/2, HEIGHT-26, "STAFF") - elif DispUser.is_Intervenant: + elif DispUser.is_Intervenant: # Intervenant - c.setFillColorRGB(.3,.3,1) - c.rect(-3, HEIGHT-30, WIDTH, HEIGHT, fill=1) + c.setFillColorRGB(.21,.67,.78) + c.rect(-3, HEIGHT-30, WIDTH, HEIGHT, fill=1, stroke=0) c.setFillColorRGB(1,1,1) c.setFont('Liberation', 30) - c.drawCentredString(WIDTH/2, HEIGHT-26, "Intervenant") + c.drawCentredString(WIDTH/2, HEIGHT-26, "Intervenant") else: # Visiteur - c.setFillColorRGB(.8,.8,.8) - c.rect(-3, HEIGHT-30, WIDTH, HEIGHT, fill=1) + c.setFillColorRGB(.8,.8,.8) + c.rect(-3, HEIGHT-30, WIDTH, HEIGHT, fill=1, stroke=0) c.setFillColorRGB(1,1,1) c.setFont('Liberation', 30) - c.drawCentredString(WIDTH/2, HEIGHT-26, "Visiteur") + c.drawCentredString(WIDTH/2, HEIGHT-26, "Visiteur") c.restoreState() @@ -242,19 +261,19 @@ def badge_user(request): # Feed Name and SurName if len(DispUser.prenom) + len(DispUser.nom)>18: if DispUser.pseudo: - c.drawCentredString(WIDTH/2, HEIGHT/2 + 4 * mm , "%s" % DispUser.prenom ) - c.setFont('Courier', 17) - c.drawCentredString(WIDTH/2, HEIGHT/2 - 2 * mm , "%s" % DispUser.nom ) + c.drawCentredString(WIDTH/2, HEIGHT/2 + 0 * mm , "%s" % DispUser.prenom ) + c.setFont('Courier', 17) + c.drawCentredString(WIDTH/2, HEIGHT/2 - 8 * mm , "%s" % DispUser.nom ) else: - c.drawCentredString(WIDTH/2, HEIGHT/2 + 2 * mm , "%s" % DispUser.prenom ) - c.setFont('Courier', 17) - c.drawCentredString(WIDTH/2, HEIGHT/2 - 6 * mm , "%s" % DispUser.nom ) + c.drawCentredString(WIDTH/2, HEIGHT/2 + 4 * mm , "%s" % DispUser.prenom ) + c.setFont('Courier', 17) + c.drawCentredString(WIDTH/2, HEIGHT/2 - 8 * mm , "%s" % DispUser.nom ) else: c.drawCentredString(WIDTH/2, HEIGHT/2 + 0 * mm , "%s %s" % (DispUser.prenom, DispUser.nom) ) if DispUser.pseudo: - c.setFont("Helvetica-Oblique", 14) - c.drawCentredString(WIDTH/2, HEIGHT/2 - 8 * mm , "%s" % DispUser.pseudo ) + c.setFont("Helvetica-Oblique", 18) + c.drawCentredString(WIDTH/2, HEIGHT/2 + 10 * mm , "%s" % DispUser.pseudo ) # Put QR code to user profile c.drawInlineImage(QRCode(DispUser), \ @@ -263,12 +282,28 @@ def badge_user(request): preserveAspectRatio=True, \ anchor='s') - Tiers_Logo(c, DispUser, 4, ( 30 * mm, 2 )) + Tiers_Logo(c, DispUser) c.showPage() c.save() - pdf.seek(0) - return Response(app_iter=pdf, content_type = 'application/pdf' ) + pdf.seek(0) + if isoutpng: + OutPDF = MediaPath().get_mediapath("badge", DispUser.uid, 'badge.pdf') + OutPNG = MediaPath().get_mediapath("badge", DispUser.uid, 'badge.png') + # Let's generate a png file for website + with open( OutPDF ,'wb') as pdff: + pdff.write(pdf.read()) + + Command = ["convert","-density","150x150", OutPDF, OutPNG] + subprocess.call(Command) + + with open( OutPNG, 'rb') as pngfile: + out_img.write(pngfile.read()) + + out_img.seek(0) + return Response(app_iter=out_img, content_type = 'image/png' ) + else: + return Response(app_iter=pdf, content_type = 'application/pdf' ) @view_config(route_name='badge_user1') def badge_user1(request): @@ -312,27 +347,7 @@ def badge_user1(request): yearobject.textLines("2 0 1 5") c.drawText(yearobject) - num = 0 - for tiers in DispUser.tiers: - if tiers.ThumbLinks: - FileName = tiers.ThumbLinks.pop().split("/")[-1] - num+=1 - ImagePath = "jm2l/upload/images/tiers/%s/%s" % (tiers.slug, FileName) - if num<6: - c.drawImage(ImagePath, - WIDTH -5 - num * (ICONSIZE+5), 5, ICONSIZE, ICONSIZE,\ - preserveAspectRatio=True, - anchor='c', - mask=[0,3,0,3,0,3]) - else: - c.drawImage(ImagePath, - WIDTH -5 - (num-5) * (ICONSIZE+5), 5 + ICONSIZE, ICONSIZE, ICONSIZE,\ - preserveAspectRatio=True, - anchor='c', - mask=[0,3,0,3,0,3]) - - - + Tiers_Logo(c, DispUser) if 1: Ribbon90(DispUser, c) @@ -454,32 +469,11 @@ def badge_user2(request): yearobject.setWordSpace(21) yearobject.textLines("2 0 1 5") c.drawText(yearobject) - - num = 0 - for tiers in DispUser.tiers: - if tiers.ThumbLinks: - FileName = tiers.ThumbLinks.pop().split("/")[-1] - num+=1 - ImagePath = "jm2l/upload/images/tiers/%s/%s" % (tiers.slug, FileName) - if num<6: - c.drawImage(ImagePath, - WIDTH -5 - num * (ICONSIZE+5), 5, ICONSIZE, ICONSIZE,\ - preserveAspectRatio=True, - anchor='c', - mask=[0,3,0,3,0,3]) - else: - c.drawImage(ImagePath, - WIDTH -5 - (num-5) * (ICONSIZE+5), 5 + ICONSIZE, ICONSIZE, ICONSIZE,\ - preserveAspectRatio=True, - anchor='c', - mask=[0,3,0,3,0,3]) - - - if 1: - c.rotate(35) - offset_u=0 + c.rotate(-35) + c.translate(-100, -70) + offset_u=0 if DispUser.Staff: # Staff c.setFillColorRGB(1,.2,.2) @@ -489,7 +483,7 @@ def badge_user2(request): c.drawCentredString(WIDTH/2-10, HEIGHT/2-offset_u+5, "STAFF") elif DispUser.is_Intervenant: # Intervenant - c.setFillColorRGB(.3,.3,1) + c.setFillColorRGB(.21,.3,1) c.rect(0, HEIGHT/2-offset_u, WIDTH, 10*mm, fill=1) c.setFillColorRGB(1,1,1) c.setFont('Liberation', 15) @@ -501,32 +495,6 @@ def badge_user2(request): c.setFillColorRGB(0,0,0) c.setFont('Liberation', 12) c.drawCentredString(WIDTH/2-10, HEIGHT/2-offset_u+7, "Visiteur") - - if 0: - c.rotate(90) - offset_u=111 - if DispUser.Staff: - # Staff - c.setFillColorRGB(1,.2,.2) - c.rect(-5, HEIGHT/2-offset_u, WIDTH, 10*mm, fill=1) - c.setFillColorRGB(1,1,1) - c.setFont('Liberation', 30) - c.drawCentredString(WIDTH/2-15, HEIGHT/2-offset_u+5, "STAFF") - elif DispUser.is_Intervenant: - # Intervenant - c.setFillColorRGB(.3,.3,1) - c.rect(0, HEIGHT/2-offset_u, WIDTH, 10*mm, fill=1) - c.setFillColorRGB(1,1,1) - c.setFont('Liberation', 15) - c.drawCentredString(WIDTH/2-15, HEIGHT/2-offset_u+10, "Intervenant") - else: - # Visiteur - c.setFillColorRGB(.8,.8,.8) - c.rect(-5, HEIGHT/2-offset_u, WIDTH, 10*mm, fill=1) - c.setFillColorRGB(0,0,0) - c.setFont('Liberation', 19) - c.drawCentredString(WIDTH/2, HEIGHT/2-offset_u+7, "Visiteur") - c.restoreState() @@ -551,7 +519,8 @@ def badge_user2(request): c.setFont("Helvetica-Oblique", 14) c.drawCentredString(WIDTH/2, HEIGHT/2 - 8 * mm , "\"%s\"" % DispUser.pseudo ) #c.restoreState() - + # Put Tiers logos + Tiers_Logo(c, DispUser) # Put QR code to user profile c.drawInlineImage(img, WIDTH - 20 * mm - 7, 0, 20 * mm, 20 * mm, preserveAspectRatio=True, anchor='s') diff --git a/jm2l/forms.py b/jm2l/forms.py index 2c7eef0..d743af3 100644 --- a/jm2l/forms.py +++ b/jm2l/forms.py @@ -156,8 +156,9 @@ class ConfUpdateForm(ConfCreateForm): class SalleForm(MyBaseForm): year_uid = SelectField(u'Année', coerce=int) phy_salle_id = SelectField('Salle Physique', coerce=int) - place_type = SelectField('Type', choices=[('Conference','Conference'), - ('Stand','Stand'), ('Ateliers','Ateliers'), ('Autres','Autres') ]) + place_type = SelectField('Type', choices=[('Conference',u'Conférence'), + ('Stand','Stand'), ('Atelier','Atelier'), ('Table ronde','Table ronde'), + ('MAO','MAO'), ('Repas','Repas / Snack'), ('Autres','Autres') ]) name = TextField('Nom de la salle', [validators.Length(min=1, max=40)], filters=[strip_filter]) description = TextAreaField('Description', diff --git a/jm2l/helpers.py b/jm2l/helpers.py index 85addd7..2958ee5 100644 --- a/jm2l/helpers.py +++ b/jm2l/helpers.py @@ -1,8 +1,9 @@ +# -*- coding: utf8 -*- from .models import DBSession, JM2L_Year, Sejour from datetime import timedelta, datetime import itertools -class Sejour_helpers: +class DummySejour(object): def __init__(self, event): self.Me = event['request'].user @@ -13,8 +14,13 @@ class Sejour_helpers: .filter(Sejour.user_id==self.Me.uid)\ .filter(Sejour.for_year==self.CurrentEventYear.year_uid)\ .first() - if self.Sejour and self.Sejour.arrival_time is None: - self.Sejour = None + +class Sejour_helpers(DummySejour): + + def __init__(self, event): + super(Sejour_helpers, self).__init__(event) + if self.Sejour and self.Sejour.arrival_time is None: + self.Sejour = None def StartEvent(self): # This function return the start of the event @@ -98,4 +104,47 @@ class Sejour_helpers: else: return "" else: - return "" \ No newline at end of file + return "" + +class Orga_helpers(DummySejour): + + def __init__(self, event): + super(Orga_helpers, self).__init__(event) + self.Orga_tasks = [ + u"Participer au fléchage de l'événement.", + u"Faire les courses.", + u"Participer à l'accueil des visiteurs.", + u"Accompagner, Guider les visiteurs.", + u"Accompagner, Guider les intervenants.", + u"Déplacer le matériel / le mobilier", + u"Monter / Démonter les stands", + u"Participer à la préparation / à vider les poubelles", + u"Participer à la préparation / à vider les salles de conférence", + u"Participer à la prise de son/vidéo des conférenciers.", + u"Participer à poser, à repartir, à enlever les ralonges éléctriques.", + u"Participer à poser, à repartir, à enlever les câbles réseau / le Wifi.", + u"Remplir les frigos, s'assurer qu'ils soient toujours pleins. (Boissons)", + u"Participer à la distribution des repas.", + u"Faire du café et s'assurer de sa disponibilité.", + u"Participer à la publication / au montage des vidéos des conférenciers.", + u"Autres" + ] + + def IsChecked(self, nb): + nb = 2**nb + if self.Sejour: + if self.Sejour.orga_part & nb == nb: + return "checked=\"checked\"" + else: + return "" + else: + return "" + + def ChoosedList(self): + """ Return choice validated by user """ + ListOrga = [] + for num in range(0,len(self.Orga_tasks)): + curs = 2**num + if self.Sejour.orga_part & curs == curs: + ListOrga.append(self.Orga_tasks[num]) + return ListOrga \ No newline at end of file diff --git a/jm2l/models.py b/jm2l/models.py index 9e3db09..227c488 100644 --- a/jm2l/models.py +++ b/jm2l/models.py @@ -175,6 +175,13 @@ class User(Base): return DBSession.query(Event).join(User_Event) \ .filter(User_Event.user_uid==self.uid) \ .filter(Event.for_year==year).count() + + def year_events(self, EventType='All', year=2015): + if EventType=='All': + return filter(lambda e: e.for_year==year, self.events) + else: + return filter(lambda e: e.for_year==year and e.event_type==EventType, self.events) + @property def my_hash(self): @@ -308,6 +315,7 @@ class Role_Tiers(Base): tiers_uid = Column(Integer, ForeignKey('tiers.uid')) tiers = relationship(Tiers, backref=backref("roles_assoc") ) tiers_role = Column(Enum('Exposant', 'Sponsor', 'Donateur')) + event_uid = Column(Integer, default=None) # Optionnal link with Event class User_Tiers(Base): """ Créer le lien entre la personne et le tiers en fonction de l'année""" @@ -364,7 +372,7 @@ class Salles(Base): phy_salle_id = Column(Integer, ForeignKey('phy_salle.uid')) year_uid = Column(Integer, ForeignKey('jm2l_year.year_uid'), default=CurrentYear) name = Column(Unicode(40)) - place_type = Column(Enum('Conference', 'Stand', 'Ateliers', 'Autres')) + place_type = Column(Enum('Conference', 'Stand', 'Atelier', 'Table ronde', 'MAO', 'Repas', 'Autres')) description = Column(UnicodeText) # Description du matériel disponible created = Column(DateTime, default=datetime.datetime.now) last_change = Column(DateTime, default=datetime.datetime.now) @@ -557,6 +565,8 @@ class Sejour(Base): repas = Column(Integer) repas_allerg = Column(Unicode(100)) repas_contr = Column(Unicode(100)) + orga_part = Column(Integer, default=0) + #travel_detail = Column(UnicodeText) created = Column(DateTime, default=datetime.datetime.now) last_change = Column(DateTime, default=datetime.datetime.now) @@ -572,7 +582,7 @@ class Event(Base): for_year = Column(Integer, ForeignKey('jm2l_year.year_uid')) # link JM2L_Year name = Column(Unicode(100), nullable=False) slug = Column(Unicode(100)) - event_type = Column(Enum('Stand', 'Table ronde', 'Atelier', 'Concert', 'Conference', 'Repas')) + event_type = Column(Enum('Conference', 'Stand', 'Atelier', 'Table ronde', 'MAO', 'Repas', 'Autres')) start_time = Column(DateTime, default=datetime.datetime.now) end_time = Column(DateTime, default=datetime.datetime.now) description = Column(UnicodeText) @@ -601,6 +611,13 @@ class Event(Base): return DBSession.query(cls)\ .filter(cls.slug == slug).first() + def get_linked_tiers(self): + ListLink = DBSession.query(Role_Tiers.tiers_uid) \ + .filter(Role_Tiers.year_uid==self.for_year) \ + .filter(Role_Tiers.tiers_role=="Exposant") \ + .filter(Role_Tiers.event_uid==self.uid) + return DBSession.query(Tiers).filter( Tiers.uid.in_( ListLink ) ) + @property def video(self): return DBSession.query(Media) \ diff --git a/jm2l/templates/Interventions/Interventions.mako b/jm2l/templates/Interventions/Interventions.mako index ad4177d..823cd01 100644 --- a/jm2l/templates/Interventions/Interventions.mako +++ b/jm2l/templates/Interventions/Interventions.mako @@ -7,22 +7,64 @@ Section Statut - + - Conférences Aucune + Conférences + % if len( request.user.year_events('Conference') ): + % for evt in request.user.year_events('Conference'): + % endfor + ${evt.name} à ${evt.start_time.strftime('%Hh%M')} + % else: + Aucune + % endif + - Stands Aucune + Stands + % if len( request.user.year_events('Stand') ): + % for evt in request.user.year_events('Stand'): + ${evt.name} + % endfor + % else: + Aucune + % endif + - Ateliers Aucune + Ateliers + % if len( request.user.year_events('Atelier') ): + % for evt in request.user.year_events('Atelier'): + ${evt.name} à ${evt.start_time.strftime('%Hh%M')} + % endfor + % else: + Aucune + % endif + - Tables Ronde Aucune + Tables Ronde + % if len( request.user.year_events('Table ronde') ): + % for evt in request.user.year_events('Table ronde'): + ${evt.name} à ${evt.start_time.strftime('%Hh%M')} + % endfor + % else: + Aucune + % endif + - Organisation Aucune + Organisation + % if myorga.Sejour and myorga.Sejour.orga_part: + + % else: +
Aucune
+ % endif + @@ -62,6 +104,7 @@ elif Type=='T': CurEventType = "Table ronde" CurLink = "Ma_Table_Ronde" %> +% if Type!='O':
Vos ${CurTitles} programmés pour 2015 <% @@ -71,6 +114,7 @@ NothingTitle = u"Vous n'avez pas sollicité d'intervention %s." % CurEvent %> ${helpers.show_Interventions(Selection, "Sujet", NothingTitle )}
+% endif % if Type=='C':

@@ -118,109 +162,46 @@ NothingTitle = u"Vous n'avez pas sollicité d'intervention %s." % CurEvent % endif % if Type=='O': +

+
Participer à l'organisation Une autre façon de participer !

Comme vous vous en doutez, la meilleure organisation qui existe, c'est celle où chacun apporte sa contribution. -

+

+

+ Dans ce genre d'évenement nous avons besoin de bras et de bonnes volontés. + Vous pouvez nous aider en vous inscrivant en tant que "bénévole du jour" sur un + certains nombre de missions : +

Et oui, il existe plein de façon de participer aux JM2L, choisissez :

-
- Voir la version publiée de cet évenement + Voir la version publiée de cet évenement
%endif
@@ -105,12 +109,20 @@ DicForm = {

% endif +<%def name="callback_Del_Summary(Entity)"> \ + + + + + % if 'uid' in form._fields:
- Indiquez l'entité dont vous faites la promotion : + Indiquez l'entité dont vous faites la promotion :

-

+ ${helpers.show_SummaryEntities( event.get_linked_tiers(), callback_Del_Summary )} + + ${formAddT.event_uid} @@ -120,27 +132,55 @@ DicForm = {
NB : Notez que les entités séléctionnées apparaissent dans les exposants. -

+

Ajouter vos co-intervenants -

- Vous avez la possibilité d'être plusieurs pour un même évenement.
- Chacun des intervenants doit être inscrit sur le site. -

- ${formAdd.event_uid} - - - -
- NB : Notez que les intervenants d'un même évenement ont tous les droits de modification. -

+ + + + + +
+

+ Vous avez la possibilité d'être plusieurs pour un même évenement.
+ Chacun des intervenants doit être inscrit sur le site. +

+ ${formAdd.event_uid} + + + +
+ NB : Notez que les intervenants d'un même évenement ont tous les droits de modification. +

+
+ Les Intrevenants: +
    + % if event.intervenants.count()==0: + Aucun + % else: + % for num, iterv in enumerate(event.intervenants): +
  • + ${iterv.prenom} ${iterv.nom}. + % if iterv.pseudo: + (${iterv.pseudo}) + %endif + % if iterv!=request.user: + + + + %endif +
  • + % endfor + % endif +
+
 
diff --git a/jm2l/templates/helpers.mako b/jm2l/templates/helpers.mako index 7261ce6..d3d8f11 100644 --- a/jm2l/templates/helpers.mako +++ b/jm2l/templates/helpers.mako @@ -407,12 +407,15 @@ TabJs = {'select':[], 'desc':[]} ## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= ## Wrapper pour les badges des entités utilisateur ## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -<%def name="show_SummaryEntities(ListEntities)"> \ +<%def name="show_SummaryEntities(ListEntities, callback=None)"> \