Browse Source

zip download button, repo single file buttons

for-closed-social
FuXiaoHei 10 years ago
parent
commit
92a6058e29
4 changed files with 13 additions and 3 deletions
  1. +1
    -1
      public/js/app.js
  2. +4
    -0
      templates/repo/nav.tmpl
  3. +1
    -1
      templates/repo/single.tmpl
  4. +7
    -1
      templates/repo/single_file.tmpl

+ 1
- 1
public/js/app.js View File

@ -291,7 +291,7 @@ function initRepository() {
$clone.find('button[data-link]').on("click",function (e) {
var $this = $(this);
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');
$url.val($this.data("link"));
$clone.find('span.clone-url').text($this.data('link'));

+ 4
- 0
templates/repo/nav.tmpl View File

@ -30,6 +30,10 @@
</span>
</div>
<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 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">

+ 1
- 1
templates/repo/single.tmpl View File

@ -9,7 +9,7 @@
{{else}}
<div class="source-toolbar">
{{ $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">
<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>

+ 7
- 1
templates/repo/single_file.tmpl View File

@ -3,9 +3,15 @@
{{if .ReadmeExist}}
<i class="icon fa fa-book"></i>
{{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>
{{end}}{{.FileName}}
<a class="btn btn-default pull-right" href="#">Raw</a>
</div>
{{if .FileIsLarge}}
<div class="panel-footer">

Loading…
Cancel
Save