| {#- |
| Licensed to the Apache Software Foundation (ASF) under one |
| or more contributor license agreements. See the NOTICE file |
| distributed with this work for additional information |
| regarding copyright ownership. The ASF licenses this file |
| to you under the Apache License, Version 2.0 (the |
| "License"); you may not use this file except in compliance |
| with the License. You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, |
| software distributed under the License is distributed on an |
| "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| KIND, either express or implied. See the License for the |
| specific language governing permissions and limitations |
| under the License. |
| -#} |
| {% extends g.theme.master %} |
| {% import 'allura:templates/jinja_master/dialog_macros.html' as dialog_macros with context %} |
| {% block title %}{{c.project.name}} / {{c.app.config.options.mount_label}} / {{title}}{% endblock %} |
| |
| {% block header %}{{title}}{% endblock %} |
| |
| {% block content %} |
| <form method="get" action="diff"> |
| <div class="grid-19"><input type="submit" value="Compare revisions"/></div> |
| <div style="clear:both"></div> |
| <table> |
| <thead> |
| <tr> |
| <th>Version</th> |
| <th>V1</th> |
| <th>V2</th> |
| <th> </th> |
| </tr> |
| </thead> |
| <tbody> |
| {% for p in posts %} |
| <tr> |
| <td>{{p.version}} by {{p.author.display_name|e}}</td> |
| <td><input name="v1" type="radio" value="{{p.version}}"/></td> |
| <td><input name="v2" type="radio" value="{{p.version}}"/></td> |
| <td> |
| <a href="./?version={{p.version}}" class="btn">View Revision</a> |
| {% if loop.index0 != 0 and h.has_access(p, 'edit')() %} |
| <a href="#" class="btn post-link" data-dialog-id="{{p.version}}">Revert to version {{p.version}}</a> |
| {{ dialog_macros.revert_confirmation_dialog(p.version) }} |
| {% endif %} |
| </td> |
| </tr> |
| {% endfor %} |
| </tbody> |
| </table> |
| </form> |
| {{c.confirmation.display(content='')}} |
| {% block extra_js %} |
| <script type="text/javascript"> |
| $('.post-link').click(function () { |
| var dialog_text; |
| var version = $(this).data("dialog-id"); |
| if (version) { |
| dialog_text = $(".confirmation_dialog_" + version); |
| } else { |
| dialog_text = $(".confirmation_dialog"); |
| } |
| |
| var modal = $('#lightbox_confirm'); |
| modal.html(dialog_text.html()); |
| |
| modal.find('.continue_confirm').click(function (evt) { |
| var cval = $.cookie('_session_id'); |
| evt.preventDefault(); |
| var _t = $(this); |
| var url = _t.data('href') || _t.attr('href'); |
| $.post(url, {_session_id: cval}, function (val) { |
| window.location = val.location; |
| }, 'json'); |
| }); |
| }); |
| </script> |
| {% endblock %} |
| |
| {% endblock %} |