Optical fixes in seasons list.
This commit is contained in:
@@ -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()])
|
||||
|
||||
@@ -14,10 +14,11 @@
|
||||
<table class="table table-hover table-striped table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
{% for prop, caption in model.columns %}
|
||||
<th scope="col" class="col-sm-auto text-center">{{ caption }}</th>
|
||||
{% endfor %}
|
||||
|
||||
<th scope="col" class="col-sm-auto text-center">#</th>
|
||||
<th scope="col" class="col-sm-auto text-center">Game</th>
|
||||
<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 #}
|
||||
<th scope="col" class="col-sm-auto text-center">View</th>
|
||||
|
||||
@@ -30,14 +31,16 @@
|
||||
<tbody>
|
||||
{% for item in model.seasons %}
|
||||
<tr>
|
||||
{% for prop, caption in model.columns %}
|
||||
<td class="col-sm-auto text-center">{{ item[prop] }}</td>
|
||||
{% endfor %}
|
||||
<td class="col-sm-auto text-center">{{ item.code }}</td>
|
||||
<td class="col-sm-auto text-center">{{ item.game }}</td>
|
||||
<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">
|
||||
<a class="btn btn-default" href="{{ url_for("season_overview", season_id = item.id) }}">
|
||||
<span class="fas fa-eye"></span></a>
|
||||
</td>
|
||||
<td class="col-sm-auto text-center">
|
||||
<a class="btn btn-default" href="{{ url_for("season_overview", season_id = item.id) }}">
|
||||
<span class="fas fa-eye"></span></a>
|
||||
</td>
|
||||
|
||||
{% if g.is_editor %}
|
||||
<td class="col-sm-auto text-center">
|
||||
@@ -56,4 +59,4 @@
|
||||
</table>
|
||||
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
{% endblock %}
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user