diff options
author | Unknwon <joe2010xtmf@163.com> | 2014-07-24 12:49:43 -0400 |
---|---|---|
committer | Unknwon <joe2010xtmf@163.com> | 2014-07-24 12:49:43 -0400 |
commit | c20f5dc2ea1b27e80c28e00831278c7451ba6cce (patch) | |
tree | 85d1f32c36f962ad6338ec75e3a7a8ff8baf1905 /templates/repo | |
parent | a41a1fe60da5b02891640dd5f99758015b78bcc9 (diff) | |
parent | da0240aacd5646bd73b2e22d92d88578dbafd64b (diff) |
Merge branch 'dev' of github.com:gogits/gogs into dev
Diffstat (limited to 'templates/repo')
-rw-r--r-- | templates/repo/issue/create.tmpl | 11 | ||||
-rw-r--r-- | templates/repo/issue/view.tmpl | 35 |
2 files changed, 43 insertions, 3 deletions
diff --git a/templates/repo/issue/create.tmpl b/templates/repo/issue/create.tmpl index b548b1e7..77058417 100644 --- a/templates/repo/issue/create.tmpl +++ b/templates/repo/issue/create.tmpl @@ -4,7 +4,7 @@ {{template "repo/toolbar" .}} <div id="body" class="container"> <div id="issue"> - <form class="form" action="{{.RepoLink}}/issues/new" method="post" id="issue-create-form"> + <form class="form" action="{{.RepoLink}}/issues/new" method="post" id="issue-create-form" enctype="multipart/form-data"> {{.CsrfTokenHtml}} {{template "base/alert" .}} <div class="col-md-1"> @@ -101,8 +101,17 @@ <div class="tab-pane issue-preview-content" id="issue-preview">loading...</div> </div> </div> + {{if .AttachmentsEnabled}} + <div id="attached"> + <div id="attached-list"></div> + </div> + {{end}} <div class="text-right panel-body"> <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}} <input type="hidden" value="id" name="repo-id"/> <button class="btn-success btn">Create new issue</button> </div> diff --git a/templates/repo/issue/view.tmpl b/templates/repo/issue/view.tmpl index 65373476..57069897 100644 --- a/templates/repo/issue/view.tmpl +++ b/templates/repo/issue/view.tmpl @@ -45,8 +45,19 @@ <div class="tab-pane issue-preview-content" id="issue-edit-preview">Loading...</div> </div> </div> - </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 */}} @@ -63,6 +74,17 @@ <div class="panel-body markdown"> {{str2html .Content}} </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}} @@ -95,7 +117,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"> @@ -115,8 +137,17 @@ <div class="tab-pane issue-preview-content" id="issue-preview">Loading...</div> </div> </div> + {{if .AttachmentsEnabled}} + <div id="attached"> + <div id="attached-list"></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}} |