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.84 kiB
HTML document, ASCII text
        
            
1
{% extends "repo.html" %}
2
{% set active_page = "log" %}
3
4
{% block title %}
5
History 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>
21
branchSelect = document.getElementById("branch-selection");
22
23
branchSelect.addEventListener("change", function() {
24
if(branchSelect.value == "new") {
25
document.getElementById("new-branch").showModal();
26
} else {
27
const PREFIX = "ref-";
28
if(branchSelect.value.startsWith(PREFIX)) {
29
branch = branchSelect.value.slice(PREFIX.length);
30
}
31
var http = new XMLHttpRequest();
32
http.open("HEAD", "/{{ username }}/{{ repository }}/log/" + branch + "/{{ subpath }}", false);
33
http.send();
34
if(http.status == 404) {
35
location.href = "/{{ username }}/{{ repository }}/log/" + branch;
36
} else {
37
location.href = "/{{ username }}/{{ repository }}/log/" + branch + "/{{ subpath }}";
38
}
39
}
40
});
41
42
path = document.getElementById("repo-path-bar");
43
44
path.addEventListener("change", function() {
45
location.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 }}
58
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>
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 %}