Including reversion templates for ease of use... probably a bad idea. From version...
authorBrandon King <kingb@caltech.edu>
Tue, 28 Apr 2009 21:53:14 +0000 (21:53 +0000)
committerBrandon King <kingb@caltech.edu>
Tue, 28 Apr 2009 21:53:14 +0000 (21:53 +0000)
templates/reversion/change_list.html [new file with mode: 0644]
templates/reversion/object_history.html [new file with mode: 0644]
templates/reversion/recover_form.html [new file with mode: 0644]
templates/reversion/recover_list.html [new file with mode: 0644]
templates/reversion/revision_form.html [new file with mode: 0644]

diff --git a/templates/reversion/change_list.html b/templates/reversion/change_list.html
new file mode 100644 (file)
index 0000000..b5c708b
--- /dev/null
@@ -0,0 +1,14 @@
+{% extends "admin/change_list.html" %}
+{% load i18n %}
+
+
+{% block object-tools %}
+       <ul class="object-tools">
+               {% if has_change_permission %}
+                       <li><a href="recover/" class="recoverlink">{% blocktrans with cl.opts.verbose_name_plural|escape as name %}Recover deleted {{name}}{% endblocktrans %}</a></li>
+               {% endif %}
+               {% if has_add_permission %}
+                       <li><a href="add/{% if is_popup %}?_popup=1{% endif %}" class="addlink">{% blocktrans with cl.opts.verbose_name|escape as name %}Add {{name}}{% endblocktrans %}</a></li>
+               {% endif %}
+       </ul>
+{% endblock %}
\ No newline at end of file
diff --git a/templates/reversion/object_history.html b/templates/reversion/object_history.html
new file mode 100644 (file)
index 0000000..2550012
--- /dev/null
@@ -0,0 +1,35 @@
+{% extends "admin/object_history.html" %}
+{% load i18n %}
+
+
+{% block content %}
+       <div id="content-main">
+       
+               <p>{% blocktrans %}Choose a date from the list below to revert to a previous version of this object.{% endblocktrans %}</p>
+       
+               <div class="module">
+                       {% if action_list %}
+                           <table id="change-history">
+                               <thead>
+                                       <tr>
+                                           <th scope="col">{% trans 'Date/time' %}</th>
+                                           <th scope="col">{% trans 'User' %}</th>
+                                           <th scope="col">{% trans 'Comment' %}</th>
+                                       </tr>
+                               </thead>
+                               <tbody>
+                                       {% for action in action_list %}
+                                               <tr>
+                                                   <th scope="row"><a href="./{{action.pk}}/">{{action.revision.date_created|date:_("DATETIME_FORMAT")}}</a></th>
+                                                   <td>{{action.revision.user.username}}{% if action.revision.user.first_name %} ({{action.revision.user.first_name}} {{action.revision.user.last_name}}){% endif %}</td>
+                                                   <td>{{action.revision.comment|default:""}}</td>
+                                               </tr>
+                                       {% endfor %}
+                               </tbody>
+                           </table>
+                       {% else %}
+                           <p>{% trans "This object doesn't have a change history. It probably wasn't added via this admin site." %}</p>
+                       {% endif %}
+               </div>
+       </div>
+{% endblock %}
\ No newline at end of file
diff --git a/templates/reversion/recover_form.html b/templates/reversion/recover_form.html
new file mode 100644 (file)
index 0000000..548ea30
--- /dev/null
@@ -0,0 +1,25 @@
+{% extends "reversion/revision_form.html" %}
+{% load i18n %}
+
+
+{% block extrahead %}
+    {{block.super.super.super}}
+    <script type="text/javascript" src="../../../../jsi18n/"></script>
+    {{media}}
+{% endblock %}
+
+
+{% block breadcrumbs %}
+       <div class="breadcrumbs">
+               <a href="../../../../">{% trans "Home" %}</a> &rsaquo;
+               <a href="../../../">{{app_label|capfirst|escape}}</a> &rsaquo; 
+               <a href="../../">{{opts.verbose_name_plural|capfirst}}</a> &rsaquo;
+               <a href="../">{% blocktrans with opts.verbose_name as verbose_name %}Recover deleted {{verbose_name}}{% endblocktrans %}</a> &rsaquo;
+               {{title}}
+       </div>
+{% endblock %}
+
+
+{% block form_top %}
+       <p>{% blocktrans %}Press the save button below to recover this version of the object.{% endblocktrans %}</p>
+{% endblock %}
\ No newline at end of file
diff --git a/templates/reversion/recover_list.html b/templates/reversion/recover_list.html
new file mode 100644 (file)
index 0000000..640f620
--- /dev/null
@@ -0,0 +1,39 @@
+{% extends "admin/base_site.html" %}
+{% load i18n %}
+
+{% block breadcrumbs %}
+<div class="breadcrumbs">
+    <a href="../../../">{% trans 'Home' %}</a> &rsaquo; 
+    <a href="../../">{{app_label|capfirst|escape}}</a> &rsaquo; 
+    <a href="../">{{module_name}}</a> &rsaquo; 
+    {% blocktrans with opts.verbose_name_plural|escape as name %}Recover deleted {{name}}{% endblocktrans %}
+</div>
+{% endblock %}
+
+{% block content %}
+       <div id="content-main">
+               <p>{% blocktrans %}Choose a date from the list below to recover a deleted version of an object.{% endblocktrans %}</p>
+               <div class="module">
+                       {% if deleted %}
+                           <table id="change-history">
+                               <thead>
+                               <tr>
+                                   <th scope="col">{% trans 'Date/time' %}</th>
+                                   <th scope="col">{{opts.verbose_name|capfirst}}</th>
+                               </tr>
+                               </thead>
+                               <tbody>
+                               {% for deletion in deleted %}
+                               <tr>
+                                   <th scope="row"><a href="{{deletion.pk}}/">{{deletion.revision.date_created|date:_("DATETIME_FORMAT")}}</a></th>
+                                   <td>{{deletion.object_repr}}</td>
+                               </tr>
+                               {% endfor %}
+                               </tbody>
+                           </table>
+                       {% else %}
+                           <p>{% trans "There are no deleted objects to recover." %}</p>
+                       {% endif %}
+               </div>
+       </div>
+{% endblock %}
\ No newline at end of file
diff --git a/templates/reversion/revision_form.html b/templates/reversion/revision_form.html
new file mode 100644 (file)
index 0000000..f6afca7
--- /dev/null
@@ -0,0 +1,33 @@
+{% extends "admin/change_form.html" %}
+{% load i18n %}
+
+
+{% block extrahead %}
+    {{block.super.super}}
+    <script type="text/javascript" src="../../../../../jsi18n/"></script>
+    {{media}}
+{% endblock %}
+
+
+{% block breadcrumbs %}
+       <div class="breadcrumbs">
+               <a href="../../../../../">{% trans "Home" %}</a> &rsaquo;
+               <a href="../../../../">{{app_label|capfirst|escape}}</a> &rsaquo; 
+               <a href="../../../">{{opts.verbose_name_plural|capfirst}}</a> &rsaquo;
+               <a href="../../">{{original|truncatewords:"18"}}</a> &rsaquo;
+               <a href="../">{% trans "History" %}</a> &rsaquo;
+               {% blocktrans with opts.verbose_name as verbose_name %}Revert {{verbose_name}}{% endblocktrans %}
+       </div>
+{% endblock %}
+
+
+{% block content %}
+       {% with 1 as is_popup %}
+               {{block.super}}
+       {% endwith %}
+{% endblock %}
+
+
+{% block form_top %}
+       <p>{% blocktrans %}Press the save button below to revert to this version of the object.{% endblocktrans %}</p>
+{% endblock %}
\ No newline at end of file