Optical fixes in seasons list.
This commit is contained in:
@@ -27,6 +27,7 @@ class GenericFormModel:
|
|||||||
post_url: str
|
post_url: str
|
||||||
errors: Dict[str, List[str]] = None
|
errors: Dict[str, List[str]] = None
|
||||||
|
|
||||||
|
|
||||||
class SeasonForm(FlaskForm):
|
class SeasonForm(FlaskForm):
|
||||||
season_id = HiddenField("Season ID", render_kw={"readonly": True})
|
season_id = HiddenField("Season ID", render_kw={"readonly": True})
|
||||||
code = StringField("Season Code", validators=[DataRequired()])
|
code = StringField("Season Code", validators=[DataRequired()])
|
||||||
|
|||||||
@@ -14,10 +14,11 @@
|
|||||||
<table class="table table-hover table-striped table-bordered">
|
<table class="table table-hover table-striped table-bordered">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
{% for prop, caption in model.columns %}
|
<th scope="col" class="col-sm-auto text-center">#</th>
|
||||||
<th scope="col" class="col-sm-auto text-center">{{ caption }}</th>
|
<th scope="col" class="col-sm-auto text-center">Game</th>
|
||||||
{% endfor %}
|
<th scope="col" class="col-sm-auto text-center">Season Description</th>
|
||||||
|
<th scope="col" class="col-sm-auto text-center">Started At</th>
|
||||||
|
<th scope="col" class="col-sm-auto text-center">Ended At</th>
|
||||||
{# Show #}
|
{# Show #}
|
||||||
<th scope="col" class="col-sm-auto text-center">View</th>
|
<th scope="col" class="col-sm-auto text-center">View</th>
|
||||||
|
|
||||||
@@ -30,14 +31,16 @@
|
|||||||
<tbody>
|
<tbody>
|
||||||
{% for item in model.seasons %}
|
{% for item in model.seasons %}
|
||||||
<tr>
|
<tr>
|
||||||
{% for prop, caption in model.columns %}
|
<td class="col-sm-auto text-center">{{ item.code }}</td>
|
||||||
<td class="col-sm-auto text-center">{{ item[prop] }}</td>
|
<td class="col-sm-auto text-center">{{ item.game }}</td>
|
||||||
{% endfor %}
|
<td class="col-sm-auto text-center">{{ item.description or "No Description" }}</td>
|
||||||
|
<td class="col-sm-auto text-center">{{ item.start }}</td>
|
||||||
|
<td class="col-sm-auto text-center">{{ item.end or "Ongoing" }}</td>
|
||||||
|
|
||||||
<td class="col-sm-auto text-center">
|
<td class="col-sm-auto text-center">
|
||||||
<a class="btn btn-default" href="{{ url_for("season_overview", season_id = item.id) }}">
|
<a class="btn btn-default" href="{{ url_for("season_overview", season_id = item.id) }}">
|
||||||
<span class="fas fa-eye"></span></a>
|
<span class="fas fa-eye"></span></a>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
{% if g.is_editor %}
|
{% if g.is_editor %}
|
||||||
<td class="col-sm-auto text-center">
|
<td class="col-sm-auto text-center">
|
||||||
@@ -56,4 +59,4 @@
|
|||||||
</table>
|
</table>
|
||||||
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
@@ -12,14 +12,7 @@ def season_list():
|
|||||||
db = orm.new_session()
|
db = orm.new_session()
|
||||||
seasons = db.query(Season).order_by(Season.code).all()
|
seasons = db.query(Season).order_by(Season.code).all()
|
||||||
model = {
|
model = {
|
||||||
"seasons": seasons,
|
"seasons": seasons
|
||||||
"columns": [
|
|
||||||
("code", "#"),
|
|
||||||
("game", "Game"),
|
|
||||||
("description", "Season Description"),
|
|
||||||
("start", "Started At"),
|
|
||||||
("end", "Ended At"),
|
|
||||||
],
|
|
||||||
}
|
}
|
||||||
return render_template("season_list.html", model=model)
|
return render_template("season_list.html", model=model)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user