diff options
Diffstat (limited to 'templates/repo/issue/view.tmpl')
-rw-r--r-- | templates/repo/issue/view.tmpl | 60 |
1 files changed, 55 insertions, 5 deletions
diff --git a/templates/repo/issue/view.tmpl b/templates/repo/issue/view.tmpl index d95fba40d8..ff68ce0cc9 100644 --- a/templates/repo/issue/view.tmpl +++ b/templates/repo/issue/view.tmpl @@ -18,7 +18,7 @@ <a class="btn btn-primary pull-right issue-edit-save hidden" href="#" data-ajax="{{.RepoLink}}/issues/{{.Issue.Index}}" data-ajax-name="issue-edit-save" data-ajax-method="post">Save</a>{{end}} <span class="status label label-{{if .Issue.IsClosed}}danger{{else}}success{{end}}">{{if .Issue.IsClosed}}Closed{{else}}Open{{end}}</span> <a href="/user/{{.Issue.Poster.Name}}" class="author"><strong>{{.Issue.Poster.Name}}</strong></a> opened this issue - <span class="time">{{TimeSince .Issue.Created}}</span> · {{.Issue.NumComments}} comments + <span class="time">{{TimeSince .Issue.Created $.Lang}}</span> · {{.Issue.NumComments}} comments </p> </div> <div class="issue-main"> @@ -47,35 +47,73 @@ </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 */}} {{if eq .Type 0}} <div class="issue-child" id="issue-comment-{{.Id}}"> <a class="user pull-left" href="/user/{{.Poster.Name}}"><img class="avatar" src="{{.Poster.AvatarLink}}" alt=""/></a> <div class="issue-content panel panel-default"> <div class="panel-heading"> - <a href="/user/{{.Poster.Name}}" class="user">{{.Poster.Name}}</a> commented <span class="time">{{TimeSince .Created}}</span> + <a href="/user/{{.Poster.Name}}" class="user">{{.Poster.Name}}</a> commented <span class="time">{{TimeSince .Created $.Lang}}</span> <!-- <a class="issue-comment-del pull-right issue-action" href="#" title="Edit Comment"><i class="fa fa-times-circle"></i></a> <a class="issue-comment-edit pull-right issue-action" href="#" title="Remove Comment" data-url="{remove-link}"><i class="fa fa-edit"></i></a> --> <span class="role label label-default pull-right">Owner</span> </div> <div class="panel-body markdown"> + {{if len .Content}} {{str2html .Content}} + {{else}} + <i>No comment entered</i> + {{end}} + </div> + {{with $attachments := .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> </div> {{else if eq .Type 1}} <div class="issue-child issue-opened"> <a class="user pull-left" href="/user/{{.Poster.Name}}"><img class="avatar" src="{{.Poster.AvatarLink}}" alt="" /></a> <div class="issue-content"> - <a class="user pull-left" href="/user/{{.Poster.Name}}">{{.Poster.Name}}</a> <span class="label label-success">Reopened</span> this issue <span class="time">{{TimeSince .Created}}</span> + <a class="user pull-left" href="/user/{{.Poster.Name}}">{{.Poster.Name}}</a> <span class="label label-success">Reopened</span> this issue <span class="time">{{TimeSince .Created $.Lang}}</span> </div> </div> {{else if eq .Type 2}} <div class="issue-child issue-closed"> <a class="user pull-left" href="/user/{{.Poster.Name}}"><img class="avatar" src="{{.Poster.AvatarLink}}" alt=""/></a> <div class="issue-content"> - <a class="user pull-left" href="/user/{{.Poster.Name}}">{{.Poster.Name}}</a> <span class="label label-danger">Closed</span> this issue <span class="time">{{TimeSince .Created}}</span> + <a class="user pull-left" href="/user/{{.Poster.Name}}">{{.Poster.Name}}</a> <span class="label label-danger">Closed</span> this issue <span class="time">{{TimeSince .Created $.Lang}}</span> + </div> + </div> + {{else if eq .Type 4}} + <div class="issue-child issue-reference issue-reference-commit"> + <a class="user pull-left" href="/user/{{.Poster.Name}}"><img class="avatar" src="{{.Poster.AvatarLink}}" alt=""/></a> + <div class="issue-content"> + <a class="user pull-left" href="/user/{{.Poster.Name}}">{{.Poster.Name}}</a> <span class="label label-primary">Referenced</span> this issue <span class="time">{{TimeSince .Created $.Lang}}</span> + <p> + <a class="user pull-left" href="/user/{{.Poster.Name}}"><img class="avatar" src="{{.Poster.AvatarLink}}" alt=""/></a> + {{.ContentHtml}} + </p> </div> </div> {{end}} @@ -83,7 +121,7 @@ <hr class="issue-line"/> {{if .SignedUser}}<div class="issue-child issue-reply"> <a class="user pull-left" href="/user/{{.SignedUser.Name}}"><img class="avatar" src="{{.SignedUser.AvatarLink}}" alt=""/></a> - <form class="panel panel-default issue-content" action="{{.RepoLink}}/comment/new" method="post"> + <form class="panel panel-default issue-content" action="{{.RepoLink}}/comment/new" method="post" enctype="multipart/form-data"> {{.CsrfTokenHtml}} <div class="panel-body"> <div class="form-group"> @@ -96,6 +134,7 @@ <div class="tab-content"> <div class="tab-pane" id="issue-textarea"> <div class="form-group"> + <div id="submit-error" class="text-danger"></div> <input type="hidden" value="{{.Issue.Index}}" name="issueIndex"/> <textarea class="form-control" name="content" id="issue-reply-content" rows="10" placeholder="Write some content" data-ajax-rel="issue-preview" data-ajax-val="val" data-ajax-field="text">{{.content}}</textarea> </div> @@ -103,8 +142,19 @@ <div class="tab-pane issue-preview-content" id="issue-preview">Loading...</div> </div> </div> + {{if .AttachmentsEnabled}} + <div id="attached"> + <div id="attached-list"> + <b>Attachments:</b> + </div> + </div> + {{end}} <div class="text-right"> <div class="form-group"> + {{if .AttachmentsEnabled}} + <input type="file" accept="{{.AllowedTypes}}" style="display: none;" id="attachments-input" name="attachments" multiple /> + <button class="btn-default btn attachment-add" id="attachments-button">Select Attachments...</button> + {{end}} {{if .IsIssueOwner}}{{if .Issue.IsClosed}} <input type="submit" class="btn-default btn issue-open" id="issue-open-btn" data-origin="Reopen" data-text="Reopen & Comment" name="change_status" value="Reopen"/>{{else}} <input type="submit" class="btn-default btn issue-close" id="issue-close-btn" data-origin="Close" data-text="Close & Comment" name="change_status" value="Close"/>{{end}}{{end}} |