diff options
author | Justin Nuß <justin.nuss@hmmh.de> | 2014-07-24 13:50:03 +0200 |
---|---|---|
committer | Justin Nuß <justin.nuss@hmmh.de> | 2014-07-24 13:50:03 +0200 |
commit | 43e5de7f830a098582b519706f9c5da6eecd2c3e (patch) | |
tree | 952610e2ae5f3bfc1be7ad0214f55fc1d659b497 /templates | |
parent | fa1db64ff014d6d06151431a3b1417ebf0104bde (diff) | |
download | gitea-43e5de7f830a098582b519706f9c5da6eecd2c3e.tar.gz gitea-43e5de7f830a098582b519706f9c5da6eecd2c3e.zip |
Show attachments in issues/comments and add preview for images
Diffstat (limited to 'templates')
-rw-r--r-- | templates/repo/issue/view.tmpl | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/templates/repo/issue/view.tmpl b/templates/repo/issue/view.tmpl index a336205415..8c90f312c3 100644 --- a/templates/repo/issue/view.tmpl +++ b/templates/repo/issue/view.tmpl @@ -45,13 +45,19 @@ <div class="tab-pane issue-preview-content" id="issue-edit-preview">Loading...</div> </div> </div> - </div> - <div class="attachments"> - {{range .Attachments}} - <a class="attachment" href="{{.IssueId}}/attachment/{{.Id}}">{{.Name}}</a> - {{end}} - </div> + </div> </div> + {{with $attachments := .Issue.Attachments}} + {{if $attachments}} + <div class="attachments"> + <span class="attachment-label label label-info">Attachments:</span> + + {{range $attachments}} + <a class="attachment label label-default" href="{{.IssueId}}/attachment/{{.Id}}">{{.Name}}</a> + {{end}} + </div> + {{end}} + {{end}} </div> {{range .Comments}} {{/* 0 = COMMENT, 1 = REOPEN, 2 = CLOSE, 3 = ISSUE, 4 = COMMIT, 5 = PULL */}} @@ -68,11 +74,17 @@ <div class="panel-body markdown"> {{str2html .Content}} </div> + {{with $attachments := .Attachments}} + {{if $attachments}} <div class="attachments"> - {{range .Attachments}} - <a class="attachment" href="{{.IssueId}}/attachment/{{.Id}}">{{.Name}}</a> + <span class="attachment-label label label-info">Attachments:</span> + + {{range $attachments}} + <a class="attachment label label-default" href="{{.IssueId}}/attachment/{{.Id}}">{{.Name}}</a> {{end}} </div> + {{end}} + {{end}} </div> </div> {{else if eq .Type 1}} |