www: Add version tag to footer

This commit is contained in:
Samuel Ortion 2022-08-19 07:46:41 +02:00
parent 3ca0abe147
commit 9d4f6ffd8c
6 changed files with 70 additions and 29 deletions

View File

@ -4,6 +4,7 @@
"@symfony/stimulus-bridge": "^3.2.0",
"@symfony/webpack-encore": "^3.0.0",
"core-js": "^3.23.0",
"git-revision-webpack-plugin": "^5.0.0",
"regenerator-runtime": "^0.13.9",
"webpack-notifier": "^1.15.0"
},

View File

@ -0,0 +1,14 @@
{% block content %}
<h2>{{ "Disk usage"|trans }}</h2>
<div class="disk">
<span class="disk-device">
{{ disk.device }}
</span>
<span>
{{ disk.usage }}
</span>
<span>
{{ disk.available }}
</span>
</div>
{% endblock %}

View File

@ -9,4 +9,7 @@
</span>
<a href="https://samuel.ortion.fr/">Samuel ORTION</a>
</p>
<p class="version">
version: <span class="version-number">v</span>
</p>
</footer>

View File

@ -1,31 +1,38 @@
{% extends "base.html.twig" %}
{% extends 'base.html.twig' %}
{% block content %}
<h2>
{% set today = "now" | date("Y-m-d") %}
{% set today = 'now'|date('Y-m-d') %}
{% if today == date %}
{{ "Today's detected species" | trans }}
{{ "Today's detected species"|trans }}
{% else %}
{{ "Detected species on" | trans }}
{{ date | format_datetime("full", "none") }}
{{ 'Detected species on'|trans }}
{{ date|format_datetime('full', 'none') }}
{% endif %}
</h2>
{% set endpoint = "today" %}
{% include "utils/calendar.html.twig" %}
{% set endpoint = 'today' %}
{% include 'utils/calendar.html.twig' %}
{# Display a list of records if any, else, print message #}
{% if results is defined and results | length > 0 %}
{% if results is defined and (results|length) > 0 %}
<ul>
{% for sp in results %}
<li class="species">
<span class="scientific-name">
{{ sp['scientific_name'] }}
(
</span>
<span class="common-name">{{ sp['common_name'] }}</span>)
<span class="link">
<a href="./species/{{ sp['taxon_id'] }}">
<span class="scientific-name">{{ sp["scientific_name"] }}
(</span>
<span class="common-name">{{ sp["common_name"] }}</span>)
<i data-feather="link"></i>
</a>
</span>
</li>
{% endfor %}
</ul>
{% else %}
<p>{{ "No species detected this day" | trans }}</p>
<p>
{{ 'No species detected this day'|trans }}
</p>
{% endif %}
{% endblock %}

View File

@ -1,4 +1,7 @@
const Encore = require('@symfony/webpack-encore');
const { DefinePlugin } = require('webpack');
const { GitRevisionPlugin } = require('git-revision-webpack-plugin');
const gitRevisionPlugin = new GitRevisionPlugin({lightweightTags: true});
// Manually configure the runtime environment if not already configured yet by the "encore" command.
// It's useful when you use tools that rely on webpack.config.js file.
@ -73,6 +76,14 @@ Encore
// uncomment if you're having problems with a jQuery plugin
//.autoProvidejQuery()
;
.addPlugin(
new DefinePlugin(
{
VERSION: JSON.stringify(gitRevisionPlugin.version()),
}
)
)
;
module.exports = Encore.getWebpackConfig();

View File

@ -2365,6 +2365,11 @@ get-stream@^6.0.0:
resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-6.0.1.tgz#a262d8eef67aced57c2852ad6167526a43cbf7b7"
integrity sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==
git-revision-webpack-plugin@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/git-revision-webpack-plugin/-/git-revision-webpack-plugin-5.0.0.tgz#0683a6a110ece618499880431cd89e1eb597b536"
integrity sha512-RptQN/4UKcEPkCBmRy8kLPo5i8MnF8+XfAgFYN9gbwmKLTLx4YHsQw726H+C5+sIGDixDkmGL3IxPA2gKo+u4w==
glob-parent@~5.1.2:
version "5.1.2"
resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4"