summaryrefslogtreecommitdiffstats
path: root/templates/repo/issue/view_content/sidebar/actions.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/issue/view_content/sidebar/actions.tmpl
parentInitial commit. (diff)
downloadforgejo-upstream/9.0.0.tar.xz
forgejo-upstream/9.0.0.zip
Adding upstream version 9.0.0.upstream/9.0.0upstreamdebian
Signed-off-by: Daniel Baumann <daniel@debian.org>
Diffstat (limited to 'templates/repo/issue/view_content/sidebar/actions.tmpl')
-rw-r--r--templates/repo/issue/view_content/sidebar/actions.tmpl114
1 files changed, 114 insertions, 0 deletions
diff --git a/templates/repo/issue/view_content/sidebar/actions.tmpl b/templates/repo/issue/view_content/sidebar/actions.tmpl
new file mode 100644
index 0000000..36f2182
--- /dev/null
+++ b/templates/repo/issue/view_content/sidebar/actions.tmpl
@@ -0,0 +1,114 @@
+{{if or .PinEnabled .Issue.IsPinned}}
+ <form class="tw-mt-1 form-fetch-action single-button-form" method="post" {{if $.NewPinAllowed}}action="{{.Issue.Link}}/pin"{{else}}data-tooltip-content="{{ctx.Locale.Tr "repo.issues.max_pinned"}}"{{end}}>
+ {{$.CsrfTokenHtml}}
+ <button class="fluid ui button {{if not $.NewPinAllowed}}disabled{{end}}">
+ {{if not .Issue.IsPinned}}
+ {{svg "octicon-pin" 16 "tw-mr-2"}}
+ {{ctx.Locale.Tr "pin"}}
+ {{else}}
+ {{svg "octicon-pin-slash" 16 "tw-mr-2"}}
+ {{ctx.Locale.Tr "unpin"}}
+ {{end}}
+ </button>
+ </form>
+{{end}}
+
+<button class="tw-mt-1 fluid ui show-modal button {{if .Issue.IsLocked}} negative {{end}}" data-modal="#lock">
+ {{if .Issue.IsLocked}}
+ {{svg "octicon-key"}}
+ {{ctx.Locale.Tr "repo.issues.unlock"}}
+ {{else}}
+ {{svg "octicon-lock"}}
+ {{ctx.Locale.Tr "repo.issues.lock"}}
+ {{end}}
+</button>
+<div class="ui tiny modal" id="lock">
+ <div class="header">
+ {{if .Issue.IsLocked}}
+ {{ctx.Locale.Tr "repo.issues.unlock.title"}}
+ {{else}}
+ {{ctx.Locale.Tr "repo.issues.lock.title"}}
+ {{end}}
+ </div>
+ <div class="content">
+ <div class="ui warning message">
+ {{if .Issue.IsLocked}}
+ {{ctx.Locale.Tr "repo.issues.unlock.notice_1"}}<br>
+ {{ctx.Locale.Tr "repo.issues.unlock.notice_2"}}<br>
+ {{else}}
+ {{ctx.Locale.Tr "repo.issues.lock.notice_1"}}<br>
+ {{ctx.Locale.Tr "repo.issues.lock.notice_2"}}<br>
+ {{ctx.Locale.Tr "repo.issues.lock.notice_3"}}<br>
+ {{end}}
+ </div>
+
+ <form class="ui form form-fetch-action" action="{{.Issue.Link}}{{if .Issue.IsLocked}}/unlock{{else}}/lock{{end}}"
+ method="post">
+ {{.CsrfTokenHtml}}
+
+ {{if not .Issue.IsLocked}}
+ <div class="field">
+ <strong> {{ctx.Locale.Tr "repo.issues.lock.reason"}} </strong>
+ </div>
+
+ <div class="field">
+ <div class="ui fluid dropdown selection">
+
+ <select name="reason">
+ <option value=""> </option>
+ {{range .LockReasons}}
+ <option value="{{.}}">{{.}}</option>
+ {{end}}
+ </select>
+ {{svg "octicon-triangle-down" 14 "dropdown icon"}}
+
+ <div class="default text"> </div>
+
+ <div class="menu">
+ {{range .LockReasons}}
+ <div class="item" data-value="{{.}}">{{.}}</div>
+ {{end}}
+ </div>
+ </div>
+ </div>
+ {{end}}
+
+ <div class="text right actions">
+ <button class="ui cancel button">{{ctx.Locale.Tr "settings.cancel"}}</button>
+ <button class="ui red button">
+ {{if .Issue.IsLocked}}
+ {{ctx.Locale.Tr "repo.issues.unlock_confirm"}}
+ {{else}}
+ {{ctx.Locale.Tr "repo.issues.lock_confirm"}}
+ {{end}}
+ </button>
+ </div>
+ </form>
+ </div>
+</div>
+<button class="tw-mt-1 fluid ui show-modal button" data-modal="#sidebar-delete-issue">
+ {{svg "octicon-trash"}}
+ {{ctx.Locale.Tr "repo.issues.delete"}}
+</button>
+<div class="ui g-modal-confirm modal" id="sidebar-delete-issue">
+ <div class="header">
+ {{if .Issue.IsPull}}
+ {{ctx.Locale.Tr "repo.pulls.delete.title"}}
+ {{else}}
+ {{ctx.Locale.Tr "repo.issues.delete.title"}}
+ {{end}}
+ </div>
+ <div class="content">
+ <p>
+ {{if .Issue.IsPull}}
+ {{ctx.Locale.Tr "repo.pulls.delete.text"}}
+ {{else}}
+ {{ctx.Locale.Tr "repo.issues.delete.text"}}
+ {{end}}
+ </p>
+ </div>
+ <form action="{{.Issue.Link}}/delete" method="post">
+ {{.CsrfTokenHtml}}
+ {{template "base/modal_actions_confirm" .}}
+ </form>
+</div>