Commits

Thomas Waldmann committed 7a01ee7

diff view: remove revision navigation (does not work like this, was based on revno integers)

Comments (0)

Files changed (2)

MoinMoin/items/__init__.py

         old_text = self.data_storage_to_internal(oldrev.data.read())
         new_text = self.data_storage_to_internal(newrev.data.read())
         storage_item = flaskg.storage[self.name]
-        revs = storage_item.list_revisions()
         diffs = [(d[0], Markup(d[1]), d[2], Markup(d[3])) for d in diff(old_text, new_text)]
         return Markup(render_template('diff_text.html',
                                       item_name=self.name,
                                       oldrev=oldrev,
                                       newrev=newrev,
-                                      min_revno=revs[0],
-                                      max_revno=revs[-1],
                                       diffs=diffs,
                                      ))
 

MoinMoin/templates/diff_text.html

 {% import "utils.html" as utils %}
 
-{% macro diff_nav(side, item_name, rev1, rev2, min_revno, max_revno) %}
-    {% set revno1 = rev1.revno %}
-    {% set revno2 = rev2.revno %}
-    {% if side == 1 %}
-        {% set revno = revno1 %}
-        {% set date_time = rev1.timestamp %}
-        {% set revno1older = revno1 - 1 %}
-        {% set revno1newer = revno1 + 1 %}
-        {% set revno2older = revno2 %}
-        {% set revno2newer = revno2 %}
-        {% set min_reached = revno1older < min_revno %}
-        {% set max_reached = revno1newer > max_revno %}
-    {% elif side == 2 %}
-        {% set revno = revno2 %}
-        {% set date_time = rev2.timestamp %}
-        {% set revno1older = revno1 %}
-        {% set revno1newer = revno1 %}
-        {% set revno2older = revno2 - 1 %}
-        {% set revno2newer = revno2 + 1 %}
-        {% set min_reached = revno2 - 1 < min_revno %}
-        {% set max_reached = revno2 + 1 > max_revno %}
-    {% endif %}
-    <div class="moin-diff-info moin-diff-info-heading">
-        {% if min_reached %}
-        <span class="moin-diff-no-nav-link moin-diff-prev-link moin-diff-old-rev"
-              title="{{ _('No older revision') }}">←</span>
-        {% else %}
-        <a class="moin-diff-nav-link moin-diff-prev-link moin-diff-old-rev"
-           href="{{ url_for('frontend.diff', item_name=item_name, rev1=revno1older, rev2=revno2older) }}"
-           title="{{ _('Use older revision') }}">←</a>
-        {% endif %}
-        {{ _('Revision %(revno)d as of %(date_time)s', revno=revno, date_time=date_time|datetimeformat) }}
-        {% if max_reached %}
-        <span class="moin-diff-no-nav-link moin-diff-next-link moin-diff-old-rev"
-              title="{{ _('No newer revision') }}">→</span>
-        {% else %}
-        <a class="moin-diff-nav-link moin-diff-next-link moin-diff-old-rev"
-           href="{{ url_for('frontend.diff', item_name=item_name, rev1=revno1newer, rev2=revno2newer) }}"
-           title="{{ _('Use newer revision') }}">→</a>
-        {% endif %}
-    </div>
-{% endmacro %}
-
 {% macro show_meta(rev) %}
     <div class="moin-diff-info moin-diff-info-rev-author">
         <span class="moin-diff-info-caption">Editor:</span>
 <table class="moin-diff">
     <tr>
         <td class="moin-diff-header">
-            {{ diff_nav(1, item_name, oldrev, newrev, min_revno, max_revno) }}
             {{ show_meta(oldrev) }}
         </td>
         <td class="moin-diff-header">
-            {{ diff_nav(2, item_name, oldrev, newrev, min_revno, max_revno) }}
             {{ show_meta(newrev) }}
         </td>
     </tr>
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.