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.25 kiB
HTML document, ASCII 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 %}
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
{% include "pagination.html" %}
74
</x-vbox>
75
</x-frame>
76
</x-vbox>
77
{% endblock %}