code.gitea.io/gitea@v1.22.3/templates/repo/issue/view_content/sidebar.tmpl (about)

     1  <div class="issue-content-right ui segment">
     2  	{{template "repo/issue/branch_selector_field" .}}
     3  	{{if .Issue.IsPull}}
     4  		<input id="reviewer_id" name="reviewer_id" type="hidden" value="{{.reviewer_id}}">
     5  		<div class="ui {{if or (and (not .Reviewers) (not .TeamReviewers)) (not .CanChooseReviewer) .Repository.IsArchived}}disabled{{end}} floating jump select-reviewers-modify dropdown">
     6  			<a class="text tw-flex tw-items-center muted">
     7  				<strong>{{ctx.Locale.Tr "repo.issues.review.reviewers"}}</strong>
     8  				{{if and .CanChooseReviewer (not .Repository.IsArchived)}}
     9  					{{svg "octicon-gear" 16 "tw-ml-1"}}
    10  				{{end}}
    11  			</a>
    12  			<div class="filter menu" data-action="update" data-issue-id="{{$.Issue.ID}}" data-update-url="{{$.RepoLink}}/issues/request_review">
    13  				{{if .Reviewers}}
    14  					<div class="ui icon search input">
    15  						<i class="icon">{{svg "octicon-search" 16}}</i>
    16  						<input type="text" placeholder="{{ctx.Locale.Tr "repo.issues.filter_reviewers"}}">
    17  					</div>
    18  				{{end}}
    19  				{{if .Reviewers}}
    20  					{{range .Reviewers}}
    21  						{{if .User}}
    22  							<a class="{{if not .CanChange}}ui{{end}} item {{if .Checked}}checked{{end}} {{if not .CanChange}}ban-change{{end}}" href="#" data-id="{{.ItemID}}" data-id-selector="#review_request_{{.ItemID}}" {{if not .CanChange}} data-tooltip-content="{{ctx.Locale.Tr "repo.issues.remove_request_review_block"}}"{{end}}>
    23  								<span class="octicon-check {{if not .Checked}}tw-invisible{{end}}">{{svg "octicon-check"}}</span>
    24  								<span class="text">
    25  									{{ctx.AvatarUtils.Avatar .User 28 "tw-mr-2"}}{{template "repo/search_name" .User}}
    26  								</span>
    27  							</a>
    28  						{{end}}
    29  					{{end}}
    30  				{{end}}
    31  				{{if .TeamReviewers}}
    32  					{{if .Reviewers}}
    33  						<div class="divider"></div>
    34  					{{end}}
    35  					{{range .TeamReviewers}}
    36  						{{if .Team}}
    37  							<a class="{{if not .CanChange}}ui{{end}} item {{if .Checked}}checked{{end}} {{if not .CanChange}}ban-change{{end}}" href="#" data-id="{{.ItemID}}" data-id-selector="#review_request_team_{{.Team.ID}}" {{if not .CanChange}} data-tooltip-content="{{ctx.Locale.Tr "repo.issues.remove_request_review_block"}}"{{end}}>
    38  								<span class="octicon-check {{if not .Checked}}tw-invisible{{end}}">{{svg "octicon-check" 16}}</span>
    39  								<span class="text">
    40  									{{svg "octicon-people" 16 "tw-ml-4 tw-mr-1"}}{{$.Issue.Repo.OwnerName}}/{{.Team.Name}}
    41  								</span>
    42  							</a>
    43  						{{end}}
    44  					{{end}}
    45  				{{end}}
    46  			</div>
    47  		</div>
    48  
    49  		<div class="ui assignees list">
    50  			<span class="no-select item {{if or .OriginalReviews .PullReviewers}}tw-hidden{{end}}">{{ctx.Locale.Tr "repo.issues.new.no_reviewers"}}</span>
    51  			<div class="selected">
    52  				{{range .PullReviewers}}
    53  					<div class="item tw-flex tw-items-center tw-py-2">
    54  						<div class="tw-flex tw-items-center tw-flex-1">
    55  							{{if .User}}
    56  								<a class="muted sidebar-item-link" href="{{.User.HomeLink}}">{{ctx.AvatarUtils.Avatar .User 20 "tw-mr-2"}}{{.User.GetDisplayName}}</a>
    57  							{{else if .Team}}
    58  								<span class="text">{{svg "octicon-people" 20 "tw-mr-2"}}{{$.Issue.Repo.OwnerName}}/{{.Team.Name}}</span>
    59  							{{end}}
    60  						</div>
    61  						<div class="tw-flex tw-items-center tw-gap-2">
    62  							{{if (and $.Permission.IsAdmin (or (eq .Review.Type 1) (eq .Review.Type 3)) (not $.Issue.IsClosed) (not $.Issue.PullRequest.HasMerged))}}
    63  								<a href="#" class="ui muted icon tw-flex tw-items-center show-modal" data-tooltip-content="{{ctx.Locale.Tr "repo.issues.dismiss_review"}}" data-modal="#dismiss-review-modal-{{.Review.ID}}">
    64  									{{svg "octicon-x" 20}}
    65  								</a>
    66  								<div class="ui small modal" id="dismiss-review-modal-{{.Review.ID}}">
    67  									<div class="header">
    68  										{{ctx.Locale.Tr "repo.issues.dismiss_review"}}
    69  									</div>
    70  									<div class="content">
    71  										<div class="ui warning message">
    72  											{{ctx.Locale.Tr "repo.issues.dismiss_review_warning"}}
    73  										</div>
    74  										<form class="ui form dismiss-review-form" id="dismiss-review-{{.Review.ID}}" action="{{$.RepoLink}}/issues/dismiss_review" method="post">
    75  											{{$.CsrfTokenHtml}}
    76  											<input type="hidden" name="review_id" value="{{.Review.ID}}">
    77  											<div class="field">
    78  												<label for="message">{{ctx.Locale.Tr "action.review_dismissed_reason"}}</label>
    79  												<input id="message" name="message">
    80  											</div>
    81  											<div class="text right actions">
    82  												<button class="ui cancel button">{{ctx.Locale.Tr "settings.cancel"}}</button>
    83  												<button class="ui red button" type="submit">{{ctx.Locale.Tr "ok"}}</button>
    84  											</div>
    85  										</form>
    86  									</div>
    87  								</div>
    88  							{{end}}
    89  							{{if .Review.Stale}}
    90  								<span data-tooltip-content="{{ctx.Locale.Tr "repo.issues.is_stale"}}">
    91  									{{svg "octicon-hourglass" 16}}
    92  								</span>
    93  							{{end}}
    94  							{{if and .CanChange (or .Checked (and (not $.Issue.IsClosed) (not $.Issue.PullRequest.HasMerged)))}}
    95  								<a href="#" class="ui muted icon re-request-review{{if .Checked}} checked{{end}}" data-tooltip-content="{{if .Checked}}{{ctx.Locale.Tr "repo.issues.remove_request_review"}}{{else}}{{ctx.Locale.Tr "repo.issues.re_request_review"}}{{end}}" data-issue-id="{{$.Issue.ID}}" data-id="{{.ItemID}}" data-update-url="{{$.RepoLink}}/issues/request_review">{{if .Checked}}{{svg "octicon-trash"}}{{else}}{{svg "octicon-sync"}}{{end}}</a>
    96  							{{end}}
    97  							{{svg (printf "octicon-%s" .Review.Type.Icon) 16 (printf "text %s" (.Review.HTMLTypeColorName))}}
    98  						</div>
    99  					</div>
   100  				{{end}}
   101  				{{range .OriginalReviews}}
   102  					<div class="item tw-flex tw-items-center tw-py-2">
   103  						<div class="tw-flex tw-items-center tw-flex-1">
   104  							<a class="muted" href="{{$.Repository.OriginalURL}}" data-tooltip-content="{{ctx.Locale.Tr "repo.migrated_from_fake" $.Repository.GetOriginalURLHostname}}">
   105  								{{svg (MigrationIcon $.Repository.GetOriginalURLHostname) 20 "tw-mr-2"}}
   106  								{{.OriginalAuthor}}
   107  							</a>
   108  						</div>
   109  						<div class="tw-flex tw-items-center tw-gap-2">
   110  							{{svg (printf "octicon-%s" .Type.Icon) 16 (printf "text %s" (.HTMLTypeColorName))}}
   111  						</div>
   112  					</div>
   113  				{{end}}
   114  			</div>
   115  		</div>
   116  		{{if and (or .HasIssuesOrPullsWritePermission .IsIssuePoster) (not .HasMerged) (not .Issue.IsClosed) (not .IsPullWorkInProgress)}}
   117  			<div class="toggle-wip" data-title="{{.Issue.Title}}" data-wip-prefix="{{index .PullRequestWorkInProgressPrefixes 0}}" data-update-url="{{.Issue.Link}}/title">
   118  				<a class="muted">
   119  					{{ctx.Locale.Tr "repo.pulls.still_in_progress"}} {{ctx.Locale.Tr "repo.pulls.add_prefix" (index .PullRequestWorkInProgressPrefixes 0)}}
   120  				</a>
   121  			</div>
   122  		{{end}}
   123  		<div class="divider"></div>
   124  	{{end}}
   125  
   126  	{{template "repo/issue/labels/labels_selector_field" .}}
   127  	{{template "repo/issue/labels/labels_sidebar" dict "root" $}}
   128  
   129  	<div class="divider"></div>
   130  
   131  	<div class="ui {{if or (not .HasIssuesOrPullsWritePermission) .Repository.IsArchived}}disabled{{end}} floating jump select-milestone dropdown">
   132  		<a class="text muted flex-text-block">
   133  			<strong>{{ctx.Locale.Tr "repo.issues.new.milestone"}}</strong>
   134  			{{if and .HasIssuesOrPullsWritePermission (not .Repository.IsArchived)}}
   135  				{{svg "octicon-gear" 16 "tw-ml-1"}}
   136  			{{end}}
   137  		</a>
   138  		<div class="menu" data-action="update" data-issue-id="{{$.Issue.ID}}" data-update-url="{{$.RepoLink}}/issues/milestone">
   139  			{{template "repo/issue/milestone/select_menu" .}}
   140  		</div>
   141  	</div>
   142  	<div class="ui select-milestone list">
   143  		<span class="no-select item {{if .Issue.Milestone}}tw-hidden{{end}}">{{ctx.Locale.Tr "repo.issues.new.no_milestone"}}</span>
   144  		<div class="selected">
   145  			{{if .Issue.Milestone}}
   146  				<a class="item muted sidebar-item-link" href="{{.RepoLink}}/milestone/{{.Issue.Milestone.ID}}">
   147  					{{svg "octicon-milestone" 18 "tw-mr-2"}}
   148  					{{.Issue.Milestone.Name}}
   149  				</a>
   150  			{{end}}
   151  		</div>
   152  	</div>
   153  
   154  	{{if .IsProjectsEnabled}}
   155  		<div class="divider"></div>
   156  
   157  		<div class="ui {{if or (not .HasIssuesOrPullsWritePermission) .Repository.IsArchived}}disabled{{end}} floating jump select-project dropdown">
   158  			<a class="text muted flex-text-block">
   159  				<strong>{{ctx.Locale.Tr "repo.issues.new.projects"}}</strong>
   160  				{{if and .HasIssuesOrPullsWritePermission (not .Repository.IsArchived)}}
   161  					{{svg "octicon-gear" 16 "tw-ml-1"}}
   162  				{{end}}
   163  			</a>
   164  			<div class="menu" data-action="update" data-issue-id="{{$.Issue.ID}}" data-update-url="{{$.RepoLink}}/issues/projects">
   165  				{{if or .OpenProjects .ClosedProjects}}
   166  				<div class="ui icon search input">
   167  					<i class="icon">{{svg "octicon-search" 16}}</i>
   168  					<input type="text" placeholder="{{ctx.Locale.Tr "repo.issues.filter_projects"}}">
   169  				</div>
   170  				{{end}}
   171  				<div class="no-select item">{{ctx.Locale.Tr "repo.issues.new.clear_projects"}}</div>
   172  				{{if .OpenProjects}}
   173  					<div class="divider"></div>
   174  					<div class="header">
   175  						{{ctx.Locale.Tr "repo.issues.new.open_projects"}}
   176  					</div>
   177  					{{range .OpenProjects}}
   178  						<a class="item muted sidebar-item-link" data-id="{{.ID}}" data-href="{{.Link ctx}}">
   179  							{{svg .IconName 18 "tw-mr-2"}}{{.Title}}
   180  						</a>
   181  					{{end}}
   182  				{{end}}
   183  				{{if .ClosedProjects}}
   184  					<div class="divider"></div>
   185  					<div class="header">
   186  						{{ctx.Locale.Tr "repo.issues.new.closed_projects"}}
   187  					</div>
   188  					{{range .ClosedProjects}}
   189  						<a class="item muted sidebar-item-link" data-id="{{.ID}}" data-href="{{.Link ctx}}">
   190  							{{svg .IconName 18 "tw-mr-2"}}{{.Title}}
   191  						</a>
   192  					{{end}}
   193  				{{end}}
   194  			</div>
   195  		</div>
   196  		<div class="ui select-project list">
   197  			<span class="no-select item {{if .Issue.Project}}tw-hidden{{end}}">{{ctx.Locale.Tr "repo.issues.new.no_projects"}}</span>
   198  			<div class="selected">
   199  				{{if .Issue.Project}}
   200  					<a class="item muted sidebar-item-link" href="{{.Issue.Project.Link ctx}}">
   201  						{{svg .Issue.Project.IconName 18 "tw-mr-2"}}{{.Issue.Project.Title}}
   202  					</a>
   203  				{{end}}
   204  			</div>
   205  		</div>
   206  	{{end}}
   207  
   208  	<div class="divider"></div>
   209  
   210  	<input id="assignee_id" name="assignee_id" type="hidden" value="{{.assignee_id}}">
   211  	<div class="ui {{if or (not .HasIssuesOrPullsWritePermission) .Repository.IsArchived}}disabled{{end}} floating jump select-assignees-modify dropdown">
   212  		<a class="text muted flex-text-block">
   213  			<strong>{{ctx.Locale.Tr "repo.issues.new.assignees"}}</strong>
   214  			{{if and .HasIssuesOrPullsWritePermission (not .Repository.IsArchived)}}
   215  				{{svg "octicon-gear" 16 "tw-ml-1"}}
   216  			{{end}}
   217  		</a>
   218  		<div class="filter menu" data-action="update" data-issue-id="{{$.Issue.ID}}" data-update-url="{{$.RepoLink}}/issues/assignee">
   219  			<div class="ui icon search input">
   220  				<i class="icon">{{svg "octicon-search" 16}}</i>
   221  				<input type="text" placeholder="{{ctx.Locale.Tr "repo.issues.filter_assignees"}}">
   222  			</div>
   223  			<div class="no-select item">{{ctx.Locale.Tr "repo.issues.new.clear_assignees"}}</div>
   224  			{{range .Assignees}}
   225  
   226  				{{$AssigneeID := .ID}}
   227  				<a class="item{{range $.Issue.Assignees}}{{if eq .ID $AssigneeID}} checked{{end}}{{end}}" href="#" data-id="{{.ID}}" data-id-selector="#assignee_{{.ID}}">
   228  					{{$checked := false}}
   229  					{{range $.Issue.Assignees}}
   230  						{{if eq .ID $AssigneeID}}
   231  							{{$checked = true}}
   232  						{{end}}
   233  					{{end}}
   234  					<span class="octicon-check {{if not $checked}}tw-invisible{{end}}">{{svg "octicon-check"}}</span>
   235  					<span class="text">
   236  						{{ctx.AvatarUtils.Avatar . 20 "tw-mr-2"}}{{template "repo/search_name" .}}
   237  					</span>
   238  				</a>
   239  			{{end}}
   240  		</div>
   241  	</div>
   242  	<div class="ui assignees list">
   243  		<span class="no-select item {{if .Issue.Assignees}}tw-hidden{{end}}">{{ctx.Locale.Tr "repo.issues.new.no_assignees"}}</span>
   244  		<div class="selected">
   245  			{{range .Issue.Assignees}}
   246  				<div class="item">
   247  					<a class="muted sidebar-item-link" href="{{$.RepoLink}}/{{if $.Issue.IsPull}}pulls{{else}}issues{{end}}?assignee={{.ID}}">
   248  						{{ctx.AvatarUtils.Avatar . 28 "tw-mr-2"}}
   249  						{{.GetDisplayName}}
   250  					</a>
   251  				</div>
   252  			{{end}}
   253  		</div>
   254  	</div>
   255  
   256  	<div class="divider"></div>
   257  
   258  	{{if .Participants}}
   259  		<span class="text"><strong>{{ctx.Locale.Tr "repo.issues.num_participants" .NumParticipants}}</strong></span>
   260  		<div class="ui list tw-flex tw-flex-wrap">
   261  			{{range .Participants}}
   262  				<a {{if gt .ID 0}}href="{{.HomeLink}}"{{end}} data-tooltip-content="{{.GetDisplayName}}">
   263  					{{ctx.AvatarUtils.Avatar . 28 "tw-my-0.5 tw-mr-1"}}
   264  				</a>
   265  			{{end}}
   266  		</div>
   267  	{{end}}
   268  
   269  	{{if and $.IssueWatch (not .Repository.IsArchived)}}
   270  		<div class="divider"></div>
   271  
   272  		<div class="ui watching">
   273  			<span class="text"><strong>{{ctx.Locale.Tr "notification.notifications"}}</strong></span>
   274  			<div class="tw-mt-2">
   275  				{{template "repo/issue/view_content/watching" .}}
   276  			</div>
   277  		</div>
   278  	{{end}}
   279  	{{if .Repository.IsTimetrackerEnabled $.Context}}
   280  		{{if and .CanUseTimetracker (not .Repository.IsArchived)}}
   281  			<div class="divider"></div>
   282  			<div class="ui timetrack">
   283  				<span class="text"><strong>{{ctx.Locale.Tr "repo.issues.tracker"}}</strong></span>
   284  				<div class="tw-mt-2">
   285  					<form method="post" action="{{.Issue.Link}}/times/stopwatch/toggle" id="toggle_stopwatch_form">
   286  						{{$.CsrfTokenHtml}}
   287  					</form>
   288  					<form method="post" action="{{.Issue.Link}}/times/stopwatch/cancel" id="cancel_stopwatch_form">
   289  						{{$.CsrfTokenHtml}}
   290  					</form>
   291  					{{if $.IsStopwatchRunning}}
   292  						<button class="ui fluid button issue-stop-time">
   293  							{{svg "octicon-stopwatch" 16 "tw-mr-2"}}
   294  							{{ctx.Locale.Tr "repo.issues.stop_tracking"}}
   295  						</button>
   296  						<button class="ui fluid button issue-cancel-time tw-mt-2">
   297  							{{svg "octicon-trash" 16 "tw-mr-2"}}
   298  							{{ctx.Locale.Tr "repo.issues.cancel_tracking"}}
   299  						</button>
   300  					{{else}}
   301  						{{if .HasUserStopwatch}}
   302  							<div class="ui warning message">
   303  								{{ctx.Locale.Tr "repo.issues.tracking_already_started" .OtherStopwatchURL}}
   304  							</div>
   305  						{{end}}
   306  						<button class="ui fluid button issue-start-time" data-tooltip-content='{{ctx.Locale.Tr "repo.issues.start_tracking"}}'>
   307  							{{svg "octicon-stopwatch" 16 "tw-mr-2"}}
   308  							{{ctx.Locale.Tr "repo.issues.start_tracking_short"}}
   309  						</button>
   310  						<div class="ui mini modal issue-start-time-modal">
   311  							<div class="header">{{ctx.Locale.Tr "repo.issues.add_time"}}</div>
   312  							<div class="content">
   313  								<form method="post" id="add_time_manual_form" action="{{.Issue.Link}}/times/add" class="ui input fluid tw-gap-2">
   314  									{{$.CsrfTokenHtml}}
   315  									<input placeholder='{{ctx.Locale.Tr "repo.issues.add_time_hours"}}' type="number" name="hours">
   316  									<input placeholder='{{ctx.Locale.Tr "repo.issues.add_time_minutes"}}' type="number" name="minutes" class="ui compact">
   317  								</form>
   318  							</div>
   319  							<div class="actions">
   320  								<button class="ui primary approve button">{{ctx.Locale.Tr "repo.issues.add_time_short"}}</button>
   321  								<button class="ui cancel button">{{ctx.Locale.Tr "repo.issues.add_time_cancel"}}</button>
   322  							</div>
   323  						</div>
   324  						<button class="ui fluid button issue-add-time tw-mt-2" data-tooltip-content='{{ctx.Locale.Tr "repo.issues.add_time"}}'>
   325  							{{svg "octicon-plus" 16 "tw-mr-2"}}
   326  							{{ctx.Locale.Tr "repo.issues.add_time_short"}}
   327  						</button>
   328  					{{end}}
   329  				</div>
   330  			</div>
   331  		{{end}}
   332  		{{if .WorkingUsers}}
   333  			<div class="divider"></div>
   334  			<div class="ui comments">
   335  				<span class="text"><strong>{{ctx.Locale.Tr "repo.issues.time_spent_from_all_authors" ($.Issue.TotalTrackedTime | Sec2Time)}}</strong></span>
   336  				<div>
   337  					{{range $user, $trackedtime := .WorkingUsers}}
   338  						<div class="comment tw-mt-2">
   339  							<a class="avatar">
   340  								{{ctx.AvatarUtils.Avatar $user}}
   341  							</a>
   342  							<div class="content">
   343  								{{template "shared/user/authorlink" $user}}
   344  								<div class="text">
   345  									{{$trackedtime|Sec2Time}}
   346  								</div>
   347  							</div>
   348  						</div>
   349  					{{end}}
   350  				</div>
   351  			</div>
   352  		{{end}}
   353  	{{end}}
   354  
   355  	<div class="divider"></div>
   356  	<span class="text"><strong>{{ctx.Locale.Tr "repo.issues.due_date"}}</strong></span>
   357  	<div class="ui form" id="deadline-loader">
   358  		<div class="ui negative message tw-hidden" id="deadline-err-invalid-date">
   359  			{{svg "octicon-x" 16 "close icon"}}
   360  			{{ctx.Locale.Tr "repo.issues.due_date_invalid"}}
   361  		</div>
   362  		{{if ne .Issue.DeadlineUnix 0}}
   363  			<p>
   364  				<div class="tw-flex tw-justify-between tw-items-center">
   365  					<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}}>
   366  						{{svg "octicon-calendar" 16 "tw-mr-2"}}
   367  						{{DateTime "long" .Issue.DeadlineUnix.FormatDate}}
   368  					</div>
   369  					<div>
   370  						{{if and .HasIssuesOrPullsWritePermission (not .Repository.IsArchived)}}
   371  							<a class="issue-due-edit muted" data-tooltip-content="{{ctx.Locale.Tr "repo.issues.due_date_form_edit"}}">{{svg "octicon-pencil" 16 "tw-mr-1"}}</a>
   372  							<a class="issue-due-remove muted" data-tooltip-content="{{ctx.Locale.Tr "repo.issues.due_date_form_remove"}}">{{svg "octicon-trash"}}</a>
   373  						{{end}}
   374  					</div>
   375  				</div>
   376  			</p>
   377  		{{else}}
   378  			<p>{{ctx.Locale.Tr "repo.issues.due_date_not_set"}}</p>
   379  		{{end}}
   380  
   381  		{{if and .HasIssuesOrPullsWritePermission (not .Repository.IsArchived)}}
   382  			<div {{if ne .Issue.DeadlineUnix 0}} class="tw-hidden"{{end}} id="deadlineForm">
   383  				<form class="ui fluid action input issue-due-form" action="{{AppSubUrl}}/{{PathEscape .Repository.Owner.Name}}/{{PathEscape .Repository.Name}}/issues/{{.Issue.Index}}/deadline" method="post" id="update-issue-deadline-form">
   384  					{{$.CsrfTokenHtml}}
   385  					<input required placeholder="{{ctx.Locale.Tr "repo.issues.due_date_form"}}" {{if gt .Issue.DeadlineUnix 0}}value="{{.Issue.DeadlineUnix.FormatDate}}"{{end}} type="date" name="deadlineDate" id="deadlineDate">
   386  					<button class="ui icon button">
   387  						{{if ne .Issue.DeadlineUnix 0}}
   388  							{{svg "octicon-pencil"}}
   389  						{{else}}
   390  							{{svg "octicon-plus"}}
   391  						{{end}}
   392  					</button>
   393  				</form>
   394  			</div>
   395  		{{end}}
   396  	</div>
   397  
   398  	{{if .Repository.IsDependenciesEnabled $.Context}}
   399  		<div class="divider"></div>
   400  
   401  		<div class="ui depending">
   402  			{{if (and (not .BlockedByDependencies) (not .BlockedByDependenciesNotPermitted) (not .BlockingDependencies) (not .BlockingDependenciesNotPermitted))}}
   403  				<span class="text"><strong>{{ctx.Locale.Tr "repo.issues.dependency.title"}}</strong></span>
   404  				<br>
   405  				<p>
   406  					{{if .Issue.IsPull}}
   407  						{{ctx.Locale.Tr "repo.issues.dependency.pr_no_dependencies"}}
   408  					{{else}}
   409  						{{ctx.Locale.Tr "repo.issues.dependency.issue_no_dependencies"}}
   410  					{{end}}
   411  				</p>
   412  			{{end}}
   413  
   414  			{{if or .BlockingDependencies .BlockingDependenciesNotPermitted}}
   415  				<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}}">
   416  					<strong>{{ctx.Locale.Tr "repo.issues.dependency.blocks_short"}}</strong>
   417  				</span>
   418  				<div class="ui relaxed divided list">
   419  					{{range .BlockingDependencies}}
   420  						<div class="item dependency{{if .Issue.IsClosed}} is-closed{{end}} tw-flex tw-items-center tw-justify-between">
   421  							<div class="item-left tw-flex tw-justify-center tw-flex-col tw-flex-1 gt-ellipsis">
   422  								<a class="title muted" href="{{.Issue.Link}}" data-tooltip-content="#{{.Issue.Index}} {{.Issue.Title | RenderEmoji $.Context}}">
   423  									#{{.Issue.Index}} {{.Issue.Title | RenderEmoji $.Context}}
   424  								</a>
   425  								<div class="text small gt-ellipsis" data-tooltip-content="{{.Repository.OwnerName}}/{{.Repository.Name}}">
   426  									{{.Repository.OwnerName}}/{{.Repository.Name}}
   427  								</div>
   428  							</div>
   429  							<div class="item-right tw-flex tw-items-center tw-m-1">
   430  								{{if and $.CanCreateIssueDependencies (not $.Repository.IsArchived)}}
   431  									<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"}}">
   432  										{{svg "octicon-trash" 16}}
   433  									</a>
   434  								{{end}}
   435  							</div>
   436  						</div>
   437  					{{end}}
   438  					{{if .BlockingDependenciesNotPermitted}}
   439  						<div class="item tw-flex tw-items-center tw-justify-between gt-ellipsis">
   440  							<span>{{ctx.Locale.TrN (len .BlockingDependenciesNotPermitted) "repo.issues.dependency.no_permission_1" "repo.issues.dependency.no_permission_n" (len .BlockingDependenciesNotPermitted)}}</span>
   441  						</div>
   442  					{{end}}
   443  				</div>
   444  			{{end}}
   445  
   446  			{{if or .BlockedByDependencies .BlockedByDependenciesNotPermitted}}
   447  				<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}}">
   448  					<strong>{{ctx.Locale.Tr "repo.issues.dependency.blocked_by_short"}}</strong>
   449  				</span>
   450  				<div class="ui relaxed divided list">
   451  					{{range .BlockedByDependencies}}
   452  						<div class="item dependency{{if .Issue.IsClosed}} is-closed{{end}} tw-flex tw-items-center tw-justify-between">
   453  							<div class="item-left tw-flex tw-justify-center tw-flex-col tw-flex-1 gt-ellipsis">
   454  								<a class="title muted" href="{{.Issue.Link}}" data-tooltip-content="#{{.Issue.Index}} {{.Issue.Title | RenderEmoji $.Context}}">
   455  									#{{.Issue.Index}} {{.Issue.Title | RenderEmoji $.Context}}
   456  								</a>
   457  								<div class="text small gt-ellipsis" data-tooltip-content="{{.Repository.OwnerName}}/{{.Repository.Name}}">
   458  									{{.Repository.OwnerName}}/{{.Repository.Name}}
   459  								</div>
   460  							</div>
   461  							<div class="item-right tw-flex tw-items-center tw-m-1">
   462  								{{if and $.CanCreateIssueDependencies (not $.Repository.IsArchived)}}
   463  									<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"}}">
   464  										{{svg "octicon-trash" 16}}
   465  									</a>
   466  								{{end}}
   467  							</div>
   468  						</div>
   469  					{{end}}
   470  					{{if $.CanCreateIssueDependencies}}
   471  						{{range .BlockedByDependenciesNotPermitted}}
   472  							<div class="item dependency{{if .Issue.IsClosed}} is-closed{{end}} tw-flex tw-items-center tw-justify-between">
   473  								<div class="item-left tw-flex tw-justify-center tw-flex-col tw-flex-1 gt-ellipsis">
   474  									<div class="gt-ellipsis">
   475  										<span data-tooltip-content="{{ctx.Locale.Tr "repo.issues.dependency.no_permission.can_remove"}}">{{svg "octicon-lock" 16}}</span>
   476  										<span class="title" data-tooltip-content="#{{.Issue.Index}} {{.Issue.Title | RenderEmoji $.Context}}">
   477  											#{{.Issue.Index}} {{.Issue.Title | RenderEmoji $.Context}}
   478  										</span>
   479  									</div>
   480  									<div class="text small gt-ellipsis" data-tooltip-content="{{.Repository.OwnerName}}/{{.Repository.Name}}">
   481  										{{.Repository.OwnerName}}/{{.Repository.Name}}
   482  									</div>
   483  								</div>
   484  								<div class="item-right tw-flex tw-items-center tw-m-1">
   485  									{{if and $.CanCreateIssueDependencies (not $.Repository.IsArchived)}}
   486  										<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"}}">
   487  											{{svg "octicon-trash" 16}}
   488  										</a>
   489  									{{end}}
   490  								</div>
   491  							</div>
   492  						{{end}}
   493  					{{else if .BlockedByDependenciesNotPermitted}}
   494  						<div class="item tw-flex tw-items-center tw-justify-between gt-ellipsis">
   495  							<span>{{ctx.Locale.TrN (len .BlockedByDependenciesNotPermitted) "repo.issues.dependency.no_permission_1" "repo.issues.dependency.no_permission_n" (len .BlockedByDependenciesNotPermitted)}}</span>
   496  						</div>
   497  					{{end}}
   498  				</div>
   499  			{{end}}
   500  
   501  			{{if and .CanCreateIssueDependencies (not .Repository.IsArchived)}}
   502  				<div>
   503  					<form method="post" action="{{.Issue.Link}}/dependency/add" id="addDependencyForm">
   504  						{{$.CsrfTokenHtml}}
   505  						<div class="ui fluid action input">
   506  							<div class="ui search selection dropdown" id="new-dependency-drop-list" data-issue-id="{{.Issue.ID}}">
   507  								<input name="newDependency" type="hidden">
   508  								{{svg "octicon-triangle-down" 14 "dropdown icon"}}
   509  								<input type="text" class="search">
   510  								<div class="default text">{{ctx.Locale.Tr "repo.issues.dependency.add"}}</div>
   511  							</div>
   512  							<button class="ui icon button">
   513  								{{svg "octicon-plus"}}
   514  							</button>
   515  						</div>
   516  					</form>
   517  				</div>
   518  			{{end}}
   519  		</div>
   520  
   521  		{{if and .CanCreateIssueDependencies (not .Repository.IsArchived)}}
   522  			<input type="hidden" id="crossRepoSearch" value="{{.AllowCrossRepositoryDependencies}}">
   523  
   524  			<div class="ui g-modal-confirm modal remove-dependency">
   525  				<div class="header">
   526  					{{svg "octicon-trash"}}
   527  					{{ctx.Locale.Tr "repo.issues.dependency.remove_header"}}
   528  				</div>
   529  				<div class="content">
   530  					<form method="post" action="{{.Issue.Link}}/dependency/delete" id="removeDependencyForm">
   531  						{{$.CsrfTokenHtml}}
   532  						<input type="hidden" value="" name="removeDependencyID" id="removeDependencyID">
   533  						<input type="hidden" value="" name="dependencyType" id="dependencyType">
   534  					</form>
   535  					<p>{{if .Issue.IsPull}}
   536  						{{ctx.Locale.Tr "repo.issues.dependency.pr_remove_text"}}
   537  					{{else}}
   538  						{{ctx.Locale.Tr "repo.issues.dependency.issue_remove_text"}}
   539  					{{end}}</p>
   540  				</div>
   541  				{{$ModalButtonCancelText := ctx.Locale.Tr "repo.issues.dependency.cancel"}}
   542  				{{$ModalButtonOkText := ctx.Locale.Tr "repo.issues.dependency.remove"}}
   543  				{{template "base/modal_actions_confirm" (dict "." . "ModalButtonCancelText" $ModalButtonCancelText "ModalButtonOkText" $ModalButtonOkText)}}
   544  			</div>
   545  		{{end}}
   546  	{{end}}
   547  
   548  	<div class="divider"></div>
   549  	<div class="ui equal width compact grid">
   550  		{{$issueReferenceLink := printf "%s#%d" .Issue.Repo.FullName .Issue.Index}}
   551  		<div class="row tw-items-center" data-tooltip-content="{{$issueReferenceLink}}">
   552  			<span class="text column truncate">{{ctx.Locale.Tr "repo.issues.reference_link" $issueReferenceLink}}</span>
   553  			<button class="ui two wide button column tw-p-2" data-clipboard-text="{{$issueReferenceLink}}">{{svg "octicon-copy" 14}}</button>
   554  		</div>
   555  	</div>
   556  
   557  	{{if and .IsRepoAdmin (not .Repository.IsArchived)}}
   558  		<div class="divider"></div>
   559  
   560  		{{if or .PinEnabled .Issue.IsPinned}}
   561  			<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}}>
   562  				{{$.CsrfTokenHtml}}
   563  				<button class="fluid ui button {{if not $.NewPinAllowed}}disabled{{end}}">
   564  					{{if not .Issue.IsPinned}}
   565  						{{svg "octicon-pin" 16 "tw-mr-2"}}
   566  						{{ctx.Locale.Tr "pin"}}
   567  					{{else}}
   568  						{{svg "octicon-pin-slash" 16 "tw-mr-2"}}
   569  						{{ctx.Locale.Tr "unpin"}}
   570  					{{end}}
   571  				</button>
   572  			</form>
   573  		{{end}}
   574  
   575  		<button class="tw-mt-1 fluid ui show-modal button{{if .Issue.IsLocked}} red{{end}}" data-modal="#lock">
   576  			{{if .Issue.IsLocked}}
   577  				{{svg "octicon-key"}}
   578  				{{ctx.Locale.Tr "repo.issues.unlock"}}
   579  			{{else}}
   580  				{{svg "octicon-lock"}}
   581  				{{ctx.Locale.Tr "repo.issues.lock"}}
   582  			{{end}}
   583  		</button>
   584  		<div class="ui tiny modal" id="lock">
   585  			<div class="header">
   586  				{{if .Issue.IsLocked}}
   587  					{{ctx.Locale.Tr "repo.issues.unlock.title"}}
   588  				{{else}}
   589  					{{ctx.Locale.Tr "repo.issues.lock.title"}}
   590  				{{end}}
   591  			</div>
   592  			<div class="content">
   593  				<div class="ui warning message">
   594  					{{if .Issue.IsLocked}}
   595  						{{ctx.Locale.Tr "repo.issues.unlock.notice_1"}}<br>
   596  						{{ctx.Locale.Tr "repo.issues.unlock.notice_2"}}<br>
   597  					{{else}}
   598  						{{ctx.Locale.Tr "repo.issues.lock.notice_1"}}<br>
   599  						{{ctx.Locale.Tr "repo.issues.lock.notice_2"}}<br>
   600  						{{ctx.Locale.Tr "repo.issues.lock.notice_3"}}<br>
   601  					{{end}}
   602  				</div>
   603  
   604  				<form class="ui form form-fetch-action" action="{{.Issue.Link}}{{if .Issue.IsLocked}}/unlock{{else}}/lock{{end}}"
   605  					method="post">
   606  					{{.CsrfTokenHtml}}
   607  
   608  					{{if not .Issue.IsLocked}}
   609  						<div class="field">
   610  							<strong> {{ctx.Locale.Tr "repo.issues.lock.reason"}} </strong>
   611  						</div>
   612  
   613  						<div class="field">
   614  							<div class="ui fluid dropdown selection">
   615  
   616  								<select name="reason">
   617  									<option value=""> </option>
   618  									{{range .LockReasons}}
   619  										<option value="{{.}}">{{.}}</option>
   620  									{{end}}
   621  								</select>
   622  								{{svg "octicon-triangle-down" 14 "dropdown icon"}}
   623  
   624  								<div class="default text"> </div>
   625  
   626  								<div class="menu">
   627  									{{range .LockReasons}}
   628  										<div class="item" data-value="{{.}}">{{.}}</div>
   629  									{{end}}
   630  								</div>
   631  							</div>
   632  						</div>
   633  					{{end}}
   634  
   635  					<div class="text right actions">
   636  						<button class="ui cancel button">{{ctx.Locale.Tr "settings.cancel"}}</button>
   637  						<button class="ui red button">
   638  							{{if .Issue.IsLocked}}
   639  								{{ctx.Locale.Tr "repo.issues.unlock_confirm"}}
   640  							{{else}}
   641  								{{ctx.Locale.Tr "repo.issues.lock_confirm"}}
   642  							{{end}}
   643  						</button>
   644  					</div>
   645  				</form>
   646  			</div>
   647  		</div>
   648  		<button class="tw-mt-1 fluid ui show-modal button" data-modal="#sidebar-delete-issue">
   649  			{{svg "octicon-trash"}}
   650  			{{ctx.Locale.Tr "repo.issues.delete"}}
   651  		</button>
   652  		<div class="ui g-modal-confirm modal" id="sidebar-delete-issue">
   653  			<div class="header">
   654  				{{if .Issue.IsPull}}
   655  					{{ctx.Locale.Tr "repo.pulls.delete.title"}}
   656  				{{else}}
   657  					{{ctx.Locale.Tr "repo.issues.delete.title"}}
   658  				{{end}}
   659  			</div>
   660  			<div class="content">
   661  				<p>
   662  					{{if .Issue.IsPull}}
   663  						{{ctx.Locale.Tr "repo.pulls.delete.text"}}
   664  					{{else}}
   665  						{{ctx.Locale.Tr "repo.issues.delete.text"}}
   666  					{{end}}
   667  				</p>
   668  			</div>
   669  			<form action="{{.Issue.Link}}/delete" method="post">
   670  				{{.CsrfTokenHtml}}
   671  				{{template "base/modal_actions_confirm" .}}
   672  			</form>
   673  		</div>
   674  	{{end}}
   675  
   676  	{{if and .Issue.IsPull .IsIssuePoster (not .Issue.IsClosed) .Issue.PullRequest.HeadRepo}}
   677  		{{if and (not (eq .Issue.PullRequest.HeadRepo.FullName .Issue.PullRequest.BaseRepo.FullName)) .CanWriteToHeadRepo}}
   678  			<div class="divider"></div>
   679  			<div class="inline field">
   680  				<div class="ui checkbox loading-icon-2px" id="allow-edits-from-maintainers"
   681  						data-url="{{.Issue.Link}}"
   682  						data-tooltip-content="{{ctx.Locale.Tr "repo.pulls.allow_edits_from_maintainers_desc"}}"
   683  						data-prompt-error="{{ctx.Locale.Tr "repo.pulls.allow_edits_from_maintainers_err"}}"
   684  					>
   685  					<label><strong>{{ctx.Locale.Tr "repo.pulls.allow_edits_from_maintainers"}}</strong></label>
   686  					<input type="checkbox" {{if .Issue.PullRequest.AllowMaintainerEdit}}checked{{end}}>
   687  				</div>
   688  			</div>
   689  		{{end}}
   690  	{{end}}
   691  </div>