tokarchuk/v1.17
slene 11 years ago
parent 79633ab1fb
commit 123c7b44e8
  1. 1
      routers/repo/repo.go
  2. 8
      templates/repo/single_file.tmpl

@ -156,6 +156,7 @@ func Single(ctx *middleware.Context, params martini.Params) {
}
if readmeFile != nil {
ctx.Data["ReadmeInSingle"] = true
ctx.Data["ReadmeExist"] = true
if blob, err := readmeFile.LookupBlob(); err != nil {
ctx.Handle(404, "repo.Single(readmeFile.LookupBlob)", err)

@ -2,10 +2,16 @@
<div class="panel-heading file-head">
{{if .ReadmeExist}}
<i class="icon fa fa-book"></i>
{{if .ReadmeInSingle}}
{{.FileName}}
{{else}}
{{.FileName}} <span class="file-size">{{FileSize .FileSize}}</span>
{{end}}
{{else}}
<i class="icon fa fa-file-text-o"></i>
{{.FileName}} <span class="file-size">{{FileSize .FileSize}}</span>
{{end}}
{{if not .ReadmeInSingle}}
<div class="btn-group pull-right">
<a class="btn btn-default hidden" href="#">Edit</a>
<a class="btn btn-default" href="{{.FileLink}}">Raw</a>
@ -17,7 +23,7 @@
</div>
{{if not .FileIsText}}
<div class="panel-footer text-center">
<a href="{{.FileLink}}" class="btn btn-default btn-lg">View Raw</a>
<a href="{{.FileLink}}" class="btn btn-default">View Raw</a>
</div>
{{else}}
{{if .ReadmeExist}}

Loading…
Cancel
Save