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