-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
51 lines (49 loc) · 1.93 KB
/
Copy pathindex.html
File metadata and controls
51 lines (49 loc) · 1.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<!DOCTYPE html>
<html>
{{template "head.html"}}
<body>
{{template "top.html" .}}
<div style="margin-bottom:10px;">
<div>
<button onclick="showAddForm()">add</button>
<button onclick="showRemoveForm()">remove</button>
<button onclick="hideForms()">cancel</button>
</div>
<form id="confirm-add" action="/action" method="post" style="display:none">
Add repository: <input id="add-input" type="text" name="addRepo" placeholder="repo" /> <input type="password" name="password" placeholder="password" /> <input type="submit" value="ok" />
</form>
<form id="confirm-remove" action="/action" method="post" style="display:none">
Remove repository: <input id="remove-input" type="text" name="removeRepo" placeholder="repo" /> <input type="password" name="password" placeholder="password" /> <input type="submit" value="ok" />
</form>
</div>
<div>
{{range $grp := .RepoGroups}}
<div>{{.Name}}</div>
{{range .Repos}}
{{if eq $grp.Name ""}}
<div style="font-size:20px; margin:5px"><a href="/{{.Name}}/">{{.Name}}</a> <span style="font-size:13px; color:gray">{{.Updated}}</span></div>
{{else}}
<div style="margin-left:20px; font-size:20px; margin:5px"><a href="/{{$grp.Name}}/{{.Name}}/">{{.Name}}</a> <span style="font-size:13px; color:gray">{{.Updated}}</span></div>
{{end}}
{{end}}
<div style="height:10px"></div>
{{end}}
</div>
<script>
function showAddForm() {
document.getElementById("confirm-remove").style.display = "none";
document.getElementById("confirm-add").style.display = "block";
document.getElementById("add-input").focus();
}
function showRemoveForm() {
document.getElementById("confirm-add").style.display = "none";
document.getElementById("confirm-remove").style.display = "block";
document.getElementById("remove-input").focus();
}
function hideForms() {
document.getElementById("confirm-add").style.display = "none";
document.getElementById("confirm-remove").style.display = "none";
}
</script>
</body>
</html>