gitlin/views/repo.html

75 行
2.1 KiB
HTML

{{ template "header" .}}
<main>
{{ if .repo }} {{ range $key, $value := .repo}}
<div class="button-parent">
<a href="/download/{{.Fullname}}/{{.DefaultBranch}}" class="button"
>Download (zip)</a
>
<a rel="noreferrer" href="https://github.com/{{.Fullname}}" class="button"
>View on GitHub</a
>
</div>
<div class="user-profile">
<h1>{{.Fullname}}</h1>
{{ if .Parent }}
<p>This repository is a fork of <a href="/{{.Parent}}">{{.Parent}}</a>.</p>
{{ end }} {{ if .Description }}
<p>{{.Description}}</p>
{{ end }} {{ if .Link }} <a href="{{.Link}}">{{.Link}}</a> {{end}} {{ if
.Tags }}
<p>Tags: {{range .Tags}} {{.}} {{end}}</p>
{{end}} {{ if .License }}
<p>
⭐ {{.Stars}} 🍴 {{.Forks}} 👀 {{.Watchers}} ⚖️ {{.License}} 🌿
{{.DefaultBranch}}
</p>
{{ else }}
<p>
⭐ {{.Stars}} 🍴 {{.Forks}} 👀 {{.Watchers}} ⚖️ No license 🌿
{{.DefaultBranch}}
</p>
{{ end }} {{ if .Language }}
<p>🗒️ {{range .Language}} {{.}} {{end}}</p>
{{end}}
</div>
{{end}} {{ if .files}}
<div class="user-readme">
<h3>Files</h3>
<div class="user-readme-text">
<ul class="file-u-list">
{{ range $key, $value := .files}} {{ if eq .Type "dir" }}
<li class="file-list">
📁
<a
href="/{{.Fullname}}/tree/{{.DefaultBranch}}/{{.Path}}"
class="filesA"
>{{.Path}}</a
>
</li>
{{ else }}
<li class="file-list">
🗒️
<a href="/{{.Fullname}}/blob/{{.DefaultBranch}}/{{.Path}}"
>{{.Path}}</a
>
</li>
{{ end }} {{ end }}
</ul>
</div>
</div>
{{ end }} {{ if .readme}}
<div class="user-readme">
{{ if .repo }} {{ range $key, $value := .repo}}
<h3>{{.Readme}}</h3>
{{end}} {{end}}
<div class="user-readme-text">{{ unescape .readme}}</div>
</div>
{{ end }} {{ else }}
<h2>Repository not found</h2>
<p>That repository doesn't exist.</p>
{{ end }}
</main>
{{ template "footer" .}}