Commits

Josh Cartmell committed df59ece

Add a backup link to the admin dashboard.

  • Participants
  • Parent commits 2e85cc2

Comments (0)

Files changed (4)

 
 ## Usage
 
-1. Go to /admin/backup/ and you will be prompted to download a zip file
+1. Go to /admin/backup/ and you will be prompted to download a zip file
+2. Optionally add `"admin_backup"` to `INSTALLED_APPS` and `"admin_backup_tags.admin_backup"` to `DASHBOARD_TAGS` to add a backup link to the admin dashboard

File admin_backup/templates/admin/includes/backup.html

+{% load i18n mezzanine_tags %}
+
+<div class="module" id="backup-module">
+    <h2><a href="{% url 'admin_backup' %}">{% trans "Backup" %}</a></h2>
+</div>

File admin_backup/templatetags/__init__.py

Empty file added.

File admin_backup/templatetags/admin_backup_tags.py

+
+from __future__ import unicode_literals
+from mezzanine import template
+
+register = template.Library()
+
+@register.inclusion_tag("admin/includes/backup.html")
+def admin_backup():
+    """
+    Dashboard widget for displaying a backup button.
+    """
+    pass