repo-log.html
HTML document, ASCII text
1{% extends "repo.html" %} 2{% set active_page = "log" %} 3 4{% block title %} 5{% trans username=username, repository=repository %}History of {{ username }}/{{ repository }}{% endtrans %} 6{% endblock %} 7{% block content %} 8<x-vbox> 9<x-frame style="--width: 896px;" class="flexible-space"> 10<x-vbox> 11<select id="branch-selection" style="flex: 0 1 auto;"> 12<option value="ref-{{ current }}" selected>{% if "tag:" in current %}{% trans %}tag:{% endtrans %}{% endif %}{{ current | replace("~", "/") | replace("tag:", " ") }}</option> 13{% for branch in branches %} 14{% if branch[0] != current | replace("~", "/") | replace("tag:", " ") %} 15<option value="ref-{% if branch[1] == 'tag' %}tag:{% endif %}{{ branch[0] | replace('/', '~') }}">{% if branch[1] == "tag" %}{% trans %}tag:{% endtrans %} {% endif %}{{ branch[0] }}</option> 16{% endif %} 17{% endfor %} 18</select> 19<script> 20branchSelect = document.getElementById("branch-selection"); 21 22branchSelect.addEventListener("change", function() { 23if(branchSelect.value == "new") { 24document.getElementById("new-branch").showModal(); 25} else { 26const PREFIX = "ref-"; 27if(branchSelect.value.startsWith(PREFIX)) { 28branch = branchSelect.value.slice(PREFIX.length); 29} 30var http = new XMLHttpRequest(); 31http.open("HEAD", "/{{ username }}/{{ repository }}/log/" + branch + "/{{ subpath }}", false); 32http.send(); 33if(http.status == 404) { 34location.href = "/{{ username }}/{{ repository }}/log/" + branch; 35} else { 36location.href = "/{{ username }}/{{ repository }}/log/" + branch + "/{{ subpath }}"; 37} 38} 39}); 40 41path = document.getElementById("repo-path-bar"); 42 43path.addEventListener("change", function() { 44location.href = "/{{ username }}/{{ repository }}/log/{{ current }}" + path.value; 45}); 46</script> 47{% for commit in commits | reverse %} 48<article class="card card-horizontal"> 49<figure class="branch-icon"> 50<a href="/{{ commit.owner_name }}"> 51<img src="/info/{{ commit.owner_name }}/avatar" style="width: 48px; height: 48px;"> 52</a> 53</figure> 54<section class="card-main flexible-space"> 55<h3><a href="/{{ username }}/{{ repository }}/commit/{{ commit.sha }}">{{ commit.message | split("\n") | first }}</a></h3> 56<p> 57{% trans owner_name=commit.owner_name %} 58by <a href="/{{ owner_name }}">{{ owner_name }}</a>, 59{% endtrans %} 60<span title="{% trans receive_date=commit.receive_date.strftime('%A, %e %B %Y, %H:%M:%S') %}received on {{ receive_date }}{% endtrans %}"> 61{{ commit.author_date.strftime("%A, %e %B %Y, %H:%M:%S") }} 62</span> 63</p> 64<code>{{ commit.sha }}</code> 65</section> 66<section> 67<x-buttonbox style="align-items: center; height: 100%;"> 68<a class="button" href="/{{ username }}/{{ repository }}/tree/~{{ commit.sha }}">{% trans %}View tree{% endtrans %}</a> 69</x-buttonbox> 70</section> 71</article> 72{% endfor %} 73{% include "pagination.html" %} 74</x-vbox> 75</x-frame> 76</x-vbox> 77{% endblock %}