Skip to content

Commit df1002c

Browse files
committed
fix
1 parent 331e878 commit df1002c

15 files changed

+675
-676
lines changed

templates/repo/issue/branch_selector_field.tmpl

-2
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,4 @@
4444
</div>
4545
</div>
4646
</div>
47-
48-
<div class="divider"></div>
4947
{{end}}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{{if and .Issue.IsPull .IsIssuePoster (not .Issue.IsClosed) .Issue.PullRequest.HeadRepo}}
2+
{{if and (not (eq .Issue.PullRequest.HeadRepo.FullName .Issue.PullRequest.BaseRepo.FullName)) .CanWriteToHeadRepo}}
3+
<div class="divider"></div>
4+
<div class="inline field">
5+
<div class="ui checkbox loading-icon-2px" id="allow-edits-from-maintainers"
6+
data-url="{{.Issue.Link}}"
7+
data-tooltip-content="{{ctx.Locale.Tr "repo.pulls.allow_edits_from_maintainers_desc"}}"
8+
data-prompt-error="{{ctx.Locale.Tr "repo.pulls.allow_edits_from_maintainers_err"}}"
9+
>
10+
<label><strong>{{ctx.Locale.Tr "repo.pulls.allow_edits_from_maintainers"}}</strong></label>
11+
<input type="checkbox" {{if .Issue.PullRequest.AllowMaintainerEdit}}checked{{end}}>
12+
</div>
13+
</div>
14+
{{end}}
15+
{{end}}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<div class="divider"></div>
2+
<input id="assignee_id" name="assignee_id" type="hidden" value="{{.assignee_id}}">
3+
<div class="ui {{if or (not .HasIssuesOrPullsWritePermission) .Repository.IsArchived}}disabled{{end}} floating jump select-assignees-modify dropdown">
4+
<a class="text muted flex-text-block">
5+
<strong>{{ctx.Locale.Tr "repo.issues.new.assignees"}}</strong>
6+
{{if and .HasIssuesOrPullsWritePermission (not .Repository.IsArchived)}}
7+
{{svg "octicon-gear" 16 "tw-ml-1"}}
8+
{{end}}
9+
</a>
10+
<div class="filter menu" data-action="update" data-issue-id="{{$.Issue.ID}}" data-update-url="{{$.RepoLink}}/issues/assignee">
11+
<div class="ui icon search input">
12+
<i class="icon">{{svg "octicon-search" 16}}</i>
13+
<input type="text" placeholder="{{ctx.Locale.Tr "repo.issues.filter_assignees"}}">
14+
</div>
15+
<div class="no-select item">{{ctx.Locale.Tr "repo.issues.new.clear_assignees"}}</div>
16+
{{range .Assignees}}
17+
18+
{{$AssigneeID := .ID}}
19+
<a class="item{{range $.Issue.Assignees}}{{if eq .ID $AssigneeID}} checked{{end}}{{end}}" href="#" data-id="{{.ID}}" data-id-selector="#assignee_{{.ID}}">
20+
{{$checked := false}}
21+
{{range $.Issue.Assignees}}
22+
{{if eq .ID $AssigneeID}}
23+
{{$checked = true}}
24+
{{end}}
25+
{{end}}
26+
<span class="octicon-check {{if not $checked}}tw-invisible{{end}}">{{svg "octicon-check"}}</span>
27+
<span class="text">
28+
{{ctx.AvatarUtils.Avatar . 20 "tw-mr-2"}}{{template "repo/search_name" .}}
29+
</span>
30+
</a>
31+
{{end}}
32+
</div>
33+
</div>
34+
<div class="ui assignees list">
35+
<span class="no-select item {{if .Issue.Assignees}}tw-hidden{{end}}">{{ctx.Locale.Tr "repo.issues.new.no_assignees"}}</span>
36+
<div class="selected">
37+
{{range .Issue.Assignees}}
38+
<div class="item">
39+
<a class="muted sidebar-item-link" href="{{$.RepoLink}}/{{if $.Issue.IsPull}}pulls{{else}}issues{{end}}?assignee={{.ID}}">
40+
{{ctx.AvatarUtils.Avatar . 28 "tw-mr-2"}}
41+
{{.GetDisplayName}}
42+
</a>
43+
</div>
44+
{{end}}
45+
</div>
46+
</div>
+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<div class="divider"></div>
2+
<span class="text"><strong>{{ctx.Locale.Tr "repo.issues.due_date"}}</strong></span>
3+
<div class="ui form tw-mt-2">
4+
{{if .Issue.DeadlineUnix}}
5+
<div class="tw-flex tw-justify-between tw-items-center tw-gap-2">
6+
<div class="due-date {{if .Issue.IsOverdue}}text red{{end}}" {{if .Issue.IsOverdue}}data-tooltip-content="{{ctx.Locale.Tr "repo.issues.due_date_overdue"}}"{{end}}>
7+
{{svg "octicon-calendar"}} {{DateUtils.AbsoluteLong .Issue.DeadlineUnix}}
8+
</div>
9+
<div class="flex-text-block">
10+
{{if and .HasIssuesOrPullsWritePermission (not .Repository.IsArchived)}}
11+
<a class="issue-due-edit muted" data-tooltip-content="{{ctx.Locale.Tr "repo.issues.due_date_form_edit"}}">{{svg "octicon-pencil"}}</a>
12+
<a class="issue-due-remove muted" data-tooltip-content="{{ctx.Locale.Tr "repo.issues.due_date_form_remove"}}">{{svg "octicon-trash"}}</a>
13+
{{end}}
14+
</div>
15+
</div>
16+
{{else}}
17+
{{ctx.Locale.Tr "repo.issues.due_date_not_set"}}
18+
{{end}}
19+
20+
{{if and .HasIssuesOrPullsWritePermission (not .Repository.IsArchived)}}
21+
<form class="ui fluid action input issue-due-form form-fetch-action tw-mt-2 {{if .Issue.DeadlineUnix}}tw-hidden{{end}}"
22+
method="post" action="{{AppSubUrl}}/{{PathEscape .Repository.Owner.Name}}/{{PathEscape .Repository.Name}}/issues/{{.Issue.Index}}/deadline"
23+
>
24+
{{$.CsrfTokenHtml}}
25+
<input required type="date" name="deadline" placeholder="{{ctx.Locale.Tr "repo.issues.due_date_form"}}" {{if .Issue.DeadlineUnix}}value="{{.Issue.DeadlineUnix.FormatDate}}"{{end}}>
26+
<button class="ui icon button">{{Iif .Issue.DeadlineUnix (svg "octicon-pencil") (svg "octicon-plus")}}</button>
27+
</form>
28+
{{end}}
29+
</div>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
{{if .Repository.IsDependenciesEnabled ctx}}
2+
<div class="divider"></div>
3+
4+
<div class="ui depending">
5+
{{if (and (not .BlockedByDependencies) (not .BlockedByDependenciesNotPermitted) (not .BlockingDependencies) (not .BlockingDependenciesNotPermitted))}}
6+
<span class="text"><strong>{{ctx.Locale.Tr "repo.issues.dependency.title"}}</strong></span>
7+
<br>
8+
<p>
9+
{{if .Issue.IsPull}}
10+
{{ctx.Locale.Tr "repo.issues.dependency.pr_no_dependencies"}}
11+
{{else}}
12+
{{ctx.Locale.Tr "repo.issues.dependency.issue_no_dependencies"}}
13+
{{end}}
14+
</p>
15+
{{end}}
16+
17+
{{if or .BlockingDependencies .BlockingDependenciesNotPermitted}}
18+
<span class="text" data-tooltip-content="{{if .Issue.IsPull}}{{ctx.Locale.Tr "repo.issues.dependency.pr_close_blocks"}}{{else}}{{ctx.Locale.Tr "repo.issues.dependency.issue_close_blocks"}}{{end}}">
19+
<strong>{{ctx.Locale.Tr "repo.issues.dependency.blocks_short"}}</strong>
20+
</span>
21+
<div class="ui relaxed divided list">
22+
{{range .BlockingDependencies}}
23+
<div class="item dependency{{if .Issue.IsClosed}} is-closed{{end}} tw-flex tw-items-center tw-justify-between">
24+
<div class="item-left tw-flex tw-justify-center tw-flex-col tw-flex-1 gt-ellipsis">
25+
<a class="title muted" href="{{.Issue.Link}}" data-tooltip-content="#{{.Issue.Index}} {{.Issue.Title | ctx.RenderUtils.RenderEmoji}}">
26+
#{{.Issue.Index}} {{.Issue.Title | ctx.RenderUtils.RenderEmoji}}
27+
</a>
28+
<div class="text small gt-ellipsis" data-tooltip-content="{{.Repository.OwnerName}}/{{.Repository.Name}}">
29+
{{.Repository.OwnerName}}/{{.Repository.Name}}
30+
</div>
31+
</div>
32+
<div class="item-right tw-flex tw-items-center tw-m-1">
33+
{{if and $.CanCreateIssueDependencies (not $.Repository.IsArchived)}}
34+
<a class="delete-dependency-button ci muted" data-id="{{.Issue.ID}}" data-type="blocking" data-tooltip-content="{{ctx.Locale.Tr "repo.issues.dependency.remove_info"}}">
35+
{{svg "octicon-trash" 16}}
36+
</a>
37+
{{end}}
38+
</div>
39+
</div>
40+
{{end}}
41+
{{if .BlockingDependenciesNotPermitted}}
42+
<div class="item tw-flex tw-items-center tw-justify-between gt-ellipsis">
43+
<span>{{ctx.Locale.TrN (len .BlockingDependenciesNotPermitted) "repo.issues.dependency.no_permission_1" "repo.issues.dependency.no_permission_n" (len .BlockingDependenciesNotPermitted)}}</span>
44+
</div>
45+
{{end}}
46+
</div>
47+
{{end}}
48+
49+
{{if or .BlockedByDependencies .BlockedByDependenciesNotPermitted}}
50+
<span class="text" data-tooltip-content="{{if .Issue.IsPull}}{{ctx.Locale.Tr "repo.issues.dependency.pr_closing_blockedby"}}{{else}}{{ctx.Locale.Tr "repo.issues.dependency.issue_closing_blockedby"}}{{end}}">
51+
<strong>{{ctx.Locale.Tr "repo.issues.dependency.blocked_by_short"}}</strong>
52+
</span>
53+
<div class="ui relaxed divided list">
54+
{{range .BlockedByDependencies}}
55+
<div class="item dependency{{if .Issue.IsClosed}} is-closed{{end}} tw-flex tw-items-center tw-justify-between">
56+
<div class="item-left tw-flex tw-justify-center tw-flex-col tw-flex-1 gt-ellipsis">
57+
<a class="title muted" href="{{.Issue.Link}}" data-tooltip-content="#{{.Issue.Index}} {{.Issue.Title | ctx.RenderUtils.RenderEmoji}}">
58+
#{{.Issue.Index}} {{.Issue.Title | ctx.RenderUtils.RenderEmoji}}
59+
</a>
60+
<div class="text small gt-ellipsis" data-tooltip-content="{{.Repository.OwnerName}}/{{.Repository.Name}}">
61+
{{.Repository.OwnerName}}/{{.Repository.Name}}
62+
</div>
63+
</div>
64+
<div class="item-right tw-flex tw-items-center tw-m-1">
65+
{{if and $.CanCreateIssueDependencies (not $.Repository.IsArchived)}}
66+
<a class="delete-dependency-button ci muted" data-id="{{.Issue.ID}}" data-type="blockedBy" data-tooltip-content="{{ctx.Locale.Tr "repo.issues.dependency.remove_info"}}">
67+
{{svg "octicon-trash" 16}}
68+
</a>
69+
{{end}}
70+
</div>
71+
</div>
72+
{{end}}
73+
{{if $.CanCreateIssueDependencies}}
74+
{{range .BlockedByDependenciesNotPermitted}}
75+
<div class="item dependency{{if .Issue.IsClosed}} is-closed{{end}} tw-flex tw-items-center tw-justify-between">
76+
<div class="item-left tw-flex tw-justify-center tw-flex-col tw-flex-1 gt-ellipsis">
77+
<div class="gt-ellipsis">
78+
<span data-tooltip-content="{{ctx.Locale.Tr "repo.issues.dependency.no_permission.can_remove"}}">{{svg "octicon-lock" 16}}</span>
79+
<span class="title" data-tooltip-content="#{{.Issue.Index}} {{.Issue.Title | ctx.RenderUtils.RenderEmoji}}">
80+
#{{.Issue.Index}} {{.Issue.Title | ctx.RenderUtils.RenderEmoji}}
81+
</span>
82+
</div>
83+
<div class="text small gt-ellipsis" data-tooltip-content="{{.Repository.OwnerName}}/{{.Repository.Name}}">
84+
{{.Repository.OwnerName}}/{{.Repository.Name}}
85+
</div>
86+
</div>
87+
<div class="item-right tw-flex tw-items-center tw-m-1">
88+
{{if and $.CanCreateIssueDependencies (not $.Repository.IsArchived)}}
89+
<a class="delete-dependency-button ci muted" data-id="{{.Issue.ID}}" data-type="blocking" data-tooltip-content="{{ctx.Locale.Tr "repo.issues.dependency.remove_info"}}">
90+
{{svg "octicon-trash" 16}}
91+
</a>
92+
{{end}}
93+
</div>
94+
</div>
95+
{{end}}
96+
{{else if .BlockedByDependenciesNotPermitted}}
97+
<div class="item tw-flex tw-items-center tw-justify-between gt-ellipsis">
98+
<span>{{ctx.Locale.TrN (len .BlockedByDependenciesNotPermitted) "repo.issues.dependency.no_permission_1" "repo.issues.dependency.no_permission_n" (len .BlockedByDependenciesNotPermitted)}}</span>
99+
</div>
100+
{{end}}
101+
</div>
102+
{{end}}
103+
104+
{{if and .CanCreateIssueDependencies (not .Repository.IsArchived)}}
105+
<div>
106+
<form method="post" action="{{.Issue.Link}}/dependency/add" id="addDependencyForm">
107+
{{$.CsrfTokenHtml}}
108+
<div class="ui fluid action input">
109+
<div class="ui search selection dropdown" id="new-dependency-drop-list" data-issue-id="{{.Issue.ID}}">
110+
<input name="newDependency" type="hidden">
111+
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
112+
<input type="text" class="search">
113+
<div class="default text">{{ctx.Locale.Tr "repo.issues.dependency.add"}}</div>
114+
</div>
115+
<button class="ui icon button">
116+
{{svg "octicon-plus"}}
117+
</button>
118+
</div>
119+
</form>
120+
</div>
121+
{{end}}
122+
</div>
123+
124+
{{if and .CanCreateIssueDependencies (not .Repository.IsArchived)}}
125+
<input type="hidden" id="crossRepoSearch" value="{{.AllowCrossRepositoryDependencies}}">
126+
127+
<div class="ui g-modal-confirm modal remove-dependency">
128+
<div class="header">
129+
{{svg "octicon-trash"}}
130+
{{ctx.Locale.Tr "repo.issues.dependency.remove_header"}}
131+
</div>
132+
<div class="content">
133+
<form method="post" action="{{.Issue.Link}}/dependency/delete" id="removeDependencyForm">
134+
{{$.CsrfTokenHtml}}
135+
<input type="hidden" value="" name="removeDependencyID" id="removeDependencyID">
136+
<input type="hidden" value="" name="dependencyType" id="dependencyType">
137+
</form>
138+
<p>{{if .Issue.IsPull}}
139+
{{ctx.Locale.Tr "repo.issues.dependency.pr_remove_text"}}
140+
{{else}}
141+
{{ctx.Locale.Tr "repo.issues.dependency.issue_remove_text"}}
142+
{{end}}</p>
143+
</div>
144+
{{$ModalButtonCancelText := ctx.Locale.Tr "repo.issues.dependency.cancel"}}
145+
{{$ModalButtonOkText := ctx.Locale.Tr "repo.issues.dependency.remove"}}
146+
{{template "base/modal_actions_confirm" (dict "." . "ModalButtonCancelText" $ModalButtonCancelText "ModalButtonOkText" $ModalButtonOkText)}}
147+
</div>
148+
{{end}}
149+
{{end}}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
{{if and .IsRepoAdmin (not .Repository.IsArchived)}}
2+
<div class="divider"></div>
3+
4+
{{if or .PinEnabled .Issue.IsPinned}}
5+
<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}}>
6+
{{$.CsrfTokenHtml}}
7+
<button class="fluid ui button {{if not $.NewPinAllowed}}disabled{{end}}">
8+
{{if not .Issue.IsPinned}}
9+
{{svg "octicon-pin" 16 "tw-mr-2"}}
10+
{{ctx.Locale.Tr "pin"}}
11+
{{else}}
12+
{{svg "octicon-pin-slash" 16 "tw-mr-2"}}
13+
{{ctx.Locale.Tr "unpin"}}
14+
{{end}}
15+
</button>
16+
</form>
17+
{{end}}
18+
19+
<button class="tw-mt-1 fluid ui show-modal button{{if .Issue.IsLocked}} red{{end}}" data-modal="#lock">
20+
{{if .Issue.IsLocked}}
21+
{{svg "octicon-key"}}
22+
{{ctx.Locale.Tr "repo.issues.unlock"}}
23+
{{else}}
24+
{{svg "octicon-lock"}}
25+
{{ctx.Locale.Tr "repo.issues.lock"}}
26+
{{end}}
27+
</button>
28+
<div class="ui tiny modal" id="lock">
29+
<div class="header">
30+
{{if .Issue.IsLocked}}
31+
{{ctx.Locale.Tr "repo.issues.unlock.title"}}
32+
{{else}}
33+
{{ctx.Locale.Tr "repo.issues.lock.title"}}
34+
{{end}}
35+
</div>
36+
<div class="content">
37+
<div class="ui warning message">
38+
{{if .Issue.IsLocked}}
39+
{{ctx.Locale.Tr "repo.issues.unlock.notice_1"}}<br>
40+
{{ctx.Locale.Tr "repo.issues.unlock.notice_2"}}<br>
41+
{{else}}
42+
{{ctx.Locale.Tr "repo.issues.lock.notice_1"}}<br>
43+
{{ctx.Locale.Tr "repo.issues.lock.notice_2"}}<br>
44+
{{ctx.Locale.Tr "repo.issues.lock.notice_3"}}<br>
45+
{{end}}
46+
</div>
47+
48+
<form class="ui form form-fetch-action" action="{{.Issue.Link}}{{if .Issue.IsLocked}}/unlock{{else}}/lock{{end}}"
49+
method="post">
50+
{{.CsrfTokenHtml}}
51+
52+
{{if not .Issue.IsLocked}}
53+
<div class="field">
54+
<strong> {{ctx.Locale.Tr "repo.issues.lock.reason"}} </strong>
55+
</div>
56+
57+
<div class="field">
58+
<div class="ui fluid dropdown selection">
59+
60+
<select name="reason">
61+
<option value=""> </option>
62+
{{range .LockReasons}}
63+
<option value="{{.}}">{{.}}</option>
64+
{{end}}
65+
</select>
66+
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
67+
68+
<div class="default text"> </div>
69+
70+
<div class="menu">
71+
{{range .LockReasons}}
72+
<div class="item" data-value="{{.}}">{{.}}</div>
73+
{{end}}
74+
</div>
75+
</div>
76+
</div>
77+
{{end}}
78+
79+
<div class="text right actions">
80+
<button class="ui cancel button">{{ctx.Locale.Tr "settings.cancel"}}</button>
81+
<button class="ui red button">
82+
{{if .Issue.IsLocked}}
83+
{{ctx.Locale.Tr "repo.issues.unlock_confirm"}}
84+
{{else}}
85+
{{ctx.Locale.Tr "repo.issues.lock_confirm"}}
86+
{{end}}
87+
</button>
88+
</div>
89+
</form>
90+
</div>
91+
</div>
92+
<button class="tw-mt-1 fluid ui show-modal button" data-modal="#sidebar-delete-issue">
93+
{{svg "octicon-trash"}}
94+
{{ctx.Locale.Tr "repo.issues.delete"}}
95+
</button>
96+
<div class="ui g-modal-confirm modal" id="sidebar-delete-issue">
97+
<div class="header">
98+
{{if .Issue.IsPull}}
99+
{{ctx.Locale.Tr "repo.pulls.delete.title"}}
100+
{{else}}
101+
{{ctx.Locale.Tr "repo.issues.delete.title"}}
102+
{{end}}
103+
</div>
104+
<div class="content">
105+
<p>
106+
{{if .Issue.IsPull}}
107+
{{ctx.Locale.Tr "repo.pulls.delete.text"}}
108+
{{else}}
109+
{{ctx.Locale.Tr "repo.issues.delete.text"}}
110+
{{end}}
111+
</p>
112+
</div>
113+
<form action="{{.Issue.Link}}/delete" method="post">
114+
{{.CsrfTokenHtml}}
115+
{{template "base/modal_actions_confirm" .}}
116+
</form>
117+
</div>
118+
{{end}}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<div class="divider"></div>
2+
<div class="ui {{if or (not .HasIssuesOrPullsWritePermission) .Repository.IsArchived}}disabled{{end}} floating jump select-milestone dropdown">
3+
<a class="text muted flex-text-block">
4+
<strong>{{ctx.Locale.Tr "repo.issues.new.milestone"}}</strong>
5+
{{if and .HasIssuesOrPullsWritePermission (not .Repository.IsArchived)}}
6+
{{svg "octicon-gear" 16 "tw-ml-1"}}
7+
{{end}}
8+
</a>
9+
<div class="menu" data-action="update" data-issue-id="{{$.Issue.ID}}" data-update-url="{{$.RepoLink}}/issues/milestone">
10+
{{template "repo/issue/milestone/select_menu" .}}
11+
</div>
12+
</div>
13+
<div class="ui select-milestone list">
14+
<span class="no-select item {{if .Issue.Milestone}}tw-hidden{{end}}">{{ctx.Locale.Tr "repo.issues.new.no_milestone"}}</span>
15+
<div class="selected">
16+
{{if .Issue.Milestone}}
17+
<a class="item muted sidebar-item-link" href="{{.RepoLink}}/milestone/{{.Issue.Milestone.ID}}">
18+
{{svg "octicon-milestone" 18 "tw-mr-2"}}
19+
{{.Issue.Milestone.Name}}
20+
</a>
21+
{{end}}
22+
</div>
23+
</div>

0 commit comments

Comments
 (0)