tangled
alpha
login
or
join now
tjh.dev
/
test
forked from
tangled.org/core
0
fork
atom
Mirror of @tangled.org/core. Running on a Raspberry Pi Zero 2
0
fork
atom
overview
issues
pulls
pipelines
appview: repo/index: optimize for mobile
oppi.li
10 months ago
368d42a7
c0e3439e
+51
-46
1 changed file
expand all
collapse all
unified
split
appview
pages
templates
repo
index.html
+51
-46
appview/pages/templates/repo/index.html
···
29
29
30
30
{{ define "repoContent" }}
31
31
<main>
32
32
-
{{ block "branchSelector" . }}{{ end }}
32
32
+
<div class="flex items-center justify-between pb-5">
33
33
+
{{ block "branchSelector" . }}{{ end }}
34
34
+
<div class="flex md:hidden items-center gap-4">
35
35
+
<a href="/{{ .RepoInfo.FullName }}/commits/{{ .Ref | urlquery }}" class="inline-flex items-center text-sm gap-1">
36
36
+
{{ i "git-commit-horizontal" "w-4" "h-4" }} {{ .TotalCommits }}
37
37
+
</a>
38
38
+
<a href="/{{ .RepoInfo.FullName }}/branches" class="inline-flex items-center text-sm gap-1">
39
39
+
{{ i "git-branch" "w-4" "h-4" }} {{ len .Branches }}
40
40
+
</a>
41
41
+
<a href="/{{ .RepoInfo.FullName }}/tags" class="inline-flex items-center text-sm gap-1">
42
42
+
{{ i "tags" "w-4" "h-4" }} {{ len .Tags }}
43
43
+
</a>
44
44
+
</div>
45
45
+
</div>
33
46
<div class="grid grid-cols-1 md:grid-cols-2 gap-2">
34
47
{{ block "fileTree" . }}{{ end }}
35
48
{{ block "rightInfo" . }}{{ end }}
···
51
38
{{ end }}
52
39
53
40
{{ define "branchSelector" }}
54
54
-
<div class="flex justify-between pb-5">
55
55
-
<select
56
56
-
onchange="window.location.href = '/{{ .RepoInfo.FullName }}/tree/' + encodeURIComponent(this.value)"
57
57
-
class="p-1 border max-w-32 border-gray-200 bg-white dark:bg-gray-800 dark:text-white dark:border-gray-700"
58
58
-
>
59
59
-
<optgroup label="branches ({{len .Branches}})" class="bold text-sm">
60
60
-
{{ range .Branches }}
61
61
-
<option
62
62
-
value="{{ .Reference.Name }}"
63
63
-
class="py-1"
64
64
-
{{ if eq .Reference.Name $.Ref }}
65
65
-
selected
66
66
-
{{ end }}
67
67
-
>
68
68
-
{{ .Reference.Name }}
69
69
-
</option>
70
70
-
{{ end }}
71
71
-
</optgroup>
72
72
-
<optgroup label="tags ({{len .Tags}})" class="bold text-sm">
73
73
-
{{ range .Tags }}
74
74
-
<option
75
75
-
value="{{ .Reference.Name }}"
76
76
-
class="py-1"
77
77
-
{{ if eq .Reference.Name $.Ref }}
78
78
-
selected
79
79
-
{{ end }}
80
80
-
>
81
81
-
{{ .Reference.Name }}
82
82
-
</option>
83
83
-
{{ else }}
84
84
-
<option class="py-1" disabled>no tags found</option>
85
85
-
{{ end }}
86
86
-
</optgroup>
87
87
-
</select>
88
88
-
</div>
41
41
+
<select
42
42
+
onchange="window.location.href = '/{{ .RepoInfo.FullName }}/tree/' + encodeURIComponent(this.value)"
43
43
+
class="p-1 border max-w-32 border-gray-200 bg-white dark:bg-gray-800 dark:text-white dark:border-gray-700"
44
44
+
>
45
45
+
<optgroup label="branches ({{len .Branches}})" class="bold text-sm">
46
46
+
{{ range .Branches }}
47
47
+
<option
48
48
+
value="{{ .Reference.Name }}"
49
49
+
class="py-1"
50
50
+
{{ if eq .Reference.Name $.Ref }}
51
51
+
selected
52
52
+
{{ end }}
53
53
+
>
54
54
+
{{ .Reference.Name }}
55
55
+
</option>
56
56
+
{{ end }}
57
57
+
</optgroup>
58
58
+
<optgroup label="tags ({{len .Tags}})" class="bold text-sm">
59
59
+
{{ range .Tags }}
60
60
+
<option
61
61
+
value="{{ .Reference.Name }}"
62
62
+
class="py-1"
63
63
+
{{ if eq .Reference.Name $.Ref }}
64
64
+
selected
65
65
+
{{ end }}
66
66
+
>
67
67
+
{{ .Reference.Name }}
68
68
+
</option>
69
69
+
{{ else }}
70
70
+
<option class="py-1" disabled>no tags found</option>
71
71
+
{{ end }}
72
72
+
</optgroup>
73
73
+
</select>
89
74
{{ end }}
90
75
91
76
{{ define "fileTree" }}
···
140
129
{{ end }}
141
130
142
131
{{ define "rightInfo" }}
143
143
-
<div id="right-info" class="col-span-1">
132
132
+
<div id="right-info" class="hidden md:block col-span-1">
144
133
{{ block "commitLog" . }} {{ end }}
145
134
{{ block "branchList" . }} {{ end }}
146
135
{{ block "tagList" . }} {{ end }}
···
154
143
<div class="flex gap-2 items-center">
155
144
{{ i "git-commit-horizontal" "w-4 h-4" }} commits
156
145
</div>
157
157
-
{{ if lt (len .CommitsTrunc) .TotalCommits }}
158
158
-
<span class="hidden group-hover:flex gap-2 items-center text-sm text-gray-500 dark:text-gray-400 ">
159
159
-
view {{ .TotalCommits }} commits {{ i "chevron-right" "w-4 h-4" }}
160
160
-
</span>
161
161
-
{{ end }}
146
146
+
<span class="hidden group-hover:flex gap-2 items-center text-sm text-gray-500 dark:text-gray-400 ">
147
147
+
view {{ .TotalCommits }} commits {{ i "chevron-right" "w-4 h-4" }}
148
148
+
</span>
162
149
</a>
163
150
</div>
164
151
<div class="flex flex-col gap-6">
···
252
243
<!-- git-branch icon is seemingly bigger than others at 4x4 -->
253
244
{{ i "git-branch" "w-3 h-3" }} branches
254
245
</div>
255
255
-
{{ if lt (len .BranchesTrunc) (len .Branches) }}
256
246
<span class="hidden group-hover:flex gap-2 items-center text-sm text-gray-500 dark:text-gray-400 ">
257
247
view {{ len .Branches }} branches {{ i "chevron-right" "w-4 h-4" }}
258
248
</span>
259
259
-
{{ end }}
260
249
</a>
261
250
<div class="flex flex-col gap-1">
262
251
{{ range .BranchesTrunc }}
···
286
279
<div class="flex gap-2 items-center">
287
280
{{ i "tags" "w-4 h-4" }} tags
288
281
</div>
289
289
-
{{ if lt (len .TagsTrunc) (len .Tags) }}
290
282
<span class="hidden group-hover:flex gap-2 items-center text-sm text-gray-500 dark:text-gray-400 ">
291
283
view {{ len .Tags }} tags {{ i "chevron-right" "w-4 h-4" }}
292
284
</span>
293
293
-
{{ end }}
294
285
</a>
295
286
</div>
296
287
<div class="flex flex-col gap-1">