From f7eebd54f5e008e8b6086c0a6498df51ea21e963 Mon Sep 17 00:00:00 2001 From: luxick Date: Sat, 19 Oct 2019 00:30:11 +0200 Subject: [PATCH] Optical fixes in seasons list. --- estusshots/forms.py | 1 + estusshots/templates/season_list.html | 27 +++++++++++++++------------ estusshots/views/seasons.py | 9 +-------- 3 files changed, 17 insertions(+), 20 deletions(-) diff --git a/estusshots/forms.py b/estusshots/forms.py index 8b316f1..9118019 100644 --- a/estusshots/forms.py +++ b/estusshots/forms.py @@ -27,6 +27,7 @@ class GenericFormModel: post_url: str errors: Dict[str, List[str]] = None + class SeasonForm(FlaskForm): season_id = HiddenField("Season ID", render_kw={"readonly": True}) code = StringField("Season Code", validators=[DataRequired()]) diff --git a/estusshots/templates/season_list.html b/estusshots/templates/season_list.html index b721bda..71fe4ea 100644 --- a/estusshots/templates/season_list.html +++ b/estusshots/templates/season_list.html @@ -14,10 +14,11 @@ - {% for prop, caption in model.columns %} - - {% endfor %} - + + + + + {# Show #} @@ -30,14 +31,16 @@ {% for item in model.seasons %} - {% for prop, caption in model.columns %} - - {% endfor %} + + + + + - + {% if g.is_editor %}
{{ caption }}#GameSeason DescriptionStarted AtEnded AtView
{{ item[prop] }}{{ item.code }}{{ item.game }}{{ item.description or "No Description" }}{{ item.start }}{{ item.end or "Ongoing" }} - - - + + + @@ -56,4 +59,4 @@
{% endif %} -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/estusshots/views/seasons.py b/estusshots/views/seasons.py index db6c105..3a93cdc 100644 --- a/estusshots/views/seasons.py +++ b/estusshots/views/seasons.py @@ -12,14 +12,7 @@ def season_list(): db = orm.new_session() seasons = db.query(Season).order_by(Season.code).all() model = { - "seasons": seasons, - "columns": [ - ("code", "#"), - ("game", "Game"), - ("description", "Season Description"), - ("start", "Started At"), - ("end", "Ended At"), - ], + "seasons": seasons } return render_template("season_list.html", model=model)