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 • 4.92 kiB
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>
20
branchSelect = document.getElementById("branch-selection");
21
22
branchSelect.addEventListener("change", function() {
23
if(branchSelect.value == "new") {
24
document.getElementById("new-branch").showModal();
25
} else {
26
const PREFIX = "ref-";
27
if(branchSelect.value.startsWith(PREFIX)) {
28
branch = branchSelect.value.slice(PREFIX.length);
29
}
30
var http = new XMLHttpRequest();
31
http.open("HEAD", "/{{ username }}/{{ repository }}/log/" + branch + "/{{ subpath }}", false);
32
http.send();
33
if(http.status == 404) {
34
location.href = "/{{ username }}/{{ repository }}/log/" + branch;
35
} else {
36
location.href = "/{{ username }}/{{ repository }}/log/" + branch + "/{{ subpath }}";
37
}
38
}
39
});
40
41
path = document.getElementById("repo-path-bar");
42
43
path.addEventListener("change", function() {
44
location.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 %}
58
by <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">
74
{% if prev_page %}
75
<a href="?page=1">
76
«
77
</a>
78
<a href="?page={{ prev_page }}">
79
80
</a>
81
{% endif %}
82
<span>{{ page_number }}</span>
83
{% if next_page %}
84
<a href="?page={{ next_page }}">
85
86
</a>
87
<a href="?page={{ last_page }}">
88
»
89
</a>
90
{% endif %}
91
</x-hbox>
92
</x-vbox>
93
</x-frame>
94
</x-vbox>
95
{% endblock %}