gitlin/views/repo.html
Odyssey 84bc2f0a71 Temporarily disable directory hrefs.
Signed-off-by: Odyssey <odyssey346@disroot.org>
2022-11-30 18:47:35 +01:00

56 行
2.1 KiB
HTML

{{ template "header" .}}
<main>
{{ if .repo }}
{{ range $key, $value := .repo}}
<div class="buttonParent">
<a href="/download/{{.Fullname}}/{{.DefaultBranch}}" class="downloadButton">Download (zip)</a>
</div>
<div class="userProfile">
<h1>{{.Fullname}}</h1>
{{ if .Fork }}
<p>This repository is a fork of <a href="/{{.Parent}}">{{.Parent}}</a>.</p>
{{ end }}
{{ if .Description }}
<p>{{.Description}}</p>
{{ end }}
{{ if .Language}}
{{ if .License }}
<p>⭐ {{.Stars}} 🍴 {{.Forks}} 👀 {{.Watchers}} ⚖️ {{.License}} 🗒️ {{.Language}}</p>
{{ else }}
<p>⭐ {{.Stars}} 🍴 {{.Forks}} 👀 {{.Watchers}} ⚖️ No license 🗒️ {{.Language}}</p>
{{ end }}
{{ else }}
{{ end }}
</div>
{{end}}
{{ if .files}}
<div class="userReadme">
<h3>Files</h3>
<div class="userReadmeText">
<ul class="filesUList">
{{ range $key, $value := .files}}
{{ if eq .Type "dir" }}
<li class="filesList"><a href="#" class="filesA">{{.Path}} (directory)</a></li>
{{ else }}
<li class="filesList"><a href="/file/{{.Fullname}}/{{.DefaultBranch}}/{{.Path}}">{{.Path}}</a></li>
{{ end }}
{{ end }}
</ul>
</div>
</div>
{{ end }}
{{ if .readme}}
<div class="userReadme">
<h3>README.md</h3>
<div class="userReadmeText">
{{ unescape .readme}}
</div>
</div>
{{ end }}
{{ else }}
<h2>Repository not found</h2>
<p>That repository doesn't exist.</p>
{{ end }}
</main>