Skip to content

Commit

Permalink
feat(ui): show version of UsersHub in the header nav
Browse files Browse the repository at this point in the history
  • Loading branch information
jacquesfize committed Nov 22, 2024
1 parent ce5d200 commit a28b300
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 40 deletions.
1 change: 1 addition & 0 deletions app/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ def create_app():
os.environ["SCRIPT_NAME"] = app.config["APPLICATION_ROOT"]
app.config["URL_REDIRECT"] = "{}/{}".format(app.config["URL_APPLICATION"], "login")
app.secret_key = app.config["SECRET_KEY"]
app.config["VERSION"] = open("VERSION").read().strip()
app.wsgi_app = ProxyFix(app.wsgi_app, x_host=1)
db.init_app(app)
app.config["DB"] = db
Expand Down
100 changes: 60 additions & 40 deletions app/templates/head-appli.html
Original file line number Diff line number Diff line change
@@ -1,41 +1,61 @@
<div class="navbar navbar-expand-lg navbar-dark bg-dark" style="margin-bottom: 25px;">
<a class="navbar-brand" href="#">UsersHub</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav"
aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div
class="navbar navbar-expand-lg navbar-dark bg-dark"
style="margin-bottom: 25px"
>
<a class="navbar-brand" href="#">UsersHub {{config['VERSION']}}</a>
<button
class="navbar-toggler"
type="button"
data-toggle="collapse"
data-target="#navbarNav"
aria-controls="navbarNav"
aria-expanded="false"
aria-label="Toggle navigation"
>
<span class="navbar-toggler-icon"></span>
</button>

<div class="collapse navbar-collapse" id="navbarNav">
<ul class="nav navbar-nav mr-auto">
<li class="nav-item">
<a class="nav-link" href="{{ url_for('user.users') }}">Utilisateurs</a>
</li>
<li class="nav-item">
<a class="nav-link" href="{{ url_for('organisme.organisms') }}">Organismes</a>
</li>
<li class="nav-item">
<a class="nav-link" href="{{ url_for('groupe.groups') }}">Groupes</a>
</li>
<li class="nav-item">
<a class="nav-link" href="{{ url_for('liste.lists') }}">Listes</a>
</li>
<li class="nav-item">
<a class="nav-link" href="{{ url_for('application.applications') }}">Applications</a>
</li>
<li class="nav-item">
<a class="nav-link" href="{{ url_for('profils.profils') }}">Profils</a>
</li>
<li class="nav-item">
<a class="nav-link" href="{{ url_for('temp_users.temp_users_list') }}">Demandes de compte</a>
</li>
</ul>
<ul class="navbar-nav ml-auto">
<li class="nav-item">
<a class="nav-link" title="Déconnexion" href="{{ url_for('auth.logout') }}?redirect={{config.URL_REDIRECT}}">
{{user.identifiant}}
<i class="fa fa-sign-out font-medium" aria-hidden="true"></i>
</a>
</li>
</ul>
</div>
</div>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="nav navbar-nav mr-auto">
<li class="nav-item">
<a class="nav-link" href="{{ url_for('user.users') }}">Utilisateurs</a>
</li>
<li class="nav-item">
<a class="nav-link" href="{{ url_for('organisme.organisms') }}"
>Organismes</a
>
</li>
<li class="nav-item">
<a class="nav-link" href="{{ url_for('groupe.groups') }}">Groupes</a>
</li>
<li class="nav-item">
<a class="nav-link" href="{{ url_for('liste.lists') }}">Listes</a>
</li>
<li class="nav-item">
<a class="nav-link" href="{{ url_for('application.applications') }}"
>Applications</a
>
</li>
<li class="nav-item">
<a class="nav-link" href="{{ url_for('profils.profils') }}">Profils</a>
</li>
<li class="nav-item">
<a class="nav-link" href="{{ url_for('temp_users.temp_users_list') }}"
>Demandes de compte</a
>
</li>
</ul>
<ul class="navbar-nav ml-auto">
<li class="nav-item">
<a
class="nav-link"
title="Déconnexion"
href="{{ url_for('auth.logout') }}?redirect={{config.URL_REDIRECT}}"
>
{{user.identifiant}}
<i class="fa fa-sign-out font-medium" aria-hidden="true"></i>
</a>
</li>
</ul>
</div>
</div>

0 comments on commit a28b300

Please sign in to comment.