| 1 | {% comment %} |
| 2 | # SPDX-License-Identifier: AGPL-3.0-or-later |
| 3 | {% endcomment %} |
| 4 | |
| 5 | {% load i18n %} |
| 6 | {% load extras %} |
| 7 | |
| 8 | <div class="table-responsive repository" data-repository-name="{{ repository.name }}"> |
| 9 | <table class="table" class="archives-list"> |
| 10 | <thead> |
| 11 | <tr> |
| 12 | <th colspan="2"> |
| 13 | <div class="d-sm-flex flex-sm-row"> |
| 14 | <div class="flex-sm-grow-1 lh-lg collapsible-button" |
| 15 | data-bs-toggle="collapse" data-bs-target="#{{ uuid }}"> |
| 16 | {% icon 'chevron-right' %} |
| 17 | {% if repository.error %} |
| 18 | <span title={{ repository.error }}> |
| 19 | {% icon 'exclamation-triangle' %}</span> |
| 20 | {% elif repository.is_encrypted %} |
| 21 | <span title="{% trans "This repository is encrypted" %}"> |
| 22 | {% icon 'lock' class='svg-icon encrypted' %} |
| 23 | </span> |
| 24 | {% endif %} |
| 25 | |
| 26 | <span class="repository-name">{{ repository.name }}</span> |
| 27 | </div> |
| 28 | |
| 29 | <div class="text-end"> |
| 30 | <a class="repository-schedule btn btn-sm btn-primary" |
| 31 | href="{% url 'backups:schedule' uuid %}"> |
| 32 | {% icon 'clock-o' %} |
| 33 | {% trans "Schedule" %} |
| 34 | </a> |
| 35 | |
| 36 | {% if repository.flags.mountable %} |
| 37 | |
| 38 | {% if repository.mounted %} |
| 39 | |
| 40 | <form action="{% url 'backups:repository-umount' uuid %}" method="POST" |
| 41 | class="inline-block" > |
| 42 | {% csrf_token %} |
| 43 | <button type="submit" class="btn btn-sm btn-default" |
| 44 | title="{% trans 'Unmount Location' %}"> |
| 45 | {% icon 'eject' %} |
| 46 | </button> |
| 47 | </form> |
| 48 | |
| 49 | {% else %} |
| 50 | |
| 51 | <form action="{% url 'backups:repository-mount' uuid %}" method="POST" |
| 52 | class="inline-block" > |
| 53 | {% csrf_token %} |
| 54 | <button type="submit" class="btn btn-sm btn-default" |
| 55 | title="{% trans 'Mount Location' %}"> |
| 56 | {% icon 'eye' %} |
| 57 | </button> |
| 58 | </form> |
| 59 | |
| 60 | {% endif %} |
| 61 | |
| 62 | {% endif %} |
| 63 | |
| 64 | {% if repository.flags.removable %} |
| 65 | |
| 66 | <a title="{% trans 'Remove Backup Location. This will not delete the remote backup.' %}" |
| 67 | role="button" class="repository-remove btn btn-sm btn-default" |
| 68 | href="{% url 'backups:repository-remove' uuid %}"> |
| 69 | {% icon 'trash-o' %} |
| 70 | </a> |
| 71 | |
| 72 | {% endif %} |
| 73 | </div> |
| 74 | </div> |
| 75 | </th> |
| 76 | </tr> |
| 77 | </thead> |
| 78 | |
| 79 | <tbody class="collapse show" id="{{ uuid }}"> |
| 80 | {% if repository.mounted %} |
| 81 | |
| 82 | {% for archive in repository.archives %} |
| 83 | <tr id="archive-{{ archive.name }}" class="archive"> |
| 84 | <td class="archive-name">{{ archive.name }}</td> |
| 85 | <td class="archive-operations"> |
| 86 | <a class="archive-export btn btn-sm btn-default" |
| 87 | href="{% url 'backups:download' uuid archive.name %}"> |
| 88 | {% trans "Download" %} |
| 89 | </a> |
| 90 | <a class="archive-export btn btn-sm btn-default" |
| 91 | href="{% url 'backups:restore-archive' uuid archive.name %}"> |
| 92 | {% trans "Restore" %} |
| 93 | </a> |
| 94 | <a class="archive-delete btn btn-sm btn-default" |
| 95 | href="{% url 'backups:delete' uuid archive.name %}"> |
| 96 | {% icon 'trash-o' %} |
| 97 | </a> |
| 98 | </td> |
| 99 | </tr> |
| 100 | {% endfor %} |
| 101 | |
| 102 | {% if repository.error %} |
| 103 | <tr> |
| 104 | <td> |
| 105 | <p>{{ repository.error }}</p> |
| 106 | </td> |
| 107 | </tr> |
| 108 | {% endif %} |
| 109 | |
| 110 | {% if not repository.error and not repository.archives %} |
| 111 | <tr> |
| 112 | <td> |
| 113 | <p>{% trans 'No archives currently exist.' %}</p> |
| 114 | </td> |
| 115 | </tr> |
| 116 | {% endif %} |
| 117 | |
| 118 | {% endif %} |
| 119 | </tbody> |
| 120 | </table> |
| 121 | </div> |