gitlin/views/dir.html

58 行
1.5 KiB
HTML
Raw 通常表示 履歴

2023-03-16 18:28:53 +09:00
{{ template "header" .}}
<main>
{{ if .dir }} {{ range $key, $value := .dir}}
<div class="button-parent">
2023-03-28 22:22:38 +09:00
<a
rel="noreferrer"
href="https://github.com/{{.Fullname}}/tree/{{.Branch}}/{{.DirName}}"
class="button"
2023-03-16 18:55:17 +09:00
>View on GitHub</a
>
2023-03-28 22:22:38 +09:00
<a href="/{{.Fullname}}/tree/{{.Branch}}/{{.Branch}}" class="button"
>Back to {{.Fullname}}</a
>
2023-03-16 18:28:53 +09:00
</div>
<div class="user-profile">
2023-03-16 18:55:17 +09:00
<h1>{{.Fullname}} | {{.DirName}}</h1>
2023-03-16 18:28:53 +09:00
</div>
{{end}} {{ if .files}}
<div class="user-readme">
2023-03-16 18:28:53 +09:00
<h3>Files</h3>
<div class="user-readme-text">
<ul class="file-u-list">
2023-03-16 18:28:53 +09:00
{{ range $key, $value := .files}} {{ if eq .Type "dir" }}
<li class="file-list">
2023-03-21 18:41:34 +09:00
📁
2023-03-16 18:55:17 +09:00
<a
href="/{{.Fullname}}/tree/{{.Branch}}/{{.DirName}}/{{.Path}}"
class="file-a"
2023-03-21 18:41:34 +09:00
>{{.Path}}</a
2023-03-16 18:55:17 +09:00
>
2023-03-16 18:28:53 +09:00
</li>
{{ else }}
<li class="file-list">
2023-03-21 18:41:34 +09:00
🗒️
2023-03-16 18:55:17 +09:00
<a href="/{{.Fullname}}/blob/{{.Branch}}/{{.DirName}}/{{.Path}}"
2023-03-16 18:28:53 +09:00
>{{.Path}}</a
>
</li>
{{ end }} {{ end }}
</ul>
</div>
</div>
{{ end }} {{ if .readme}}
<div class="user-readme">
2023-03-16 18:28:53 +09:00
{{ if .dir }} {{ range $key, $value := .dir }}
<h3>{{.Readme}}</h3>
{{end}} {{end}}
<div class="user-readme-text">{{ unescape .readme}}</div>
2023-03-16 18:28:53 +09:00
</div>
{{ end }} {{ else }}
<h2>Directory not found</h2>
<p>That directory doesn't exist.</p>
{{ end }}
</main>
{{ template "footer" .}}