mirror of
https://github.com/go-gitea/gitea
synced 2025-12-07 13:28:25 +00:00
Implement Review form
Show Review comments on comment stream Signed-off-by: Jonas Franz <info@jonasfranz.software>
This commit is contained in:
@@ -122,7 +122,7 @@
|
||||
{{ template "repo/diff/comments" dict "root" $ "comments" (index $.CodeComments $file.Name (mul $line.LeftIdx -1))}}
|
||||
</ui>
|
||||
</div>
|
||||
{{template "repo/diff/comment_form" .}}
|
||||
{{template "repo/diff/comment_form" $}}
|
||||
</div>
|
||||
</td>
|
||||
{{end}}
|
||||
|
||||
@@ -1,25 +1,29 @@
|
||||
<div class="ui top right pointing dropdown custom">
|
||||
<div class="ui top right pointing dropdown custom" id="review-box">
|
||||
<div class="ui tiny green button btn-review">
|
||||
<span class="text">{{.i18n.Tr "repo.diff.review"}}</span>
|
||||
<i class="dropdown icon"></i>
|
||||
</div>
|
||||
<div class="menu">
|
||||
<div class="ui clearing segment">
|
||||
<form class="ui form" action="{{.Link}}" method="post">
|
||||
{{.CsrfTokenHtml}}
|
||||
<form class="ui form" action="{{.Link}}/reviews/submit" method="post">
|
||||
{{.CsrfTokenHtml}}
|
||||
<div class="ui right floated">
|
||||
<a href="#" class="close"><i class="icon close"></i></a>
|
||||
<button onclick="$('.btn-review').click()" type="button" class="ui tiny icon button"><i class="icon close"></i></button>
|
||||
</div>
|
||||
<div class="header">
|
||||
{{$.i18n.Tr "repo.diff.review.header"}}
|
||||
{{$.i18n.Tr "repo.diff.review.header"}}
|
||||
</div>
|
||||
<div class="ui field">
|
||||
<textarea name="comment" tabindex="0" rows="2" placeholder="{{$.i18n.Tr "repo.diff.review.placeholder"}}"></textarea>
|
||||
<textarea name="content" tabindex="0" rows="2"
|
||||
placeholder="{{$.i18n.Tr "repo.diff.review.placeholder"}}"></textarea>
|
||||
</div>
|
||||
<div class="ui divider"></div>
|
||||
<div class="ui submit green tiny button btn-submit">{{$.i18n.Tr "repo.diff.review.approve"}}</div>
|
||||
<div class="ui submit tiny basic button btn-submit">{{$.i18n.Tr "repo.diff.review.comment"}}</div>
|
||||
<div class="ui submit red tiny button btn-submit">{{$.i18n.Tr "repo.diff.review.reject"}}</div>
|
||||
<button type="submit" name="type" value="approve"
|
||||
class="ui submit green tiny button btn-submit">{{$.i18n.Tr "repo.diff.review.approve"}}</button>
|
||||
<button type="submit" name="type" value="comment"
|
||||
class="ui submit tiny basic button btn-submit">{{$.i18n.Tr "repo.diff.review.comment"}}</button>
|
||||
<button type="submit" name="type" value="reject"
|
||||
class="ui submit red tiny button btn-submit">{{$.i18n.Tr "repo.diff.review.reject"}}</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{{range .Issue.Comments}}
|
||||
{{ $createdStr:= TimeSinceUnix .CreatedUnix $.Lang }}
|
||||
|
||||
<!-- 0 = COMMENT, 1 = REOPEN, 2 = CLOSE, 3 = ISSUE_REF, 4 = COMMIT_REF, 5 = COMMENT_REF, 6 = PULL_REF, 7 = COMMENT_LABEL, 12 = START_TRACKING, 13 = STOP_TRACKING, 14 = ADD_TIME_MANUAL, 16 = ADDED_DEADLINE, 17 = MODIFIED_DEADLINE, 18 = REMOVED_DEADLINE -->
|
||||
<!-- 0 = COMMENT, 1 = REOPEN, 2 = CLOSE, 3 = ISSUE_REF, 4 = COMMIT_REF, 5 = COMMENT_REF, 6 = PULL_REF, 7 = COMMENT_LABEL, 12 = START_TRACKING, 13 = STOP_TRACKING, 14 = ADD_TIME_MANUAL, 16 = ADDED_DEADLINE, 17 = MODIFIED_DEADLINE, 18 = REMOVED_DEADLINE, 19 = CODE, 20 = REVIEW -->
|
||||
{{if eq .Type 0}}
|
||||
<div class="comment" id="{{.HashTag}}">
|
||||
<a class="avatar" {{if gt .Poster.ID 0}}href="{{.Poster.HomeLink}}"{{end}}>
|
||||
@@ -219,5 +219,29 @@
|
||||
{{$.i18n.Tr "repo.issues.due_date_remove" .Content $createdStr | Safe}}
|
||||
</span>
|
||||
</div>
|
||||
{{else if eq .Type 20}}
|
||||
<div class="event" id="{{.HashTag}}">
|
||||
<span class="octicon octicon-{{.Review.Type.Icon}}"></span>
|
||||
<a class="ui avatar image" href="{{.Poster.HomeLink}}">
|
||||
<img src="{{.Poster.RelAvatarLink}}">
|
||||
</a>
|
||||
<span class="text grey"><a href="{{.Poster.HomeLink}}">{{.Poster.Name}}</a>
|
||||
{{if eq .Review.Type 1}}
|
||||
{{$.i18n.Tr "repo.issues.review.approve" $createdStr | Safe}}
|
||||
{{else if eq .Review.Type 2}}
|
||||
{{$.i18n.Tr "repo.issues.review.comment" $createdStr | Safe}}
|
||||
{{else if eq .Review.Type 3}}
|
||||
{{$.i18n.Tr "repo.issues.review.reject" $createdStr | Safe}}
|
||||
{{else}}
|
||||
{{$.i18n.Tr "repo.issues.review.comment" $createdStr | Safe}}
|
||||
{{end}}
|
||||
</span>
|
||||
{{if .Content}}
|
||||
<div class="detail">
|
||||
<span class="octicon octicon-quote"></span>
|
||||
<span class="text grey">{{.Content}}</span>
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
{{end}}
|
||||
{{end}}
|
||||
|
||||
Reference in New Issue
Block a user