main
1{{- /*gotype: mokhan.ca/xlgmokha/gitmal/pkg/templates.ListParams*/ -}}
2{{- define "head" -}}
3<style>
4 .files {
5 border: 1px solid var(--c-border);
6 border-top: none;
7 width: 100%;
8 border-bottom-left-radius: var(--border-radius);
9 border-bottom-right-radius: var(--border-radius);
10 overflow-x: auto;
11 }
12 .files .dir {
13 color: var(--c-dir);
14 }
15 .files a {
16 color: var(--c-text-1);
17 }
18 .files a:hover {
19 color: var(--c-brand-2);
20 }
21 .row {
22 display: flex;
23 height: 40px;
24 border-bottom: 1px solid var(--c-border);
25 padding-inline: 16px;
26 gap: 16px;
27 }
28 .row:last-child {
29 border-bottom: none;
30 }
31 .row:hover {
32 background-color: var(--c-bg-alt);
33 }
34 .cell {
35 flex: 1;
36 display: flex;
37 gap: 8px;
38 align-items: center;
39 white-space: nowrap;
40 }
41 .cell:not(:first-child) {
42 justify-content: flex-end;
43 max-width: 100px;
44 }
45 @media (max-width: 767px) {
46 .file-mode {
47 display: none;
48 }
49 }
50{{- if .Readme}}
51 .markdown-container {
52 padding-inline: 16px;
53 border: 1px solid var(--c-divider);
54 border-radius: 8px;
55 overflow-x: auto;
56 margin-top: 16px;
57 }
58 .markdown-body {
59 width: 100%;
60 min-width: 200px;
61 max-width: 980px;
62 margin: 0 auto;
63 padding: 32px;
64 word-wrap: break-word;
65 font-size: 16px;
66 line-height: 1.5;
67 }
68 @media (max-width: 767px) {
69 .markdown-body {
70 padding: 16px;
71 }
72 }
73{{- end}}
74</style>
75{{- end}}
76
77{{- define "body" -}}
78{{- template "header" .}}
79<div class="files">
80{{- if .ParentHref}}
81 <div class="row">
82 <div class="cell">
83 <svg aria-hidden="true" focusable="false" width="16" height="16" class="dir">
84 <use xlink:href="#dir"></use>
85 </svg>
86 <a href="{{.ParentHref}}">..</a>
87 </div>
88 </div>
89{{- end}}
90{{- if or .Dirs .Files}}
91{{- range .Dirs}}
92 <div class="row">
93 <div class="cell">
94 <svg aria-hidden="true" focusable="false" width="16" height="16" class="dir">
95 <use xlink:href="#dir"></use>
96 </svg>
97 <a href="{{.Href}}">{{.Name}}</a>
98 </div>
99 </div>
100{{- end}}
101{{- range .Files}}
102 <div class="row">
103 <div class="cell">
104 <svg aria-hidden="true" focusable="false" width="16" height="16">
105 <use xlink:href="#file"></use>
106 </svg>
107 <a href="{{.Href}}">{{.Name}}</a>
108 </div>
109 <div class="cell file-mode">{{.Mode}}</div>
110 <div class="cell file-size">{{.Size}}</div>
111 </div>
112{{- end}}
113{{- else}}
114 <div class="row">
115 <div class="cell">(empty)</div>
116 </div>
117{{- end}}
118</div>
119{{- if .Readme}}
120<div class="markdown-container">
121 <div class="markdown-body">
122{{.Readme}}
123 </div>
124</div>
125{{- end}}
126{{- end}}