Show whether backup, restores and updates are allowed or disabled by sysadmin on update manager

This commit is contained in:
Jan Böhmer 2026-03-07 19:25:41 +01:00
parent 6d43a979b8
commit 166c3b8546
3 changed files with 309 additions and 283 deletions

View file

@ -1,5 +1,7 @@
{% extends "main_card.html.twig" %} {% extends "main_card.html.twig" %}
{% import "helper.twig" as helper %}
{% block title %}Part-DB {% trans %}update_manager.title{% endtrans %}{% endblock %} {% block title %}Part-DB {% trans %}update_manager.title{% endtrans %}{% endblock %}
{% block card_title %} {% block card_title %}
@ -100,17 +102,23 @@
<tr> <tr>
<th scope="row">{% trans %}update_manager.auto_update_supported{% endtrans %}</th> <th scope="row">{% trans %}update_manager.auto_update_supported{% endtrans %}</th>
<td> <td>
{% if status.can_auto_update %} {{ helper.boolean_badge(status.can_auto_update) }}
<span class="badge bg-success">
<i class="fas fa-check me-1"></i>{% trans %}Yes{% endtrans %}
</span>
{% else %}
<span class="badge bg-secondary">
<i class="fas fa-times me-1"></i>{% trans %}No{% endtrans %}
</span>
{% endif %}
</td> </td>
</tr> </tr>
<tr>
<th scope="row">{% trans %}update_manager.web_updates_allowed{% endtrans %}</th>
<td>{{ helper.boolean_badge(not web_updates_disabled) }}</td>
</tr>
<tr>
<th scope="row">{% trans %}update_manager.backup_restore_allowed{% endtrans %}</th>
<td>{{ helper.boolean_badge(not backup_restore_disabled) }}</td>
</tr>
<tr>
<th scope="row">{% trans %}update_manager.backup_download_allowed{% endtrans %}</th>
<td>{{ helper.boolean_badge(not backup_download_disabled) }}</td>
</tr>
</tbody> </tbody>
</table> </table>
</div> </div>

View file

@ -1,8 +1,8 @@
{% macro boolean(value) %} {% macro boolean(value) %}
{% if value %} {% if value %}
{% trans %}bool.true{% endtrans %} {% trans %}Yes{% endtrans %}
{% else %} {% else %}
{% trans %}bool.false{% endtrans %} {% trans %}No{% endtrans %}
{% endif %} {% endif %}
{% endmacro %} {% endmacro %}
@ -14,9 +14,9 @@
{% macro bool_icon(bool) %} {% macro bool_icon(bool) %}
{% if bool %} {% if bool %}
<i class="fas fa-check-circle fa-fw" title="{% trans %}Yes{% endtrans %}"></i> <i class="fas fa-check fa-fw" title="{% trans %}Yes{% endtrans %}"></i>
{% else %} {% else %}
<i class="fas fa-times-circle fa-fw" title="{% trans %}No{% endtrans %}"></i> <i class="fas fa-times fa-fw" title="{% trans %}No{% endtrans %}"></i>
{% endif %} {% endif %}
{% endmacro %} {% endmacro %}
@ -24,7 +24,7 @@
{% if value %} {% if value %}
{% set class = class ~ ' bg-success' %} {% set class = class ~ ' bg-success' %}
{% else %} {% else %}
{% set class = class ~ ' bg-danger' %} {% set class = class ~ ' bg-secondary' %}
{% endif %} {% endif %}
<span class="{{ class }}">{{ _self.bool_icon(value) }} {{ _self.boolean(value) }}</span> <span class="{{ class }}">{{ _self.bool_icon(value) }} {{ _self.boolean(value) }}</span>

View file

@ -12923,5 +12923,23 @@ Buerklin-API Authentication server:
<target>Cancel</target> <target>Cancel</target>
</segment> </segment>
</unit> </unit>
<unit id="jdpoFf2" name="update_manager.web_updates_allowed">
<segment>
<source>update_manager.web_updates_allowed</source>
<target>Web updates allowed</target>
</segment>
</unit>
<unit id="bdWa7is" name="update_manager.backup_restore_allowed">
<segment>
<source>update_manager.backup_restore_allowed</source>
<target>Backup restore allowed</target>
</segment>
</unit>
<unit id="kllGQEN" name="update_manager.backup_download_allowed">
<segment>
<source>update_manager.backup_download_allowed</source>
<target>Backup download allowed</target>
</segment>
</unit>
</file> </file>
</xliff> </xliff>