gitlin/views/repo.html

84 行
2.7 KiB
HTML

{{ template "header" .}}
<main>
{{ if .repo }} {{ range $key, $value := .repo}}
<div class="button-parent">
<a href="/{{.Username}}/{{.Reponame}}/archive/{{.DefaultBranch}}.zip" class="button">Download (zip)</a>
<a rel="noreferrer" href="https://github.com/{{.Username}}/{{.Reponame}}" class="button">View on GitHub</a>
</div>
<div class="user-profile">
<h1><a href="/{{.Username}}">{{.Username}}</a>/<a href="/{{.Username}}/{{.Reponame}}">{{.Reponame}}</a></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 $o := .Language}}{{$o.Name}} {{$o.Percent}}, {{end}}
<div class="ui segment">{{range $i, $o := .Language}}
<span style="width: {{$o.Percent}}; background-color: {{$o.Color}}">
&nbsp;
</span>
{{end}}
</div>
</p>
{{end}} {{ if .CommitsBehind }} This repository is {{.CommitsBehind}}
commits behind its parent. {{end}}
</div>
{{end}} {{ if .files}}
<div class="user-readme">
<h3>Files</h3>
<table class="user-readme-text file-table">
<tbody>
{{ range $key, $value := .files}}
<tr class="file-u-list">
{{ if eq .Type "dir" }}
<td class="file-list">
📁
<a href="/{{.Username}}/{{.Reponame}}/tree/{{.DefaultBranch}}/{{.Path}}" class="filesA">{{.Path}}</a>
</td>
{{ else }}
<td class="file-list">
🗒️
<a href="/{{.Username}}/{{.Reponame}}/blob/{{.DefaultBranch}}/{{.Path}}">{{.Path}}</a>
</td>
{{ end }}
<td class="file-list">
{{.Commit}}
</td>
<td class="file-list" style="text-align: right;">
{{.Date}}
</td>
</tr>
{{ end }}
</tbody>
</table>
</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" .}}