By using this site, you agree to have cookies stored on your device, strictly for functional purposes, such as storing your session and preferences.

Dismiss

 repo-log.html

View raw Download
text/html • 3.81 kiB
HTML document, ASCII text
        
            
1
{% extends "repo.html" %}
2
{% block title %}
3
History 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>
19
branchSelect = document.getElementById("branch-selection");
20
21
branchSelect.addEventListener("change", function() {
22
if(branchSelect.value == "new") {
23
document.getElementById("new-branch").showModal();
24
} else {
25
const PREFIX = "ref-";
26
if(branchSelect.value.startsWith(PREFIX)) {
27
branch = branchSelect.value.slice(PREFIX.length);
28
}
29
var http = new XMLHttpRequest();
30
http.open("HEAD", "/{{ username }}/{{ repository }}/log/" + branch + "/{{ subpath }}", false);
31
http.send();
32
if(http.status == 404) {
33
location.href = "/{{ username }}/{{ repository }}/log/" + branch;
34
} else {
35
location.href = "/{{ username }}/{{ repository }}/log/" + branch + "/{{ subpath }}";
36
}
37
}
38
});
39
40
path = document.getElementById("repo-path-bar");
41
42
path.addEventListener("change", function() {
43
location.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.owner_name }}">
50
<img src="/info/{{ commit.owner_name }}/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.owner_name }}">{{ commit.owner_name }}</a>, <span title="{{ commit.author_date | unixtime }}
56
received 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>
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 %}