repo-log.html
HTML document, Unicode text, UTF-8 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<x-hbox id="pagination-options"> 74<x-hbox id="pagination"> 75{% if prev_page %} 76<a href="?page=1"> 77« 78</a> 79<a href="?page={{ prev_page }}"> 80‹ 81</a> 82{% endif %} 83<span>{{ page_number }}/{{ num_pages }}</span> 84{% if next_page %} 85<a href="?page={{ next_page }}"> 86› 87</a> 88<a href="?page={{ last_page }}"> 89» 90</a> 91{% endif %} 92</x-hbox> 93<form> 94<x-hbox> 95<label> 96Items per page: 97<input type="number" name="per_page" value="{{ page_length }}" min="1" max="256" style="font: var(--mono-font);"> 98</label> 99<button type="submit">Load</button> 100</x-hbox> 101</form> 102</x-hbox> 103</x-vbox> 104</x-frame> 105</x-vbox> 106{% endblock %}