From 1aa425e1d7b5818d5677530512b4e0a6f525580e Mon Sep 17 00:00:00 2001 From: Karan Jayachandra Date: Fri, 18 Oct 2024 16:58:03 +0200 Subject: Made the visuals look good for laptop --- app.py | 6 +----- model.py | 5 +++-- requirements.txt | 3 +-- static/custom.css | 2 +- templates/controls.j2 | 16 +++++++--------- templates/macros.j2 | 12 ++++++------ templates/players.j2 | 2 +- 7 files changed, 20 insertions(+), 26 deletions(-) diff --git a/app.py b/app.py index d7d3b65..cb790f3 100644 --- a/app.py +++ b/app.py @@ -1,4 +1,3 @@ -from os import getenv from dotenv import load_dotenv from controller import RoundGenerator from model import CourtList, PlayerList @@ -8,10 +7,7 @@ from flask import Flask, render_template, request load_dotenv() app = Flask("Match Up! Backend") -app.config.from_object(getenv("APP_SETTINGS")) -rg = RoundGenerator( - courts=CourtList(int(getenv("COURTS"))), players=PlayerList(getenv("DATABASE")) -) +rg = RoundGenerator(courts=CourtList(), players=PlayerList()) re = Environment(loader=FileSystemLoader("templates")) diff --git a/model.py b/model.py index f768d0f..c652ce8 100644 --- a/model.py +++ b/model.py @@ -1,3 +1,4 @@ +from os import getenv from math import floor from csv import reader from typing import Tuple @@ -30,7 +31,7 @@ class Game: @dataclass class CourtList: - total: int + total: int = int(getenv("COURTS")) def __post_init__(self) -> None: self.courts = {i + 1: True for i in range(self.total)} @@ -54,7 +55,7 @@ class CourtList: @dataclass class PlayerList: - location: str + location: str = getenv("DATABASE") guests: int = 0 def __post_init__(self) -> None: diff --git a/requirements.txt b/requirements.txt index 886c3db..5a4a2b9 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,2 @@ flask -python-dotenv -gunicorn \ No newline at end of file +python-dotenv \ No newline at end of file diff --git a/static/custom.css b/static/custom.css index 3e57091..11d583f 100644 --- a/static/custom.css +++ b/static/custom.css @@ -2,7 +2,7 @@ button, input, .select, .select select { width: 100%; } table { - font-size: 30px; + font-size: 17.5px; } td { width: 20%; diff --git a/templates/controls.j2 b/templates/controls.j2 index 125dd38..6ba724a 100644 --- a/templates/controls.j2 +++ b/templates/controls.j2 @@ -1,5 +1,5 @@ {% from "macros.j2" import court %} -
+
{% for key, value in courts.items() %} {{ court(key, value) }} @@ -10,16 +10,14 @@
-
- @@ -27,7 +25,7 @@
-
+
+
{%- endmacro %} @@ -49,15 +49,15 @@

- +

-

Match Up!

+

Match Up!

- +

diff --git a/templates/players.j2 b/templates/players.j2 index 6db040a..ae6afe0 100644 --- a/templates/players.j2 +++ b/templates/players.j2 @@ -5,7 +5,7 @@
{{ navbar() }} -
+
{% for id, value in players.items() %}
{{ player(id, value.status, value.name) }}
-- cgit v1.3.1