changeset 2358:566c2adb1f36

Adds a basic history view (try)
author sharky93 <rishabhr123@gmail.com>
date Sun, 28 Jul 2013 15:21:34 +0530
parents 20ba81bbe10a
children 70c76c0949e1
files MoinMoin/themes/basic/static/css/common.css MoinMoin/themes/basic/templates/history.html
diffstat 2 files changed, 94 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/themes/basic/static/css/common.css	Fri Jul 26 23:16:49 2013 +0530
+++ b/MoinMoin/themes/basic/static/css/common.css	Sun Jul 28 15:21:34 2013 +0530
@@ -6,6 +6,12 @@
   border-color: rgba(82, 168, 236, 0.8);
   box-shadow: 0px 1px 1px rgba(0, 0, 0, 0.075) inset, 0px 0px 4px rgba(82, 168, 236, 0.6);
 }
+.moin-hist-rev {
+	text-align: center;
+}
+#moin-button-diff {
+	text-align: center;
+}
 .sidebar-nav {
   padding: 9px 0;
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MoinMoin/themes/basic/templates/history.html	Sun Jul 28 15:21:34 2013 +0530
@@ -0,0 +1,88 @@
+{% extends theme("layout.html") %}
+{% import "utils.html" as utils %}
+{% import theme("itemviews.html") as itemviews with context %}
+
+{% set title = _("History of '%(item_name)s'", item_name=item_name) %}
+
+{% block views %}
+{{ itemviews }}
+{% endblock %}
+
+{% block content %}
+    {% set (history, next_offset, previous_offset) = history_page %}
+    {% if history %}
+    <div class='moin-offset-links'>
+        {% if previous_offset >= 0 %}
+            <a href="{{ url_for('frontend.history', item_name=item_name, offset=previous_offset) }}" title="{{ _("Previous") }}">&laquo;</a>
+        {% endif %}
+        {% if next_offset %}
+            <a href="{{ url_for('frontend.history', item_name=item_name, offset=next_offset) }}" title="{{ _("Next") }}">&raquo;</a>
+        {% endif %}
+    </div>
+    <h2>{{ title }}</h2>
+    <div class="moin-clr"></div>
+    <form action="{{ url_for('frontend.diff', item_name=item_name) }}" method="GET">
+        <div id="moin-page-history">
+        <table class="table table-hover table-condensed">
+            <thead>
+                <tr>
+                    <th>{{ _("Name") }}</th>
+                    <th>{{ _("Rev.") }}</th>
+                    <th>{{ _("Timestamp") }}</th>
+                    <th class="moin-integer">{{ _("Size") }}</th>
+                    <th id="moin-button-diff"><button class="btn btn-primary">Diff</button></th>
+                    <th>{{ _("Editor") }}</th>
+                    <th>{{ _("Content-Type") }}</th>
+                    <th>{{ _("Comment") }}</th>
+                    <th></th>
+                </tr>
+            </thead>
+            <tbody>
+                {% for doc in history %}
+                <tr>
+                    <td class="moin-wordbreak">{{ doc.name|join(' | ') }}</td>
+                    <td>{{ doc.revid | shorten_id }}</td>
+                    <td>{{ doc.mtime|datetimeformat }}</td>
+                    <td class="moin-integer">{{ doc.size }}</td>
+                    <td>
+                        <div class="moin-hist-rev">
+                            <input type="radio" name="rev1" value="{{ doc.revid }}" />
+                            <input type="radio" name="rev2" value="{{ doc.revid }}" />
+                        </div>
+                    </td>
+                    <td class="moin-wordbreak">{{ utils.editor_info(doc) }}</td>
+                    <td class="moin-wordbreak">{{ doc.contenttype }}</td>
+                    <td class="moin-wordbreak">{{ doc.comment }}</td>
+                    <td>
+            <div class="dropup">
+                        <button class="btn btn-primary dropdown-toggle" data-toggle="dropdown"> <span class="caret"></span></button>
+                <ul class="dropdown-menu pull-right"> 
+<li><a href="{{ url_for('frontend.show_item', item_name=doc.name[0], rev=doc.revid) }}" tabindex="-1" href="#">{{ _('show') }}</a></li>
+<li><a href="{{ url_for('frontend.show_item_meta', item_name=doc.name[0], rev=doc.revid) }}" tabindex="-1" href="#">{{ _('meta') }}</a></li>
+<li><a href="{{ url_for('frontend.download_item', item_name=doc.name[0], rev=doc.revid) }}" tabindex="-1" href="#">{{ _('download') }}</a></li>
+<li>
+    <a href="{{ url_for('frontend.highlight_item', item_name=doc.name[0], rev=doc.revid) }}" tabindex="-1" href="#">{{ _('highlight') }}</a>
+</li>
+    {% if user.may.write(item_name) -%}
+    <li><a href="{{ url_for('frontend.revert_item', item_name=doc.name[0], rev=doc.revid) }}" tabindex="-1" href="#">{{ _('revert') }}</a></li>
+    {%- endif %}
+    {% if user.may.destroy(item_name) -%}
+    <li><a href="{{ url_for('frontend.destroy_item', item_name=doc.name[0], rev=doc.revid) }}" tabindex="-1" href="#">{{ _('destroy') }}</a> </li>
+    {%- endif %}
+        </tr>
+        {% endfor %}
+            </tbody>
+            {% if bookmark_time %}
+            <tfoot>
+                <tr>
+                    <td colspan="2">Bookmark is set to</td>
+                    <td>{{ bookmark_time|datetimeformat }}</td>
+                    <td colspan="11"></td>
+                </tr>
+            </tfoot>
+            {% endif %}
+        </table>
+        </div>
+        </form>
+    {% endif %}
+{% endblock %}