zip download button, repo single file buttons

This commit is contained in:
FuXiaoHei 2014-03-24 23:53:26 +08:00
parent 67b43387f4
commit 92a6058e29
4 changed files with 13 additions and 3 deletions

View File

@ -291,7 +291,7 @@ function initRepository() {
$clone.find('button[data-link]').on("click",function (e) { $clone.find('button[data-link]').on("click",function (e) {
var $this = $(this); var $this = $(this);
if (!$this.hasClass('btn-primary')) { if (!$this.hasClass('btn-primary')) {
$clone.find('.btn-primary').removeClass('btn-primary').addClass("btn-default"); $clone.find('.input-group-btn .btn-primary').removeClass('btn-primary').addClass("btn-default");
$(this).addClass('btn-primary').removeClass('btn-default'); $(this).addClass('btn-primary').removeClass('btn-default');
$url.val($this.data("link")); $url.val($this.data("link"));
$clone.find('span.clone-url').text($this.data('link')); $clone.find('span.clone-url').text($this.data('link'));

View File

@ -30,6 +30,10 @@
</span> </span>
</div> </div>
<p class="help-block text-center">Need help cloning? Visit <a href="#">Help</a>!</p> <p class="help-block text-center">Need help cloning? Visit <a href="#">Help</a>!</p>
<hr/>
<div class="clone-zip text-center">
<a class="btn btn-success btn-lg" href="#"><i class="fa fa-suitcase"></i>Download ZIP</a>
</div>
</div> </div>
</div> </div>
<div class="btn-group {{if .IsRepositoryWatching}}watching{{else}}no-watching{{end}}" id="gogs-repo-watching" data-watch="/{{.Owner.Name}}/{{.Repository.Name}}/action/watch" data-unwatch="/{{.Owner.Name}}/{{.Repository.Name}}/action/unwatch"> <div class="btn-group {{if .IsRepositoryWatching}}watching{{else}}no-watching{{end}}" id="gogs-repo-watching" data-watch="/{{.Owner.Name}}/{{.Repository.Name}}/action/watch" data-unwatch="/{{.Owner.Name}}/{{.Repository.Name}}/action/unwatch">

View File

@ -9,7 +9,7 @@
{{else}} {{else}}
<div class="source-toolbar"> <div class="source-toolbar">
{{ $n := len .Treenames}} {{ $n := len .Treenames}}
{{if not .IsFile}}<button class="btn btn-default pull-right"><i class="fa fa-plus-square"></i>Add File</button>{{end}} {{if not .IsFile}}<button class="btn btn-default pull-right hidden"><i class="fa fa-plus-square"></i>Add File</button>{{end}}
<div class="dropdown branch-switch"> <div class="dropdown branch-switch">
<a href="#" class="btn btn-success dropdown-toggle" data-toggle="dropdown"><i class="fa fa-chain"></i>{{.Branchname}}&nbsp;&nbsp; <a href="#" class="btn btn-success dropdown-toggle" data-toggle="dropdown"><i class="fa fa-chain"></i>{{.Branchname}}&nbsp;&nbsp;
<b class="caret"></b></a> <b class="caret"></b></a>

View File

@ -3,9 +3,15 @@
{{if .ReadmeExist}} {{if .ReadmeExist}}
<i class="icon fa fa-book"></i> <i class="icon fa fa-book"></i>
{{else}} {{else}}
<div class="btn-group pull-right">
<a class="btn btn-default hidden" href="#">Edit</a>
<a class="btn btn-default" href="#">Raw</a>
<a class="btn btn-default hidden" href="#">Blame</a>
<a class="btn btn-default hidden" href="#">History</a>
<a class="btn btn-danger hidden" href="#">Delete</a>
</div>
<i class="icon fa fa-file-text-o"></i> <i class="icon fa fa-file-text-o"></i>
{{end}}{{.FileName}} {{end}}{{.FileName}}
<a class="btn btn-default pull-right" href="#">Raw</a>
</div> </div>
{{if .FileIsLarge}} {{if .FileIsLarge}}
<div class="panel-footer"> <div class="panel-footer">