mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-31 00:04:40 +02:00
Show a notification on homepage and server info page if there is a new version available.
This commit is contained in:
parent
fa4af99525
commit
1fb334b0ca
16 changed files with 1741 additions and 1346 deletions
9
templates/components/new_version.macro.html.twig
Normal file
9
templates/components/new_version.macro.html.twig
Normal file
|
@ -0,0 +1,9 @@
|
|||
{% macro new_version_alert(is_available, new_version, new_version_url) %}
|
||||
{% if is_available %}
|
||||
<div class="alert alert-success" role="alert">
|
||||
<h5><i class="fa-solid fa-champagne-glasses"></i> {% trans %}update_manager.new_version_available.title{% endtrans %}</h5>
|
||||
{% trans %}update_manager.new_version_available.text{% endtrans %}: <b><a href="{{ new_version_url }}" class="alert-link link-external" target="_blank">{% trans %}version.caption{% endtrans %} {{ new_version }}</a></b>
|
||||
<br><small>{% trans %}update_manager.new_version_available.only_administrators_can_see{% endtrans %}</small>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endmacro %}
|
|
@ -1,6 +1,13 @@
|
|||
{% extends "base.html.twig" %}
|
||||
|
||||
{% import "components/new_version.macro.html.twig" as nv %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
{% if is_granted('@system.show_updates') %}
|
||||
{{ nv.new_version_alert(new_version_available, new_version, new_version_url) }}
|
||||
{% endif %}
|
||||
|
||||
<div class="rounded p-4 bg-body-secondary">
|
||||
<h1 class="display-3">{{ partdb_title }}</h1>
|
||||
<h4>
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
{% extends "main_card.html.twig" %}
|
||||
{% import "components/new_version.macro.html.twig" as nv %}
|
||||
|
||||
{% block title %}{% trans %}tools.server_infos.title{% endtrans %}{% endblock %}
|
||||
|
||||
|
@ -6,6 +7,12 @@
|
|||
<i class="fas fa-database"></i> {% trans %}tools.server_infos.title{% endtrans %}
|
||||
{% endblock %}
|
||||
|
||||
{% block before_card %}
|
||||
{% if is_granted('@system.show_updates') %}
|
||||
{{ nv.new_version_alert(new_version_available, new_version, new_version_url) }}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block card_content %}
|
||||
<nav>
|
||||
<div class="nav nav-tabs" id="nav-tab" role="tablist">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue