From d615709b8a34715ca70694011e6bfe064761323e Mon Sep 17 00:00:00 2001
From: Sunil Mohan Adapa {{ title }}
+{% block configuration %}
-
-
{% trans "Number" %}
- {% trans "Date" %}
- {% trans "Description" %}
- {% trans "Rollback" %}
- {% trans "Delete" %}
-
-
- {% for snapshot in snapshots %}
- {% if snapshot.description != "current" %}
-
-
- {% endif %}
- {% endfor %}
-
+
+ {{ snapshot.number }}
- {{ snapshot.date }}
-
- {% if snapshot.is_default %}
- {% trans "[default subvolume]" %}
-
- {% endif %}
- {{ snapshot.description }}
-
-
-
-
-
-
- {% if not snapshot.is_default %}
-
-
-
- {% endif %}
-
- {% trans "Number" %}
+ {% trans "Date" %}
+ {% trans "Description" %}
+ {% trans "Rollback" %}
+ {% trans "Delete" %}
+
+
+ {% for snapshot in snapshots %}
+ {% if snapshot.description != "current" %}
+
+
+ {% endif %}
+ {% endfor %}
+
+ {{ snapshot.number }}
+ {% if snapshot.is_default %}
+
+ {% trans "active" %}
+
+ {% endif %}
+
+ {{ snapshot.date }}
+ {{ snapshot.description }}
+
+
+
+
+
+
+ {% if not snapshot.is_default %}
+
+
+
+ {% endif %}
+
+
- {% blocktrans trimmed %} - The snapshot will be permanently deleted. Please confirm. - {% endblocktrans %} -
+{% trans "Delete this snapshot permanently?" %}
{% trans "Roll back the system to this snapshot?" %}
+{% blocktrans trimmed %} - The system will be rolled back to the selected snapshot. Please confirm. + A new snapshot with the current state of the file system will be + automatically created. You will be able to undo a rollback by + reverting to the newly created snapshot. {% endblocktrans %}
@@ -54,7 +58,9 @@ {% csrf_token %} + value="{% blocktrans trimmed with number=snapshot.number %} + Rollback to Snapshot #{{ number }} + {% endblocktrans %}"/> diff --git a/plinth/modules/snapshot/views.py b/plinth/modules/snapshot/views.py index 87702a4e9..1cdcbef0d 100644 --- a/plinth/modules/snapshot/views.py +++ b/plinth/modules/snapshot/views.py @@ -41,6 +41,7 @@ def index(request): return TemplateResponse(request, 'snapshot.html', {'title': snapshot_module.title, + 'description': snapshot_module.description, 'snapshots': snapshots}) @@ -48,16 +49,17 @@ def delete(request, number): """Show confirmation to delete a snapshot.""" if request.method == 'POST': actions.superuser_run('snapshot', ['delete', number]) - messages.success(request, _('Deleted snapshot.')) + messages.success( + request, _('Deleted snapshot #{number}.').format(number=number)) return redirect(reverse('snapshot:index')) output = actions.superuser_run('snapshot', ['list']) snapshots = json.loads(output) snapshot = None - for s in snapshots: - if s['number'] == number: - snapshot = s + for current_snapshot in snapshots: + if current_snapshot['number'] == number: + snapshot = current_snapshot return TemplateResponse(request, 'snapshot_delete.html', {'title': _('Delete Snapshot'), @@ -68,7 +70,9 @@ def rollback(request, number): """Show confirmation to rollback to a snapshot.""" if request.method == 'POST': actions.superuser_run('snapshot', ['rollback', number]) - messages.success(request, _('Set default subvolume for rollback.')) + messages.success( + request, + _('Rolled back to snapshot #{number}.').format(number=number)) messages.warning( request, _('The system must be restarted to complete the rollback.')) @@ -78,9 +82,9 @@ def rollback(request, number): snapshots = json.loads(output) snapshot = None - for s in snapshots: - if s['number'] == number: - snapshot = s + for current_snapshot in snapshots: + if current_snapshot['number'] == number: + snapshot = current_snapshot return TemplateResponse(request, 'snapshot_rollback.html', {'title': _('Rollback to Snapshot'),