diff MoinMoin/templates/global_history.html @ 465:3076415fdaba

Bookmark functionality added for the global history results
author Akash Sinha <akash2607@gmail.com>
date Mon, 13 Jun 2011 02:08:44 +0530
parents 58a29a7fd016
children 511a2a2e9950
line wrap: on
line diff
--- a/MoinMoin/templates/global_history.html	Wed Jun 08 02:16:25 2011 +0530
+++ b/MoinMoin/templates/global_history.html	Mon Jun 13 02:08:44 2011 +0530
@@ -8,10 +8,29 @@
 
 {% block content %}
 <h1>{{ _("Global History") }}</h1>
+    {% if user.valid  %}
+    <div id="moin-set-bookmark">
+        {% if bookmark_time %}
+            {{ _("Bookmark (currently set to %(bookmark)s). ", bookmark=bookmark_time|datetimeformat) }} 
+            <a href="{{ url_for('frontend.bookmark', time='del') }}">{{ _("Delete bookmark") }}</a>
+        {% else %}
+            {{ _("Bookmark (not set). ") }}<a href="{{ url_for('frontend.bookmark', time=current_timestamp) }}">{{ _("Set bookmark") }}</a> 
+        {% endif %}
+    {% endif %}
+    </div>
     <div id="moin-global-history">
         {% for rev_date, revs in history %}
+           {% set  latest_rev = revs[0] %}
+           {% set  latest_timestamp = latest_rev.timestamp %}
             <div class="moin-history-container"> 
-                <h2 class="moin-history-container-header">{{ rev_date }}</h2>
+                <div class="moin-history-container-header">
+                    <span>
+                        <h2>{{ rev_date }}</h2>
+                        {% if user.valid %}
+                        <a class="bookmark-link" href="{{ url_for('frontend.bookmark', time=latest_timestamp) }}">{{ _("Set bookmark") }}</a>
+                        {% endif %}
+                   </span>
+                </div>
                 <div class="moin-history-container-body">
                     <table>
                     {% for rev in revs %}
@@ -49,4 +68,7 @@
             </div>
         {% endfor %}
     </div>
+   {% if bookmark_time %}
+       <div id="moin-bookmark-reached">{{ _("Bookmark reached") }}</div>
+   {% endif %}
 {% endblock %}