From 274369603061cc8e9c538929510cccc74bcc79fd Mon Sep 17 00:00:00 2001
From: Antoine Gaudron-desjardins <antoine.gaudrondesjardins@student-cs.fr>
Date: Tue, 19 Jul 2022 12:11:32 +0200
Subject: [PATCH] fix css for button in mobile phone and order for timetable

---
 backend/db/crud.py               | 10 +++++++---
 frontend/src/styles/Comments.css |  2 +-
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/backend/db/crud.py b/backend/db/crud.py
index 0910e78..d9b1653 100644
--- a/backend/db/crud.py
+++ b/backend/db/crud.py
@@ -44,7 +44,8 @@ def add_slot(slots_list, start_time, end_time, function):
     average_waiting_time = function(start_time, end_time)
     if average_waiting_time:
         name = 60 * start_time.hour + start_time.minute
-        slots_list.append(schemas.RecordRead(name=name, time=average_waiting_time))
+        slots_list.append(schemas.RecordRead(
+            name=name, time=average_waiting_time))
 
 
 def get_avg_graph_points(place: str, weekday: int, min_time: time,
@@ -260,8 +261,11 @@ def get_restaurants(db: Session):
     restaurants = []
 
     for place in places:
-        opening_hours = db.query(models.OpeningHours).filter(
-            models.OpeningHours.place == place.place, models.OpeningHours.day == weekday).all()
+        opening_hours = db.query(
+            models.OpeningHours).filter(
+            models.OpeningHours.place == place.place,
+            models.OpeningHours.day == weekday).order_by(
+            models.OpeningHours.open_time).all()
         opening_hours_formated = [
             f"{row.open_time.strftime('%Hh%M')}-{row.close_time.strftime('%Hh%M')}" for row in opening_hours]
         timetable = "/".join(opening_hours_formated)
diff --git a/frontend/src/styles/Comments.css b/frontend/src/styles/Comments.css
index 1fdfc1e..d52fe85 100644
--- a/frontend/src/styles/Comments.css
+++ b/frontend/src/styles/Comments.css
@@ -129,7 +129,7 @@
         top: 0;
         height: 3rem;
         width: 3rem;
-        margin: 1rem;
+        margin: 0.5rem;
         padding: 0.5rem;
         border-radius: 5px;
     }
-- 
GitLab