Skip to content
Snippets Groups Projects
Commit 626f22d9 authored by Benjamin Bertrand's avatar Benjamin Bertrand
Browse files

Add app version in navbar

The version file is created when building the docker image
using the git tag.

Switch to calendar versioning

JIRA INFRA-1789 #action In Progress
parent 0461682a
No related branches found
No related tags found
No related merge requests found
...@@ -60,11 +60,13 @@ RUN apt-get update \ ...@@ -60,11 +60,13 @@ RUN apt-get update \
libpq5 \ libpq5 \
libpcre3 \ libpcre3 \
zlib1g \ zlib1g \
git \
&& apt-get clean \ && apt-get clean \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
COPY --chown=csi:csi . /app/ COPY --chown=csi:csi . /app/
WORKDIR /app WORKDIR /app
RUN echo "__version__ = \"$(git describe)\"" > app/_version.py
ENV PATH /venv/bin:$PATH ENV PATH /venv/bin:$PATH
EXPOSE 8000 EXPOSE 8000
......
__version__ = "dev"
...@@ -48,6 +48,7 @@ from .api.user import bp as user_api ...@@ -48,6 +48,7 @@ from .api.user import bp as user_api
from .api.inventory import bp as inventory_api from .api.inventory import bp as inventory_api
from .api.network import bp as network_api from .api.network import bp as network_api
from .commands import register_cli from .commands import register_cli
from ._version import __version__
from . import utils from . import utils
...@@ -61,6 +62,7 @@ def create_app(config=None): ...@@ -61,6 +62,7 @@ def create_app(config=None):
app.jinja_env.filters["datetimeformat"] = utils.format_datetime app.jinja_env.filters["datetimeformat"] = utils.format_datetime
app.jinja_env.filters["toyaml"] = utils.pretty_yaml app.jinja_env.filters["toyaml"] = utils.pretty_yaml
app.jinja_env.globals["__version__"] = __version__
if app.config["SENTRY_DSN"]: if app.config["SENTRY_DSN"]:
sentry_sdk.init( sentry_sdk.init(
......
...@@ -46,6 +46,13 @@ a.nav-item.nav-link.active, .navbar-nav .nav-item:focus, ...@@ -46,6 +46,13 @@ a.nav-item.nav-link.active, .navbar-nav .nav-item:focus,
color: #ffffff; color: #ffffff;
} }
/* version in navbar */
.navbar-right .navbar-text {
color: #b4ebff;
font-family: 'Titillium Web';
font-weight: 400;
}
/* username */ /* username */
.navbar-right .dropdown-toggle { .navbar-right .dropdown-toggle {
color: #b4ebff; color: #b4ebff;
......
...@@ -42,6 +42,7 @@ ...@@ -42,6 +42,7 @@
</div> </div>
<div class="navbar-nav navbar-right"> <div class="navbar-nav navbar-right">
{% block navbar_right %}{% endblock %} {% block navbar_right %}{% endblock %}
<span class="navbar-text">Version {{ __version__ }}</span>
{% if current_user.is_authenticated %} {% if current_user.is_authenticated %}
<div class="dropdown {{ is_active(path == "/user/profile") }}"> <div class="dropdown {{ is_active(path == "/user/profile") }}">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <a class="nav-link dropdown-toggle" href="#" id="navbarDropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
......
docs/_static/home.png

1.5 MiB | W: | H:

docs/_static/home.png

1.52 MiB | W: | H:

docs/_static/home.png
docs/_static/home.png
docs/_static/home.png
docs/_static/home.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
Control System Entry Control System Entry
==================== ====================
Release v\ |version|. Release |version|.
Control System Entry is a web application that facilitates the tracking of physical items Control System Entry is a web application that facilitates the tracking of physical items
and network devices. and network devices.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment