Compare commits
No commits in common. "2be13b613669b43fd8bcc10637dac73511a4439c" and "8f4ed337aa2495045e700b5198c99a401b4aaf46" have entirely different histories.
2be13b6136
...
8f4ed337aa
8
app.py
8
app.py
@ -13,7 +13,6 @@
|
|||||||
|
|
||||||
# Modules :
|
# Modules :
|
||||||
import datetime as dti
|
import datetime as dti
|
||||||
import pytz
|
|
||||||
|
|
||||||
from flask import Flask
|
from flask import Flask
|
||||||
from flask import render_template
|
from flask import render_template
|
||||||
@ -244,7 +243,7 @@ def free_rooms() :
|
|||||||
if time_uf_sav != "None" :
|
if time_uf_sav != "None" :
|
||||||
nofavslink += "time=" + time_uf_sav
|
nofavslink += "time=" + time_uf_sav
|
||||||
# Suppression de l'éventuel '&' en trop :
|
# Suppression de l'éventuel '&' en trop :
|
||||||
if nofavslink[-1] == "&" :
|
if nofavslink[:-1] == "&" :
|
||||||
nofavslink = nofavslink[:-1]
|
nofavslink = nofavslink[:-1]
|
||||||
|
|
||||||
# Tri des salles selon leurs catégories :
|
# Tri des salles selon leurs catégories :
|
||||||
@ -256,11 +255,6 @@ def free_rooms() :
|
|||||||
for r in free_rooms:
|
for r in free_rooms:
|
||||||
[[soon_rooms,final_rooms],[favs_soon_rooms,favs_free_rooms]][r.id in favs_ids][r.is_free].append(r)
|
[[soon_rooms,final_rooms],[favs_soon_rooms,favs_free_rooms]][r.id in favs_ids][r.is_free].append(r)
|
||||||
|
|
||||||
# Tri des salles bientôt disponibles en fonction du temps d'attente
|
|
||||||
sortfunc = lambda x: x.start-date.astimezone(pytz.timezone('Europe/Paris'))
|
|
||||||
soon_rooms.sort(key=sortfunc)
|
|
||||||
favs_soon_rooms.sort(key=sortfunc)
|
|
||||||
|
|
||||||
context = {"favs_free_rooms":favs_free_rooms, "favs_soon_rooms":favs_soon_rooms,
|
context = {"favs_free_rooms":favs_free_rooms, "favs_soon_rooms":favs_soon_rooms,
|
||||||
"free_rooms":final_rooms, "soon_rooms":soon_rooms, "frooms_disp":frooms_disp,
|
"free_rooms":final_rooms, "soon_rooms":soon_rooms, "frooms_disp":frooms_disp,
|
||||||
"depts_str":depts_str, "dident_list":dident_list, "date_str":date_str,
|
"depts_str":depts_str, "dident_list":dident_list, "date_str":date_str,
|
||||||
|
@ -90,4 +90,4 @@ class Dept :
|
|||||||
self.rooms = rooms
|
self.rooms = rooms
|
||||||
|
|
||||||
def genlink(self,link):
|
def genlink(self,link):
|
||||||
return "https://adecons.unistra.fr/jsp/custom/modules/plannings/anonymous_cal.jsp?resources="+link.strip()+"&projectId=5&calType=ical"
|
return "https://adecons.unistra.fr/jsp/custom/modules/plannings/anonymous_cal.jsp?resources="+link.strip()+"&projectId=8&calType=ical"
|
||||||
|
@ -255,8 +255,7 @@ def get_tot_rooms(datet, depts, ignore_list) :
|
|||||||
rnamelist.append(roomname)
|
rnamelist.append(roomname)
|
||||||
|
|
||||||
for rname in rnamelist :
|
for rname in rnamelist :
|
||||||
rname = rname.strip()
|
if rname not in roomnames :
|
||||||
if (rname not in roomnames) and (rname not in ignore_list) :
|
|
||||||
roomnames.append(rname)
|
roomnames.append(rname)
|
||||||
|
|
||||||
start = datet.replace(hour = 0, minute = 0, second=0) # Par défaut, l'heure de début de disponibilité est aujourd'hui à 00:00
|
start = datet.replace(hour = 0, minute = 0, second=0) # Par défaut, l'heure de début de disponibilité est aujourd'hui à 00:00
|
||||||
|
Loading…
Reference in New Issue
Block a user