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