gitea/templates/repo/header.tmpl

63 lines
4.3 KiB
Cheetah
Raw Normal View History

2014-10-19 13:35:24 +08:00
{{with .Repository}}
2014-08-03 01:47:33 +08:00
<div id="repo-header" class="clear">
<div class="container clear">
<h1 id="repo-header-name" class="left public">
2014-10-19 13:35:24 +08:00
<i class="mega-octicon octicon-{{if .IsPrivate}}lock{{else if .IsMirror}}repo-clone{{else if .IsFork}}repo-forked{{else}}repo{{end}}"></i>
2014-09-20 08:11:34 +08:00
<a class="author" href="{{AppSubUrl}}/{{.Owner.Name}}">{{.Owner.Name}}</a>
2014-08-03 01:47:33 +08:00
<span class="divider">/</span>
2014-10-19 13:35:24 +08:00
<a class="repo text-bold" href="{{$.RepoLink}}">{{.Name}}</a>
{{if .IsMirror}}<span class="label label-gray">{{$.i18n.Tr "mirror"}}</span>{{end}}
{{if .IsFork}}<span class="fork-flag">forked from <a href="{{.ForkRepo.RepoLink}}">{{SubStr .ForkRepo.RepoLink 1 -1}}</a></span>{{end}}
2014-08-03 01:47:33 +08:00
</h1>
<ul id="repo-header-meta" class="right menu menu-line">
2014-09-15 04:43:22 +08:00
<li id="repo-header-download" class="drop">
2014-08-03 01:47:33 +08:00
<a id="repo-header-download-btn" href="#">
<button class="btn btn-black text-bold btn-radius">
<i class="octicon octicon-cloud-download"></i>
</button>
</a>
<div id="repo-header-download-drop" class="drop-down">
<div id="repo-clone" class="clear">
2015-02-07 23:46:57 +08:00
{{if not $.DisableSSH}}
<button class="btn btn-blue left btn-left-radius" id="repo-clone-ssh" data-link="{{$.CloneLink.SSH}}">SSH</button>
{{end}}
<button class="btn {{if $.DisableSSH}}btn-blue{{else}}btn-gray{{end}} left" id="repo-clone-https" data-link="{{$.CloneLink.HTTPS}}">HTTPS</button>
<input id="repo-clone-url" class="ipt ipt-disabled left" value="{{if $.DisableSSH}}{{$.CloneLink.HTTPS}}{{else}}{{$.CloneLink.SSH}}{{end}}" readonly />
2014-10-19 13:35:24 +08:00
<button id="repo-clone-copy" class="btn btn-black left btn-right-radius" data-copy-val="val" data-copy-from="#repo-clone-url" original-title="{{$.i18n.Tr "repo.click_to_copy"}}" data-original-title="{{$.i18n.Tr "repo.click_to_copy"}}" data-after-title="{{$.i18n.Tr "repo.copied"}}">{{$.i18n.Tr "repo.copy_link"}}</button>
2014-11-10 18:30:07 +08:00
<p class="text-center" id="repo-clone-help">{{$.i18n.Tr "repo.clone_helper" "http://git-scm.com/book/en/Git-Basics-Getting-a-Git-Repository" | Str2html}}</p>
2014-08-03 01:47:33 +08:00
<hr/>
<div class="text-center" id="repo-clone-zip">
2014-11-08 05:44:25 +08:00
<a class="btn btn-green btn-radius" href="{{$.RepoLink}}/archive/{{EscapePound $.BranchName}}.zip"><i class="octicon octicon-file-zip"></i>ZIP</a>
<a class="btn btn-green btn-radius" href="{{$.RepoLink}}/archive/{{EscapePound $.BranchName}}.tar.gz"><i class="octicon octicon-file-zip"></i>TAR.GZ</a>
2014-08-03 01:47:33 +08:00
</div>
</div>
</div>
</li>
<li id="repo-header-watch">
2014-10-19 13:35:24 +08:00
<a id="repo-header-watch-btn" href="{{$.RepoLink}}/action/{{if $.IsWatchingRepo}}un{{end}}watch">
2014-08-03 01:47:33 +08:00
<button class="btn btn-gray text-bold btn-radius">
2014-10-19 13:35:24 +08:00
<i class="octicon octicon-eye-watch"></i>{{if $.IsWatchingRepo}}{{$.i18n.Tr "repo.unwatch"}}{{else}}{{$.i18n.Tr "repo.watch"}}{{end}}<span class="num">{{.NumWatches}}</span>
2014-08-03 01:47:33 +08:00
</button>
</a>
</li>
<li id="repo-header-star">
2014-10-19 13:35:24 +08:00
<a id="repo-header-star-btn" href="{{$.RepoLink}}/action/{{if $.IsStaringRepo}}un{{end}}star">
2014-08-03 01:47:33 +08:00
<button class="btn btn-gray text-bold btn-radius">
2014-10-19 13:35:24 +08:00
<i class="octicon octicon-star"></i>{{if $.IsStaringRepo}}{{$.i18n.Tr "repo.unstar"}}{{else}}{{$.i18n.Tr "repo.star"}}{{end}}
<span class="num">{{.NumStars}}</span>
2014-08-03 01:47:33 +08:00
</button>
</a>
</li>
2014-10-05 01:19:14 +08:00
<li id="repo-header-fork">
2014-11-12 04:30:11 +08:00
<a id="repo-header-fork-btn" {{if or (not $.IsRepositoryTrueOwner) $.Owner.IsOrganization}}href="{{AppSubUrl}}/repo/fork?fork_id={{.Id}}"{{end}}>
2014-08-03 01:47:33 +08:00
<button class="btn btn-gray text-bold btn-radius">
2014-10-19 13:35:24 +08:00
<i class="octicon octicon-repo-forked"></i>{{$.i18n.Tr "repo.fork"}}
<span class="num">{{.NumForks}}</span>
2014-08-03 01:47:33 +08:00
</button>
</a>
2014-10-14 03:23:30 +08:00
2014-10-05 01:19:14 +08:00
</li>
2014-08-03 01:47:33 +08:00
</ul>
</div>
2014-10-19 13:35:24 +08:00
</div>
{{end}}