初始提交: Gitea 项目代码
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
{{- $isHeadForkedRepo := and .Issue.PullRequest .Issue.PullRequest.HeadRepo (ne .Issue.PullRequest.HeadRepo.FullName .Issue.PullRequest.BaseRepo.FullName) -}}
|
||||
{{if $isHeadForkedRepo}}
|
||||
{{- $isPullPoster := and .Issue.IsPull .IsIssuePoster -}}
|
||||
{{- $isPullEditable := and .Issue.PullRequest (not .Issue.IsClosed) (not .Repository.IsArchived) -}}
|
||||
{{- $allowToChange := and $isPullPoster $isPullEditable -}}
|
||||
<div class="divider"></div>
|
||||
<div class="ui checkbox {{if not $allowToChange}}disabled{{end}} loading-icon-2px"
|
||||
{{if $allowToChange}}
|
||||
id="allow-edits-from-maintainers"
|
||||
data-url="{{.Issue.Link}}"
|
||||
data-tooltip-content="{{ctx.Locale.Tr "repo.pulls.allow_edits_from_maintainers_desc"}}"
|
||||
data-prompt-error="{{ctx.Locale.Tr "repo.pulls.allow_edits_from_maintainers_err"}}"
|
||||
{{end}}
|
||||
>
|
||||
<label><strong>{{ctx.Locale.Tr "repo.pulls.allow_edits_from_maintainers"}}</strong></label>
|
||||
<input type="checkbox" {{if .Issue.PullRequest.AllowMaintainerEdit}}checked{{end}} {{if not $allowToChange}}disabled{{end}}>
|
||||
</div>
|
||||
{{end}}
|
||||
@@ -0,0 +1,40 @@
|
||||
{{$pageMeta := .}}
|
||||
{{$data := .AssigneesData}}
|
||||
{{$listBaseLink := print $pageMeta.RepoLink (Iif $pageMeta.IsPullRequest "/pulls" "/issues")}}
|
||||
{{/* TODO: it seems that the code keeps checking $pageMeta.Issue and assumes that it might not exist, need to figure out why */}}
|
||||
{{$issueAssignees := NIL}}{{if $pageMeta.Issue}}{{$issueAssignees = $pageMeta.Issue.Assignees}}{{end}}
|
||||
<div class="divider"></div>
|
||||
<div class="issue-sidebar-combo" data-selection-mode="multiple" data-update-algo="diff"
|
||||
{{if $pageMeta.Issue}}data-update-url="{{$pageMeta.RepoLink}}/issues/assignee?issue_ids={{$pageMeta.Issue.ID}}"{{end}}
|
||||
>
|
||||
<input class="combo-value" name="assignee_ids" type="hidden" value="{{$data.SelectedAssigneeIDs}}">
|
||||
<div class="ui dropdown full-width {{if not $pageMeta.CanModifyIssueOrPull}}disabled{{end}}">
|
||||
<a class="fixed-text muted">
|
||||
<strong>{{ctx.Locale.Tr "repo.issues.new.assignees"}}</strong> {{if $pageMeta.CanModifyIssueOrPull}}{{svg "octicon-gear"}}{{end}}
|
||||
</a>
|
||||
<div class="menu">
|
||||
<div class="ui icon search input">
|
||||
<i class="icon">{{svg "octicon-search" 16}}</i>
|
||||
<input type="text" placeholder="{{ctx.Locale.Tr "repo.issues.filter_assignees"}}">
|
||||
</div>
|
||||
<div class="scrolling menu flex-items-block">
|
||||
<div class="item clear-selection" data-text="">{{ctx.Locale.Tr "repo.issues.new.clear_assignees"}}</div>
|
||||
<div class="divider"></div>
|
||||
{{range $data.CandidateAssignees}}
|
||||
<a class="item" href="{{$listBaseLink}}?assignee={{.ID}}" data-value="{{.ID}}">
|
||||
<span class="item-check-mark">{{svg "octicon-check"}}</span>
|
||||
{{ctx.AvatarUtils.Avatar . 20}} {{template "repo/search_name" .}}
|
||||
</a>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ui relaxed list muted-links flex-items-block">
|
||||
<span class="item empty-list {{if $issueAssignees}}tw-hidden{{end}}">{{ctx.Locale.Tr "repo.issues.new.no_assignees"}}</span>
|
||||
{{range $issueAssignees}}
|
||||
<a class="item" href="{{$listBaseLink}}?assignee={{.ID}}">
|
||||
{{ctx.AvatarUtils.Avatar . 20}} {{.GetDisplayName}}
|
||||
</a>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,28 @@
|
||||
<div class="divider"></div>
|
||||
<span class="text"><strong>{{ctx.Locale.Tr "repo.issues.due_date"}}</strong></span>
|
||||
<div class="ui form tw-mt-2">
|
||||
{{if .Issue.DeadlineUnix}}
|
||||
<div class="flex-left-right">
|
||||
<div class="due-date {{if .Issue.IsOverdue}}tw-text-red{{end}}" {{if .Issue.IsOverdue}}data-tooltip-content="{{ctx.Locale.Tr "repo.issues.due_date_overdue"}}"{{end}}>
|
||||
{{svg "octicon-calendar"}} {{DateUtils.AbsoluteLong .Issue.DeadlineUnix}}
|
||||
</div>
|
||||
<div class="flex-text-block">
|
||||
{{if and .HasIssuesOrPullsWritePermission (not .Repository.IsArchived)}}
|
||||
<a class="issue-due-edit muted" data-tooltip-content="{{ctx.Locale.Tr "repo.issues.due_date_form_edit"}}">{{svg "octicon-pencil"}}</a>
|
||||
<a class="issue-due-remove muted" data-tooltip-content="{{ctx.Locale.Tr "repo.issues.due_date_form_remove"}}">{{svg "octicon-trash"}}</a>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
{{else}}
|
||||
{{ctx.Locale.Tr "repo.issues.due_date_not_set"}}
|
||||
{{end}}
|
||||
|
||||
{{if and .HasIssuesOrPullsWritePermission (not .Repository.IsArchived)}}
|
||||
<form class="ui fluid action input issue-due-form form-fetch-action tw-mt-2 {{if .Issue.DeadlineUnix}}tw-hidden{{end}}"
|
||||
method="post" action="{{AppSubUrl}}/{{PathEscape .Repository.Owner.Name}}/{{PathEscape .Repository.Name}}/issues/{{.Issue.Index}}/deadline"
|
||||
>
|
||||
<input required type="date" name="deadline" placeholder="{{ctx.Locale.Tr "repo.issues.due_date_form"}}" {{if .Issue.DeadlineUnix}}value="{{.Issue.DeadlineUnix.FormatDate}}"{{end}}>
|
||||
<button class="ui icon button">{{Iif .Issue.DeadlineUnix (svg "octicon-pencil") (svg "octicon-plus")}}</button>
|
||||
</form>
|
||||
{{end}}
|
||||
</div>
|
||||
@@ -0,0 +1,144 @@
|
||||
{{if .Repository.IsDependenciesEnabled ctx}}
|
||||
<div class="divider"></div>
|
||||
|
||||
<div class="ui depending">
|
||||
{{if (and (not .BlockedByDependencies) (not .BlockedByDependenciesNotPermitted) (not .BlockingDependencies) (not .BlockingDependenciesNotPermitted))}}
|
||||
<span class="text"><strong>{{ctx.Locale.Tr "repo.issues.dependency.title"}}</strong></span>
|
||||
<br>
|
||||
<p>
|
||||
{{if .Issue.IsPull}}
|
||||
{{ctx.Locale.Tr "repo.issues.dependency.pr_no_dependencies"}}
|
||||
{{else}}
|
||||
{{ctx.Locale.Tr "repo.issues.dependency.issue_no_dependencies"}}
|
||||
{{end}}
|
||||
</p>
|
||||
{{end}}
|
||||
|
||||
{{if or .BlockingDependencies .BlockingDependenciesNotPermitted}}
|
||||
<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}}">
|
||||
<strong>{{ctx.Locale.Tr "repo.issues.dependency.blocks_short"}}</strong>
|
||||
</span>
|
||||
<div class="ui divided list">
|
||||
{{range .BlockingDependencies}}
|
||||
<div class="item dependency{{if .Issue.IsClosed}} is-closed{{end}} flex-left-right">
|
||||
<div class="item-left tw-flex tw-justify-center tw-flex-col tw-flex-1 gt-ellipsis">
|
||||
<a class="muted issue-dependency-title gt-ellipsis" href="{{.Issue.Link}}" data-tooltip-content="#{{.Issue.Index}} {{.Issue.Title | ctx.RenderUtils.RenderEmoji}}">
|
||||
#{{.Issue.Index}} {{.Issue.Title | ctx.RenderUtils.RenderEmoji}}
|
||||
</a>
|
||||
<div class="tw-text-xs gt-ellipsis" data-tooltip-content="{{.Repository.OwnerName}}/{{.Repository.Name}}">
|
||||
{{.Repository.OwnerName}}/{{.Repository.Name}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="item-right tw-flex tw-items-center tw-m-1">
|
||||
{{if and $.CanCreateIssueDependencies (not $.Repository.IsArchived)}}
|
||||
<a class="muted show-modal" data-modal="#issue-remove-dependency-confirm"
|
||||
data-modal-remove-dependency-id="{{.Issue.ID}}" data-modal-dependency-type="blocking"
|
||||
data-tooltip-content="{{ctx.Locale.Tr "repo.issues.dependency.remove_info"}}">
|
||||
{{svg "octicon-trash" 16}}
|
||||
</a>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
{{if .BlockingDependenciesNotPermitted}}
|
||||
<div class="item gt-ellipsis">
|
||||
<span>{{ctx.Locale.TrN (len .BlockingDependenciesNotPermitted) "repo.issues.dependency.no_permission_1" "repo.issues.dependency.no_permission_n" (len .BlockingDependenciesNotPermitted)}}</span>
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
{{if or .BlockedByDependencies .BlockedByDependenciesNotPermitted}}
|
||||
<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}}">
|
||||
<strong>{{ctx.Locale.Tr "repo.issues.dependency.blocked_by_short"}}</strong>
|
||||
</span>
|
||||
<div class="ui divided list">
|
||||
{{range .BlockedByDependencies}}
|
||||
<div class="item dependency{{if .Issue.IsClosed}} is-closed{{end}} flex-left-right">
|
||||
<div class="item-left tw-flex tw-justify-center tw-flex-col tw-flex-1 gt-ellipsis">
|
||||
<a class="muted issue-dependency-title gt-ellipsis" href="{{.Issue.Link}}" data-tooltip-content="#{{.Issue.Index}} {{.Issue.Title | ctx.RenderUtils.RenderEmoji}}">
|
||||
#{{.Issue.Index}} {{.Issue.Title | ctx.RenderUtils.RenderEmoji}}
|
||||
</a>
|
||||
<div class="tw-text-xs gt-ellipsis" data-tooltip-content="{{.Repository.OwnerName}}/{{.Repository.Name}}">
|
||||
{{.Repository.OwnerName}}/{{.Repository.Name}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="item-right tw-flex tw-items-center tw-m-1">
|
||||
{{if and $.CanCreateIssueDependencies (not $.Repository.IsArchived)}}
|
||||
<a class="muted show-modal" data-modal="#issue-remove-dependency-confirm"
|
||||
data-modal-remove-dependency-id="{{.Issue.ID}}" data-modal-dependency-type="blockedBy"
|
||||
data-tooltip-content="{{ctx.Locale.Tr "repo.issues.dependency.remove_info"}}">
|
||||
{{svg "octicon-trash" 16}}
|
||||
</a>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
{{if $.CanCreateIssueDependencies}}
|
||||
{{range .BlockedByDependenciesNotPermitted}}
|
||||
<div class="item dependency{{if .Issue.IsClosed}} is-closed{{end}} flex-left-right">
|
||||
<div class="item-left tw-flex tw-justify-center tw-flex-col tw-flex-1 gt-ellipsis">
|
||||
<div class="gt-ellipsis">
|
||||
<span data-tooltip-content="{{ctx.Locale.Tr "repo.issues.dependency.no_permission.can_remove"}}">{{svg "octicon-lock" 16}}</span>
|
||||
<span class="gt-ellipsis issue-dependency-title" data-tooltip-content="#{{.Issue.Index}} {{.Issue.Title | ctx.RenderUtils.RenderEmoji}}">
|
||||
#{{.Issue.Index}} {{.Issue.Title | ctx.RenderUtils.RenderEmoji}}
|
||||
</span>
|
||||
</div>
|
||||
<div class="tw-text-xs gt-ellipsis" data-tooltip-content="{{.Repository.OwnerName}}/{{.Repository.Name}}">
|
||||
{{.Repository.OwnerName}}/{{.Repository.Name}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="item-right tw-flex tw-items-center tw-m-1">
|
||||
{{if and $.CanCreateIssueDependencies (not $.Repository.IsArchived)}}
|
||||
<a class="muted show-modal" data-modal="#issue-remove-dependency-confirm"
|
||||
data-modal-remove-dependency-id="{{.Issue.ID}}" data-modal-dependency-type="blocking"
|
||||
data-tooltip-content="{{ctx.Locale.Tr "repo.issues.dependency.remove_info"}}">
|
||||
{{svg "octicon-trash" 16}}
|
||||
</a>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
{{else if .BlockedByDependenciesNotPermitted}}
|
||||
<div class="item gt-ellipsis">
|
||||
<span>{{ctx.Locale.TrN (len .BlockedByDependenciesNotPermitted) "repo.issues.dependency.no_permission_1" "repo.issues.dependency.no_permission_n" (len .BlockedByDependenciesNotPermitted)}}</span>
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
{{if and .CanCreateIssueDependencies (not .Repository.IsArchived)}}
|
||||
<div>
|
||||
<form method="post" action="{{.Issue.Link}}/dependency/add" id="addDependencyForm">
|
||||
<div class="ui fluid action input">
|
||||
<div class="ui search selection dropdown" id="new-dependency-drop-list" data-issue-id="{{.Issue.ID}}" data-issue-cross-repo-search="{{.AllowCrossRepositoryDependencies}}">
|
||||
<input name="newDependency" type="hidden">
|
||||
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
||||
<input type="text" class="search">
|
||||
<div class="default text">{{ctx.Locale.Tr "repo.issues.dependency.add"}}</div>
|
||||
</div>
|
||||
<button class="ui icon button">
|
||||
{{svg "octicon-plus"}}
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
|
||||
{{if and .CanCreateIssueDependencies (not .Repository.IsArchived)}}
|
||||
<form id="issue-remove-dependency-confirm" class="ui g-modal-confirm modal" method="post" action="{{.Issue.Link}}/dependency/delete">
|
||||
<div class="header">{{svg "octicon-trash"}} {{ctx.Locale.Tr "repo.issues.dependency.remove_header"}}</div>
|
||||
<div class="content">
|
||||
<input type="hidden" value="" name="removeDependencyID" class="remove-dependency-id">
|
||||
<input type="hidden" value="" name="dependencyType" class="dependency-type">
|
||||
<p>
|
||||
{{ctx.Locale.Tr (Iif .Issue.IsPull "repo.issues.dependency.pr_remove_text" "repo.issues.dependency.issue_remove_text")}}
|
||||
</p>
|
||||
{{$ModalButtonCancelText := ctx.Locale.Tr "repo.issues.dependency.cancel"}}
|
||||
{{$ModalButtonOkText := ctx.Locale.Tr "repo.issues.dependency.remove"}}
|
||||
{{template "base/modal_actions_confirm" (dict "." . "ModalButtonCancelText" $ModalButtonCancelText "ModalButtonOkText" $ModalButtonOkText)}}
|
||||
</div>
|
||||
</form>
|
||||
{{end}}
|
||||
{{end}}
|
||||
@@ -0,0 +1,107 @@
|
||||
{{if and .IsRepoAdmin (not .Repository.IsArchived)}}
|
||||
<div class="divider"></div>
|
||||
|
||||
{{/* Pin issue */}}
|
||||
{{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}}>
|
||||
<button class="fluid ui button {{if not $.NewPinAllowed}}disabled{{end}}">
|
||||
{{if not .Issue.IsPinned}}
|
||||
{{svg "octicon-pin"}}
|
||||
{{ctx.Locale.Tr "pin"}}
|
||||
{{else}}
|
||||
{{svg "octicon-pin-slash"}}
|
||||
{{ctx.Locale.Tr "unpin"}}
|
||||
{{end}}
|
||||
</button>
|
||||
</form>
|
||||
{{end}}
|
||||
|
||||
{{/* Lock/unlock conversation */}}
|
||||
<button class="tw-mt-1 fluid ui show-modal button{{if .Issue.IsLocked}} red{{end}}" data-modal="#lock-conversation">
|
||||
{{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-conversation">
|
||||
<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" method="post" action="{{.Issue.Link}}{{if .Issue.IsLocked}}/unlock{{else}}/lock{{end}}">
|
||||
|
||||
{{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">
|
||||
<input type="hidden" name="reason">
|
||||
<div class="text"></div> {{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
||||
<div class="menu">
|
||||
<div class="item" data-value=""></div>
|
||||
{{range .LockReasons}}
|
||||
<div class="item" data-value="{{.}}">{{.}}</div>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
<div class="actions">
|
||||
<button class="ui cancel button">{{ctx.Locale.Tr "settings.cancel"}}</button>
|
||||
{{/* explicitly focus the submit button, to avoid Fomantic modal focuses and popups the dropdown */}}
|
||||
<button class="ui red button" autofocus>
|
||||
{{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">
|
||||
{{template "base/modal_actions_confirm" .}}
|
||||
</form>
|
||||
</div>
|
||||
{{end}}
|
||||
@@ -0,0 +1,57 @@
|
||||
{{$pageMeta := .}}
|
||||
{{$data := .LabelsData}}
|
||||
{{$listBaseLink := print $pageMeta.RepoLink (Iif $pageMeta.IsPullRequest "/pulls" "/issues")}}
|
||||
<div class="issue-sidebar-combo" data-selection-mode="multiple" data-update-algo="diff"
|
||||
{{if $pageMeta.Issue}}data-update-url="{{$pageMeta.RepoLink}}/issues/labels?issue_ids={{$pageMeta.Issue.ID}}"{{end}}
|
||||
>
|
||||
<input class="combo-value" name="label_ids" type="hidden" value="{{$data.SelectedLabelIDs}}">
|
||||
<div class="ui dropdown full-width {{if not $pageMeta.CanModifyIssueOrPull}}disabled{{end}}">
|
||||
<a class="fixed-text muted">
|
||||
<strong>{{ctx.Locale.Tr "repo.issues.new.labels"}}</strong> {{if $pageMeta.CanModifyIssueOrPull}}{{svg "octicon-gear"}}{{end}}
|
||||
</a>
|
||||
<div class="menu">
|
||||
{{if not $data.AllLabels}}
|
||||
<div class="item disabled">{{ctx.Locale.Tr "repo.issues.new.no_items"}}</div>
|
||||
{{else}}
|
||||
<div class="ui icon search input">
|
||||
<i class="icon">{{svg "octicon-search" 16}}</i>
|
||||
<input type="text" placeholder="{{ctx.Locale.Tr "repo.issues.filter_labels"}}">
|
||||
</div>
|
||||
<div class="scrolling menu">
|
||||
<a class="item clear-selection" data-text="" href="#">{{ctx.Locale.Tr "repo.issues.new.clear_labels"}}</a>
|
||||
<div class="divider"></div>
|
||||
{{$previousExclusiveScope := "_no_scope"}}
|
||||
{{range $data.RepoLabels}}
|
||||
{{$exclusiveScope := .ExclusiveScope}}
|
||||
{{if and (ne $previousExclusiveScope "_no_scope") (ne $previousExclusiveScope $exclusiveScope)}}
|
||||
<div class="divider" data-scope="{{.ExclusiveScope}}"></div>
|
||||
{{end}}
|
||||
{{$previousExclusiveScope = $exclusiveScope}}
|
||||
{{template "repo/issue/sidebar/label_list_item" dict "Label" . "LabelLink" (print $listBaseLink "?labels=" .ID)}}
|
||||
{{end}}
|
||||
{{if and $data.RepoLabels $data.OrgLabels}}<div class="divider"></div>{{end}}
|
||||
{{$previousExclusiveScope = "_no_scope"}}
|
||||
{{range $data.OrgLabels}}
|
||||
{{$exclusiveScope := .ExclusiveScope}}
|
||||
{{if and (ne $previousExclusiveScope "_no_scope") (ne $previousExclusiveScope $exclusiveScope)}}
|
||||
<div class="divider" data-scope="{{.ExclusiveScope}}"></div>
|
||||
{{end}}
|
||||
{{$previousExclusiveScope = $exclusiveScope}}
|
||||
{{template "repo/issue/sidebar/label_list_item" dict "Label" . "LabelLink" (print $listBaseLink "?labels=" .ID)}}
|
||||
{{end}}
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="ui list labels-list">
|
||||
<span class="item empty-list {{if $data.SelectedLabelIDs}}tw-hidden{{end}}">{{ctx.Locale.Tr "repo.issues.new.no_labels"}}</span>
|
||||
{{range $data.AllLabels}}
|
||||
{{if .IsChecked}}
|
||||
<a class="item" href="{{$listBaseLink}}?labels={{.ID}}">
|
||||
{{- ctx.RenderUtils.RenderLabel . -}}
|
||||
</a>
|
||||
{{end}}
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,12 @@
|
||||
{{$label := .Label}}
|
||||
{{$labelLink := or .LabelLink "#"}}
|
||||
<a class="item muted {{if $label.IsChecked}}checked{{else if $label.IsArchived}}tw-hidden{{end}}" href="{{$labelLink}}"
|
||||
data-scope="{{$label.ExclusiveScope}}" data-value="{{$label.ID}}" {{if $label.IsArchived}}data-is-archived{{end}}
|
||||
>
|
||||
<span class="item-check-mark">{{svg (Iif $label.ExclusiveScope "octicon-dot-fill" "octicon-check")}}</span>
|
||||
{{ctx.RenderUtils.RenderLabel $label}}
|
||||
<div class="item-secondary-info">
|
||||
{{if $label.Description}}<div class="tw-pl-[20px]"><small>{{$label.Description | ctx.RenderUtils.RenderEmoji}}</small></div>{{end}}
|
||||
<div class="archived-label-hint">{{template "repo/issue/labels/label_archived" $label}}</div>
|
||||
</div>
|
||||
</a>
|
||||
@@ -0,0 +1,54 @@
|
||||
{{$pageMeta := .}}
|
||||
{{$data := .MilestonesData}}
|
||||
{{$issueMilestone := NIL}}{{if and $pageMeta.Issue $pageMeta.Issue.Milestone}}{{$issueMilestone = $pageMeta.Issue.Milestone}}{{end}}
|
||||
<div class="divider"></div>
|
||||
<div class="issue-sidebar-combo" data-selection-mode="single" data-update-algo="all"
|
||||
{{if $pageMeta.Issue}}data-update-url="{{$pageMeta.RepoLink}}/issues/milestone?issue_ids={{$pageMeta.Issue.ID}}"{{end}}
|
||||
>
|
||||
<input class="combo-value" name="milestone_id" type="hidden" value="{{$data.SelectedMilestoneID}}">
|
||||
<div class="ui dropdown full-width {{if not $pageMeta.CanModifyIssueOrPull}}disabled{{end}}">
|
||||
<a class="fixed-text muted">
|
||||
<strong>{{ctx.Locale.Tr "repo.issues.new.milestone"}}</strong> {{if $pageMeta.CanModifyIssueOrPull}}{{svg "octicon-gear"}}{{end}}
|
||||
</a>
|
||||
<div class="menu">
|
||||
{{if and (not $data.OpenMilestones) (not $data.ClosedMilestones)}}
|
||||
<div class="item disabled">{{ctx.Locale.Tr "repo.issues.new.no_items"}}</div>
|
||||
{{else}}
|
||||
<div class="ui icon search input">
|
||||
<i class="icon">{{svg "octicon-search"}}</i>
|
||||
<input type="text" placeholder="{{ctx.Locale.Tr "repo.issues.filter_milestones"}}">
|
||||
</div>
|
||||
<div class="scrolling menu flex-items-menu">
|
||||
<div class="item clear-selection" data-text="">{{ctx.Locale.Tr "repo.issues.new.clear_milestone"}}</div>
|
||||
<div class="divider"></div>
|
||||
{{if $data.OpenMilestones}}
|
||||
<div class="header">{{ctx.Locale.Tr "repo.issues.filter_milestone_open"}}</div>
|
||||
{{range $data.OpenMilestones}}
|
||||
<a class="item muted" data-value="{{.ID}}" href="{{$pageMeta.RepoLink}}/milestone/{{.ID}}">
|
||||
{{svg "octicon-milestone" 18 "tw-shrink-0"}}<span class="tw-flex-1 tw-break-anywhere">{{.Name}}</span>
|
||||
</a>
|
||||
{{end}}
|
||||
{{end}}
|
||||
{{if and $data.OpenMilestones $data.ClosedMilestones}}<div class="divider"></div>{{end}}
|
||||
{{if $data.ClosedMilestones}}
|
||||
<div class="header">{{ctx.Locale.Tr "repo.issues.filter_milestone_closed"}}</div>
|
||||
{{range $data.ClosedMilestones}}
|
||||
<a class="item muted" data-value="{{.ID}}" href="{{$pageMeta.RepoLink}}/milestone/{{.ID}}">
|
||||
{{svg "octicon-milestone" 18 "tw-shrink-0"}}<span class="tw-flex-1 tw-break-anywhere">{{.Name}}</span>
|
||||
</a>
|
||||
{{end}}
|
||||
{{end}}
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="ui list muted-links flex-items-block">
|
||||
<span class="item empty-list {{if $issueMilestone}}tw-hidden{{end}}">{{ctx.Locale.Tr "repo.issues.new.no_milestone"}}</span>
|
||||
{{if $issueMilestone}}
|
||||
<a class="item" href="{{$pageMeta.RepoLink}}/milestone/{{$issueMilestone.ID}}">
|
||||
{{svg "octicon-milestone" 18 "tw-shrink-0"}}<span class="tw-flex-1 tw-break-anywhere">{{$issueMilestone.Name}}</span>
|
||||
</a>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,11 @@
|
||||
{{if .Participants}}
|
||||
<div class="divider"></div>
|
||||
<span class="text"><strong>{{ctx.Locale.Tr "repo.issues.num_participants" .NumParticipants}}</strong></span>
|
||||
<div class="ui list tw-flex tw-flex-wrap">
|
||||
{{range .Participants}}
|
||||
<a {{if gt .ID 0}}href="{{.HomeLink}}"{{end}} data-tooltip-content="{{.GetDisplayName}}">
|
||||
{{ctx.AvatarUtils.Avatar . 20 "tw-my-0.5 tw-mr-1"}}
|
||||
</a>
|
||||
{{end}}
|
||||
</div>
|
||||
{{end}}
|
||||
@@ -0,0 +1,94 @@
|
||||
{{$pageMeta := .}}
|
||||
{{$data := .ProjectsData}}
|
||||
<div class="divider"></div>
|
||||
|
||||
{{/* project selector */}}
|
||||
<div class="issue-sidebar-combo sidebar-project-combo" data-selection-mode="multiple" data-update-algo="all"
|
||||
{{if $pageMeta.Issue}}data-update-url="{{$pageMeta.RepoLink}}/issues/projects?issue_ids={{$pageMeta.Issue.ID}}"{{end}}
|
||||
>
|
||||
<input class="combo-value" name="project_ids" type="hidden" value="{{SliceUtils.JoinInt64 $data.SelectedProjectIDs}}">
|
||||
<div class="ui dropdown full-width {{if not $pageMeta.CanModifyIssueOrPull}}disabled{{end}}">
|
||||
<a class="fixed-text muted">
|
||||
<strong>{{ctx.Locale.Tr "repo.issues.new.projects"}}</strong> {{if $pageMeta.CanModifyIssueOrPull}}{{svg "octicon-gear"}}{{end}}
|
||||
</a>
|
||||
<div class="menu">
|
||||
{{if or $data.OpenProjects $data.ClosedProjects}}
|
||||
<div class="ui icon search input">
|
||||
<i class="icon">{{svg "octicon-search" 16}}</i>
|
||||
<input type="text" placeholder="{{ctx.Locale.Tr "repo.issues.filter_projects"}}">
|
||||
</div>
|
||||
{{end}}
|
||||
<div class="scrolling menu flex-items-menu">
|
||||
<div class="item clear-selection" data-text="">{{ctx.Locale.Tr "repo.issues.new.clear_projects"}}</div>
|
||||
<div class="divider"></div>
|
||||
{{if $data.OpenProjects}}
|
||||
<div class="header">{{ctx.Locale.Tr "repo.issues.new.open_projects"}}</div>
|
||||
{{range $data.OpenProjects}}
|
||||
<a class="item muted" data-value="{{.ID}}" href="{{.Link ctx}}">
|
||||
<span class="item-check-mark">{{svg "octicon-check"}}</span>
|
||||
{{svg .IconName 18}}<span class="tw-flex-1 gt-ellipsis">{{.Title}}</span>
|
||||
</a>
|
||||
{{end}}
|
||||
{{end}}
|
||||
{{if and $data.OpenProjects $data.ClosedProjects}}<div class="divider"></div>{{end}}
|
||||
{{if $data.ClosedProjects}}
|
||||
<div class="header">{{ctx.Locale.Tr "repo.issues.new.closed_projects"}}</div>
|
||||
{{range $data.ClosedProjects}}
|
||||
<a class="item muted" data-value="{{.ID}}" href="{{.Link ctx}}">
|
||||
<span class="item-check-mark">{{svg "octicon-check"}}</span>
|
||||
{{svg .IconName 18}}<span class="tw-flex-1 gt-ellipsis">{{.Title}}</span>
|
||||
</a>
|
||||
{{end}}
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{/* project cards (column selectors) */}}
|
||||
<div class="ui list tw-my-2 flex-relaxed-list issue-sidebar-project-cards" data-combo-list-inited="true">
|
||||
<div class="item empty-list {{if $data.ProjectCards}}tw-hidden{{end}}">{{ctx.Locale.Tr "repo.issues.new.no_projects"}}</div>
|
||||
{{range $card := $data.ProjectCards}}
|
||||
{{$selectedColumn := $card.SelectedColumn}}
|
||||
{{/* only show a "project column card" if the selected column exists, otherwise only show the project title */}}
|
||||
<div class="item {{if $selectedColumn}}sidebar-project-card{{end}}">
|
||||
<a class="suppressed flex-text-block" href="{{$card.Project.Link ctx}}">
|
||||
{{svg $card.Project.IconName 16}} <span class="gt-ellipsis">{{$card.Project.Title}}</span>
|
||||
</a>
|
||||
{{if and $selectedColumn $pageMeta.CanModifyIssueOrPull}}
|
||||
<div class="issue-sidebar-combo sidebar-project-column-combo" data-selection-mode="single" data-update-algo="all"
|
||||
data-update-url="{{$pageMeta.RepoLink}}/issues/projects/column?issue_id={{$pageMeta.Issue.ID}}"
|
||||
>
|
||||
<input class="combo-value" name="column_id" type="hidden" value="{{if $selectedColumn}}{{$selectedColumn.ID}}{{end}}">
|
||||
<div class="ui dropdown full-width">
|
||||
<div class="flex-text-block tw-ml-[16px]">{{/* align with the "project" icon */}}
|
||||
<div class="interact-bg tw-px-2 tw-py-1 tw-rounded flex-text-block fixed-text">
|
||||
{{if $selectedColumn}}
|
||||
{{if $card.SelectedColumn.Color}}<span class="color-icon icon-size-8" style="background-color: {{$card.SelectedColumn.Color}}"></span>{{end}}
|
||||
<div class="gt-ellipsis">{{$card.SelectedColumn.Title}}</div>
|
||||
{{else}}
|
||||
<div class="gt-ellipsis">{{ctx.Locale.Tr "repo.issues.new.no_column"}}</div>
|
||||
{{end}}
|
||||
{{svg "octicon-triangle-down" 14}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="menu flex-items-menu">
|
||||
{{range $columnItem := $card.Columns}}
|
||||
<a class="item" data-value="{{$columnItem.ID}}">
|
||||
<span class="item-check-mark">{{svg "octicon-check"}}</span>
|
||||
{{if $columnItem.Color}}<span class="color-icon icon-size-8" style="background-color: {{$columnItem.Color}}"></span>{{end}}
|
||||
<div class="gt-ellipsis">{{$columnItem.Title}}</div>
|
||||
</a>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{else if $selectedColumn}}
|
||||
<div class="flex-text-block tw-my-1 tw-ml-[22px]">{{/* align with the "project" icon */}}
|
||||
{{if $selectedColumn.Color}}<span class="color-icon icon-size-8" style="background-color: {{$selectedColumn.Color}}"></span>{{end}}
|
||||
<div class="gt-ellipsis">{{$selectedColumn.Title}}</div>
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,6 @@
|
||||
<div class="divider"></div>
|
||||
{{$issueReferenceLink := printf "%s#%d" .Issue.Repo.FullName .Issue.Index}}
|
||||
<div class="flex-text-block" data-tooltip-content="{{$issueReferenceLink}}">
|
||||
<span class="tw-flex-1 gt-ellipsis">{{ctx.Locale.Tr "repo.issues.reference_link" $issueReferenceLink}}</span>
|
||||
<button class="ui compact tiny icon button" data-clipboard-text="{{$issueReferenceLink}}">{{svg "octicon-copy" 14}}</button>
|
||||
</div>
|
||||
@@ -0,0 +1,131 @@
|
||||
{{$pageMeta := .}}
|
||||
{{$data := .ReviewersData}}
|
||||
{{$repoOwnerName := $pageMeta.Repository.OwnerName}}
|
||||
{{$hasCandidates := or $data.Reviewers $data.TeamReviewers}}
|
||||
<div class="issue-sidebar-combo" data-selection-mode="multiple" data-update-algo="diff"
|
||||
{{if $pageMeta.Issue}}data-update-url="{{$pageMeta.RepoLink}}/issues/request_review?issue_ids={{$pageMeta.Issue.ID}}"{{end}}
|
||||
>
|
||||
<input type="hidden" class="combo-value" name="reviewer_ids">{{/* match CreateIssueForm */}}
|
||||
<div class="ui dropdown full-width {{if or (not $hasCandidates) (not $data.CanChooseReviewer)}}disabled{{end}}">
|
||||
<a class="fixed-text muted">
|
||||
<strong>{{ctx.Locale.Tr "repo.issues.review.reviewers"}}</strong> {{if $data.CanChooseReviewer}}{{svg "octicon-gear"}}{{end}}
|
||||
</a>
|
||||
<div class="menu flex-items-menu">
|
||||
{{if $hasCandidates}}
|
||||
<div class="ui icon search input">
|
||||
<i class="icon">{{svg "octicon-search"}}</i>
|
||||
<input type="text" placeholder="{{ctx.Locale.Tr "repo.issues.filter_reviewers"}}">
|
||||
</div>
|
||||
{{end}}
|
||||
<div class="scrolling menu flex-items-menu">
|
||||
{{range $data.Reviewers}}
|
||||
{{if .User}}
|
||||
<a class="item muted {{if .Requested}}checked{{end}}" href="{{.User.HomeLink}}" data-value="{{.ItemID}}" data-can-change="{{.CanChange}}"
|
||||
{{if not .CanChange}}data-tooltip-content="{{ctx.Locale.Tr "repo.issues.remove_request_review_block"}}"{{end}}>
|
||||
<span class="item-check-mark">{{svg "octicon-check"}}</span>
|
||||
{{ctx.AvatarUtils.Avatar .User 20}} {{template "repo/search_name" .User}}
|
||||
</a>
|
||||
{{end}}
|
||||
{{end}}
|
||||
{{if $data.TeamReviewers}}
|
||||
{{if $data.Reviewers}}<div class="divider"></div>{{end}}
|
||||
{{range $data.TeamReviewers}}
|
||||
{{if .Team}}
|
||||
<a class="item muted {{if .Requested}}checked{{end}}" href="#" data-value="{{.ItemID}}" data-can-change="{{.CanChange}}"
|
||||
{{if not .CanChange}} data-tooltip-content="{{ctx.Locale.Tr "repo.issues.remove_request_review_block"}}"{{end}}>
|
||||
<span class="item-check-mark">{{svg "octicon-check"}}</span>
|
||||
{{svg "octicon-people" 20}} {{$repoOwnerName}}/{{.Team.Name}}
|
||||
</a>
|
||||
{{end}}
|
||||
{{end}}
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="ui relaxed list flex-items-block">
|
||||
<span class="item empty-list {{if or $data.OriginalReviews $data.CurrentPullReviewers}}tw-hidden{{end}}">
|
||||
{{ctx.Locale.Tr "repo.issues.new.no_reviewers"}}
|
||||
</span>
|
||||
{{range $data.CurrentPullReviewers}}
|
||||
<div class="item">
|
||||
<div class="flex-text-inline tw-flex-1">
|
||||
{{if .User}}
|
||||
<a class="muted flex-text-inline tw-gap-2" href="{{.User.HomeLink}}">{{ctx.AvatarUtils.Avatar .User 20}} {{.User.GetDisplayName}}</a>
|
||||
{{else if .Team}}
|
||||
<span class="flex-text-inline tw-gap-2">{{svg "octicon-people" 20}} {{$repoOwnerName}}/{{.Team.Name}}</span>
|
||||
{{end}}
|
||||
</div>
|
||||
<div class="flex-text-inline">
|
||||
{{if .CanBeDismissed}}
|
||||
<a href="#" class="ui muted icon show-modal" data-tooltip-content="{{ctx.Locale.Tr "repo.issues.dismiss_review"}}"
|
||||
data-modal="#issue-sidebar-dismiss-review-modal" data-modal-reviewer-id="{{.Review.ID}}">
|
||||
{{svg "octicon-x" 20}}
|
||||
</a>
|
||||
{{end}}
|
||||
{{if .Review.Stale}}
|
||||
<span data-tooltip-content="{{ctx.Locale.Tr "repo.issues.is_stale"}}">{{svg "octicon-hourglass" 16}}</span>
|
||||
{{end}}
|
||||
{{if and .CanChange $data.CanChooseReviewer}}
|
||||
{{if .Requested}}
|
||||
<a href="#" class="ui muted icon link-action"
|
||||
data-tooltip-content="{{ctx.Locale.Tr "repo.issues.remove_request_review"}}"
|
||||
data-url="{{$pageMeta.RepoLink}}/issues/request_review?action=detach&issue_ids={{$pageMeta.Issue.ID}}&id={{.ItemID}}">
|
||||
{{svg "octicon-trash"}}
|
||||
</a>
|
||||
{{else}}
|
||||
<a href="#" class="ui muted icon link-action"
|
||||
data-tooltip-content="{{ctx.Locale.Tr "repo.issues.re_request_review"}}"
|
||||
data-url="{{$pageMeta.RepoLink}}/issues/request_review?action=attach&issue_ids={{$pageMeta.Issue.ID}}&id={{.ItemID}}">
|
||||
{{svg "octicon-sync"}}
|
||||
</a>
|
||||
{{end}}
|
||||
{{end}}
|
||||
<span {{if .Review.TooltipContent}}data-tooltip-content="{{ctx.Locale.Tr .Review.TooltipContent}}"{{end}}>
|
||||
{{svg (printf "octicon-%s" .Review.Type.Icon) 16 .Review.HTMLTypeColorClass}}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
{{range $data.OriginalReviews}}
|
||||
<div class="item">
|
||||
<div class="flex-text-inline tw-flex-1">
|
||||
{{$originalURLHostname := $pageMeta.Repository.GetOriginalURLHostname}}
|
||||
{{$originalURL := $pageMeta.Repository.OriginalURL}}
|
||||
<a class="muted flex-text-inline tw-gap-2" href="{{$originalURL}}" data-tooltip-content="{{ctx.Locale.Tr "repo.migrated_from_fake" $originalURLHostname}}">
|
||||
{{svg (MigrationIcon $originalURLHostname) 20}} {{.OriginalAuthor}}
|
||||
</a>
|
||||
</div>
|
||||
<div class="flex-text-inline">
|
||||
<span {{if .TooltipContent}}data-tooltip-content="{{ctx.Locale.Tr .TooltipContent}}"{{end}}>
|
||||
{{svg (printf "octicon-%s" .Type.Icon) 16 .HTMLTypeColorClass}}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
|
||||
{{if $data.CurrentPullReviewers}}
|
||||
<div class="ui small modal" id="issue-sidebar-dismiss-review-modal">
|
||||
<div class="header">
|
||||
{{ctx.Locale.Tr "repo.issues.dismiss_review"}}
|
||||
</div>
|
||||
<div class="content">
|
||||
<div class="ui warning message">
|
||||
{{ctx.Locale.Tr "repo.issues.dismiss_review_warning"}}
|
||||
</div>
|
||||
<form class="ui form" action="{{$pageMeta.RepoLink}}/issues/dismiss_review" method="post">
|
||||
<input type="hidden" class="reviewer-id" name="review_id">
|
||||
<div class="field">
|
||||
<label for="issue-sidebar-dismiss-review-message">{{ctx.Locale.Tr "action.review_dismissed_reason"}}</label>
|
||||
<input id="issue-sidebar-dismiss-review-message" name="message">
|
||||
</div>
|
||||
<div class="actions">
|
||||
<button class="ui cancel button">{{ctx.Locale.Tr "settings.cancel"}}</button>
|
||||
<button class="ui red button" type="submit">{{ctx.Locale.Tr "ok"}}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
@@ -0,0 +1,83 @@
|
||||
{{if .Repository.IsTimetrackerEnabled ctx}}
|
||||
{{if and .CanUseTimetracker (not .Repository.IsArchived)}}
|
||||
<div class="divider"></div>
|
||||
<div>
|
||||
<div class="flex-text-block">
|
||||
<strong class="tw-flex-1">{{ctx.Locale.Tr "repo.issues.tracker"}}</strong>
|
||||
<button class="btn interact-fg show-modal" data-tooltip-content="{{ctx.Locale.Tr "repo.issues.time_estimate_set"}}" data-modal="#issue-time-set-estimate-modal">
|
||||
{{svg "octicon-pencil"}}
|
||||
</button>
|
||||
</div>
|
||||
<div class="ui buttons tw-mt-2 tw-w-full">
|
||||
{{if $.IsStopwatchRunning}}
|
||||
<button class="ui button tw-flex-1 issue-stop-time link-action" data-url="{{.Issue.Link}}/times/stopwatch/stop">
|
||||
{{svg "octicon-stopwatch"}} {{ctx.Locale.Tr "repo.issues.timetracker_timer_stop"}}
|
||||
</button>
|
||||
<button class="ui icon button issue-cancel-time link-action" data-url="{{.Issue.Link}}/times/stopwatch/cancel" data-tooltip-content="{{ctx.Locale.Tr "repo.issues.timetracker_timer_discard"}}">
|
||||
{{svg "octicon-trash"}}
|
||||
</button>
|
||||
{{else}}
|
||||
<button class="ui button tw-flex-1 issue-start-time link-action" data-url="{{.Issue.Link}}/times/stopwatch/start">
|
||||
{{svg "octicon-stopwatch"}} {{ctx.Locale.Tr "repo.issues.timetracker_timer_start"}}
|
||||
</button>
|
||||
<button class="ui icon button issue-add-time show-modal" data-modal="#issue-time-manually-add-modal" data-tooltip-content="{{ctx.Locale.Tr "repo.issues.timetracker_timer_manually_add"}}">
|
||||
{{svg "octicon-plus"}}
|
||||
</button>
|
||||
{{end}}
|
||||
</div>
|
||||
|
||||
{{if and (not $.IsStopwatchRunning) .HasUserStopwatch}}
|
||||
<div class="ui warning message">{{ctx.Locale.Tr "repo.issues.tracking_already_started" .OtherStopwatchURL}}</div>
|
||||
{{end}}
|
||||
|
||||
{{if .Issue.TimeEstimate}}
|
||||
<div class="tw-my-2">{{ctx.Locale.Tr "repo.issues.time_estimate_display" (TimeEstimateString .Issue.TimeEstimate)}}</div>
|
||||
{{end}}
|
||||
|
||||
{{/* set time estimate modal */}}
|
||||
<div class="ui mini modal" id="issue-time-set-estimate-modal">
|
||||
<div class="header">{{ctx.Locale.Tr "repo.issues.time_estimate_set"}}</div>
|
||||
<form method="post" class="ui form form-fetch-action" action="{{.Issue.Link}}/time_estimate">
|
||||
<div class="content">
|
||||
<input name="time_estimate" placeholder="1h 2m" value="{{TimeEstimateString .Issue.TimeEstimate}}">
|
||||
<div class="actions">
|
||||
<button class="ui cancel button">{{ctx.Locale.Tr "cancel"}}</button>
|
||||
<button class="ui primary button">{{ctx.Locale.Tr "repo.issues.save"}}</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
{{/* manually add time modal */}}
|
||||
<div class="ui mini modal" id="issue-time-manually-add-modal">
|
||||
<div class="header">{{ctx.Locale.Tr "repo.issues.add_time_manually"}}</div>
|
||||
<form method="post" class="ui form form-fetch-action" action="{{.Issue.Link}}/times/add">
|
||||
<div class="content flex-text-block">
|
||||
<input placeholder='{{ctx.Locale.Tr "repo.issues.add_time_hours"}}' type="number" name="hours">:
|
||||
<input placeholder='{{ctx.Locale.Tr "repo.issues.add_time_minutes"}}' type="number" name="minutes">
|
||||
</div>
|
||||
<div class="actions">
|
||||
<button class="ui cancel button">{{ctx.Locale.Tr "cancel"}}</button>
|
||||
<button class="ui primary button">{{ctx.Locale.Tr "repo.issues.timetracker_timer_manually_add"}}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
{{if .WorkingUsers}}
|
||||
<div class="tw-mt-2">
|
||||
{{ctx.Locale.Tr "repo.issues.time_spent_from_all_authors" ($.Issue.TotalTrackedTime | Sec2Hour)}}
|
||||
</div>
|
||||
<div class="ui list flex-items-block">
|
||||
{{range $user, $trackedtime := .WorkingUsers}}
|
||||
<div class="item tw-gap-3">
|
||||
{{template "shared/user/avatarlink" dict "user" $user}}
|
||||
<div>
|
||||
{{template "shared/user/authorlink" $user}}
|
||||
<div class="text">{{$trackedtime|Sec2Hour}}</div>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
{{end}}
|
||||
{{end}}
|
||||
@@ -0,0 +1,9 @@
|
||||
{{if and $.IssueWatch (not .Repository.IsArchived)}}
|
||||
<div class="divider"></div>
|
||||
<div class="ui watching">
|
||||
<span class="text"><strong>{{ctx.Locale.Tr "notification.notifications"}}</strong></span>
|
||||
<div class="tw-mt-2">
|
||||
{{template "repo/issue/view_content/watching" .}}
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
@@ -0,0 +1,5 @@
|
||||
{{if and (or .HasIssuesOrPullsWritePermission .IsIssuePoster) (not .HasMerged) (not .Issue.IsClosed) (not .IsPullWorkInProgress)}}
|
||||
<a data-global-init="initPullRequestWipToggle" data-title="{{.Issue.Title}}" data-wip-prefix="{{index .PullRequestWorkInProgressPrefixes 0}}" data-update-url="{{.Issue.Link}}/title">
|
||||
{{ctx.Locale.Tr "repo.pulls.still_in_progress"}} {{ctx.Locale.Tr "repo.pulls.add_prefix" (index .PullRequestWorkInProgressPrefixes 0)}}
|
||||
</a>
|
||||
{{end}}
|
||||
Reference in New Issue
Block a user