gitlin/views/repo.html

99 行
3.7 KiB
HTML

{{ template "header" .}}
<main>
{{ if .repo }} {{ range $key, $value := .repo}}
<div class="button-parent">
<a href="/{{.Username}}/{{.Reponame}}/branches" class="button">ブランチ</a>
<a href="/{{.Username}}/{{.Reponame}}/archive/{{.DefaultBranch}}.tar.gz" class="button">ダウンロード (tar.gz)</a>
<a rel="noreferrer" href="https://github.com/{{.Username}}/{{.Reponame}}" class="button">GitHubで確認</a>
</div>
<div class="user-profile">
<h1><a href="/{{.Username}}">{{.Username}}</a>/<a href="/{{.Username}}/{{.Reponame}}">{{.Reponame}}</a></h1>
{{ if .Parent }}
<p>フォーク元 <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="lang-bar">{{range $i, $o := .Language}}
<span style="width: {{$o.Percent}}; background-color: {{$o.Color}}">
&nbsp;
</span>
{{end}}
</div>
</p>
{{end}} {{ if .CommitsBehind }}このレポジトリは、フォーク元に対して{{.CommitsBehind}}コミット遅れています。{{end}}
</div>
{{end}} {{ if .files}}
<div class="user-readme">
<h3>ファイル</h3>
<table class="user-readme-text file-table">
<thead>
<tr>
<td colspan="2">
<a href="/{{.lastcom.User}}"><img src="{{.lastcom.Ava}}" alt="{{.lastcom.User}}さんの画像" class="avatar" width="24" height="24" /></a>
<a href="/{{.usrep}}/commits?author={{.lastcom.User}}">{{.lastcom.User}}</a>
<a href="/{{.usrep}}/commit/{{.lastcom.Id}}">{{.lastcom.Mess}}</a>
{{if .lastcom.MessIssue}}(<a href="/{{.usrep}}/pull/{{.lastcom.MessIssue}}">#{{.lastcom.MessIssue}}</a>){{end}}
</td>
<td style="text-align: right;">
<a href="/{{.usrep}}/commit/{{.lastcom.Id}}">{{.lastcom.IdShort}}</a>
<a href="/{{.usrep}}/commit/{{.lastcom.Id}}">{{.lastcom.Date}}</a>
<a href="/{{.usrep}}/commits/{{.branch}}">{{.commits}}件コミット</a>
</td>
</tr>
</thead>
<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>レポジトリを見つけられません</h2>
<p>このレポジトリは存在しないようです。</p>
{{ end }}
</main>
{{ template "footer" .}}