gitlin/views/repo.html

57 行
2.2 KiB
HTML
Raw 通常表示 履歴

{{ template "header" .}}
<main>
{{ if .repo }}
{{ range $key, $value := .repo}}
<div class="buttonParent">
<a href="/download/{{.Fullname}}/{{.DefaultBranch}}" class="button">Download (zip)</a>
<a href="https://github.com/{{.Fullname}}" class="button">View on GitHub</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="/{{.Fullname}}/tree/{{.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>