FreedomBox/plinth/modules/snapshot/templates/snapshot_manage.html
Sunil Mohan Adapa 144efd71b8
html: Drop type attribute value of text/javascript
As is encouraged[1]

https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/script#attribute_is_not_set_default_an_empty_string_or_a_javascript_mime_type

Links:

- Apps page loads and javascript works as expected.

Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2026-03-19 19:12:14 -04:00

78 lines
2.7 KiB
HTML

{% extends "app.html" %}
{% comment %}
# SPDX-License-Identifier: AGPL-3.0-or-later
{% endcomment %}
{% load bootstrap %}
{% load i18n %}
{% load static %}
{% block page_js %}
<script src="{% static 'snapshot/snapshot.js' %}" defer></script>
{% endblock %}
{% block configuration %}
<form class="form" method="post">
<div class="button-table">
<div class="btn-toolbar">
{% csrf_token %}
<input type="submit" class="btn btn-primary" name="create"
value="{% trans 'Create Snapshot' %}"/>
<input type="submit" class="btn btn-danger button-secondary"
name="delete_selected"
value="{% trans 'Delete Snapshots' %}"
{{ has_deletable_snapshots|yesno:',disabled="disabled"' }}/>
</div>
<div class="table-responsive">
<table class="table">
<thead>
<th>{% trans "Number" %}</th>
<th>{% trans "Date" %}</th>
<th>{% trans "Description" %}</th>
<th class="centered-column">{% trans "Rollback" %}</th>
<th class="centered-column"><input type="checkbox" id="select-all"></th>
</thead>
<tbody>
{% for snapshot in snapshots %}
<tr>
<td>
{{ snapshot.number }}
{% if snapshot.is_default %}
<span class="badge text-bg-secondary">
{% trans "will be used at next boot" %}
</span>
{% endif %}
{% if snapshot.is_active %}
<span class="badge text-bg-success">
{% trans "in use" %}
</span>
{% endif %}
</td>
<td>{{ snapshot.date }}</td>
<td>{% trans snapshot.description %}</td>
<td class="centered-column">
<a href="{% url 'snapshot:rollback' snapshot.number %}"
class="btn btn-default btn-sm" role="button"
title="{% blocktrans trimmed with number=snapshot.number %}
Rollback to snapshot #{{ number }}
{% endblocktrans %}">
<span class="fa fa-repeat"
aria-hidden="true"></span>
</a>
</td>
<td class="centered-column">
{% if not snapshot.is_default and not snapshot.is_active %}
<input type="checkbox" name="snapshot_list" value={{ snapshot.number }} />
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</form>
{% endblock %}