diff --git a/Dockerfile b/Dockerfile index 909bc436c2e64db85df184241476bf719c336887..853f56bcd319b5ed2337d90c51b5c2b9154d4097 100644 --- a/Dockerfile +++ b/Dockerfile @@ -60,11 +60,13 @@ RUN apt-get update \ libpq5 \ libpcre3 \ zlib1g \ + git \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* COPY --chown=csi:csi . /app/ WORKDIR /app +RUN echo "__version__ = \"$(git describe)\"" > app/_version.py ENV PATH /venv/bin:$PATH EXPOSE 8000 diff --git a/app/_version.py b/app/_version.py new file mode 100644 index 0000000000000000000000000000000000000000..eb1b2324482ccc64443ce6284c9b5064ec943ba9 --- /dev/null +++ b/app/_version.py @@ -0,0 +1 @@ +__version__ = "dev" diff --git a/app/factory.py b/app/factory.py index 805fb552fa0bb19b2493b8be568c0591c54b0008..13fe8284f911b21e645d1829038a711536bd87cf 100644 --- a/app/factory.py +++ b/app/factory.py @@ -48,6 +48,7 @@ from .api.user import bp as user_api from .api.inventory import bp as inventory_api from .api.network import bp as network_api from .commands import register_cli +from ._version import __version__ from . import utils @@ -61,6 +62,7 @@ def create_app(config=None): app.jinja_env.filters["datetimeformat"] = utils.format_datetime app.jinja_env.filters["toyaml"] = utils.pretty_yaml + app.jinja_env.globals["__version__"] = __version__ if app.config["SENTRY_DSN"]: sentry_sdk.init( diff --git a/app/static/css/csentry.css b/app/static/css/csentry.css index 2de421cdf9a1ccc64e8f358f810f593230f63bda..073ba3c6bb65f7c11574fd88ed7884539d1ee5f3 100644 --- a/app/static/css/csentry.css +++ b/app/static/css/csentry.css @@ -46,6 +46,13 @@ a.nav-item.nav-link.active, .navbar-nav .nav-item:focus, color: #ffffff; } +/* version in navbar */ +.navbar-right .navbar-text { + color: #b4ebff; + font-family: 'Titillium Web'; + font-weight: 400; +} + /* username */ .navbar-right .dropdown-toggle { color: #b4ebff; diff --git a/app/templates/base.html b/app/templates/base.html index 32fe2f1cb6a2b6ddd759c065366dba0a321ae419..6025517036591dee8fbf3c393089636828ff0a95 100644 --- a/app/templates/base.html +++ b/app/templates/base.html @@ -42,6 +42,7 @@ </div> <div class="navbar-nav navbar-right"> {% block navbar_right %}{% endblock %} + <span class="navbar-text">Version {{ __version__ }}</span> {% if current_user.is_authenticated %} <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"> diff --git a/docs/_static/home.png b/docs/_static/home.png index 304ec9e96bd8840ca505dc8f91ad12c381bd5e0d..c3d691a2de80998bc6e35083275f1e1dc4e0beac 100644 Binary files a/docs/_static/home.png and b/docs/_static/home.png differ diff --git a/docs/index.rst b/docs/index.rst index 7e06cce6a6cdee988abf712e7c54fe88e4ba373c..a6a6fac4caebfa5066993a23cd3f02bece98670f 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -6,7 +6,7 @@ Control System Entry ==================== -Release v\ |version|. +Release |version|. Control System Entry is a web application that facilitates the tracking of physical items and network devices.