summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--routers/repo/repo.go1
-rw-r--r--templates/repo/single_file.tmpl22
2 files changed, 15 insertions, 8 deletions
diff --git a/routers/repo/repo.go b/routers/repo/repo.go
index 76d55554bc..cd28d52caa 100644
--- a/routers/repo/repo.go
+++ b/routers/repo/repo.go
@@ -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)
diff --git a/templates/repo/single_file.tmpl b/templates/repo/single_file.tmpl
index 45586012ba..cf398595e5 100644
--- a/templates/repo/single_file.tmpl
+++ b/templates/repo/single_file.tmpl
@@ -2,22 +2,28 @@
<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>
- <div class="btn-group pull-right">
- <a class="btn btn-default hidden" href="#">Edit</a>
- <a class="btn btn-default" href="{{.FileLink}}">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>
+ {{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>
+ <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>
{{end}}
</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}}