Skip to content

Commit

Permalink
Updated app version; Show correct version ID in html template
Browse files Browse the repository at this point in the history
  • Loading branch information
eliasdoehne committed May 25, 2018
1 parent ffd1e6e commit 7c86d29
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
9 changes: 5 additions & 4 deletions src/stellarisdashboard/dash_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,20 @@
timeline_app.css.config.serve_locally = True
timeline_app.scripts.config.serve_locally = True

VERSION_ID = "v0.1.3"

@flask_app.route("/")
@flask_app.route("/checkversion/<version>/")
def index_page(version=None):
show_old_version_notice = False
if version is not None:
show_old_version_notice = version != "v0.1.0"
show_old_version_notice = version != VERSION_ID
games = [dict(country=country, game_name=g) for g, country in models.get_available_games_dict().items()]
return render_template(
"index.html",
games=games,
show_old_version_notice=show_old_version_notice,
version=version,
version=VERSION_ID,
)


Expand All @@ -45,7 +46,7 @@ def index_page(version=None):
def history_page(game_name=None, version=None):
show_old_version_notice = False
if version is not None:
show_old_version_notice = version != "v0.1.0"
show_old_version_notice = version != VERSION_ID
if game_name is None:
game_name = ""

Expand All @@ -67,7 +68,7 @@ def history_page(game_name=None, version=None):
wars=wars,
leaders=leaders,
show_old_version_notice=show_old_version_notice,
version=version,
version=VERSION_ID,
)


Expand Down
7 changes: 4 additions & 3 deletions src/stellarisdashboard/templates/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@
{%if show_old_version_notice%}
<p>
You may be using an old version of the stellaris dashboard program.
You can get the current version on <a href=https://github.com/eliasdoehne/stellaris-dashboard>Github.
You are on version {{ version }}.</a>
You can get the current version on <a href=https://github.com/eliasdoehne/stellaris-dashboard>Github.</a>
You are on version {{ version }}.
</p>
{%endif%}
{% block body %}{% endblock %}
<a class="button" href="/">Go to Game Selection</a>
</div>
</div>
</div>

0 comments on commit 7c86d29

Please sign in to comment.