Skip to content

Commit

Permalink
Merge pull request #95 from IFB-ElixirFr/version-at-the-bottom
Browse files Browse the repository at this point in the history
adding version in page + making jsonld available globally in templates
  • Loading branch information
thomasrosnet authored Apr 6, 2022
2 parents 208515c + a96688a commit e37fc0a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
17 changes: 13 additions & 4 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,19 @@
DICT_TEMP_RES = {}


@app.context_processor
def inject_app_version():
repo = git.Repo(".")
tags = sorted(repo.tags, key=lambda t: t.commit.committed_datetime)
latest_tag = tags[-1]
return dict(version_tag=latest_tag)


@app.context_processor
def inject_jsonld():
return dict(jld=buildJSONLD())


@app.route("/favicon.ico")
def favicon():
return send_from_directory(
Expand All @@ -158,7 +171,6 @@ def home():
"index.html",
title="FAIR-Checker",
subtitle="Improve the FAIRness of your web resources",
jld=buildJSONLD(),
)


Expand All @@ -175,7 +187,6 @@ def about():
"about.html",
title="About",
subtitle="More about FAIR-Checker",
jld=buildJSONLD(),
)


Expand All @@ -185,7 +196,6 @@ def statistics():
"statistics.html",
title="Statistics",
subtitle="Visualize usage statistics of FAIR-Checker",
jld=buildJSONLD(),
evals=stats.evaluations_this_week(),
success=stats.success_this_week(),
success_weekly=stats.success_weekly_one_year(),
Expand Down Expand Up @@ -1232,7 +1242,6 @@ def kg_metrics_2():
sample_data=sample_resources,
title="Inspect",
subtitle="to enhance metadata quality",
jld=buildJSONLD(),
)


Expand Down
6 changes: 5 additions & 1 deletion templates/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,13 @@

</div>
<div class="content has-text-centered">
<p>
Software version:
<a href="https://github.com/IFB-ElixirFr/FAIR-checker/releases/tag/{{ version_tag }}" target="_blank">{{ version_tag }}</a>
</p>
<p>
The source code is licensed
<a href="http://opensource.org/licenses/mit-license.php">MIT</a>.
<a href="http://opensource.org/licenses/mit-license.php" target="_blank">MIT</a>.
</p>
</div>

Expand Down

0 comments on commit e37fc0a

Please sign in to comment.