summaryrefslogtreecommitdiffstats
path: root/templates/repo/diff/new_review.tmpl
diff options
context:
space:
mode:
authorDaniel Baumann <daniel@debian.org>2024-10-18 20:33:49 +0200
committerDaniel Baumann <daniel@debian.org>2024-10-18 20:33:49 +0200
commitdd136858f1ea40ad3c94191d647487fa4f31926c (patch)
tree58fec94a7b2a12510c9664b21793f1ed560c6518 /templates/repo/diff/new_review.tmpl
parentInitial commit. (diff)
downloadforgejo-upstream/9.0.0.tar.xz
forgejo-upstream/9.0.0.zip
Adding upstream version 9.0.0.HEADupstream/9.0.0upstreamdebian
Signed-off-by: Daniel Baumann <daniel@debian.org>
Diffstat (limited to 'templates/repo/diff/new_review.tmpl')
-rw-r--r--templates/repo/diff/new_review.tmpl52
1 files changed, 52 insertions, 0 deletions
diff --git a/templates/repo/diff/new_review.tmpl b/templates/repo/diff/new_review.tmpl
new file mode 100644
index 0000000..a2eae00
--- /dev/null
+++ b/templates/repo/diff/new_review.tmpl
@@ -0,0 +1,52 @@
+<div id="review-box">
+ <button class="ui tiny primary button tw-pr-1 tw-flex js-btn-review {{if not $.IsShowingAllCommits}}disabled{{end}}" {{if not $.IsShowingAllCommits}}data-tooltip-content="{{ctx.Locale.Tr "repo.pulls.review_only_possible_for_full_diff"}}"{{end}}>
+ {{ctx.Locale.Tr "repo.diff.review"}}
+ <span class="ui small label review-comments-counter" data-pending-comment-number="{{.PendingCodeCommentNumber}}">{{.PendingCodeCommentNumber}}</span>
+ {{svg "octicon-triangle-down" 14 "dropdown icon"}}
+ </button>
+ {{if $.IsShowingAllCommits}}
+ <div class="review-box-panel tippy-target">
+ <div class="ui segment">
+ <form class="ui form form-fetch-action" action="{{.Link}}/reviews/submit" method="post">
+ {{.CsrfTokenHtml}}
+ <input type="hidden" name="commit_id" value="{{.AfterCommitID}}">
+ <div class="field tw-flex tw-items-center">
+ <div class="tw-flex-1">{{ctx.Locale.Tr "repo.diff.review.header"}}</div>
+ <a class="muted close">{{svg "octicon-x" 16}}</a>
+ </div>
+ <div class="field">
+ {{template "shared/combomarkdowneditor" (dict
+ "MarkdownPreviewUrl" (print .Repository.Link "/markup")
+ "MarkdownPreviewContext" .RepoLink
+ "TextareaName" "content"
+ "TextareaPlaceholder" (ctx.Locale.Tr "repo.diff.review.placeholder")
+ "DropzoneParentContainer" "form"
+ )}}
+ </div>
+ {{if .IsAttachmentEnabled}}
+ <div class="field">
+ {{template "repo/upload" .}}
+ </div>
+ {{end}}
+ <div class="divider"></div>
+ {{$showSelfTooltip := (and $.IsSigned ($.Issue.IsPoster $.SignedUser.ID))}}
+ {{if $showSelfTooltip}}
+ <span class="tw-inline-block" data-tooltip-content="{{ctx.Locale.Tr "repo.diff.review.self_approve"}}">
+ <button type="submit" name="type" value="approve" disabled class="ui submit primary tiny button btn-submit">{{ctx.Locale.Tr "repo.diff.review.approve"}}</button>
+ </span>
+ {{else}}
+ <button type="submit" name="type" value="approve" class="ui submit primary tiny button btn-submit">{{ctx.Locale.Tr "repo.diff.review.approve"}}</button>
+ {{end}}
+ <button type="submit" name="type" value="comment" class="ui submit tiny basic button btn-submit">{{ctx.Locale.Tr "repo.diff.review.comment"}}</button>
+ {{if $showSelfTooltip}}
+ <span class="tw-inline-block" data-tooltip-content="{{ctx.Locale.Tr "repo.diff.review.self_reject"}}">
+ <button type="submit" name="type" value="reject" disabled class="ui submit red tiny button btn-submit">{{ctx.Locale.Tr "repo.diff.review.reject"}}</button>
+ </span>
+ {{else}}
+ <button type="submit" name="type" value="reject" class="ui submit red tiny button btn-submit">{{ctx.Locale.Tr "repo.diff.review.reject"}}</button>
+ {{end}}
+ </form>
+ </div>
+ </div>
+ {{end}}
+</div>