| <!-- |
| Copyright (C) 2019 Apple Inc. All rights reserved. |
| |
| Redistribution and use in source and binary forms, with or without |
| modification, are permitted provided that the following conditions |
| are met: |
| 1. Redistributions of source code must retain the above copyright |
| notice, this list of conditions and the following disclaimer. |
| 2. Redistributions in binary form must reproduce the above copyright |
| notice, this list of conditions and the following disclaimer in the |
| documentation and/or other materials provided with the distribution. |
| |
| THIS SOFTWARE IS PROVIDED BY APPLE INC. "AS IS" AND ANY |
| EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
| PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR |
| CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
| EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
| PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
| PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
| OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| --> |
| |
| {% extends "base.html" %} |
| {% block head %} |
| <link rel="stylesheet" type="text/css" href="assets/css/commit.css"> |
| {% endblock %} |
| {% block content %} |
| <div class="content row"> |
| <div class="col-12"> |
| <div class="row"> |
| <div class="col-4" style="text-align:left"> |
| <a class="button" href="/commit/previous?repository_id={{ commit.repository_id }}&branch={{ commit.branch }}&id={{ commit.id }}">◀ Previous</a> |
| </div> |
| <div class="col-4" style="text-align:center"> |
| <a class="button" href="/commit/info?repository_id={{ commit.repository_id }}&branch={{ commit.branch }}&id={{ commit.id }}">{{ commit.id }}</a> |
| </div> |
| <div class="col-4" style="text-align:right"> |
| <a class="button" href="/commit/next?repository_id={{ commit.repository_id }}&branch={{ commit.branch }}&id={{ commit.id }}">Next ▶</a> |
| </div> |
| </div> |
| <div id="commitTable"></div> |
| </div> |
| </div> |
| |
| <script type="module"> |
| import {CommitTable} from '/assets/js/commit.js'; |
| |
| function unescapeJinjaText(text) { |
| return text.replace(/&([^;]+);/g, function(match, encoded) { |
| switch (encoded) { |
| case 'amp': |
| return '&'; |
| case 'gt': |
| return '>'; |
| case 'lt': |
| return '<'; |
| case 'quot': |
| return '"'; |
| default: |
| if (encoded[0] != '#') |
| return encoded; |
| return String.fromCharCode(encoded.substr(1)); |
| } |
| }); |
| } |
| |
| let commits = [ |
| {% for commit in commits %} { |
| {% for key, value in commit.items() %} |
| {{ key }}: |
| {% if 'str' in value.__class__.__name__ %} |
| unescapeJinjaText('{{ value | replace("\\", "\\\\") | replace("\n", "\\n") }}') |
| {% else %} |
| {{ value }} |
| {% endif %}, |
| {% endfor %}}, |
| {% endfor %}]; |
| |
| document.getElementById('commitTable').innerHTML = CommitTable(commits, {{ repository|safe }}); |
| </script> |
| {% endblock %} |