初始提交: Gitea 项目代码
This commit is contained in:
@@ -0,0 +1,133 @@
|
||||
{{template "base/head" .}}
|
||||
<div class="page-content repository actions">
|
||||
{{template "repo/header" .}}
|
||||
<div class="ui container">
|
||||
{{template "base/alert" .}}
|
||||
|
||||
{{if .HasWorkflowsOrRuns}}
|
||||
<div class="flex-container">
|
||||
<div class="flex-container-nav">
|
||||
<div class="ui fluid vertical menu">
|
||||
<a class="item {{if not $.CurWorkflow}}active{{end}}" href="?actor={{$.CurActor}}&status={{$.CurStatus}}&branch={{$.CurBranch}}">{{ctx.Locale.Tr "actions.runs.all_workflows"}}</a>
|
||||
{{range .workflows}}
|
||||
<a class="item flex-text-block {{if eq .Entry.Name $.CurWorkflow}}active{{end}}" href="?workflow={{.Entry.Name}}&actor={{$.CurActor}}&status={{$.CurStatus}}&branch={{$.CurBranch}}">
|
||||
<span class="gt-ellipsis">{{.DisplayName}}</span>
|
||||
|
||||
{{if .ErrMsg}}
|
||||
<span class="flex-text-inline" data-tooltip-content="{{.ErrMsg}}">{{svg "octicon-alert" 16 "tw-text-red"}}</span>
|
||||
{{end}}
|
||||
|
||||
{{if $.ActionsConfig.IsWorkflowDisabled .Entry.Name}}
|
||||
<div class="ui red label">{{ctx.Locale.Tr "disabled"}}</div>
|
||||
{{end}}
|
||||
</a>
|
||||
{{end}}
|
||||
{{if .OtherWorkflows}}
|
||||
<details class="item"{{if not $.CurWorkflowIsListed}} open{{end}}>
|
||||
<summary data-tooltip-content="{{ctx.Locale.Tr "actions.runs.other_workflows_tooltip"}}">
|
||||
<span class="flex-text-block">
|
||||
{{ctx.Locale.Tr "actions.runs.other_workflows"}}
|
||||
<span class="ui label">{{len .OtherWorkflows}}</span>
|
||||
</span>
|
||||
</summary>
|
||||
<div class="menu items-full-width">
|
||||
{{range .OtherWorkflows}}
|
||||
<a class="item {{if eq . $.CurWorkflow}}active{{end}}" href="?workflow={{.}}&actor={{$.CurActor}}&status={{$.CurStatus}}">
|
||||
<span class="gt-ellipsis">{{.}}</span>
|
||||
</a>
|
||||
{{end}}
|
||||
</div>
|
||||
</details>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-container-main">
|
||||
<div class="ui top attached header flex-left-right">
|
||||
<strong>{{ctx.Locale.TrN .Page.Paginater.Total "actions.runs.workflow_run_count_1" "actions.runs.workflow_run_count_n" .Page.Paginater.Total}}</strong>
|
||||
<div class="ui secondary filter menu flex-text-block tw-m-0">
|
||||
<!-- Actor -->
|
||||
<div class="ui{{if not .Actors}} disabled{{end}} dropdown jump item">
|
||||
<span class="text">{{ctx.Locale.Tr "actions.runs.actor"}}</span>
|
||||
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
||||
<div class="menu">
|
||||
<div class="ui icon search input">
|
||||
<i class="icon">{{svg "octicon-search"}}</i>
|
||||
<input type="text" placeholder="{{ctx.Locale.Tr "actions.runs.actor"}}">
|
||||
</div>
|
||||
<a class="item{{if not $.CurActor}} selected{{end}}" href="?workflow={{$.CurWorkflow}}&status={{$.CurStatus}}&branch={{$.CurBranch}}&actor=0">
|
||||
{{ctx.Locale.Tr "actions.runs.actors_no_select"}}
|
||||
</a>
|
||||
{{range .Actors}}
|
||||
<a class="item{{if eq .ID $.CurActor}} selected{{end}}" href="?workflow={{$.CurWorkflow}}&actor={{.ID}}&status={{$.CurStatus}}&branch={{$.CurBranch}}">
|
||||
{{ctx.AvatarUtils.Avatar . 20}} {{.GetDisplayName}}
|
||||
</a>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
<!-- Status -->
|
||||
<div class="ui dropdown jump item">
|
||||
<span class="text">{{ctx.Locale.Tr "actions.runs.status"}}</span>
|
||||
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
||||
<div class="menu">
|
||||
<div class="ui icon search input">
|
||||
<i class="icon">{{svg "octicon-search"}}</i>
|
||||
<input type="text" placeholder="{{ctx.Locale.Tr "actions.runs.status"}}">
|
||||
</div>
|
||||
<a class="item{{if not $.CurStatus}} selected{{end}}" href="?workflow={{$.CurWorkflow}}&actor={{$.CurActor}}&branch={{$.CurBranch}}&status=0">
|
||||
{{ctx.Locale.Tr "actions.runs.status_no_select"}}
|
||||
</a>
|
||||
{{range .StatusInfoList}}
|
||||
<a class="item{{if eq .Status $.CurStatus}} selected{{end}}" href="?workflow={{$.CurWorkflow}}&actor={{$.CurActor}}&status={{.Status}}&branch={{$.CurBranch}}">
|
||||
{{.DisplayedStatus}}
|
||||
</a>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
<!-- Branch -->
|
||||
<div class="ui{{if not .RunBranches}} disabled{{end}} dropdown jump item" data-test-id="filter-branch">
|
||||
<span class="text">{{ctx.Locale.Tr "actions.runs.branch"}}</span>
|
||||
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
||||
<div class="menu">
|
||||
<div class="ui icon search input">
|
||||
<i class="icon">{{svg "octicon-search"}}</i>
|
||||
<input type="text" placeholder="{{ctx.Locale.Tr "actions.runs.branch"}}">
|
||||
</div>
|
||||
<a class="item{{if not $.CurBranch}} selected{{end}}" href="?workflow={{$.CurWorkflow}}&actor={{$.CurActor}}&status={{$.CurStatus}}">
|
||||
{{ctx.Locale.Tr "actions.runs.branches_no_select"}}
|
||||
</a>
|
||||
{{range .RunBranches}}
|
||||
<a class="item{{if eq . $.CurBranch}} selected{{end}}" href="?workflow={{$.CurWorkflow}}&actor={{$.CurActor}}&status={{$.CurStatus}}&branch={{.}}">
|
||||
{{.}}
|
||||
</a>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{if and .AllowDisableOrEnableWorkflow .CurWorkflowIsListed $.CurWorkflow}}
|
||||
<button class="ui jump dropdown btn interact-bg tw-p-2">
|
||||
{{svg "octicon-kebab-horizontal"}}
|
||||
<div class="menu">
|
||||
<a class="item link-action" data-url="{{$.Link}}/{{if .CurWorkflowDisabled}}enable{{else}}disable{{end}}?workflow={{$.CurWorkflow}}&actor={{.CurActor}}&status={{$.CurStatus}}&branch={{$.CurBranch}}">
|
||||
{{if .CurWorkflowDisabled}}{{ctx.Locale.Tr "actions.workflow.enable"}}{{else}}{{ctx.Locale.Tr "actions.workflow.disable"}}{{end}}
|
||||
</a>
|
||||
</div>
|
||||
</button>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{if .WorkflowDispatchConfig}}
|
||||
{{template "repo/actions/workflow_dispatch" .}}
|
||||
{{end}}
|
||||
|
||||
<div class="ui attached segment">
|
||||
{{template "repo/actions/runs_list" .}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{else}}
|
||||
{{template "repo/actions/no_workflows" .}}
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
{{template "base/footer" .}}
|
||||
@@ -0,0 +1,8 @@
|
||||
<div class="empty-placeholder">
|
||||
{{svg "octicon-no-entry" 48}}
|
||||
<h2>{{ctx.Locale.Tr "actions.runs.no_workflows"}}</h2>
|
||||
{{if and .CanWriteCode .CanWriteActions}}
|
||||
<p>{{ctx.Locale.Tr "actions.runs.no_workflows.quick_start" "https://docs.gitea.com/usage/actions/quickstart/"}}</p>
|
||||
{{end}}
|
||||
<p>{{ctx.Locale.Tr "actions.runs.no_workflows.documentation" "https://docs.gitea.com/usage/actions/overview/"}}</p>
|
||||
</div>
|
||||
@@ -0,0 +1,77 @@
|
||||
<div class="flex-divided-list items-with-main run-list">
|
||||
{{if not .Runs}}
|
||||
<div class="empty-placeholder">
|
||||
{{svg "octicon-no-entry" 48}}
|
||||
<h2>{{if $.IsFiltered}}{{ctx.Locale.Tr "actions.runs.no_results"}}{{else}}{{ctx.Locale.Tr "actions.runs.no_runs"}}{{end}}</h2>
|
||||
</div>
|
||||
{{end}}
|
||||
{{range $run := .Runs}}
|
||||
<div class="item tw-items-center">
|
||||
<div class="item-leading">
|
||||
<span data-tooltip-content="{{ctx.Locale.Tr (printf "actions.status.%s" $run.Status.String)}}">
|
||||
{{template "repo/icons/action_status" (dict "Status" $run.Status.String "IconVariant" "circle-fill")}}
|
||||
</span>
|
||||
</div>
|
||||
<div class="item-main">
|
||||
<span class="item-title" title="{{$run.Title}}">
|
||||
{{if $run.Title}}
|
||||
{{ctx.RenderUtils.RenderCommitMessageLinkSubject $run.Title $run.Link $.Repository}}
|
||||
{{else}}
|
||||
<a href="{{$run.Link}}">{{ctx.Locale.Tr "actions.runs.empty_commit_message"}}</a>
|
||||
{{end}}
|
||||
</span>
|
||||
<div class="item-body">
|
||||
{{$workflowName := index $.WorkflowNames $run.WorkflowID}}
|
||||
<span><b>{{if not $.CurWorkflow}}{{if $workflowName}}{{$workflowName}}{{else}}{{$run.WorkflowID}}{{end}} {{end}}#{{$run.Index}}</b>:</span>
|
||||
|
||||
{{- if $run.ScheduleID -}}
|
||||
{{ctx.Locale.Tr "actions.runs.scheduled"}}
|
||||
{{- else -}}
|
||||
{{ctx.Locale.Tr "actions.runs.commit"}}
|
||||
<a href="{{$.RepoLink}}/commit/{{$run.CommitSHA}}">{{ShortSha $run.CommitSHA}}</a>
|
||||
{{ctx.Locale.Tr "actions.runs.pushed_by"}}
|
||||
<a href="{{$run.TriggerUser.HomeLink}}">{{$run.TriggerUser.GetDisplayName}}</a>
|
||||
{{- end -}}
|
||||
|
||||
{{$errMsg := index $.RunErrors $run.ID}}
|
||||
{{if $errMsg}}
|
||||
<span class="flex-text-inline" data-tooltip-content="{{$errMsg}}">
|
||||
{{svg "octicon-alert" 16 "tw-text-red"}}
|
||||
</span>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="item-trailing">
|
||||
{{if $run.IsRefDeleted}}
|
||||
<span class="ui label run-list-ref gt-ellipsis tw-line-through" data-tooltip-content="{{$run.RefTooltip}}">{{$run.PrettyRef}}</span>
|
||||
{{else}}
|
||||
<a class="ui label run-list-ref gt-ellipsis" href="{{$run.RefLink}}" data-tooltip-content="{{$run.RefTooltip}}">{{$run.PrettyRef}}</a>
|
||||
{{end}}
|
||||
<div class="run-list-item-right">
|
||||
<div class="run-list-meta">{{svg "octicon-calendar" 16}}{{DateUtils.TimeSince $run.Updated}}</div>
|
||||
<div class="run-list-meta">{{svg "octicon-stopwatch" 16}}{{$run.Duration}}</div>
|
||||
</div>
|
||||
<div class="ui dropdown jump tw-p-2">
|
||||
{{svg "octicon-kebab-horizontal"}}
|
||||
<div class="menu flex-items-menu">
|
||||
<a class="item" href="{{$run.Link}}/workflow">{{svg "octicon-play"}}{{ctx.Locale.Tr "actions.runs.view_workflow_file"}}</a>
|
||||
{{if and $.CanWriteRepoUnitActions (not $run.Status.IsDone)}}
|
||||
<a class="item link-action" data-url="{{$run.Link}}/cancel">
|
||||
{{svg "octicon-x"}}{{ctx.Locale.Tr "actions.runs.cancel"}}
|
||||
</a>
|
||||
{{end}}
|
||||
{{if and $.CanWriteRepoUnitActions $run.Status.IsDone}}
|
||||
<a class="item link-action"
|
||||
data-url="{{$run.Link}}/delete"
|
||||
data-modal-confirm="{{ctx.Locale.Tr "actions.runs.delete.description"}}"
|
||||
>
|
||||
{{svg "octicon-trash"}}{{ctx.Locale.Tr "actions.runs.delete"}}
|
||||
</a>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
{{template "base/paginate" .}}
|
||||
@@ -0,0 +1,11 @@
|
||||
{{template "base/head" .}}
|
||||
|
||||
<div class="page-content repository">
|
||||
{{template "repo/header" .}}
|
||||
{{template "repo/actions/view_component" (dict
|
||||
"JobID" .JobID
|
||||
"ActionsViewURL" .ActionsViewURL
|
||||
)}}
|
||||
</div>
|
||||
|
||||
{{template "base/footer" .}}
|
||||
@@ -0,0 +1,55 @@
|
||||
<div id="repo-action-view"
|
||||
data-job-id="{{.JobID}}"
|
||||
data-actions-view-url="{{.ActionsViewURL}}"
|
||||
|
||||
data-locale-approve="{{ctx.Locale.Tr "repo.diff.review.approve"}}"
|
||||
data-locale-cancel="{{ctx.Locale.Tr "actions.runs.cancel"}}"
|
||||
data-locale-rerun="{{ctx.Locale.Tr "rerun"}}"
|
||||
data-locale-rerun-all="{{ctx.Locale.Tr "rerun_all"}}"
|
||||
data-locale-rerun-failed="{{ctx.Locale.Tr "rerun_failed"}}"
|
||||
data-locale-latest="{{ctx.Locale.Tr "actions.runs.latest"}}"
|
||||
data-locale-latest-attempt="{{ctx.Locale.Tr "actions.runs.latest_attempt"}}"
|
||||
data-locale-attempt="{{ctx.Locale.Tr "actions.runs.attempt"}}"
|
||||
data-locale-runs-scheduled="{{ctx.Locale.Tr "actions.runs.scheduled"}}"
|
||||
data-locale-runs-commit="{{ctx.Locale.Tr "actions.runs.commit"}}"
|
||||
data-locale-runs-pushed-by="{{ctx.Locale.Tr "actions.runs.pushed_by"}}"
|
||||
data-locale-summary="{{ctx.Locale.Tr "actions.runs.summary"}}"
|
||||
data-locale-all-jobs="{{ctx.Locale.Tr "actions.runs.all_jobs"}}"
|
||||
data-locale-expand-caller-jobs="{{ctx.Locale.Tr "actions.runs.expand_caller_jobs"}}"
|
||||
data-locale-collapse-caller-jobs="{{ctx.Locale.Tr "actions.runs.collapse_caller_jobs"}}"
|
||||
data-locale-triggered-via="{{ctx.Locale.Tr "actions.runs.triggered_via"}}"
|
||||
data-locale-total-duration="{{ctx.Locale.Tr "actions.runs.total_duration"}}"
|
||||
data-locale-run-details="{{ctx.Locale.Tr "actions.runs.run_details"}}"
|
||||
data-locale-workflow-file="{{ctx.Locale.Tr "actions.runs.workflow_file"}}"
|
||||
data-locale-status-unknown="{{ctx.Locale.Tr "actions.status.unknown"}}"
|
||||
data-locale-status-waiting="{{ctx.Locale.Tr "actions.status.waiting"}}"
|
||||
data-locale-status-running="{{ctx.Locale.Tr "actions.status.running"}}"
|
||||
data-locale-status-cancelling="{{ctx.Locale.Tr "actions.status.cancelling"}}"
|
||||
data-locale-status-success="{{ctx.Locale.Tr "actions.status.success"}}"
|
||||
data-locale-status-failure="{{ctx.Locale.Tr "actions.status.failure"}}"
|
||||
data-locale-status-cancelled="{{ctx.Locale.Tr "actions.status.cancelled"}}"
|
||||
data-locale-status-skipped="{{ctx.Locale.Tr "actions.status.skipped"}}"
|
||||
data-locale-status-blocked="{{ctx.Locale.Tr "actions.status.blocked"}}"
|
||||
data-locale-artifacts-title="{{ctx.Locale.Tr "artifacts"}}"
|
||||
data-locale-artifact-expired="{{ctx.Locale.Tr "expired"}}"
|
||||
data-locale-artifact-expires-at="{{ctx.Locale.Tr "artifact_expires_at"}}"
|
||||
data-locale-confirm-delete-artifact="{{ctx.Locale.Tr "confirm_delete_artifact"}}"
|
||||
data-locale-show-timestamps="{{ctx.Locale.Tr "show_timestamps"}}"
|
||||
data-locale-show-log-seconds="{{ctx.Locale.Tr "show_log_seconds"}}"
|
||||
data-locale-show-full-screen="{{ctx.Locale.Tr "show_full_screen"}}"
|
||||
data-locale-download-logs="{{ctx.Locale.Tr "download_logs"}}"
|
||||
data-locale-copy-output="{{ctx.Locale.Tr "copy_output"}}"
|
||||
data-locale-logs-always-auto-scroll="{{ctx.Locale.Tr "actions.logs.always_auto_scroll"}}"
|
||||
data-locale-logs-always-expand-running="{{ctx.Locale.Tr "actions.logs.always_expand_running"}}"
|
||||
data-locale-workflow-dependencies="{{ctx.Locale.Tr "actions.runs.workflow_dependencies"}}"
|
||||
data-locale-graph-jobs-count-1="{{ctx.Locale.Tr "actions.runs.graph_jobs_count_1"}}"
|
||||
data-locale-graph-jobs-count-n="{{ctx.Locale.Tr "actions.runs.graph_jobs_count_n"}}"
|
||||
data-locale-graph-dependencies-count-1="{{ctx.Locale.Tr "actions.runs.graph_dependencies_count_1"}}"
|
||||
data-locale-graph-dependencies-count-n="{{ctx.Locale.Tr "actions.runs.graph_dependencies_count_n"}}"
|
||||
data-locale-graph-success-rate="{{ctx.Locale.Tr "actions.runs.graph_success_rate"}}"
|
||||
data-locale-graph-zoom-in="{{ctx.Locale.Tr "actions.runs.graph_zoom_in"}}"
|
||||
data-locale-graph-zoom-max="{{ctx.Locale.Tr "actions.runs.graph_zoom_max"}}"
|
||||
data-locale-graph-zoom-out="{{ctx.Locale.Tr "actions.runs.graph_zoom_out"}}"
|
||||
data-locale-graph-reset-view="{{ctx.Locale.Tr "actions.runs.graph_reset_view"}}"
|
||||
>
|
||||
</div>
|
||||
@@ -0,0 +1,58 @@
|
||||
{{/* "z-index" is used to maintain continuous attached styling and keep the colored border-bottom visible (pre-existing fomantic issue with negative margins) */}}
|
||||
<div class="ui blue info attached message flex-left-right tw-z-1">
|
||||
<span>{{ctx.Locale.Tr "actions.workflow.has_workflow_dispatch"}}</span>
|
||||
<div class="flex-text-block tw-bg-box-body tw-rounded">{{/*make the button have correct hovered color */}}
|
||||
<button class="ui mini button show-modal" data-modal="#runWorkflowDispatchModal">{{ctx.Locale.Tr "actions.workflow.run"}}{{svg "octicon-triangle-down" 14 "dropdown icon"}}</button>
|
||||
</div>
|
||||
</div>
|
||||
<div id="runWorkflowDispatchModal" class="ui tiny modal">
|
||||
<div class="content">
|
||||
<form id="runWorkflowDispatchForm" class="ui form ignore-dirty" action="{{$.Link}}/run?workflow={{$.CurWorkflow}}&actor={{$.CurActor}}&status={{$.CurStatus}}&branch={{$.CurBranch}}" method="post">
|
||||
<div class="ui inline field required tw-flex tw-items-center">
|
||||
<span class="ui inline required field">
|
||||
<label>{{ctx.Locale.Tr "actions.workflow.from_ref"}}:</label>
|
||||
</span>
|
||||
<div class="ui inline field dropdown button select-branch branch-selector-dropdown ellipsis-text-items">
|
||||
<input type="hidden" name="ref" value="refs/heads/{{index .Branches 0}}"
|
||||
data-fetch-trigger="change" data-fetch-sync="$body #runWorkflowDispatchModalInputs"
|
||||
data-fetch-url="{{$.Link}}/workflow-dispatch-inputs?workflow={{$.CurWorkflow}}"
|
||||
>
|
||||
{{svg "octicon-git-branch" 14}}
|
||||
<div class="default text">{{index .Branches 0}}</div>
|
||||
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
||||
<div class="menu transition">
|
||||
<div class="ui icon search input">
|
||||
<i class="icon">{{svg "octicon-filter" 16}}</i>
|
||||
<input name="search" type="text" placeholder="{{ctx.Locale.Tr "repo.filter_branch_and_tag"}}...">
|
||||
</div>
|
||||
<div class="branch-tag-tab">
|
||||
<a class="branch-tag-item reference column muted active" href="#" data-target="#branch-list">
|
||||
{{svg "octicon-git-branch" 16 "tw-mr-1"}} {{ctx.Locale.Tr "repo.branches"}}
|
||||
</a>
|
||||
<a class="branch-tag-item reference column muted" href="#" data-target="#tag-list">
|
||||
{{svg "octicon-tag" 16 "tw-mr-1"}} {{ctx.Locale.Tr "repo.tags"}}
|
||||
</a>
|
||||
</div>
|
||||
<div class="branch-tag-divider"></div>
|
||||
<div id="branch-list" class="scrolling menu reference-list-menu">
|
||||
{{range .Branches}}
|
||||
<div class="item" data-value="refs/heads/{{.}}" title="{{.}}">{{.}}</div>
|
||||
{{else}}
|
||||
<div class="item">{{ctx.Locale.Tr "no_results_found"}}</div>
|
||||
{{end}}
|
||||
</div>
|
||||
<div id="tag-list" class="scrolling menu reference-list-menu tw-hidden">
|
||||
{{range .Tags}}
|
||||
<div class="item" data-value="refs/tags/{{.}}" title="{{.}}">{{.}}</div>
|
||||
{{else}}
|
||||
<div class="item">{{ctx.Locale.Tr "no_results_found"}}</div>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="divider"></div>
|
||||
{{template "repo/actions/workflow_dispatch_inputs" .}}
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,46 @@
|
||||
<div id="runWorkflowDispatchModalInputs">
|
||||
{{if not .WorkflowDispatchConfig}}
|
||||
<div class="ui error message tw-block">{{/* using "ui message" in "ui form" needs to force to display */}}
|
||||
{{if not .CurWorkflowExists}}
|
||||
{{ctx.Locale.Tr "actions.workflow.not_found" $.CurWorkflow}}
|
||||
{{else}}
|
||||
{{ctx.Locale.Tr "actions.workflow.has_no_workflow_dispatch" $.CurWorkflow}}
|
||||
{{end}}
|
||||
</div>
|
||||
{{else}}
|
||||
{{range $item := .WorkflowDispatchConfig.Inputs}}
|
||||
<div class="ui field {{if .Required}}required{{end}}">
|
||||
{{if eq .Type "choice"}}
|
||||
<label>{{or .Description .Name}}:</label>
|
||||
<select class="ui selection dropdown" name="{{.Name}}">
|
||||
{{range .Options}}
|
||||
<option value="{{.}}" {{if eq $item.Default .}}selected{{end}}>{{.}}</option>
|
||||
{{end}}
|
||||
</select>
|
||||
{{else if eq .Type "boolean"}}
|
||||
<label class="tw-flex flex-text-inline">
|
||||
<input type="checkbox" name="{{.Name}}" {{if eq .Default "true"}}checked{{end}}>
|
||||
{{or .Description .Name}}
|
||||
</label>
|
||||
{{else if eq .Type "number"}}
|
||||
<label>{{or .Description .Name}}:</label>
|
||||
<input name="{{.Name}}" value="{{.Default}}" {{if .Required}}required{{end}}>
|
||||
{{else}}
|
||||
<label>{{or .Description .Name}}:</label>
|
||||
<input name="{{.Name}}" value="{{.Default}}" {{if .Required}}required{{end}}>
|
||||
{{end}}
|
||||
</div>
|
||||
{{end}}
|
||||
<div class="ui field">
|
||||
{{/* use autofocus here to prevent the "branch selection" dropdown from getting focus, otherwise it will auto popup */}}
|
||||
<button class="ui tiny primary button" autofocus type="submit">{{ctx.Locale.Tr "actions.workflow.run"}}</button>
|
||||
</div>
|
||||
{{end}}
|
||||
{{range .workflows}}
|
||||
{{if and .ErrMsg (eq .Entry.Name $.CurWorkflow)}}
|
||||
<div class="ui field">
|
||||
<div>{{svg "octicon-alert" 16 "tw-text-red"}} {{.ErrMsg}}</div>
|
||||
</div>
|
||||
{{end}}
|
||||
{{end}}
|
||||
</div>
|
||||
@@ -0,0 +1,17 @@
|
||||
{{template "base/head" .}}
|
||||
<div role="main" aria-label="{{.Title}}" class="page-content repository commits">
|
||||
{{template "repo/header" .}}
|
||||
<div class="ui container flex-container">
|
||||
<div class="flex-container-nav">
|
||||
{{template "repo/navbar" .}}
|
||||
</div>
|
||||
<div class="flex-container-main" data-ref-issue-container>
|
||||
{{if .PageIsPulse}}{{template "repo/pulse" .}}{{end}}
|
||||
{{if .PageIsContributors}}{{template "repo/contributors" .}}{{end}}
|
||||
{{if .PageIsCodeFrequency}}{{template "repo/code_frequency" .}}{{end}}
|
||||
{{if .PageIsRecentCommits}}{{template "repo/recent_commits" .}}{{end}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{template "base/footer" .}}
|
||||
|
||||
@@ -0,0 +1,88 @@
|
||||
{{if or .UsesIgnoreRevs .FaultyIgnoreRevsFile}}
|
||||
{{$revsFileLink := print .RepoLink "/src/" .RefTypeNameSubURL "/.git-blame-ignore-revs"}}
|
||||
{{if .UsesIgnoreRevs}}
|
||||
<div class="ui info message">
|
||||
<p>{{ctx.Locale.Tr "repo.blame.ignore_revs" $revsFileLink "?bypass-blame-ignore=true"}}</p>
|
||||
</div>
|
||||
{{else}}
|
||||
<div class="ui error message">
|
||||
<p>{{ctx.Locale.Tr "repo.blame.ignore_revs.failed" $revsFileLink}}</p>
|
||||
</div>
|
||||
{{end}}
|
||||
{{end}}
|
||||
<div class="{{TabSizeClass .Editorconfig .FileTreePath}} non-diff-file-content">
|
||||
<h4 class="file-header ui top attached header flex-left-right">
|
||||
<div class="file-header-left tw-flex tw-items-center tw-py-2 tw-pr-4">
|
||||
{{template "repo/file_info" .}}
|
||||
</div>
|
||||
<div class="file-header-right file-actions tw-flex tw-items-center tw-flex-wrap">
|
||||
<div class="ui buttons">
|
||||
<a class="ui tiny button" href="{{$.RawFileLink}}">{{ctx.Locale.Tr "repo.file_raw"}}</a>
|
||||
{{if or .RefFullName.IsBranch .RefFullName.IsTag}}
|
||||
<a class="ui tiny button" href="{{.RepoLink}}/src/commit/{{.CommitID | PathEscape}}/{{.TreePath | PathEscapeSegments}}">{{ctx.Locale.Tr "repo.file_permalink"}}</a>
|
||||
{{end}}
|
||||
<a class="ui tiny button" href="{{.RepoLink}}/src/{{.RefTypeNameSubURL}}/{{.TreePath | PathEscapeSegments}}">{{ctx.Locale.Tr "repo.normal_view"}}</a>
|
||||
<a class="ui tiny button" href="{{.RepoLink}}/commits/{{.RefTypeNameSubURL}}/{{.TreePath | PathEscapeSegments}}">{{ctx.Locale.Tr "repo.file_history"}}</a>
|
||||
<button class="ui tiny button unescape-button">{{ctx.Locale.Tr "repo.unescape_control_characters"}}</button>
|
||||
<button class="ui tiny button escape-button tw-hidden">{{ctx.Locale.Tr "repo.escape_control_characters"}}</button>
|
||||
</div>
|
||||
</div>
|
||||
</h4>
|
||||
<div class="ui bottom attached table unstackable segment">
|
||||
<div class="file-view code-view unicode-escaped">
|
||||
{{if .IsFileTooLarge}}
|
||||
{{template "shared/filetoolarge" dict "RawFileLink" .RawFileLink}}
|
||||
{{else if not .FileSize}}
|
||||
{{template "shared/fileisempty"}}
|
||||
{{else}}
|
||||
<table>
|
||||
<tbody>
|
||||
{{range $row := .BlameRows}}
|
||||
<tr class="{{if $row.CommitURL}}top-line-blame{{end}}">
|
||||
<td class="lines-commit">
|
||||
<div class="blame-info">
|
||||
<div class="blame-data">
|
||||
<div class="blame-avatar">
|
||||
{{$row.Avatar}}
|
||||
</div>
|
||||
<div class="blame-message muted-links" title="{{$row.CommitMessage}}">
|
||||
{{ctx.RenderUtils.RenderCommitMessageLinkSubject $row.CommitMessage $row.CommitURL $.Repository}}
|
||||
</div>
|
||||
<div class="blame-time not-mobile">
|
||||
{{$row.CommitSince}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class="lines-blame-btn">
|
||||
{{if $row.PreviousSha}}
|
||||
<a role="button" class="muted" href="{{$row.PreviousShaURL}}" data-tooltip-content='{{ctx.Locale.Tr "repo.blame_prior"}}'>
|
||||
{{svg "octicon-versions"}}
|
||||
</a>
|
||||
{{end}}
|
||||
</td>
|
||||
<td class="lines-num">
|
||||
<span id="L{{$row.RowNumber}}" data-line-number="{{$row.RowNumber}}"></span>
|
||||
</td>
|
||||
|
||||
{{ctx.RenderUtils.RenderUnicodeEscapeToggleTd $.EscapeStatus $row.EscapeStatus}}
|
||||
|
||||
<td rel="L{{$row.RowNumber}}" class="lines-code blame-code chroma">
|
||||
<code class="code-inner tw-pl-2">{{$row.Code}}</code>
|
||||
</td>
|
||||
</tr>
|
||||
{{end}}
|
||||
</tbody>
|
||||
</table>
|
||||
{{end}}{{/* end if .IsFileTooLarge */}}
|
||||
<div class="code-line-menu tippy-target">
|
||||
{{/*FIXME: the "HasSourceRenderedToggle" is never set on blame page, it should mean "whether the file is renderable".
|
||||
If the file is renderable, then it must has the "display=source" parameter to make sure the file view page shows the source code, then line number works. */}}
|
||||
{{if $.Permission.CanRead ctx.Consts.RepoUnitTypeIssues}}
|
||||
<a class="item ref-in-new-issue" role="menuitem" data-url-issue-new="{{.RepoLink}}/issues/new" data-url-param-body-link="{{.Repository.Link}}/src/commit/{{PathEscape .CommitID}}/{{PathEscapeSegments .TreePath}}{{if $.HasSourceRenderedToggle}}?display=source{{end}}" rel="nofollow noindex">{{ctx.Locale.Tr "repo.issues.context.reference_issue"}}</a>
|
||||
{{end}}
|
||||
<a class="item copy-line-permalink" role="menuitem" data-url="{{.Repository.Link}}/src/commit/{{PathEscape .CommitID}}/{{PathEscapeSegments .TreePath}}{{if $.HasSourceRenderedToggle}}?display=source{{end}}">{{ctx.Locale.Tr "repo.file_copy_permalink"}}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,266 @@
|
||||
{{template "base/head" .}}
|
||||
<div role="main" aria-label="{{.Title}}" class="page-content ui repository branches">
|
||||
{{template "repo/header" .}}
|
||||
<div class="ui container">
|
||||
{{template "base/alert" .}}
|
||||
{{template "repo/sub_menu" .}}
|
||||
{{if .DefaultBranchBranch}}
|
||||
<h4 class="ui top attached header">
|
||||
{{ctx.Locale.Tr "repo.default_branch"}}
|
||||
{{if and $.IsWriter $.Repository.CanContentChange (not .IsDeleted)}}
|
||||
<a role="button" class="right" href="{{.RepoLink}}/settings/branches" data-tooltip-content="{{ctx.Locale.Tr "repo.settings.branches.switch_default_branch"}}">
|
||||
{{svg "octicon-arrow-switch"}}
|
||||
</a>
|
||||
{{end}}
|
||||
</h4>
|
||||
|
||||
<div class="ui attached table segment">
|
||||
<table class="ui very basic fixed table single line">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<div class="flex-text-block">
|
||||
<a class="gt-ellipsis branch-name" href="{{.RepoLink}}/src/branch/{{PathEscapeSegments .DefaultBranchBranch.DBBranch.Name}}">{{.DefaultBranchBranch.DBBranch.Name}}</a>
|
||||
{{if .DefaultBranchBranch.IsProtected}}
|
||||
<span data-tooltip-content="{{ctx.Locale.Tr "repo.settings.protected_branch"}}">{{svg "octicon-shield-lock"}}</span>
|
||||
{{end}}
|
||||
<button class="btn interact-fg tw-px-1" data-clipboard-text="{{.DefaultBranchBranch.DBBranch.Name}}" data-tooltip-content="{{ctx.Locale.Tr "copy_branch"}}">{{svg "octicon-copy" 14}}</button>
|
||||
{{template "repo/commit_statuses" dict "Status" (index $.CommitStatus .DefaultBranchBranch.DBBranch.CommitID) "Statuses" (index $.CommitStatuses .DefaultBranchBranch.DBBranch.CommitID)}}
|
||||
</div>
|
||||
<p class="info tw-flex tw-items-center tw-my-1">{{svg "octicon-git-commit" 16 "tw-mr-1"}}<a href="{{.RepoLink}}/commit/{{PathEscape .DefaultBranchBranch.DBBranch.CommitID}}">{{ShortSha .DefaultBranchBranch.DBBranch.CommitID}}</a> · <span class="commit-message">{{ctx.RenderUtils.RenderCommitMessage .DefaultBranchBranch.DBBranch.CommitMessage .Repository}}</span> · {{ctx.Locale.Tr "org.repo_updated"}} {{DateUtils.TimeSince .DefaultBranchBranch.DBBranch.CommitTime}}{{if .DefaultBranchBranch.DBBranch.Pusher}} {{template "shared/user/avatarlink" dict "user" .DefaultBranchBranch.DBBranch.Pusher}}{{template "shared/user/namelink" .DefaultBranchBranch.DBBranch.Pusher}}{{end}}</p>
|
||||
</td>
|
||||
<td>
|
||||
<div class="tw-flex tw-flex-wrap tw-justify-end">
|
||||
{{if and $.IsWriter $.Repository.CanContentChange (not .IsDeleted)}}
|
||||
<button class="btn interact-bg show-create-branch-modal tw-p-2"
|
||||
data-modal="#create-branch-modal"
|
||||
data-branch-from="{{$.DefaultBranchBranch.DBBranch.Name}}"
|
||||
data-branch-from-urlcomponent="{{PathEscapeSegments $.DefaultBranchBranch.DBBranch.Name}}"
|
||||
data-tooltip-content="{{ctx.Locale.Tr "repo.branch.new_branch_from" ($.DefaultBranchBranch.DBBranch.Name)}}"
|
||||
>
|
||||
{{svg "octicon-git-branch"}}
|
||||
</button>
|
||||
{{end}}
|
||||
{{if .EnableFeed}}
|
||||
<a role="button" class="btn interact-bg tw-p-2" href="{{$.RepoLink}}/rss/branch/{{PathEscapeSegments .DefaultBranchBranch.DBBranch.Name}}" data-tooltip-content="{{ctx.Locale.Tr "rss_feed"}}">{{svg "octicon-rss"}}</a>
|
||||
{{end}}
|
||||
{{if not $.DisableDownloadSourceArchives}}
|
||||
<div class="ui dropdown btn interact-bg tw-p-2" data-tooltip-content="{{ctx.Locale.Tr "repo.branch.download" ($.DefaultBranchBranch.DBBranch.Name)}}">
|
||||
{{svg "octicon-download"}}
|
||||
<div class="menu">
|
||||
<a class="item archive-link" href="{{$.RepoLink}}/archive/{{PathEscapeSegments $.DefaultBranchBranch.DBBranch.Name}}.zip" rel="nofollow">{{svg "octicon-file-zip"}} ZIP</a>
|
||||
<a class="item archive-link" href="{{$.RepoLink}}/archive/{{PathEscapeSegments $.DefaultBranchBranch.DBBranch.Name}}.tar.gz" rel="nofollow">{{svg "octicon-file-zip"}} TAR.GZ</a>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
{{if and $.IsWriter $.Repository.CanContentChange (not .IsDeleted)}}
|
||||
<button class="btn interact-bg tw-p-2 show-modal show-rename-branch-modal"
|
||||
data-is-default-branch="true"
|
||||
data-modal="#rename-branch-modal"
|
||||
data-old-branch-name="{{$.DefaultBranchBranch.DBBranch.Name}}"
|
||||
data-tooltip-content="{{ctx.Locale.Tr "repo.branch.rename" ($.DefaultBranchBranch.DBBranch.Name)}}"
|
||||
>
|
||||
{{svg "octicon-pencil"}}
|
||||
</button>
|
||||
{{end}}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
<h4 class="ui top attached header">
|
||||
{{ctx.Locale.Tr "repo.branches"}}
|
||||
</h4>
|
||||
|
||||
<div class="ui attached segment">
|
||||
<form class="ignore-dirty" method="get">
|
||||
{{template "shared/search/combo" dict "Value" .Keyword "Placeholder" (ctx.Locale.Tr "search.branch_kind")}}
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="ui attached table segment">
|
||||
<table class="ui very basic fixed table single line">
|
||||
<tbody>
|
||||
{{range .Branches}}
|
||||
<tr>
|
||||
<td class="eight wide">
|
||||
{{if .DBBranch.IsDeleted}}
|
||||
<div class="flex-text-block">
|
||||
<span class="gt-ellipsis branch-name">{{.DBBranch.Name}}</span>
|
||||
<button class="btn interact-fg tw-px-1" data-clipboard-text="{{.DBBranch.Name}}" data-tooltip-content="{{ctx.Locale.Tr "copy_branch"}}">{{svg "octicon-copy" 14}}</button>
|
||||
</div>
|
||||
<p class="info">{{ctx.Locale.Tr "repo.branch.deleted_by" .DBBranch.DeletedBy.Name}} {{DateUtils.TimeSince .DBBranch.DeletedUnix}}</p>
|
||||
{{else}}
|
||||
<div class="flex-text-block">
|
||||
<a class="gt-ellipsis branch-name" href="{{$.RepoLink}}/src/branch/{{PathEscapeSegments .DBBranch.Name}}">{{.DBBranch.Name}}</a>
|
||||
{{if .IsProtected}}
|
||||
<span data-tooltip-content="{{ctx.Locale.Tr "repo.settings.protected_branch"}}">{{svg "octicon-shield-lock"}}</span>
|
||||
{{end}}
|
||||
<button class="btn interact-fg tw-px-1" data-clipboard-text="{{.DBBranch.Name}}" data-tooltip-content="{{ctx.Locale.Tr "copy_branch"}}">{{svg "octicon-copy" 14}}</button>
|
||||
{{template "repo/commit_statuses" dict "Status" (index $.CommitStatus .DBBranch.CommitID) "Statuses" (index $.CommitStatuses .DBBranch.CommitID)}}
|
||||
</div>
|
||||
<p class="info tw-flex tw-items-center tw-my-1">{{svg "octicon-git-commit" 16 "tw-mr-1"}}<a href="{{$.RepoLink}}/commit/{{PathEscape .DBBranch.CommitID}}">{{ShortSha .DBBranch.CommitID}}</a> · <span class="commit-message">{{ctx.RenderUtils.RenderCommitMessage .DBBranch.CommitMessage $.Repository}}</span> · {{ctx.Locale.Tr "org.repo_updated"}} {{DateUtils.TimeSince .DBBranch.CommitTime}}{{if .DBBranch.Pusher}} {{template "shared/user/avatarlink" dict "user" .DBBranch.Pusher}} {{template "shared/user/namelink" .DBBranch.Pusher}}{{end}}</p>
|
||||
{{end}}
|
||||
</td>
|
||||
<td class="two wide">
|
||||
{{if and (not .DBBranch.IsDeleted) $.DefaultBranchBranch}}
|
||||
{{$tooltipDivergence := ""}}
|
||||
{{if or .CommitsBehind .CommitsAhead}}
|
||||
{{$tooltipDivergence = ctx.Locale.Tr "repo.branch.commits_divergence_from" .CommitsBehind .CommitsAhead $.DefaultBranchBranch.DBBranch.Name}}
|
||||
{{else}}
|
||||
{{$tooltipDivergence = ctx.Locale.Tr "repo.branch.commits_no_divergence" $.DefaultBranchBranch.DBBranch.Name}}
|
||||
{{end}}
|
||||
<div class="commit-divergence" data-tooltip-content="{{$tooltipDivergence}}">
|
||||
<div class="bar-group">
|
||||
<div class="count count-behind">{{.CommitsBehind}}</div>
|
||||
{{/* old code bears 0/0.0 = NaN output, so it might output invalid "width: NaNpx", it just works and doesn't cause any problem. */}}
|
||||
<div class="bar bar-behind" style="width: {{Eval 100 "*" .CommitsBehind "/" "(" .CommitsBehind "+" .CommitsAhead "+" 0.0 ")"}}%"></div>
|
||||
</div>
|
||||
<div class="bar-group">
|
||||
<div class="count count-ahead">{{.CommitsAhead}}</div>
|
||||
<div class="bar bar-ahead" style="width: {{Eval 100 "*" .CommitsAhead "/" "(" .CommitsBehind "+" .CommitsAhead "+" 0.0 ")"}}%"></div>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
</td>
|
||||
<td class="three wide tw-text-right">
|
||||
{{if not .LatestPullRequest}}
|
||||
{{if .IsIncluded}}
|
||||
<span class="ui orange large label" data-tooltip-content="{{ctx.Locale.Tr "repo.branch.included_desc"}}">
|
||||
{{svg "octicon-git-pull-request"}} {{ctx.Locale.Tr "repo.branch.included"}}
|
||||
</span>
|
||||
{{else if and (not .DBBranch.IsDeleted) $.AllowsPulls (gt .CommitsAhead 0)}}
|
||||
<a class="ui compact basic button tw-m-0 tw-max-w-full" href="{{$.PullRequestCtx.MakeDefaultCompareLink .DBBranch.Name}}?expand=1">
|
||||
<span class="gt-ellipsis">{{if $.CanPull}}{{ctx.Locale.Tr "repo.pulls.compare_changes"}}{{else}}{{ctx.Locale.Tr "action.compare_branch"}}{{end}}</span>
|
||||
</a>
|
||||
{{end}}
|
||||
{{else if and .LatestPullRequest.HasMerged .MergeMovedOn}}
|
||||
{{if and (not .DBBranch.IsDeleted) $.AllowsPulls (gt .CommitsAhead 0)}}
|
||||
<a class="ui compact basic button tw-m-0 tw-max-w-full" href="{{$.PullRequestCtx.MakeDefaultCompareLink .DBBranch.Name}}?expand=1">
|
||||
<span class="gt-ellipsis">{{if $.CanPull}}{{ctx.Locale.Tr "repo.pulls.compare_changes"}}{{else}}{{ctx.Locale.Tr "action.compare_branch"}}{{end}}</span>
|
||||
</a>
|
||||
{{end}}
|
||||
{{else}}
|
||||
<a href="{{.LatestPullRequest.Issue.Link}}" class="tw-align-middle ref-issue">{{if not .LatestPullRequest.IsSameRepo}}{{.LatestPullRequest.BaseRepo.FullName}}{{end}}#{{.LatestPullRequest.Issue.Index}}</a>
|
||||
{{if .LatestPullRequest.HasMerged}}
|
||||
<a href="{{.LatestPullRequest.Issue.Link}}" class="ui purple large label">{{svg "octicon-git-merge" 16 "tw-mr-1"}}{{ctx.Locale.Tr "repo.pulls.merged"}}</a>
|
||||
{{else if .LatestPullRequest.Issue.IsClosed}}
|
||||
<a href="{{.LatestPullRequest.Issue.Link}}" class="ui red large label">{{svg "octicon-git-pull-request-closed" 16 "tw-mr-1"}}{{ctx.Locale.Tr "repo.issues.closed_title"}}</a>
|
||||
{{else}}
|
||||
<a href="{{.LatestPullRequest.Issue.Link}}" class="ui green large label">{{svg "octicon-git-pull-request" 16 "tw-mr-1"}}{{ctx.Locale.Tr "repo.issues.open_title"}}</a>
|
||||
{{end}}
|
||||
{{end}}
|
||||
</td>
|
||||
<td class="three wide">
|
||||
<div class="tw-flex tw-flex-wrap tw-justify-end">
|
||||
{{if and $.IsWriter $.Repository.CanContentChange (not .DBBranch.IsDeleted)}}
|
||||
<button class="btn interact-bg tw-p-2 show-modal show-create-branch-modal"
|
||||
data-branch-from="{{.DBBranch.Name}}"
|
||||
data-branch-from-urlcomponent="{{PathEscapeSegments .DBBranch.Name}}"
|
||||
data-tooltip-content="{{ctx.Locale.Tr "repo.branch.new_branch_from" .DBBranch.Name}}"
|
||||
data-modal="#create-branch-modal" data-name="{{.DBBranch.Name}}"
|
||||
>
|
||||
{{svg "octicon-git-branch"}}
|
||||
</button>
|
||||
{{end}}
|
||||
{{if $.EnableFeed}}
|
||||
<a role="button" class="btn interact-bg tw-p-2" href="{{$.RepoLink}}/rss/branch/{{PathEscapeSegments .DBBranch.Name}}" data-tooltip-content="{{ctx.Locale.Tr "rss_feed"}}">{{svg "octicon-rss"}}</a>
|
||||
{{end}}
|
||||
{{if and (not .DBBranch.IsDeleted) (not $.DisableDownloadSourceArchives)}}
|
||||
<div class="ui dropdown btn interact-bg tw-p-2" data-tooltip-content="{{ctx.Locale.Tr "repo.branch.download" (.DBBranch.Name)}}">
|
||||
{{svg "octicon-download"}}
|
||||
<div class="menu">
|
||||
<a class="item archive-link" href="{{$.RepoLink}}/archive/{{PathEscapeSegments .DBBranch.Name}}.zip" rel="nofollow">{{svg "octicon-file-zip"}} ZIP</a>
|
||||
<a class="item archive-link" href="{{$.RepoLink}}/archive/{{PathEscapeSegments .DBBranch.Name}}.tar.gz" rel="nofollow">{{svg "octicon-file-zip"}} TAR.GZ</a>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
{{if and $.IsWriter $.Repository.CanContentChange (not .DBBranch.IsDeleted)}}
|
||||
<button class="btn interact-bg tw-p-2 show-modal show-rename-branch-modal"
|
||||
data-is-default-branch="false"
|
||||
data-old-branch-name="{{.DBBranch.Name}}"
|
||||
data-modal="#rename-branch-modal"
|
||||
data-tooltip-content="{{ctx.Locale.Tr "repo.branch.rename" (.DBBranch.Name)}}"
|
||||
>
|
||||
{{svg "octicon-pencil"}}
|
||||
</button>
|
||||
{{end}}
|
||||
{{if and $.IsWriter $.Repository.CanContentChange (not .IsProtected)}}
|
||||
{{if .DBBranch.IsDeleted}}
|
||||
<button class="btn interact-bg tw-p-2 link-action restore-branch-button" data-url="{{$.Link}}/restore?branch_id={{.DBBranch.ID}}&name={{.DBBranch.Name}}&page={{$.Page.Paginater.Current}}" data-tooltip-content="{{ctx.Locale.Tr "repo.branch.restore" (.DBBranch.Name)}}">
|
||||
<span class="tw-text-blue">
|
||||
{{svg "octicon-reply"}}
|
||||
</span>
|
||||
</button>
|
||||
{{else}}
|
||||
<button class="btn interact-bg tw-p-2 delete-button delete-branch-button" data-url="{{$.Link}}/delete?name={{.DBBranch.Name}}&page={{$.Page.Paginater.Current}}" data-tooltip-content="{{ctx.Locale.Tr "repo.branch.delete" (.DBBranch.Name)}}" data-name="{{.DBBranch.Name}}">
|
||||
{{svg "octicon-trash"}}
|
||||
</button>
|
||||
{{end}}
|
||||
{{end}}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{{end}}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{{template "base/paginate" .}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="ui g-modal-confirm delete modal">
|
||||
<div class="header">
|
||||
{{svg "octicon-trash"}}
|
||||
{{ctx.Locale.Tr "repo.branch.delete_html"}} <span class="name"></span>
|
||||
</div>
|
||||
<div class="content">
|
||||
<p>{{ctx.Locale.Tr "repo.branch.delete_desc"}}</p>
|
||||
</div>
|
||||
{{template "base/modal_actions_confirm" .}}
|
||||
</div>
|
||||
|
||||
<div class="ui mini modal" id="create-branch-modal">
|
||||
<div class="header">
|
||||
{{ctx.Locale.Tr "repo.branch.new_branch"}}
|
||||
</div>
|
||||
|
||||
<form class="ui form" id="create-branch-form" action="" data-base-action="{{.Link}}/_new/branch/" method="post">
|
||||
<div class="content">
|
||||
<div class="field">
|
||||
{{ctx.Locale.Tr "repo.branch.create_new_branch"}}
|
||||
<span id="modal-create-branch-from-span"></span>
|
||||
</div>
|
||||
<div class="required field">
|
||||
<label for="new_branch_name">{{ctx.Locale.Tr "repo.branch.name"}}</label>
|
||||
<input id="new_branch_name" name="new_branch_name" required>
|
||||
</div>
|
||||
</div>
|
||||
{{template "base/modal_actions_confirm" (dict "ModalButtonTypes" "confirm")}}
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="ui mini modal" id="rename-branch-modal">
|
||||
<div class="header">
|
||||
{{ctx.Locale.Tr "repo.settings.rename_branch"}}
|
||||
</div>
|
||||
<form class="ui form" action="{{$.Repository.Link}}/branches/rename" method="post">
|
||||
<div class="content">
|
||||
<div class="field default-branch-warning">
|
||||
<span class="tw-text-red">{{ctx.Locale.Tr "repo.branch.warning_rename_default_branch"}}</span>
|
||||
</div>
|
||||
<div class="field">
|
||||
<span class="text" data-rename-branch-to="{{ctx.Locale.Tr "repo.branch.rename_branch_to"}}"></span>
|
||||
</div>
|
||||
<input name="from" type="hidden" required>
|
||||
<div class="required field">
|
||||
<input name="to" required>
|
||||
</div>
|
||||
</div>
|
||||
{{template "base/modal_actions_confirm" (dict "ModalButtonTypes" "confirm")}}
|
||||
</form>
|
||||
</div>
|
||||
{{template "base/footer" .}}
|
||||
@@ -0,0 +1,68 @@
|
||||
{{/* Attributes:
|
||||
* ContainerClasses
|
||||
* Repository
|
||||
* CurrentRefType: eg. "branch", "tag", "commit"
|
||||
* CurrentRefShortName: eg. "master", "v1.0", "abcdef0123"
|
||||
* CurrentTreePath
|
||||
* RefLinkTemplate: redirect to the link when a branch/tag is selected
|
||||
* RefFormActionTemplate: change the parent form's action when a branch/tag is selected
|
||||
* DropdownFixedText: the text to show in the dropdown (mainly used by "release page"), if empty, the text will be the branch/tag name
|
||||
* ShowTabBranches
|
||||
* ShowTabTagsTab
|
||||
* AllowCreateNewRef
|
||||
* ShowViewAllRefsEntry
|
||||
|
||||
Search "repo/branch_dropdown" in the template directory to find all occurrences.
|
||||
*/}}
|
||||
<div class="{{if .ContainerClasses}}{{.ContainerClasses}}{{end}}"
|
||||
data-global-init="initRepoBranchTagSelector"
|
||||
data-text-release-compare="{{ctx.Locale.Tr "repo.release.compare"}}"
|
||||
data-text-branches="{{ctx.Locale.Tr "repo.branches"}}"
|
||||
data-text-tags="{{ctx.Locale.Tr "repo.tags"}}"
|
||||
data-text-filter-branch="{{ctx.Locale.Tr "repo.pulls.filter_branch"}}"
|
||||
data-text-filter-tag="{{ctx.Locale.Tr "repo.find_tag"}}"
|
||||
data-text-default-branch-label="{{ctx.Locale.Tr "repo.default_branch_label"}}"
|
||||
data-text-create-tag="{{ctx.Locale.Tr "repo.tag.create_tag"}}"
|
||||
data-text-create-branch="{{ctx.Locale.Tr "repo.branch.create_branch"}}"
|
||||
data-text-create-ref-from="{{ctx.Locale.Tr "repo.branch.create_from"}}"
|
||||
data-text-no-results="{{ctx.Locale.Tr "no_results_found"}}"
|
||||
data-text-view-all-branches="{{ctx.Locale.Tr "repo.view_all_branches"}}"
|
||||
data-text-view-all-tags="{{ctx.Locale.Tr "repo.view_all_tags"}}"
|
||||
|
||||
data-current-repo-default-branch="{{.Repository.DefaultBranch}}"
|
||||
data-current-repo-link="{{.Repository.Link}}"
|
||||
data-current-tree-path="{{.CurrentTreePath}}"
|
||||
data-current-ref-type="{{.CurrentRefType}}"
|
||||
data-current-ref-short-name="{{.CurrentRefShortName}}"
|
||||
|
||||
data-ref-link-template="{{.RefLinkTemplate}}"
|
||||
data-ref-form-action-template="{{.RefFormActionTemplate}}"
|
||||
data-dropdown-fixed-text="{{.DropdownFixedText}}"
|
||||
data-show-tab-branches="{{.ShowTabBranches}}"
|
||||
data-show-tab-tags="{{.ShowTabTags}}"
|
||||
data-allow-create-new-ref="{{.AllowCreateNewRef}}"
|
||||
data-show-view-all-refs-entry="{{.ShowViewAllRefsEntry}}"
|
||||
|
||||
data-enable-feed="{{ctx.RootData.EnableFeed}}"
|
||||
>
|
||||
{{/* show dummy elements before Vue componment is mounted, this code must match the code in BranchTagSelector.vue */}}
|
||||
<div class="ui dropdown custom branch-selector-dropdown ellipsis-text-items">
|
||||
<div class="ui compact button branch-dropdown-button">
|
||||
<span class="flex-text-block gt-ellipsis">
|
||||
{{if .DropdownFixedText}}
|
||||
{{.DropdownFixedText}}
|
||||
{{else}}
|
||||
{{if eq .CurrentRefType "tag"}}
|
||||
{{svg "octicon-tag"}}
|
||||
{{else if eq .CurrentRefType "branch"}}
|
||||
{{svg "octicon-git-branch"}}
|
||||
{{else}}
|
||||
{{svg "octicon-git-commit"}}
|
||||
{{end}}
|
||||
<strong class="tw-inline-block gt-ellipsis">{{.CurrentRefShortName}}</strong>
|
||||
{{end}}
|
||||
</span>
|
||||
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,11 @@
|
||||
<button class="ui citation button" id="citation-copy-apa" data-text="">
|
||||
APA
|
||||
</button>
|
||||
<button class="ui citation button" id="citation-copy-bibtex" data-text="">
|
||||
BibTeX
|
||||
</button>
|
||||
<!-- the value will be updated by initCitationFileCopyContent, the code below is used to avoid UI flicking -->
|
||||
<input id="citation-copy-content" value="" size="1" readonly>
|
||||
<button class="ui icon button" id="citation-clipboard-btn" data-tooltip-content="{{ctx.Locale.Tr "copy"}}" data-clipboard-target="#citation-copy-content">
|
||||
{{svg "octicon-copy"}}
|
||||
</button>
|
||||
@@ -0,0 +1,20 @@
|
||||
<div class="ui small modal" id="cite-repo-modal">
|
||||
<div class="header">
|
||||
{{ctx.Locale.Tr "repo.cite_this_repo"}}
|
||||
</div>
|
||||
<div class="content">
|
||||
<div class="ui stackable secondary menu">
|
||||
<div class="ui action input" id="citation-panel">
|
||||
{{template "repo/cite/cite_buttons" .}}
|
||||
<a id="goto-citation-btn" class="ui basic jump icon button" href="{{$.RepoLink}}/src/{{$.BranchName}}/CITATION.cff" data-tooltip-content="{{ctx.Locale.Tr "repo.find_file.go_to_file"}}">
|
||||
{{svg "octicon-file-moved"}}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<button class="ui cancel button">
|
||||
{{ctx.Locale.Tr "cancel"}}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,13 @@
|
||||
<!-- there is always at least one button (guaranteed by context/repo.go) -->
|
||||
<div class="ui action small input clone-buttons-combo">
|
||||
{{if $.CloneButtonShowHTTPS}}
|
||||
<button class="ui small button repo-clone-https" data-link="{{$.CloneButtonOriginLink.HTTPS}}">HTTPS</button>
|
||||
{{end}}
|
||||
{{if $.CloneButtonShowSSH}}
|
||||
<button class="ui small button repo-clone-ssh" data-link="{{$.CloneButtonOriginLink.SSH}}">SSH</button>
|
||||
{{end}}
|
||||
<input size="10" class="repo-clone-url js-clone-url" value="{{$.CloneButtonOriginLink.HTTPS}}" readonly>
|
||||
<button class="ui small icon button" data-clipboard-target=".repo-clone-url" data-tooltip-content="{{ctx.Locale.Tr "copy_url"}}">
|
||||
{{svg "octicon-copy" 14}}
|
||||
</button>
|
||||
</div>
|
||||
@@ -0,0 +1,48 @@
|
||||
<button class="ui compact primary button js-btn-clone-panel">
|
||||
{{svg "octicon-code" 16}}
|
||||
<span>{{ctx.Locale.Tr "repo.code"}}</span>
|
||||
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
||||
</button>
|
||||
<div class="clone-panel-popup tippy-target">
|
||||
<div class="flex-text-block clone-panel-field">{{svg "octicon-terminal"}} Clone</div>
|
||||
|
||||
<div class="clone-panel-tab">
|
||||
<!-- there is always at least one button (guaranteed by context/repo.go) -->
|
||||
{{if $.CloneButtonShowHTTPS}}
|
||||
<button class="item repo-clone-https" data-link="{{$.CloneButtonOriginLink.HTTPS}}">HTTPS</button>
|
||||
{{end}}
|
||||
{{if $.CloneButtonShowSSH}}
|
||||
<button class="item repo-clone-ssh" data-link="{{$.CloneButtonOriginLink.SSH}}">SSH</button>
|
||||
{{end}}
|
||||
<button class="item repo-clone-tea" data-link="{{$.CloneButtonOriginLink.Tea}}">Tea CLI</button>
|
||||
</div>
|
||||
<div class="divider"></div>
|
||||
|
||||
<div class="clone-panel-field">
|
||||
<div class="ui input tiny action">
|
||||
<input size="30" class="repo-clone-url js-clone-url" value="{{$.CloneButtonOriginLink.HTTPS}}" readonly>
|
||||
<div class="ui small compact icon button" data-clipboard-target=".js-clone-url" data-tooltip-content="{{ctx.Locale.Tr "copy_url"}}">
|
||||
{{svg "octicon-copy" 14}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{if not .PageIsWiki}}
|
||||
<div class="flex-items-block clone-panel-list">
|
||||
{{range .OpenWithEditorApps}}
|
||||
<a class="item muted js-clone-url-editor" data-href-template="{{.OpenURL}}">{{.IconHTML}}{{ctx.Locale.Tr "repo.open_with_editor" .DisplayName}}</a>
|
||||
{{end}}
|
||||
</div>
|
||||
|
||||
{{if and (not $.DisableDownloadSourceArchives) $.RefFullName}}
|
||||
<div class="divider"></div>
|
||||
<div class="flex-items-block clone-panel-list">
|
||||
{{/* FIXME: here it only uses the shortname in the ref to build the link, it can't distinguish the branch/tag/commit with the same name
|
||||
in the future, it's better to use something like "/archive/branch/the-name.zip", "/archive/tag/the-name.zip" */}}
|
||||
<a class="item muted archive-link" href="{{$.RepoLink}}/archive/{{PathEscapeSegments $.RefFullName.ShortName}}.zip" rel="nofollow">{{svg "octicon-file-zip"}} {{ctx.Locale.Tr "repo.download_zip"}}</a>
|
||||
<a class="item muted archive-link" href="{{$.RepoLink}}/archive/{{PathEscapeSegments $.RefFullName.ShortName}}.tar.gz" rel="nofollow">{{svg "octicon-file-zip"}} {{ctx.Locale.Tr "repo.download_tar"}}</a>
|
||||
<a class="item muted archive-link" href="{{$.RepoLink}}/archive/{{PathEscapeSegments $.RefFullName.ShortName}}.bundle" rel="nofollow">{{svg "octicon-package"}} {{ctx.Locale.Tr "repo.download_bundle"}}</a>
|
||||
</div>
|
||||
{{end}}
|
||||
{{end}}
|
||||
</div>
|
||||
@@ -0,0 +1,18 @@
|
||||
{{/* Template Attributes:
|
||||
* RecentBranchesPromptData
|
||||
*/}}
|
||||
{{$data := .RecentBranchesPromptData}}
|
||||
{{if $data}}
|
||||
{{range $recentBranch := $data.RecentlyPushedNewBranches}}
|
||||
<div class="ui positive message flex-text-block">
|
||||
<div class="tw-flex-1">
|
||||
{{$timeSince := DateUtils.TimeSince $recentBranch.PushedTime}}
|
||||
{{$branchLink := HTMLFormat `<a href="%s">%s</a>` $recentBranch.BranchLink .BranchDisplayName}}
|
||||
{{ctx.Locale.Tr "repo.pulls.recently_pushed_new_branches" $branchLink $timeSince}}
|
||||
</div>
|
||||
<a role="button" class="ui compact green button" href="{{QueryBuild $recentBranch.BranchCompareURL "expand" 1}}">
|
||||
{{ctx.Locale.Tr "repo.pulls.compare_changes"}}
|
||||
</a>
|
||||
</div>
|
||||
{{end}}
|
||||
{{end}}
|
||||
@@ -0,0 +1,23 @@
|
||||
{{if and .UpstreamDivergingInfo .UpstreamDivergingInfo.BaseBranchHasNewCommits}}
|
||||
<div class="ui message flex-text-block">
|
||||
<div class="tw-flex-1">
|
||||
{{$upstreamLink := printf "%s/src/branch/%s" .Repository.BaseRepo.Link (.UpstreamDivergingInfo.BaseBranchName|PathEscapeSegments)}}
|
||||
{{$upstreamRepoBranchDisplay := HTMLFormat "%s:%s" .Repository.BaseRepo.FullName .UpstreamDivergingInfo.BaseBranchName}}
|
||||
{{$thisRepoBranchDisplay := HTMLFormat "%s:%s" .Repository.FullName .BranchName}}
|
||||
{{$upstreamHtml := HTMLFormat `<a href="%s">%s</a>` $upstreamLink $upstreamRepoBranchDisplay}}
|
||||
{{if .UpstreamDivergingInfo.HeadBranchCommitsBehind}}
|
||||
{{ctx.Locale.TrN .UpstreamDivergingInfo.HeadBranchCommitsBehind "repo.pulls.upstream_diverging_prompt_behind_1" "repo.pulls.upstream_diverging_prompt_behind_n" .UpstreamDivergingInfo.HeadBranchCommitsBehind $upstreamHtml}}
|
||||
{{else}}
|
||||
{{ctx.Locale.Tr "repo.pulls.upstream_diverging_prompt_base_newer" $upstreamHtml}}
|
||||
{{end}}
|
||||
</div>
|
||||
{{if .CanWriteCode}}
|
||||
<button class="ui compact primary button tw-m-0 link-action"
|
||||
data-modal-confirm-header="{{ctx.Locale.Tr "repo.pulls.upstream_diverging_merge"}}"
|
||||
data-modal-confirm-content="{{ctx.Locale.Tr "repo.pulls.upstream_diverging_merge_confirm" $upstreamRepoBranchDisplay $thisRepoBranchDisplay}}"
|
||||
data-url="{{.Repository.Link}}/branches/merge-upstream?branch={{.BranchName}}">
|
||||
{{ctx.Locale.Tr "repo.pulls.upstream_diverging_merge"}}
|
||||
</button>
|
||||
{{end}}
|
||||
</div>
|
||||
{{end}}
|
||||
@@ -0,0 +1,9 @@
|
||||
{{if .Permission.CanRead ctx.Consts.RepoUnitTypeCode}}
|
||||
<div id="repo-code-frequency-chart"
|
||||
data-locale-loading-title="{{ctx.Locale.Tr "graphs.component_loading" (ctx.Locale.Tr "graphs.code_frequency.what")}}"
|
||||
data-locale-loading-title-failed="{{ctx.Locale.Tr "graphs.component_loading_failed" (ctx.Locale.Tr "graphs.code_frequency.what")}}"
|
||||
data-locale-loading-info="{{ctx.Locale.Tr "graphs.component_loading_info"}}"
|
||||
data-locale-component-failed-to-load="{{ctx.Locale.Tr "graphs.component_failed_to_load"}}"
|
||||
>
|
||||
</div>
|
||||
{{end}}
|
||||
@@ -0,0 +1,27 @@
|
||||
{{if not .PageIsWiki}}
|
||||
<div class="branch-and-tag-area" data-text-default-branch-tooltip="{{ctx.Locale.Tr "repo.commit.contained_in_default_branch"}}">
|
||||
{{if .MergedPRIssueNumber}}
|
||||
{{$prLink := HTMLFormat `<a class="ref-issue" href="%s/pulls/%d">#%d</a>` $.RepoLink $.MergedPRIssueNumber $.MergedPRIssueNumber}}
|
||||
<div>
|
||||
<div class="divider"></div>
|
||||
<div>{{ctx.Locale.Tr "repo.commit.merged_in_pr" $prLink}}</div>
|
||||
</div>
|
||||
{{end}}
|
||||
<button class="ui button ellipsis-button load-branches-and-tags tw-mt-2" aria-expanded="false"
|
||||
data-url="{{.RepoLink}}/commit/{{.CommitID}}/load-branches-and-tags"
|
||||
data-tooltip-content="{{ctx.Locale.Tr "repo.commit.load_referencing_branches_and_tags"}}"
|
||||
>...</button>
|
||||
<div class="branch-and-tag-detail tw-hidden">
|
||||
<div class="divider"></div>
|
||||
<div>{{ctx.Locale.Tr "repo.commit.contained_in"}}</div>
|
||||
<div class="tw-flex tw-mt-2">
|
||||
<div class="tw-p-1">{{svg "octicon-git-branch"}}</div>
|
||||
<div class="branch-area flex-text-block tw-flex-wrap tw-flex-1"></div>
|
||||
</div>
|
||||
<div class="tw-flex tw-mt-2">
|
||||
<div class="tw-p-1">{{svg "octicon-tag"}}</div>
|
||||
<div class="tag-area flex-text-block tw-flex-wrap tw-flex-1"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
@@ -0,0 +1,205 @@
|
||||
{{template "base/head" .}}
|
||||
{{$commitLinkBase := print $.RepoLink (Iif $.PageIsWiki "/wiki" "") "/commit"}}
|
||||
<div role="main" aria-label="{{.Title}}" class="page-content repository diff">
|
||||
{{template "repo/header" .}}
|
||||
<div class="ui container fluid padded">
|
||||
<div class="ui top attached header clearing segment tw-relative commit-header">
|
||||
<div class="tw-flex tw-mb-4 tw-gap-1">
|
||||
<h3 class="tw-mb-0 tw-flex-1"><span class="commit-summary" title="{{.Commit.MessageTitle}}">{{ctx.RenderUtils.RenderCommitMessage .Commit.MessageUTF8 $.Repository}}</span>{{template "repo/commit_statuses" dict "Status" .CommitStatus "Statuses" .CommitStatuses "AdditionalClasses" "tw-inline"}}</h3>
|
||||
{{if not $.PageIsWiki}}
|
||||
<div class="commit-header-buttons">
|
||||
<a class="ui primary tiny button" href="{{.SourcePath}}">
|
||||
{{ctx.Locale.Tr "repo.diff.browse_source"}}
|
||||
</a>
|
||||
{{if and ($.Permission.CanWrite ctx.Consts.RepoUnitTypeCode) (not $.Repository.IsArchived) (not .IsDeleted)}}{{- /* */ -}}
|
||||
<div class="ui dropdown primary tiny button">
|
||||
{{ctx.Locale.Tr "repo.commit.operations"}}
|
||||
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
||||
<div class="menu">
|
||||
<div class="header">{{ctx.Locale.Tr "repo.commit.operations"}}</div>
|
||||
<div class="divider"></div>
|
||||
<div class="item show-create-branch-modal"
|
||||
data-content="{{ctx.Locale.Tr "repo.branch.new_branch_from" (.CommitID)}}" {{/* used by the form */}}
|
||||
data-branch-from="{{ShortSha .CommitID}}"
|
||||
data-branch-from-urlcomponent="{{.CommitID}}"
|
||||
data-modal="#create-branch-modal">
|
||||
{{ctx.Locale.Tr "repo.branch.create_branch_operation"}}
|
||||
</div>
|
||||
<div class="item show-create-branch-modal"
|
||||
data-content="{{ctx.Locale.Tr "repo.branch.new_branch_from" (.CommitID)}}" {{/* used by the form */}}
|
||||
data-branch-from="{{ShortSha .CommitID}}"
|
||||
data-branch-from-urlcomponent="{{.CommitID}}"
|
||||
data-modal="#create-tag-modal"
|
||||
data-modal-from-span="#modal-create-tag-from-span"
|
||||
data-modal-form="#create-tag-form">
|
||||
{{ctx.Locale.Tr "repo.tag.create_tag_operation"}}
|
||||
</div>
|
||||
<div class="item show-modal revert-button"
|
||||
data-modal="#cherry-pick-modal"
|
||||
data-modal-cherry-pick-type="revert"
|
||||
data-modal-cherry-pick-header="{{ctx.Locale.Tr "repo.commit.revert-header" (ShortSha .CommitID)}}"
|
||||
data-modal-cherry-pick-content="{{ctx.Locale.Tr "repo.commit.revert-content"}}"
|
||||
data-modal-cherry-pick-submit="{{ctx.Locale.Tr "repo.commit.revert"}}">{{ctx.Locale.Tr "repo.commit.revert"}}</div>
|
||||
<div class="item cherry-pick-button show-modal"
|
||||
data-modal="#cherry-pick-modal"
|
||||
data-modal-cherry-pick-type="cherry-pick"
|
||||
data-modal-cherry-pick-header="{{ctx.Locale.Tr "repo.commit.cherry-pick-header" (ShortSha .CommitID)}}"
|
||||
data-modal-cherry-pick-content="{{ctx.Locale.Tr "repo.commit.cherry-pick-content"}}"
|
||||
data-modal-cherry-pick-submit="{{ctx.Locale.Tr "repo.commit.cherry-pick"}}">{{ctx.Locale.Tr "repo.commit.cherry-pick"}}</div>
|
||||
<div class="ui g-modal-confirm modal" id="cherry-pick-modal">
|
||||
<div class="header">
|
||||
<span id="cherry-pick-header"></span>
|
||||
</div>
|
||||
<div class="content">
|
||||
<p id="cherry-pick-content" class="branch-dropdown"></p>
|
||||
|
||||
<form method="get">
|
||||
{{template "repo/branch_dropdown" dict
|
||||
"Repository" .Repository
|
||||
"ShowTabBranches" true
|
||||
"CurrentRefType" "branch"
|
||||
"CurrentRefShortName" $.Repository.DefaultBranch
|
||||
"RefFormActionTemplate" (print "{RepoLink}/_cherrypick/" .CommitID "/{RefShortName}")
|
||||
}}
|
||||
<input type="hidden" id="cherry-pick-type" name="cherry-pick-type"><br>
|
||||
<button type="submit" id="cherry-pick-submit" class="ui primary button"></button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ui small modal" id="create-branch-modal">
|
||||
<div class="header">
|
||||
{{ctx.Locale.Tr "repo.branch.new_branch"}}
|
||||
</div>
|
||||
<div class="content">
|
||||
<form class="ui form" id="create-branch-form" action="" data-base-action="{{.RepoLink}}/branches/_new/commit/" method="post">
|
||||
<div class="field">
|
||||
<label>
|
||||
{{ctx.Locale.Tr "repo.branch.new_branch_from" (HTMLFormat `<span class="%s" id="%s"></span>` "text" "modal-create-branch-from-span")}}
|
||||
</label>
|
||||
</div>
|
||||
<div class="required field">
|
||||
<label for="new_branch_name">{{ctx.Locale.Tr "repo.branch.name"}}</label>
|
||||
<input id="new_branch_name" name="new_branch_name" required>
|
||||
</div>
|
||||
|
||||
<div class="actions">
|
||||
<button class="ui cancel button">{{ctx.Locale.Tr "settings.cancel"}}</button>
|
||||
<button class="ui primary button">{{ctx.Locale.Tr "repo.branch.confirm_create_branch"}}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ui small modal" id="create-tag-modal">
|
||||
<div class="header">
|
||||
{{ctx.Locale.Tr "repo.tag.create_tag_operation"}}
|
||||
</div>
|
||||
<div class="content">
|
||||
<form class="ui form" id="create-tag-form" action="" data-base-action="{{.RepoLink}}/branches/_new/commit/" method="post">
|
||||
<input type="hidden" name="create_tag" value="true">
|
||||
<div class="field">
|
||||
<label>
|
||||
{{ctx.Locale.Tr "repo.tag.create_tag_from" (HTMLFormat `<span class="%s" id="%s"></span>` "text" "modal-create-tag-from-span")}}
|
||||
</label>
|
||||
</div>
|
||||
<div class="required field">
|
||||
<label for="new_branch_name">{{ctx.Locale.Tr "repo.release.tag_name"}}</label>
|
||||
<input id="new_branch_name" name="new_branch_name" required>
|
||||
</div>
|
||||
|
||||
<div class="actions">
|
||||
<button class="ui cancel button">{{ctx.Locale.Tr "settings.cancel"}}</button>
|
||||
<button class="ui primary button">{{ctx.Locale.Tr "repo.tag.confirm_create_tag"}}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
{{if .Commit.MessageBody}}
|
||||
<pre class="commit-body">{{ctx.RenderUtils.RenderCommitBody .Commit.MessageUTF8 $.Repository}}</pre>
|
||||
{{end}}
|
||||
{{template "repo/commit_load_branches_and_tags" .}}
|
||||
</div>
|
||||
|
||||
<div class="ui bottom attached segment flex-text-block tw-flex-wrap">
|
||||
<div class="flex-text-inline">
|
||||
{{if .Author}}
|
||||
{{ctx.AvatarUtils.Avatar .Author 20}}
|
||||
{{if .Author.FullName}}
|
||||
<a href="{{.Author.HomeLink}}"><strong>{{.Author.FullName}}</strong></a>
|
||||
{{else}}
|
||||
<a href="{{.Author.HomeLink}}"><strong>{{.Commit.Author.Name}}</strong></a>
|
||||
{{end}}
|
||||
{{else}}
|
||||
{{ctx.AvatarUtils.AvatarByEmail .Commit.Author.Email .Commit.Author.Email 20}}
|
||||
<strong>{{.Commit.Author.Name}}</strong>
|
||||
{{end}}
|
||||
</div>
|
||||
|
||||
<span class="tw-text-text-light">{{DateUtils.TimeSince .Commit.Author.When}}</span>
|
||||
|
||||
<div class="flex-text-inline">
|
||||
{{if or (ne .Commit.Committer.Name .Commit.Author.Name) (ne .Commit.Committer.Email .Commit.Author.Email)}}
|
||||
<span class="tw-text-text-light">{{ctx.Locale.Tr "repo.diff.committed_by"}}</span>
|
||||
{{if and .Verification.CommittingUser .Verification.CommittingUser.ID}}
|
||||
{{ctx.AvatarUtils.Avatar .Verification.CommittingUser 20}}
|
||||
<a href="{{.Verification.CommittingUser.HomeLink}}"><strong>{{.Commit.Committer.Name}}</strong></a>
|
||||
{{else}}
|
||||
{{ctx.AvatarUtils.AvatarByEmail .Commit.Committer.Email .Commit.Committer.Name 20}}
|
||||
<strong>{{.Commit.Committer.Name}}</strong>
|
||||
{{end}}
|
||||
{{end}}
|
||||
</div>
|
||||
|
||||
{{if .Verification}}
|
||||
{{template "repo/commit_sign_badge" dict "CommitSignVerification" .Verification}}
|
||||
{{end}}
|
||||
|
||||
<div class="tw-flex-1"></div>
|
||||
|
||||
<div class="flex-text-inline tw-gap-5">
|
||||
{{if .Parents}}
|
||||
<div class="flex-text-inline">
|
||||
<span>{{ctx.Locale.Tr "repo.diff.parent"}}</span>
|
||||
{{range .Parents}}
|
||||
<a class="ui label commit-id-short" href="{{$commitLinkBase}}/{{PathEscape .}}">{{ShortSha .}}</a>
|
||||
{{end}}
|
||||
</div>
|
||||
{{end}}
|
||||
<div class="flex-text-inline">
|
||||
<span>{{ctx.Locale.Tr "repo.diff.commit"}}</span>
|
||||
<a class="ui label commit-id-short" href="{{$commitLinkBase}}/{{PathEscape .CommitID}}">{{ShortSha .CommitID}}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{if .NoteRendered}}
|
||||
<div class="ui top attached header segment git-notes">
|
||||
{{svg "octicon-note" 16 "tw-mr-2"}}
|
||||
{{ctx.Locale.Tr "repo.diff.git-notes"}}:
|
||||
{{if .NoteAuthor}}
|
||||
<a href="{{.NoteAuthor.HomeLink}}">
|
||||
{{if .NoteAuthor.FullName}}
|
||||
<strong>{{.NoteAuthor.FullName}}</strong>
|
||||
{{else}}
|
||||
<strong>{{.NoteCommit.Author.Name}}</strong>
|
||||
{{end}}
|
||||
</a>
|
||||
{{else}}
|
||||
<strong>{{.NoteCommit.Author.Name}}</strong>
|
||||
{{end}}
|
||||
<span class="tw-text-text-light">{{DateUtils.TimeSince .NoteCommit.Author.When}}</span>
|
||||
</div>
|
||||
<div class="ui bottom attached info segment git-notes">
|
||||
<pre class="commit-body">{{.NoteRendered}}</pre>
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
{{template "repo/diff/box" .}}
|
||||
</div>
|
||||
</div>
|
||||
{{template "base/footer" .}}
|
||||
@@ -0,0 +1,81 @@
|
||||
{{/* Template attributes:
|
||||
* Commit
|
||||
* CommitBaseLink
|
||||
* CommitSignVerification
|
||||
If you'd like to modify this template, you could test it on the devtest page.
|
||||
ATTENTION: this template could be re-rendered many times (on the graph and commit list page),
|
||||
so this template should be kept as small as possible, DO NOT put large components like modal/dialog into it.
|
||||
*/}}
|
||||
{{- $commit := $.Commit -}}
|
||||
{{- $commitBaseLink := $.CommitBaseLink -}}
|
||||
{{- $verification := $.CommitSignVerification -}}{{- /* asymkey.CommitVerification */ -}}
|
||||
|
||||
{{- $extraClass := "" -}}
|
||||
{{- $verified := false -}}
|
||||
{{- $signingUser := NIL -}}
|
||||
{{- $signingEmail := "" -}}
|
||||
{{- $msgReasonPrefix := "" -}}
|
||||
{{- $msgReason := "" -}}
|
||||
{{- $msgSigningKey := "" -}}
|
||||
|
||||
{{- if $verification -}}
|
||||
{{- $signingUser = $verification.SigningUser -}}
|
||||
{{- $signingEmail = $verification.SigningEmail -}}
|
||||
{{- $extraClass = print $extraClass " commit-is-signed" -}}
|
||||
{{- if $verification.Verified -}}
|
||||
{{- /* reason is "{name} / {key-id}" */ -}}
|
||||
{{- $msgReason = $verification.Reason -}}
|
||||
{{- $verified = true -}}
|
||||
{{- if eq $verification.TrustStatus "trusted" -}}
|
||||
{{- $extraClass = print $extraClass " sign-trusted" -}}
|
||||
{{- else if eq $verification.TrustStatus "untrusted" -}}
|
||||
{{- $extraClass = print $extraClass " sign-untrusted" -}}
|
||||
{{- $msgReasonPrefix = ctx.Locale.Tr "repo.commits.signed_by_untrusted_user" -}}
|
||||
{{- else -}}
|
||||
{{- $extraClass = print $extraClass " sign-unmatched" -}}
|
||||
{{- $msgReasonPrefix = ctx.Locale.Tr "repo.commits.signed_by_untrusted_user_unmatched" -}}
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
{{- if $verification.Warning -}}
|
||||
{{- $extraClass = print $extraClass " sign-warning" -}}
|
||||
{{- else -}}
|
||||
{{- $extraClass = "" -}}{{/* the commit is not signed */}}
|
||||
{{- end -}}
|
||||
{{- $msgReason = ctx.Locale.Tr $verification.Reason -}}{{- /* dirty part: it is the translation key ..... */ -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if $msgReasonPrefix -}}
|
||||
{{- $msgReason = print $msgReasonPrefix ": " $msgReason -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if $verification.SigningSSHKey -}}
|
||||
{{- $msgSigningKey = print (ctx.Locale.Tr "repo.commits.ssh_key_fingerprint") ": " $verification.SigningSSHKey.Fingerprint -}}
|
||||
{{- else if $verification.SigningKey -}}{{- /* asymkey.GPGKey */ -}}
|
||||
{{- $msgSigningKey = print (ctx.Locale.Tr "repo.commits.gpg_key_id") ": " $verification.SigningKey.PaddedKeyID -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if $commit -}}
|
||||
<a {{if $commitBaseLink}}href="{{$commitBaseLink}}/{{$commit.ID}}"{{end}} class="ui label commit-id-short {{$extraClass}}" rel="nofollow">
|
||||
{{- ShortSha $commit.ID.String -}}
|
||||
{{- end -}}
|
||||
{{- if or (not $commit) $extraClass}}{{/* only show the lock icon if there is no commit info (icon only) or the commit is really signed */}}
|
||||
<span class="ui label commit-sign-badge {{$extraClass}}">
|
||||
{{- if $verified -}}
|
||||
{{- if and $signingUser $signingUser.ID -}}
|
||||
<span data-tooltip-content="{{$msgReason}}">{{svg "gitea-lock"}}</span>
|
||||
<span data-tooltip-content="{{$msgSigningKey}}">{{ctx.AvatarUtils.Avatar $signingUser 16}}</span>
|
||||
{{- else -}}
|
||||
<span data-tooltip-content="{{$msgReason}}">{{svg "gitea-lock-cog"}}</span>
|
||||
<span data-tooltip-content="{{$msgSigningKey}}">{{ctx.AvatarUtils.AvatarByEmail $signingEmail "" 16}}</span>
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
<span data-tooltip-content="{{$msgReason}}">{{svg "gitea-unlock"}}</span>
|
||||
{{- end -}}
|
||||
</span>
|
||||
{{- end -}}
|
||||
{{- if $commit -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* This template should be kept as small as possible, DO NOT put large components like modal/dialog into it. */ -}}
|
||||
@@ -0,0 +1,16 @@
|
||||
{{if .Statuses}}
|
||||
{{if and (eq (len .Statuses) 1) .Status.TargetURL}}
|
||||
<a class="flex-text-inline tw-no-underline {{.AdditionalClasses}}" data-global-init="initCommitStatuses" href="{{.Status.TargetURL}}">
|
||||
{{template "repo/icons/commit_status" .Status}}
|
||||
</a>
|
||||
{{else}}
|
||||
<span class="flex-text-inline {{.AdditionalClasses}}" data-global-init="initCommitStatuses" tabindex="0">
|
||||
{{template "repo/icons/commit_status" .Status}}
|
||||
</span>
|
||||
{{end}}
|
||||
<div class="tippy-target">
|
||||
<div class="flex-divided-list items-px-default">
|
||||
{{template "repo/pulls/status_items" (dict "CommitStatuses" .Statuses)}}
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
@@ -0,0 +1,28 @@
|
||||
{{template "base/head" .}}
|
||||
<div role="main" aria-label="{{.Title}}" class="page-content repository commits">
|
||||
{{template "repo/header" .}}
|
||||
<div class="ui container">
|
||||
{{template "repo/sub_menu" .}}
|
||||
<div class="repo-button-row">
|
||||
<div class="repo-button-row-left">
|
||||
{{- /* for /owner/repo/commits/{RefType}/{RefShortName} */ -}}
|
||||
{{- template "repo/branch_dropdown" dict
|
||||
"Repository" .Repository
|
||||
"ShowTabBranches" true
|
||||
"ShowTabTags" true
|
||||
"CurrentRefType" .RefFullName.RefType
|
||||
"CurrentRefShortName" .RefFullName.ShortName
|
||||
"CurrentTreePath" .TreePath
|
||||
"RefLinkTemplate" "{RepoLink}/commits/{RefType}/{RefShortName}/{TreePath}"
|
||||
"AllowCreateNewRef" .CanCreateBranch
|
||||
-}}
|
||||
<a href="{{.RepoLink}}/graph" class="ui basic small compact button">
|
||||
{{svg "octicon-git-branch"}}
|
||||
{{ctx.Locale.Tr "repo.commit_graph"}}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
{{template "repo/commits_table" .}}
|
||||
</div>
|
||||
</div>
|
||||
{{template "base/footer" .}}
|
||||
@@ -0,0 +1,90 @@
|
||||
<div class="ui attached table segment commit-table">
|
||||
<table class="ui very basic table unstackable" id="commits-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="three wide">{{ctx.Locale.Tr "repo.commits.author"}}</th>
|
||||
<th class="two wide sha">{{StringUtils.ToUpper $.Repository.ObjectFormatName}}</th>
|
||||
<th class="eight wide message">{{ctx.Locale.Tr "repo.commits.message"}}</th>
|
||||
<th class="two wide tw-text-right">{{ctx.Locale.Tr "repo.commits.date"}}</th>
|
||||
<th class="one wide"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="commit-list">
|
||||
{{$commitRepoLink := $.RepoLink}}{{if $.CommitRepoLink}}{{$commitRepoLink = $.CommitRepoLink}}{{end}}
|
||||
{{range $commit := .Commits}}
|
||||
<tr>
|
||||
<td class="author">
|
||||
<span class="author-wrapper">
|
||||
{{- if .User -}}
|
||||
{{- ctx.AvatarUtils.Avatar .User 20 "tw-mr-2" -}}
|
||||
{{- .User.GetShortDisplayNameLinkHTML -}}
|
||||
{{- else -}}
|
||||
{{- ctx.AvatarUtils.AvatarByEmail .Author.Email .Author.Name 20 "tw-mr-2" -}}
|
||||
{{- .Author.Name -}}
|
||||
{{- end -}}
|
||||
</span>
|
||||
</td>
|
||||
<td class="sha">
|
||||
{{$commitBaseLink := ""}}
|
||||
{{if $.PageIsWiki}}
|
||||
{{$commitBaseLink = printf "%s/wiki/commit" $commitRepoLink}}
|
||||
{{else if $.PageIsPullCommits}}
|
||||
{{$commitBaseLink = printf "%s/pulls/%d/commits" $commitRepoLink $.Issue.Index}}
|
||||
{{else}}
|
||||
{{$commitBaseLink = printf "%s/commit" $commitRepoLink}}
|
||||
{{end}}
|
||||
{{template "repo/commit_sign_badge" dict "Commit" . "CommitBaseLink" $commitBaseLink "CommitSignVerification" .Verification}}
|
||||
</td>
|
||||
<td class="message">
|
||||
<span class="message-wrapper">
|
||||
{{if $.PageIsWiki}}
|
||||
<span class="commit-summary {{if gt $commit.ParentCount 1}} grey text{{end}}" title="{{$commit.MessageTitle}}">
|
||||
{{$commit.MessageTitle | ctx.RenderUtils.RenderEmoji}}
|
||||
</span>
|
||||
{{else}}
|
||||
{{$commitLink:= printf "%s/commit/%s" $commitRepoLink (PathEscape $commit.ID.String)}}
|
||||
<span class="commit-summary {{if gt $commit.ParentCount 1}} grey text{{end}}" title="{{$commit.MessageTitle}}">
|
||||
{{ctx.RenderUtils.RenderCommitMessageLinkSubject $commit.MessageUTF8 $commitLink $.Repository}}
|
||||
</span>
|
||||
{{end}}
|
||||
</span>
|
||||
{{if $commit.MessageBody}}
|
||||
<button class="ui button ellipsis-button" aria-expanded="false" data-global-click="onRepoEllipsisButtonClick">...</button>
|
||||
{{end}}
|
||||
{{template "repo/commit_statuses" dict "Status" .Status "Statuses" .Statuses}}
|
||||
{{if $commit.MessageBody}}
|
||||
<pre class="commit-body tw-hidden">{{ctx.RenderUtils.RenderCommitBody $commit.MessageUTF8 $.Repository}}</pre>
|
||||
{{end}}
|
||||
{{if $.CommitsTagsMap}}
|
||||
{{range (index $.CommitsTagsMap .ID.String)}}
|
||||
{{- template "repo/tag/name" dict "AdditionalClasses" "tw-py-0" "RepoLink" $.Repository.Link "TagName" .TagName "IsRelease" (not .IsTag) -}}
|
||||
{{end}}
|
||||
{{end}}
|
||||
</td>
|
||||
{{if .Committer}}
|
||||
<td class="tw-text-right">{{DateUtils.TimeSince .Committer.When}}</td>
|
||||
{{else}}
|
||||
<td class="tw-text-right">{{DateUtils.TimeSince .Author.When}}</td>
|
||||
{{end}}
|
||||
<td class="tw-text-right tw-py-0">
|
||||
<button class="btn interact-bg tw-p-2 copy-commit-id" data-tooltip-content="{{ctx.Locale.Tr "copy_hash"}}" data-clipboard-text="{{.ID}}">{{svg "octicon-copy"}}</button>
|
||||
{{/* at the moment, wiki doesn't support these "view" links like "view at history point" */}}
|
||||
{{if not $.PageIsWiki}}
|
||||
{{/* view single file diff */}}
|
||||
{{if $.FileTreePath}}
|
||||
<a class="btn interact-bg tw-p-2 view-single-diff" data-tooltip-content="{{ctx.Locale.Tr "repo.commits.view_file_diff"}}"
|
||||
href="{{$commitRepoLink}}/commit/{{.ID.String}}?files={{$.FileTreePath}}"
|
||||
>{{svg "octicon-file-diff"}}</a>
|
||||
{{end}}
|
||||
|
||||
{{/* view at history point */}}
|
||||
{{$viewCommitLink := printf "%s/src/commit/%s" $commitRepoLink (PathEscape .ID.String)}}
|
||||
{{if $.FileTreePath}}{{$viewCommitLink = printf "%s/%s" $viewCommitLink (PathEscapeSegments $.FileTreePath)}}{{end}}
|
||||
<a class="btn interact-bg tw-p-2 view-commit-path" data-tooltip-content="{{ctx.Locale.Tr "repo.commits.view_path"}}" href="{{$viewCommitLink}}">{{svg "octicon-file-code"}}</a>
|
||||
{{end}}
|
||||
</td>
|
||||
</tr>
|
||||
{{end}}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@@ -0,0 +1,36 @@
|
||||
{{$index := 0}}
|
||||
<div class="timeline-item commits-list">
|
||||
{{range $commit := .comment.Commits}}
|
||||
{{$tag := printf "%s-%d" $.comment.HashTag $index}}
|
||||
{{$index = Eval $index "+" 1}}
|
||||
<div class="flex-text-block" id="{{$tag}}">{{/*singular-commit*/}}
|
||||
<span class="badge badge-commit">{{svg "octicon-git-commit"}}</span>
|
||||
{{if .User}}
|
||||
<a class="avatar" href="{{.User.HomeLink}}">{{ctx.AvatarUtils.Avatar .User 20}}</a>
|
||||
{{else}}
|
||||
{{ctx.AvatarUtils.AvatarByEmail .Author.Email .Author.Name 20}}
|
||||
{{end}}
|
||||
|
||||
{{$commitBaseLink := printf "%s/commit" $.comment.Issue.PullRequest.BaseRepo.Link}}
|
||||
{{$commitLink:= printf "%s/%s" $commitBaseLink (PathEscape .ID.String)}}
|
||||
|
||||
<span class="tw-flex-1 tw-font-mono gt-ellipsis" title="{{$commit.MessageTitle}}">
|
||||
{{- ctx.RenderUtils.RenderCommitMessageLinkSubject $commit.MessageUTF8 $commitLink $.comment.Issue.PullRequest.BaseRepo -}}
|
||||
</span>
|
||||
|
||||
{{if $commit.MessageBody}}
|
||||
<button class="ui button ellipsis-button show-panel toggle" data-panel="[data-singular-commit-body-for='{{$tag}}']">...</button>
|
||||
{{end}}
|
||||
|
||||
<span class="flex-text-block">
|
||||
{{template "repo/commit_statuses" dict "Status" .Status "Statuses" .Statuses}}
|
||||
{{template "repo/commit_sign_badge" dict "Commit" . "CommitBaseLink" $commitBaseLink "CommitSignVerification" .Verification}}
|
||||
</span>
|
||||
</div>
|
||||
{{if $commit.MessageBody}}
|
||||
<pre class="commit-body tw-ml-[33px] tw-hidden" data-singular-commit-body-for="{{$tag}}">
|
||||
{{- ctx.RenderUtils.RenderCommitBody $commit.MessageUTF8 $.comment.Issue.PullRequest.BaseRepo -}}
|
||||
</pre>
|
||||
{{end}}
|
||||
{{end}}
|
||||
</div>
|
||||
@@ -0,0 +1,9 @@
|
||||
{{- /* Template Argument: git.RefName */ -}}
|
||||
{{- $refName := . -}}
|
||||
{{- if $refName.IsBranch -}}
|
||||
{{svg "octicon-git-branch"}} {{$refName.ShortName}}
|
||||
{{- else if $refName.IsTag -}}
|
||||
{{svg "octicon-tag"}} {{$refName.ShortName}}
|
||||
{{- else -}}
|
||||
{{ShortSha $refName.ShortName}}
|
||||
{{- end -}}
|
||||
@@ -0,0 +1,8 @@
|
||||
<div class="ui small dropdown selection">
|
||||
<input name="all" type="hidden" value="{{.All}}">{{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
||||
<div class="text">{{if .All}}{{ctx.Locale.Tr "repo.commits.search_all"}}{{else}}{{ctx.Locale.Tr "repo.commits.search_branch"}}{{end}}</div>
|
||||
<div class="menu">
|
||||
<div class="item" data-value="false">{{ctx.Locale.Tr "repo.commits.search_branch"}}</div>
|
||||
<div class="item" data-value="true">{{ctx.Locale.Tr "repo.commits.search_all"}}</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,36 @@
|
||||
<h4 class="ui top attached header commits-table flex-left-right">
|
||||
<div class="commits-table-left flex-text-block">
|
||||
{{if or .PageIsCommits (gt .CommitCount 0)}}
|
||||
{{.CommitCount}} {{ctx.Locale.Tr "repo.commits.commits"}}
|
||||
{{else if .IsNothingToCompare}}
|
||||
{{ctx.Locale.Tr "repo.commits.nothing_to_compare"}}
|
||||
{{else}}
|
||||
{{ctx.Locale.Tr "repo.commits.no_commits" $.BaseBranch $.HeadBranch}}
|
||||
{{end}}
|
||||
</div>
|
||||
{{if .IsDiffCompare}}
|
||||
<div class="commits-table-right tw-whitespace-nowrap">
|
||||
<a href="{{$.CommitRepoLink}}/commit/{{.BeforeCommitID | PathEscape}}" class="ui green sha label tw-mx-0">{{template "repo/commits_ref_name" .CompareInfo.BaseRef}}</a>
|
||||
{{$.CompareInfo.CompareSeparator}}
|
||||
<a href="{{$.CommitRepoLink}}/commit/{{.AfterCommitID | PathEscape}}" class="ui green sha label tw-mx-0">{{template "repo/commits_ref_name" .CompareInfo.HeadRef}}</a>
|
||||
</div>
|
||||
{{end}}
|
||||
</h4>
|
||||
|
||||
{{if .PageIsCommits}}
|
||||
<div class="ui attached segment">
|
||||
<form class="ignore-dirty" action="{{.RepoLink}}/commits/{{.RefTypeNameSubURL}}/search">
|
||||
<div class="ui small fluid action input">
|
||||
{{template "shared/search/input" dict "Value" .Keyword "Placeholder" (ctx.Locale.Tr "search.commit_kind")}}
|
||||
{{template "repo/commits_search_dropdown" .}}
|
||||
{{template "shared/search/button" dict "Tooltip" (ctx.Locale.Tr "repo.commits.search.tooltip")}}
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
{{if and .Commits (gt .CommitCount 0)}}
|
||||
{{template "repo/commits_list" .}}
|
||||
{{end}}
|
||||
|
||||
{{template "base/paginate" .}}
|
||||
@@ -0,0 +1,16 @@
|
||||
{{if .Permission.CanRead ctx.Consts.RepoUnitTypeCode}}
|
||||
<div id="repo-contributors-chart"
|
||||
data-repo-link="{{.RepoLink}}"
|
||||
data-repo-default-branch-name="{{.Repository.DefaultBranch}}"
|
||||
data-locale-filter-label="{{ctx.Locale.Tr "repo.contributors.contribution_type.filter_label"}}"
|
||||
data-locale-contribution-type-commits="{{ctx.Locale.Tr "repo.contributors.contribution_type.commits"}}"
|
||||
data-locale-contribution-type-additions="{{ctx.Locale.Tr "repo.contributors.contribution_type.additions"}}"
|
||||
data-locale-contribution-type-deletions="{{ctx.Locale.Tr "repo.contributors.contribution_type.deletions"}}"
|
||||
data-locale-loading-title="{{ctx.Locale.Tr "graphs.component_loading" (ctx.Locale.Tr "graphs.contributors.what")}}"
|
||||
data-locale-loading-title-failed="{{ctx.Locale.Tr "graphs.component_loading_failed" (ctx.Locale.Tr "graphs.contributors.what")}}"
|
||||
data-locale-loading-info="{{ctx.Locale.Tr "graphs.component_loading_info"}}"
|
||||
data-locale-component-failed-to-load="{{ctx.Locale.Tr "graphs.component_failed_to_load"}}"
|
||||
data-locale-chart-zoom-hint="{{ctx.Locale.Tr "graphs.chart_zoom_hint"}}"
|
||||
>
|
||||
</div>
|
||||
{{end}}
|
||||
@@ -0,0 +1,218 @@
|
||||
{{template "base/head" .}}
|
||||
<div role="main" aria-label="{{.Title}}" class="page-content repository new-repo">
|
||||
<div class="ui container medium-width">
|
||||
<h3 class="ui top attached header">
|
||||
{{ctx.Locale.Tr "new_repo"}}
|
||||
</h3>
|
||||
<div class="ui attached segment">
|
||||
{{template "base/alert" .}}
|
||||
{{template "repo/create_helper" .}}
|
||||
<form class="ui form left-right-form new-repo-form" action="{{.Link}}" method="post">
|
||||
<div id="create-repo-error-message" class="ui negative message tw-text-center tw-hidden"></div>
|
||||
<div class="inline required field {{if .Err_Owner}}error{{end}}">
|
||||
<label>{{ctx.Locale.Tr "repo.owner"}}</label>
|
||||
<div class="ui selection dropdown ellipsis-text-items" id="repo_owner_dropdown">
|
||||
<input type="hidden" name="uid" value="{{.ContextUser.ID}}">
|
||||
<span class="text"></span>
|
||||
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
||||
<div class="menu">
|
||||
<div class="item" data-value="{{.SignedUser.ID}}" title="{{.SignedUser.Name}}"
|
||||
{{if not .CanCreateRepoInDoer}}
|
||||
data-create-repo-disallowed-prompt="{{ctx.Locale.TrN .MaxCreationLimit "repo.form.reach_limit_of_creation_1" "repo.form.reach_limit_of_creation_n" .MaxCreationLimitOfDoer}}"
|
||||
{{end}}
|
||||
>
|
||||
{{ctx.AvatarUtils.Avatar .SignedUser 28 "mini"}}
|
||||
{{.SignedUser.ShortName 40}}
|
||||
</div>
|
||||
{{range .Orgs}}
|
||||
<div class="item" data-value="{{.ID}}" title="{{.Name}}">
|
||||
{{ctx.AvatarUtils.Avatar . 28 "mini"}}
|
||||
{{.ShortName 40}}
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
<span class="help">{{ctx.Locale.Tr "repo.owner_helper"}}</span>
|
||||
</div>
|
||||
|
||||
<div class="inline required field {{if .Err_RepoName}}error{{end}}">
|
||||
<label for="repo_name">{{ctx.Locale.Tr "repo.repo_name"}}</label>
|
||||
<input id="repo_name" name="repo_name" value="{{.repo_name}}" autofocus required maxlength="100">
|
||||
<span class="help" data-help-for-repo-name>{{ctx.Locale.Tr "repo.repo_name_helper"}}</span>
|
||||
<span class="help tw-hidden" data-help-for-repo-name=".profile">{{ctx.Locale.Tr "repo.repo_name_profile_public_hint"}}</span>
|
||||
<span class="help tw-hidden" data-help-for-repo-name=".profile-private">{{ctx.Locale.Tr "repo.repo_name_profile_private_hint"}}</span>
|
||||
</div>
|
||||
|
||||
<div class="inline field">
|
||||
<label>{{ctx.Locale.Tr "repo.visibility"}}</label>
|
||||
<div class="ui checkbox">
|
||||
{{if .IsForcedPrivate}}
|
||||
<input name="private" type="checkbox" checked disabled>
|
||||
<label>{{ctx.Locale.Tr "repo.visibility_helper_forced"}}</label>
|
||||
{{else}}
|
||||
<input name="private" type="checkbox" {{if .private}}checked{{end}}>
|
||||
<label>{{ctx.Locale.Tr "repo.visibility_helper"}}</label>
|
||||
{{end}}
|
||||
</div>
|
||||
<span class="help">{{ctx.Locale.Tr "repo.visibility_description"}}</span>
|
||||
</div>
|
||||
<div class="inline field {{if .Err_Description}}error{{end}}">
|
||||
<label for="description">{{ctx.Locale.Tr "repo.repo_desc"}}</label>
|
||||
<textarea id="description" rows="2" name="description" placeholder="{{ctx.Locale.Tr "repo.repo_desc_helper"}}" maxlength="2048">{{.description}}</textarea>
|
||||
</div>
|
||||
<div class="inline field">
|
||||
<label>{{ctx.Locale.Tr "repo.template"}}</label>
|
||||
<div id="repo_template_search" class="ui search selection dropdown">
|
||||
<input type="hidden" id="repo_template" name="repo_template" value="{{or .repo_template ""}}">
|
||||
<div class="default text">{{.repo_template_name}}</div>
|
||||
<div class="menu">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="template_units" class="tw-hidden">
|
||||
<div class="inline field">
|
||||
<label>{{ctx.Locale.Tr "repo.template.items"}}</label>
|
||||
<div class="ui checkbox">
|
||||
<input name="git_content" type="checkbox" {{if .git_content}}checked{{end}}>
|
||||
<label>{{ctx.Locale.Tr "repo.template.git_content"}}</label>
|
||||
</div>
|
||||
<div class="ui checkbox" {{if not .SignedUser.CanEditGitHook}}data-tooltip-content="{{ctx.Locale.Tr "repo.template.git_hooks_tooltip"}}"{{end}}>
|
||||
<input name="git_hooks" type="checkbox" {{if .git_hooks}}checked{{end}}>
|
||||
<label>{{ctx.Locale.Tr "repo.template.git_hooks"}}</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="inline field">
|
||||
<label></label>
|
||||
<div class="ui checkbox">
|
||||
<input name="webhooks" type="checkbox" {{if .webhooks}}checked{{end}}>
|
||||
<label>{{ctx.Locale.Tr "repo.template.webhooks"}}</label>
|
||||
</div>
|
||||
<div class="ui checkbox">
|
||||
<input name="topics" type="checkbox" {{if .topics}}checked{{end}}>
|
||||
<label>{{ctx.Locale.Tr "repo.template.topics"}}</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="inline field">
|
||||
<label></label>
|
||||
<div class="ui checkbox">
|
||||
<input name="avatar" type="checkbox" {{if .avatar}}checked{{end}}>
|
||||
<label>{{ctx.Locale.Tr "repo.template.avatar"}}</label>
|
||||
</div>
|
||||
<div class="ui checkbox">
|
||||
<input name="labels" type="checkbox" {{if .labels}}checked{{end}}>
|
||||
<label>{{ctx.Locale.Tr "repo.template.issue_labels"}}</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="inline field">
|
||||
<label></label>
|
||||
<div class="ui checkbox">
|
||||
<input name="protected_branch" type="checkbox" {{if .protected_branch}}checked{{end}}>
|
||||
<label>{{ctx.Locale.Tr "repo.settings.protected_branch"}}</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="non_template">
|
||||
<div class="inline field">
|
||||
<label>{{ctx.Locale.Tr "repo.issue_labels"}}</label>
|
||||
<div class="ui search selection dropdown">
|
||||
<input type="hidden" name="issue_labels" value="{{.issueLabels}}">
|
||||
<div class="default text">{{ctx.Locale.Tr "repo.issue_labels_helper"}}</div>
|
||||
<div class="menu">
|
||||
<div class="item" data-value="">{{ctx.Locale.Tr "repo.issue_labels_helper"}}</div>
|
||||
{{range .LabelTemplateFiles}}
|
||||
<div class="item" data-value="{{.DisplayName}}">{{.DisplayName}}<br><i>({{.Description}})</i></div>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="divider"></div>
|
||||
|
||||
<div class="inline field">
|
||||
<label>.gitignore</label>
|
||||
<div class="ui multiple search selection dropdown">
|
||||
<input type="hidden" name="gitignores" value="{{.gitignores}}">
|
||||
<div class="default text">{{ctx.Locale.Tr "repo.repo_gitignore_helper"}}</div>
|
||||
<div class="menu">
|
||||
{{range .Gitignores}}
|
||||
<div class="item" data-value="{{.}}">{{.}}</div>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
<span class="help">{{ctx.Locale.Tr "repo.repo_gitignore_helper_desc"}}</span>
|
||||
</div>
|
||||
<div class="inline field">
|
||||
<label>{{ctx.Locale.Tr "repo.license"}}</label>
|
||||
<div class="ui search selection dropdown">
|
||||
<input type="hidden" name="license" value="{{.license}}">
|
||||
<div class="default text">{{ctx.Locale.Tr "repo.license_helper"}}</div>
|
||||
<div class="menu">
|
||||
<div class="item" data-value="">{{ctx.Locale.Tr "repo.license_helper"}}</div>
|
||||
{{range .Licenses}}
|
||||
<div class="item" data-value="{{.}}">{{.}}</div>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
<span class="help">{{ctx.Locale.Tr "repo.license_helper_desc" "https://choosealicense.com/"}}</span>
|
||||
</div>
|
||||
|
||||
<div class="inline field">
|
||||
<label>{{ctx.Locale.Tr "repo.readme"}}</label>
|
||||
<div class="ui selection dropdown">
|
||||
<input type="hidden" name="readme" value="{{.readme}}">
|
||||
<div class="default text">{{ctx.Locale.Tr "repo.readme_helper"}}</div>
|
||||
<div class="menu">
|
||||
{{range .Readmes}}
|
||||
<div class="item" data-value="{{.}}">{{.}}</div>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
<span class="help">{{ctx.Locale.Tr "repo.readme_helper_desc"}}</span>
|
||||
</div>
|
||||
<div class="inline field">
|
||||
<label></label>
|
||||
<div class="ui checkbox" id="auto-init">
|
||||
<input name="auto_init" type="checkbox" {{if .auto_init}}checked{{end}}>
|
||||
<label>{{ctx.Locale.Tr "repo.auto_init"}}</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="inline field">
|
||||
<label for="default_branch">{{ctx.Locale.Tr "repo.default_branch"}}</label>
|
||||
<input id="default_branch" name="default_branch" value="{{.default_branch}}" placeholder="{{.default_branch}}">
|
||||
<span class="help">{{ctx.Locale.Tr "repo.default_branch_helper"}}</span>
|
||||
</div>
|
||||
<div class="inline field">
|
||||
<label>{{ctx.Locale.Tr "repo.object_format"}}</label>
|
||||
<div class="ui selection owner dropdown">
|
||||
<input type="hidden" id="object_format_name" name="object_format_name" value="{{or .object_format_name .DefaultObjectFormat.Name}}" required>
|
||||
<div class="default text">{{.DefaultObjectFormat.Name}}</div>
|
||||
<div class="menu">
|
||||
{{range .SupportedObjectFormats}}
|
||||
<div class="item" data-value="{{.Name}}">{{.Name}}</div>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
<span class="help">{{ctx.Locale.Tr "repo.object_format_helper"}}</span>
|
||||
</div>
|
||||
<div class="inline field">
|
||||
<label>{{ctx.Locale.Tr "repo.template"}}</label>
|
||||
<div class="ui checkbox">
|
||||
<input name="template" type="checkbox">
|
||||
<label>{{ctx.Locale.Tr "repo.template_helper"}}</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<div class="inline field">
|
||||
<label></label>
|
||||
<button class="ui primary button">
|
||||
{{ctx.Locale.Tr "repo.create_repo"}}
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{template "base/footer" .}}
|
||||
@@ -0,0 +1,3 @@
|
||||
{{if not $.DisableMigrations}}
|
||||
<p class="ui center">{{ctx.Locale.Tr "repo.new_repo_helper" (print AppSubUrl "/repo/migrate")}}</p>
|
||||
{{end}}
|
||||
@@ -0,0 +1,91 @@
|
||||
{{$diffBlobExcerptData := .DiffBlobExcerptData}}
|
||||
{{$canCreateComment := and ctx.RootData.SignedUserID $diffBlobExcerptData.PullIssueIndex}}
|
||||
{{if $.IsSplitStyle}}
|
||||
{{range $k, $line := $.section.Lines}}
|
||||
<tr class="{{.GetHTMLDiffLineType}}-code nl-{{$k}} ol-{{$k}} line-expanded" data-line-type="{{.GetHTMLDiffLineType}}">
|
||||
{{if eq .GetType 4}}
|
||||
<td class="lines-num lines-num-old">{{$line.RenderBlobExcerptButtons $.FileNameHash $diffBlobExcerptData}}</td>
|
||||
<td colspan="7" class="lines-code lines-code-old">
|
||||
{{- $inlineDiff := $.section.GetComputedInlineDiffFor $line ctx.Locale -}}
|
||||
{{- template "repo/diff/section_code" dict "diff" $inlineDiff -}}
|
||||
</td>
|
||||
{{else}}
|
||||
{{$inlineDiff := $.section.GetComputedInlineDiffFor $line ctx.Locale}}
|
||||
<td class="lines-num lines-num-old" data-line-num="{{if $line.LeftIdx}}{{$line.LeftIdx}}{{end}}"><span rel="{{if $line.LeftIdx}}diff-{{$.FileNameHash}}L{{$line.LeftIdx}}{{end}}"></span></td>
|
||||
<td class="lines-escape lines-escape-old">{{if $line.LeftIdx}}{{ctx.RenderUtils.RenderUnicodeEscapeToggleButton $inlineDiff.EscapeStatus}}{{end}}</td>
|
||||
<td class="lines-type-marker lines-type-marker-old">{{if $line.LeftIdx}}<span class="tw-font-mono" data-type-marker=""></span>{{end}}</td>
|
||||
<td class="lines-code lines-code-old">
|
||||
{{/* ATTENTION: BLOB-EXCERPT-COMMENT-RIGHT: here it intentionally use "right" side to comment, because the backend code depends on the assumption that the comment only happens on right side*/}}
|
||||
{{- if and $canCreateComment $line.RightIdx -}}
|
||||
<button type="button" aria-label="{{ctx.Locale.Tr "repo.diff.comment.add_line_comment"}}" class="ui primary button add-code-comment add-code-comment-right{{if (not $line.CanComment)}} tw-invisible{{end}}" data-side="right" data-idx="{{$line.RightIdx}}">
|
||||
{{- svg "octicon-plus" -}}
|
||||
</button>
|
||||
{{- end -}}
|
||||
{{- if $line.LeftIdx -}}
|
||||
{{- template "repo/diff/section_code" dict "diff" $inlineDiff -}}
|
||||
{{- else -}}
|
||||
<code class="code-inner"></code>
|
||||
{{- end -}}
|
||||
</td>
|
||||
<td class="lines-num lines-num-new" data-line-num="{{if $line.RightIdx}}{{$line.RightIdx}}{{end}}"><span rel="{{if $line.RightIdx}}diff-{{$.FileNameHash}}R{{$line.RightIdx}}{{end}}"></span></td>
|
||||
<td class="lines-escape lines-escape-new">{{if and $line.RightIdx}}{{ctx.RenderUtils.RenderUnicodeEscapeToggleButton $inlineDiff.EscapeStatus}}{{end}}</td>
|
||||
<td class="lines-type-marker lines-type-marker-new">{{if $line.RightIdx}}<span class="tw-font-mono" data-type-marker=""></span>{{end}}</td>
|
||||
<td class="lines-code lines-code-new">
|
||||
{{- if and $canCreateComment $line.RightIdx -}}
|
||||
<button type="button" aria-label="{{ctx.Locale.Tr "repo.diff.comment.add_line_comment"}}" class="ui primary button add-code-comment add-code-comment-right{{if (not $line.CanComment)}} tw-invisible{{end}}" data-side="right" data-idx="{{$line.RightIdx}}">
|
||||
{{- svg "octicon-plus" -}}
|
||||
</button>
|
||||
{{- end -}}
|
||||
{{- if $line.RightIdx -}}
|
||||
{{- template "repo/diff/section_code" dict "diff" $inlineDiff -}}
|
||||
{{- else -}}
|
||||
<code class="code-inner"></code>
|
||||
{{- end -}}
|
||||
</td>
|
||||
{{end}}
|
||||
</tr>
|
||||
{{if $line.Comments}}
|
||||
<tr class="add-comment" data-line-type="{{.GetHTMLDiffLineType}}">
|
||||
<td class="add-comment-left" colspan="4">
|
||||
{{if eq $line.GetCommentSide "previous"}}
|
||||
{{template "repo/diff/conversation" dict "." $ "comments" $line.Comments}}
|
||||
{{end}}
|
||||
</td>
|
||||
<td class="add-comment-right" colspan="4">
|
||||
{{if eq $line.GetCommentSide "proposed"}}
|
||||
{{template "repo/diff/conversation" dict "." $ "comments" $line.Comments}}
|
||||
{{end}}
|
||||
</td>
|
||||
</tr>
|
||||
{{end}}
|
||||
{{end}}
|
||||
{{else}}
|
||||
{{range $k, $line := $.section.Lines}}
|
||||
<tr class="{{.GetHTMLDiffLineType}}-code nl-{{$k}} ol-{{$k}} line-expanded" data-line-type="{{.GetHTMLDiffLineType}}">
|
||||
{{if eq .GetType 4}}
|
||||
<td colspan="2" class="lines-num">{{$line.RenderBlobExcerptButtons $.FileNameHash $diffBlobExcerptData}}</td>
|
||||
{{else}}
|
||||
<td class="lines-num lines-num-old" data-line-num="{{if $line.LeftIdx}}{{$line.LeftIdx}}{{end}}"><span rel="{{if $line.LeftIdx}}diff-{{$.FileNameHash}}L{{$line.LeftIdx}}{{end}}"></span></td>
|
||||
<td class="lines-num lines-num-new" data-line-num="{{if $line.RightIdx}}{{$line.RightIdx}}{{end}}"><span rel="{{if $line.RightIdx}}diff-{{$.FileNameHash}}R{{$line.RightIdx}}{{end}}"></span></td>
|
||||
{{end}}
|
||||
{{$inlineDiff := $.section.GetComputedInlineDiffFor $line ctx.Locale}}
|
||||
<td class="lines-escape">{{ctx.RenderUtils.RenderUnicodeEscapeToggleButton $inlineDiff.EscapeStatus}}</td>
|
||||
<td class="lines-type-marker"><span class="tw-font-mono" data-type-marker="{{$line.GetLineTypeMarker}}"></span></td>
|
||||
<td class="lines-code{{if (not $line.RightIdx)}} lines-code-old{{end}}">
|
||||
{{- if and $canCreateComment -}}
|
||||
<button type="button" aria-label="{{ctx.Locale.Tr "repo.diff.comment.add_line_comment"}}" class="ui primary button add-code-comment add-code-comment-{{if $line.RightIdx}}right{{else}}left{{end}}{{if (not $line.CanComment)}} tw-invisible{{end}}" data-side="{{if $line.RightIdx}}right{{else}}left{{end}}" data-idx="{{if $line.RightIdx}}{{$line.RightIdx}}{{else}}{{$line.LeftIdx}}{{end}}">
|
||||
{{- svg "octicon-plus" -}}
|
||||
</button>
|
||||
{{- end -}}
|
||||
<code class="code-inner {{if $inlineDiff.EscapeStatus.Escaped}}has-escaped{{end}}">{{$inlineDiff.Content}}</code>
|
||||
</td>
|
||||
</tr>
|
||||
{{if $line.Comments}}
|
||||
<tr class="add-comment" data-line-type="{{.GetHTMLDiffLineType}}">
|
||||
<td class="add-comment-left add-comment-right" colspan="5">
|
||||
{{template "repo/diff/conversation" dict "." $ "comments" $line.Comments}}
|
||||
</td>
|
||||
</tr>
|
||||
{{end}}
|
||||
{{end}}
|
||||
{{end}}
|
||||
@@ -0,0 +1,251 @@
|
||||
{{$showFileTree := (and (not .DiffNotAvailable) (gt .DiffShortStat.NumFiles 1))}}
|
||||
<div>
|
||||
<div class="diff-detail-box">
|
||||
<div class="flex-text-block tw-flex-wrap tw-ml-0.5">
|
||||
{{if $showFileTree}}
|
||||
<button class="diff-toggle-file-tree-button not-mobile btn interact-fg" data-show-text="{{ctx.Locale.Tr "repo.diff.show_file_tree"}}" data-hide-text="{{ctx.Locale.Tr "repo.diff.hide_file_tree"}}">
|
||||
{{/* the icon meaning is reversed here, "octicon-sidebar-collapse" means show the file tree */}}
|
||||
{{svg "octicon-sidebar-collapse" 20 "icon tw-hidden"}}
|
||||
{{svg "octicon-sidebar-expand" 20 "icon tw-hidden"}}
|
||||
</button>
|
||||
<script nonce="{{ctx.CspScriptNonce}}">
|
||||
// Default to true if unset
|
||||
const diffTreeVisible = window.localUserSettings.getBoolean('diff_file_tree_visible', true);
|
||||
const diffTreeBtn = document.querySelector('.diff-toggle-file-tree-button');
|
||||
const diffTreeIcon = `.octicon-sidebar-${diffTreeVisible ? 'expand' : 'collapse'}`;
|
||||
diffTreeBtn.querySelector(diffTreeIcon).classList.remove('tw-hidden');
|
||||
diffTreeBtn.setAttribute('data-tooltip-content', diffTreeBtn.getAttribute(diffTreeVisible ? 'data-hide-text' : 'data-show-text'));
|
||||
</script>
|
||||
{{end}}
|
||||
{{if not .DiffNotAvailable}}
|
||||
<div class="diff-detail-stats tw-flex tw-items-center tw-flex-wrap">
|
||||
{{svg "octicon-diff" 16 "tw-mr-1"}}{{ctx.Locale.Tr "repo.diff.stats_desc" .DiffShortStat.NumFiles .DiffShortStat.TotalAddition .DiffShortStat.TotalDeletion}}
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
<div class="diff-detail-actions">
|
||||
{{if and .PageIsPullFiles $.SignedUserID (not .DiffNotAvailable)}}
|
||||
<div class="not-mobile tw-flex tw-items-center tw-flex-col tw-whitespace-nowrap tw-mr-1">
|
||||
<label for="viewed-files-summary" id="viewed-files-summary-label" data-text-changed-template="{{ctx.Locale.Tr "repo.pulls.viewed_files_label"}}">
|
||||
{{ctx.Locale.Tr "repo.pulls.viewed_files_label" .NumViewedFiles .DiffShortStat.NumFiles}}
|
||||
</label>
|
||||
<progress id="viewed-files-summary" value="{{.NumViewedFiles}}" max="{{.DiffShortStat.NumFiles}}"></progress>
|
||||
</div>
|
||||
{{end}}
|
||||
{{template "repo/diff/whitespace_dropdown" .}}
|
||||
{{template "repo/diff/options_dropdown" .}}
|
||||
{{if .PageIsPullFiles}}
|
||||
<div id="diff-commit-select" data-merge-base="{{$.CompareInfo.CompareBase}}" data-issuelink="{{$.Issue.Link}}" data-queryparams="?style={{if $.IsSplitStyle}}split{{else}}unified{{end}}&whitespace={{$.WhitespaceBehavior}}&show-outdated={{$.ShowOutdatedComments}}" data-filter_changes_by_commit="{{ctx.Locale.Tr "repo.pulls.filter_changes_by_commit"}}">
|
||||
{{/* the following will be replaced by vue component, but this avoids any loading artifacts till the vue component is initialized */}}
|
||||
<div class="ui jump dropdown tiny basic button custom">
|
||||
{{svg "octicon-git-commit"}}
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
{{if and .PageIsPullFiles $.SignedUserID}}
|
||||
{{template "repo/diff/new_review" .}}
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
{{if not .DiffNotAvailable}}
|
||||
{{if and .IsShowingOnlySingleCommit .PageIsPullFiles}}
|
||||
<div class="ui info message">
|
||||
<div>{{ctx.Locale.Tr "repo.pulls.showing_only_single_commit" (ShortSha .AfterCommitID)}} - <a href="{{$.Issue.Link}}/files?style={{if $.IsSplitStyle}}split{{else}}unified{{end}}&whitespace={{$.WhitespaceBehavior}}&show-outdated={{$.ShowOutdatedComments}}">{{ctx.Locale.Tr "repo.pulls.show_all_commits"}}</a></div>
|
||||
</div>
|
||||
{{else if and (not .IsShowingAllCommits) .PageIsPullFiles}}
|
||||
<div class="ui info message">
|
||||
<div>{{ctx.Locale.Tr "repo.pulls.showing_specified_commit_range" (ShortSha .BeforeCommitID) (ShortSha .AfterCommitID)}} - <a href="{{$.Issue.Link}}/files?style={{if $.IsSplitStyle}}split{{else}}unified{{end}}&whitespace={{$.WhitespaceBehavior}}&show-outdated={{$.ShowOutdatedComments}}">{{ctx.Locale.Tr "repo.pulls.show_all_commits"}}</a></div>
|
||||
</div>
|
||||
{{end}}
|
||||
{{end}}
|
||||
<div id="diff-container">
|
||||
{{if $showFileTree}}
|
||||
{{$.FileIconPoolHTML}}
|
||||
<div id="diff-file-tree" class="tw-hidden not-mobile"></div>
|
||||
<script nonce="{{ctx.CspScriptNonce}}">
|
||||
if (diffTreeVisible) document.getElementById('diff-file-tree').classList.remove('tw-hidden');
|
||||
</script>
|
||||
{{end}}
|
||||
{{if .DiffNotAvailable}}
|
||||
<h4>{{ctx.Locale.Tr "repo.diff.data_not_available"}}</h4>
|
||||
{{else}}
|
||||
<div id="diff-file-boxes" class="sixteen wide column">
|
||||
{{range $i, $file := .Diff.Files}}
|
||||
{{/*notice: the index of Diff.Files should not be used for element ID, because the index will be restarted from 0 when doing load-more for PRs with a lot of files*/}}
|
||||
{{$blobBase := call $.GetBlobByPathForCommit $.BeforeCommit $file.OldName}}
|
||||
{{$blobHead := call $.GetBlobByPathForCommit $.HeadCommit $file.Name}}
|
||||
{{$sniffedTypeBase := call $.GetSniffedTypeForBlob $blobBase}}
|
||||
{{$sniffedTypeHead := call $.GetSniffedTypeForBlob $blobHead}}
|
||||
{{$isImage:= or (call $.IsSniffedTypeAnImage $sniffedTypeBase) (call $.IsSniffedTypeAnImage $sniffedTypeHead)}}
|
||||
{{$isCsv := (call $.IsCsvFile $file)}}
|
||||
{{$showFileViewToggle := or $isImage (and (not $file.IsIncomplete) $isCsv)}}
|
||||
{{$isExpandable := or (gt $file.Addition 0) (gt $file.Deletion 0) $file.IsBin}}
|
||||
{{$isReviewFile := and $.IsSigned $.PageIsPullFiles (not $.Repository.IsArchived) $.IsShowingAllCommits}}
|
||||
<div class="diff-file-box file-content {{TabSizeClass $.Editorconfig $file.Name}} tw-mt-0" id="diff-{{$file.NameHash}}" data-old-filename="{{$file.OldName}}" data-new-filename="{{$file.Name}}" {{if or ($file.ShouldBeHidden) (not $isExpandable)}}data-folded="true"{{end}}>
|
||||
<div class="diff-file-header sticky-2nd-row ui top attached header">
|
||||
<div class="diff-file-name tw-flex tw-flex-1 tw-items-center tw-gap-1 tw-flex-wrap">
|
||||
<div class="flex-text-block">
|
||||
<button class="fold-file btn interact-bg tw-flex-shrink-0 tw-p-1{{if not $isExpandable}} tw-invisible{{end}}">
|
||||
{{if $file.ShouldBeHidden}}
|
||||
{{svg "octicon-chevron-right" 18}}
|
||||
{{else}}
|
||||
{{svg "octicon-chevron-down" 18}}
|
||||
{{end}}
|
||||
</button>
|
||||
{{$entryModeText := $file.TranslateDiffEntryMode ctx.Locale}}
|
||||
<a class="muted file-link tw-font-mono" title="{{if $file.IsRenamed}}{{$file.OldName}} → {{end}}{{$file.Name}}" href="#diff-{{$file.NameHash}}">
|
||||
{{if $file.IsRenamed}}{{$file.OldName}} → {{end}}{{$file.Name}}
|
||||
</a>
|
||||
</div>
|
||||
<button class="btn interact-fg tw-p-2 tw-shrink-0" data-clipboard-text="{{$file.Name}}" data-tooltip-content="{{ctx.Locale.Tr "copy_path"}}">{{svg "octicon-copy" 14}}</button>
|
||||
{{if $file.IsLFSFile}}
|
||||
<span class="ui label">LFS</span>
|
||||
{{end}}
|
||||
{{if $file.IsGenerated}}
|
||||
<span class="ui label">{{ctx.Locale.Tr "repo.diff.generated"}}</span>
|
||||
{{end}}
|
||||
{{if $file.IsVendored}}
|
||||
<span class="ui label">{{ctx.Locale.Tr "repo.diff.vendored"}}</span>
|
||||
{{end}}
|
||||
{{if $entryModeText}}
|
||||
<span class="ui label">{{$entryModeText}}</span>
|
||||
{{end}}
|
||||
</div>
|
||||
<div class="diff-file-header-actions flex-text-block tw-justify-end tw-flex-wrap">
|
||||
{{if $file.IsBin}}
|
||||
{{ctx.Locale.Tr "repo.diff.bin"}}
|
||||
{{else}}
|
||||
{{template "repo/diff/stats" dict "Addition" .Addition "Deletion" .Deletion}}
|
||||
{{end}}
|
||||
|
||||
{{if $showFileViewToggle}}
|
||||
<div class="ui compact icon buttons">
|
||||
<button class="ui tiny basic button file-view-toggle" data-toggle-selector="#diff-source-{{$file.NameHash}}" data-tooltip-content="{{ctx.Locale.Tr "repo.file_view_source"}}">{{svg "octicon-code"}}</button>
|
||||
<button class="ui tiny basic button file-view-toggle active" data-toggle-selector="#diff-rendered-{{$file.NameHash}}" data-tooltip-content="{{ctx.Locale.Tr "repo.file_view_rendered"}}">{{svg "octicon-file"}}</button>
|
||||
</div>
|
||||
{{end}}
|
||||
{{if $file.IsProtected}}
|
||||
<span class="ui basic label">{{ctx.Locale.Tr "repo.diff.protected"}}</span>
|
||||
{{end}}
|
||||
{{if and $isReviewFile $file.HasChangedSinceLastReview}}
|
||||
<span class="changed-since-last-review unselectable not-mobile">{{ctx.Locale.Tr "repo.pulls.has_changed_since_last_review"}}</span>
|
||||
{{end}}
|
||||
{{if $isReviewFile}}
|
||||
<label data-link="{{$.Issue.Link}}/viewed-files" data-headcommit="{{$.AfterCommitID}}" class="viewed-file-form unselectable{{if $file.IsViewed}} viewed-file-checked-form{{end}}">
|
||||
<input type="checkbox" name="{{$file.GetDiffFileName}}" autocomplete="off"{{if $file.IsViewed}} checked{{end}}> {{ctx.Locale.Tr "repo.pulls.has_viewed_file"}}
|
||||
</label>
|
||||
{{end}}
|
||||
{{if not $file.IsSubmodule}}
|
||||
<button class="btn diff-header-popup-btn tw-p-1">{{svg "octicon-kebab-horizontal" 18}}</button>
|
||||
<div class="tippy-target">
|
||||
{{if not (or $file.IsIncomplete $file.IsBin)}}
|
||||
<button class="unescape-button item" data-unicode-content-selector="#diff-{{$file.NameHash}}">{{ctx.Locale.Tr "repo.unescape_control_characters"}}</button>
|
||||
<button class="escape-button tw-hidden item" data-unicode-content-selector="#diff-{{$file.NameHash}}">{{ctx.Locale.Tr "repo.escape_control_characters"}}</button>
|
||||
{{end}}
|
||||
<button class="item" data-clipboard-text="{{$file.GetDiffFileBaseName}}">{{ctx.Locale.Tr "copy_filename"}}</button>
|
||||
{{if not $.PageIsWiki}}
|
||||
{{if $file.IsDeleted}}
|
||||
<a class="item" rel="nofollow" href="{{$.BeforeSourcePath}}/{{PathEscapeSegments .Name}}">{{ctx.Locale.Tr "repo.diff.view_file"}}</a>
|
||||
{{else}}
|
||||
<a class="item" rel="nofollow" href="{{$.SourcePath}}/{{PathEscapeSegments .Name}}">{{ctx.Locale.Tr "repo.diff.view_file"}}</a>
|
||||
{{if and $.Repository.CanEnableEditor $.CanEditFile}}
|
||||
<a class="item" rel="nofollow" href="{{$.HeadRepoLink}}/_edit/{{PathEscapeSegments $.HeadBranchName}}/{{PathEscapeSegments $file.Name}}?return_uri={{print $.BackToLink "#diff-" $file.NameHash | QueryEscape}}">{{ctx.Locale.Tr "repo.editor.edit_this_file"}}</a>
|
||||
{{end}}
|
||||
{{end}}
|
||||
{{end}}
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="diff-file-body ui attached unstackable table segment" {{if and $file.IsViewed $.IsShowingAllCommits}}data-folded="true"{{end}}>
|
||||
<div id="diff-source-{{$file.NameHash}}" class="file-body file-code unicode-escaped code-diff{{if $.IsSplitStyle}} code-diff-split{{else}} code-diff-unified{{end}}{{if $showFileViewToggle}} tw-hidden{{end}}">
|
||||
{{if or $file.IsIncomplete $file.IsBin}}
|
||||
<div class="diff-file-body binary">
|
||||
{{if $file.IsIncomplete}}
|
||||
{{if $file.IsIncompleteLineTooLong}}
|
||||
{{ctx.Locale.Tr "repo.diff.file_suppressed_line_too_long"}}
|
||||
{{else}}
|
||||
{{ctx.Locale.Tr "repo.diff.file_suppressed"}}
|
||||
<a class="ui basic tiny button diff-load-button" data-href="?file-only=true&files={{$file.Name}}&files={{$file.OldName}}">{{ctx.Locale.Tr "repo.diff.load"}}</a>
|
||||
{{end}}
|
||||
{{else}}
|
||||
{{ctx.Locale.Tr "repo.diff.bin_not_shown"}}
|
||||
{{end}}
|
||||
</div>
|
||||
{{else if $file.SubmoduleDiffInfo}}
|
||||
<div class="tw-p-3">{{svg "octicon-file-submodule"}} {{$submoduleDiffInfo := $file.SubmoduleDiffInfo -}}
|
||||
{{- $submoduleName := $submoduleDiffInfo.SubmoduleRepoLinkHTML ctx -}}
|
||||
{{- if $file.IsDeleted -}}
|
||||
{{- ctx.Locale.Tr "repo.diff.submodule_deleted" $submoduleName ($submoduleDiffInfo.CommitRefIDLinkHTML ctx $submoduleDiffInfo.PreviousRefID) -}}
|
||||
{{- else if $file.IsCreated -}}
|
||||
{{- ctx.Locale.Tr "repo.diff.submodule_added" $submoduleName ($submoduleDiffInfo.CommitRefIDLinkHTML ctx $submoduleDiffInfo.NewRefID) -}}
|
||||
{{- else -}}
|
||||
{{- ctx.Locale.Tr "repo.diff.submodule_updated" $submoduleName ($submoduleDiffInfo.CompareRefIDLinkHTML ctx) -}}
|
||||
{{end}}
|
||||
</div>
|
||||
{{else}}
|
||||
<table class="chroma" data-new-comment-url="{{$.Issue.Link}}/files/reviews/new_comment" data-path="{{$file.Name}}">
|
||||
{{if $.IsSplitStyle}}
|
||||
{{template "repo/diff/section_split" dict "file" . "root" $}}
|
||||
{{else}}
|
||||
{{template "repo/diff/section_unified" dict "file" . "root" $}}
|
||||
{{end}}
|
||||
</table>
|
||||
{{end}}
|
||||
</div>
|
||||
{{if $showFileViewToggle}}
|
||||
{{/* for image or CSV, it can have a horizontal scroll bar, there won't be review comment context menu (position absolute) which would be clipped by "overflow" */}}
|
||||
<div id="diff-rendered-{{$file.NameHash}}" class="file-body file-code {{if $.IsSplitStyle}}code-diff-split{{else}}code-diff-unified{{end}} tw-overflow-x-scroll">
|
||||
<table class="chroma tw-w-full">
|
||||
{{if $isImage}}
|
||||
{{template "repo/diff/image_diff" dict "file" . "root" $ "blobBase" $blobBase "blobHead" $blobHead "sniffedTypeBase" $sniffedTypeBase "sniffedTypeHead" $sniffedTypeHead}}
|
||||
{{else}}
|
||||
{{template "repo/diff/csv_diff" dict "file" . "root" $ "blobBase" $blobBase "blobHead" $blobHead "sniffedTypeBase" $sniffedTypeBase "sniffedTypeHead" $sniffedTypeHead}}
|
||||
{{end}}
|
||||
</table>
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
{{if .Diff.IsIncomplete}}
|
||||
<div class="diff-file-box file-content tw-mt-2" id="diff-incomplete">
|
||||
<h4 class="ui top attached header tw-font-normal flex-left-right">
|
||||
{{ctx.Locale.Tr "repo.diff.too_many_files"}}
|
||||
<a class="ui basic tiny button" id="diff-show-more-files" data-href="?skip-to={{.Diff.End}}&file-only=true">{{ctx.Locale.Tr "repo.diff.show_more"}}</a>
|
||||
</h4>
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
|
||||
{{if and (not $.Repository.IsArchived) (not .DiffNotAvailable)}}
|
||||
<template id="issue-comment-editor-template">
|
||||
<form class="ui form comment">
|
||||
<div class="field">
|
||||
{{template "shared/combomarkdowneditor" (dict
|
||||
"CustomInit" true
|
||||
"MarkdownEditorContext" (ctx.MiscUtils.MarkdownEditorComment $.Repository)
|
||||
"TextareaName" "content"
|
||||
"DropzoneParentContainer" ".ui.form"
|
||||
)}}
|
||||
</div>
|
||||
{{if .IsAttachmentEnabled}}
|
||||
<div class="field">
|
||||
{{template "repo/upload" .}}
|
||||
</div>
|
||||
{{end}}
|
||||
<div class="field flex-text-block tw-justify-end">
|
||||
<button class="ui cancel button">{{ctx.Locale.Tr "repo.issues.cancel"}}</button>
|
||||
<button class="ui primary button">{{ctx.Locale.Tr "repo.issues.save"}}</button>
|
||||
</div>
|
||||
</form>
|
||||
</template>
|
||||
{{end}}
|
||||
{{if (not .DiffNotAvailable)}}
|
||||
{{template "repo/issue/view_content/reference_issue_dialog" .}}
|
||||
{{template "shared/user/block_user_dialog" .}}
|
||||
{{end}}
|
||||
</div>
|
||||
@@ -0,0 +1,47 @@
|
||||
{{if and ctx.RootData.SignedUserID (not ctx.RootData.Repository.IsArchived)}}
|
||||
<form class="ui form {{if $.hidden}}tw-hidden comment-form{{end}}" action="{{$.root.Issue.Link}}/files/reviews/comments" method="post">
|
||||
<input type="hidden" name="origin" value="{{if $.root.PageIsPullFiles}}diff{{else}}timeline{{end}}">
|
||||
<input type="hidden" name="latest_commit_id" value="{{$.root.AfterCommitID}}">
|
||||
<input type="hidden" name="side" value="{{if $.Side}}{{$.Side}}{{end}}">
|
||||
<input type="hidden" name="line" value="{{if $.Line}}{{$.Line}}{{end}}">
|
||||
<input type="hidden" name="path" value="{{if $.File}}{{$.File}}{{end}}">
|
||||
<input type="hidden" name="diff_start_cid">
|
||||
<input type="hidden" name="diff_end_cid">
|
||||
<input type="hidden" name="diff_base_cid">
|
||||
<div class="field">
|
||||
{{template "shared/combomarkdowneditor" (dict
|
||||
"CustomInit" true
|
||||
"MarkdownEditorContext" (ctx.MiscUtils.MarkdownEditorComment ctx.RootData.Repository)
|
||||
"TextareaName" "content"
|
||||
"TextareaPlaceholder" (ctx.Locale.Tr "repo.diff.comment.placeholder")
|
||||
"DropzoneParentContainer" "form"
|
||||
"DisableAutosize" "true"
|
||||
)}}
|
||||
</div>
|
||||
{{if $.root.IsAttachmentEnabled}}
|
||||
<div class="field">
|
||||
{{template "repo/upload" $.root}}
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
<div class="field footer">
|
||||
<div class="flex-text-block tw-justify-end">
|
||||
{{if $.reply}}
|
||||
<button class="ui submit primary tiny button btn-reply" type="submit">{{ctx.Locale.Tr "repo.diff.comment.reply"}}</button>
|
||||
<input type="hidden" name="reply" value="{{$.reply}}">
|
||||
<input type="hidden" name="single_review" value="true">
|
||||
{{else}}
|
||||
{{if $.root.CurrentReview}}
|
||||
<button name="pending_review" type="submit" class="ui submit primary tiny button btn-add-comment">{{ctx.Locale.Tr "repo.diff.comment.add_review_comment"}}</button>
|
||||
{{else}}
|
||||
<button name="pending_review" type="submit" class="ui submit primary tiny button btn-start-review">{{ctx.Locale.Tr "repo.diff.comment.start_review"}}</button>
|
||||
<button name="single_review" value="true" type="submit" class="ui submit tiny basic button btn-add-single">{{ctx.Locale.Tr "repo.diff.comment.add_single_comment"}}</button>
|
||||
{{end}}
|
||||
{{end}}
|
||||
{{if or (not $.HasComments) $.hidden}}
|
||||
<button type="button" class="ui submit tiny basic button btn-cancel cancel-code-comment">{{ctx.Locale.Tr "cancel"}}</button>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
{{end}}
|
||||
@@ -0,0 +1,7 @@
|
||||
{{if $.comment}}
|
||||
{{template "repo/diff/comment_form" dict "root" $.root "hidden" $.hidden "reply" $.reply "Line" $.comment.UnsignedLine "File" $.comment.TreePath "Side" $.comment.DiffSide "HasComments" true}}
|
||||
{{else if $.root}}
|
||||
{{template "repo/diff/comment_form" $}}
|
||||
{{else}}
|
||||
{{template "repo/diff/comment_form" dict "root" $}}
|
||||
{{end}}
|
||||
@@ -0,0 +1,79 @@
|
||||
{{range .comments}}
|
||||
|
||||
{{$createdStr:= DateUtils.TimeSince .CreatedUnix}}
|
||||
<div class="comment" id="{{.HashTag}}">
|
||||
<div class="tw-mt-2 tw-mr-4">
|
||||
{{if .OriginalAuthor}}
|
||||
<span class="avatar">{{ctx.AvatarUtils.Avatar nil}}</span>
|
||||
{{else}}
|
||||
{{template "shared/user/avatarlink" dict "user" .Poster}}
|
||||
{{end}}
|
||||
</div>
|
||||
<div class="content comment-container">
|
||||
<div class="comment-header avatar-content-left-arrow">
|
||||
<div class="comment-header-left">
|
||||
{{if .OriginalAuthor}}
|
||||
<span class="tw-text-text tw-font-semibold tw-mr-1">
|
||||
{{svg (MigrationIcon $.root.Repository.GetOriginalURLHostname)}}
|
||||
{{.OriginalAuthor}}
|
||||
</span>
|
||||
<span class="tw-text-text-light muted-links">
|
||||
{{ctx.Locale.Tr "repo.issues.commented_at" .HashTag $createdStr}}
|
||||
</span>
|
||||
<span class="text migrate">
|
||||
{{if $.root.Repository.OriginalURL}}
|
||||
({{ctx.Locale.Tr "repo.migrated_from" $.root.Repository.OriginalURL $.root.Repository.GetOriginalURLHostname}})
|
||||
{{end}}
|
||||
</span>
|
||||
{{else}}
|
||||
<span class="tw-text-text-light muted-links">
|
||||
{{template "shared/user/namelink" .Poster}}
|
||||
{{ctx.Locale.Tr "repo.issues.commented_at" .HashTag $createdStr}}
|
||||
</span>
|
||||
{{end}}
|
||||
</div>
|
||||
<div class="comment-header-right">
|
||||
{{if .Invalidated}}
|
||||
{{$referenceUrl := printf "%s#%s" $.root.Issue.Link .HashTag}}
|
||||
<a href="{{$referenceUrl}}" class="ui label basic small" data-tooltip-content="{{ctx.Locale.Tr "repo.issues.review.outdated_description"}}">
|
||||
{{ctx.Locale.Tr "repo.issues.review.outdated"}}
|
||||
</a>
|
||||
{{end}}
|
||||
{{if .Review}}
|
||||
{{if eq .Review.Type 0}}
|
||||
<div class="ui label basic small yellow pending-label" data-tooltip-content="{{ctx.Locale.Tr "repo.issues.review.pending.tooltip" (ctx.Locale.Tr "repo.diff.review") (ctx.Locale.Tr "repo.diff.review.approve") (ctx.Locale.Tr "repo.diff.review.comment") (ctx.Locale.Tr "repo.diff.review.reject")}}">
|
||||
{{ctx.Locale.Tr "repo.issues.review.pending"}}
|
||||
</div>
|
||||
{{else}}
|
||||
<div class="ui label basic small">
|
||||
{{ctx.Locale.Tr "repo.issues.review.review"}}
|
||||
</div>
|
||||
{{end}}
|
||||
{{end}}
|
||||
{{if not $.root.Repository.IsArchived}}
|
||||
{{template "repo/issue/view_content/add_reaction" dict "ActionURL" (printf "%s/comments/%d/reactions" $.root.RepoLink .ID)}}
|
||||
{{end}}
|
||||
{{template "repo/issue/view_content/context_menu" dict "item" . "delete" true "issue" false "diff" true "IsCommentPoster" (and $.root.IsSigned (eq $.root.SignedUserID .PosterID))}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="ui attached segment comment-body">
|
||||
<div class="render-content markup" {{if or $.Permission.IsAdmin $.HasIssuesOrPullsWritePermission (and $.root.IsSigned (eq $.root.SignedUserID .PosterID))}}data-can-edit="true"{{end}}>
|
||||
{{if .RenderedContent}}
|
||||
{{.RenderedContent}}
|
||||
{{else}}
|
||||
<span class="no-content">{{ctx.Locale.Tr "repo.issues.no_content"}}</span>
|
||||
{{end}}
|
||||
</div>
|
||||
<div id="{{.HashTag}}-raw" class="raw-content tw-hidden">{{.Content}}</div>
|
||||
<div class="edit-content-zone tw-hidden" data-update-url="{{$.root.RepoLink}}/comments/{{.ID}}" data-content-version="{{.ContentVersion}}" data-context="{{$.root.RepoLink}}" data-attachment-url="{{$.root.RepoLink}}/comments/{{.ID}}/attachments"></div>
|
||||
{{if .Attachments}}
|
||||
{{template "repo/issue/view_content/attachments" dict "Attachments" .Attachments "RenderedContent" .RenderedContent}}
|
||||
{{end}}
|
||||
</div>
|
||||
{{$reactions := .Reactions.GroupByType}}
|
||||
{{if $reactions}}
|
||||
{{template "repo/issue/view_content/reactions" dict "ActionURL" (printf "%s/comments/%d/reactions" $.root.RepoLink .ID) "Reactions" $reactions}}
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
@@ -0,0 +1,227 @@
|
||||
{{template "base/head" .}}
|
||||
<div role="main" aria-label="{{.Title}}" class="page-content repository diff {{if .PageIsComparePull}}compare pull{{end}}">
|
||||
{{template "repo/header" .}}
|
||||
|
||||
{{$compareSeparator := $.CompareInfo.CompareSeparator}}
|
||||
{{$compareSeparatorSwitch := Iif $.CompareInfo.DirectComparison "..." ".."}}
|
||||
<div class="ui container fluid padded">
|
||||
<h2 class="ui header">
|
||||
{{if and $.PageIsComparePull $.IsSigned (not .Repository.IsArchived)}}
|
||||
{{ctx.Locale.Tr "repo.compare.title"}}
|
||||
<div class="sub header">{{ctx.Locale.Tr "repo.compare.description"}}</div>
|
||||
{{else}}
|
||||
{{ctx.Locale.Tr "action.compare_commits_general"}}
|
||||
{{end}}
|
||||
</h2>
|
||||
{{template "base/alert" .}}
|
||||
{{$BaseCompareName := $.Repository.FullName -}}
|
||||
{{$HeadCompareName := $.HeadRepo.FullName -}}
|
||||
{{$OwnForkCompareName := "" -}}
|
||||
{{if $.OwnForkRepo -}}
|
||||
{{$OwnForkCompareName = $.OwnForkRepo.FullName -}}
|
||||
{{end -}}
|
||||
{{$RootRepoCompareName := "" -}}
|
||||
{{if $.RootRepo -}}
|
||||
{{$RootRepoCompareName = $.RootRepo.FullName -}}
|
||||
{{end -}}
|
||||
|
||||
<div class="ui segment choose branch">
|
||||
<a class="tw-mr-2" href="{{$.HeadRepo.Link}}/compare/{{PathEscapeSegments $.HeadBranch}}{{$compareSeparator}}{{if not $.PullRequestCtx.SameRepo}}{{PathEscape $.BaseName}}/{{PathEscape $.Repository.Name}}:{{end}}{{PathEscapeSegments $.BaseBranch}}" title="{{ctx.Locale.Tr "repo.pulls.switch_head_and_base"}}">{{svg "octicon-git-compare"}}</a>
|
||||
<div class="ui dropdown jump select-branch">
|
||||
<div class="ui basic small button">
|
||||
<span class="text">{{if $.PageIsComparePull}}{{ctx.Locale.Tr "repo.pulls.compare_base"}}{{else}}{{ctx.Locale.Tr "repo.compare.compare_base"}}{{end}}: <strong>{{$BaseCompareName}}:{{$.BaseBranch}}</strong></span>
|
||||
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
||||
</div>
|
||||
<div class="menu">
|
||||
<div class="ui icon search input">
|
||||
<i class="icon">{{svg "octicon-filter" 16}}</i>
|
||||
<input name="search" placeholder="{{ctx.Locale.Tr "repo.filter_branch_and_tag"}}...">
|
||||
</div>
|
||||
<div class="header">
|
||||
<div class="ui grid">
|
||||
<div class="two column row">
|
||||
<a class="reference column" href="#" data-target=".base-branch-list">
|
||||
<span class="tw-text-text">
|
||||
{{svg "octicon-git-branch"}} {{ctx.Locale.Tr "repo.branches"}}
|
||||
</span>
|
||||
</a>
|
||||
<a class="reference column" href="#" data-target=".base-tag-list">
|
||||
<span class="tw-text-text">
|
||||
{{svg "octicon-tag"}} {{ctx.Locale.Tr "repo.tags"}}
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="scrolling menu reference-list-menu base-branch-list">
|
||||
{{range .Branches}}
|
||||
<a class="item {{if eq $.BaseBranch .}}selected{{end}}" href="{{$.RepoLink}}/compare/{{PathEscapeSegments .}}{{$compareSeparator}}{{if not $.PullRequestCtx.SameRepo}}{{PathEscape $.HeadUser.Name}}/{{PathEscape $.HeadRepo.Name}}:{{end}}{{PathEscapeSegments $.HeadBranch}}">{{$BaseCompareName}}:{{.}}</a>
|
||||
{{end}}
|
||||
{{if not .PullRequestCtx.SameRepo}}
|
||||
{{range .HeadBranches}}
|
||||
<a class="item" href="{{$.HeadRepo.Link}}/compare/{{PathEscapeSegments .}}{{$compareSeparator}}{{PathEscape $.HeadUser.Name}}/{{PathEscape $.HeadRepo.Name}}:{{PathEscapeSegments $.HeadBranch}}">{{$HeadCompareName}}:{{.}}</a>
|
||||
{{end}}
|
||||
{{end}}
|
||||
{{if .OwnForkRepo}}
|
||||
{{range .OwnForkRepoBranches}}
|
||||
<a class="item" href="{{$.OwnForkRepo.Link}}/compare/{{PathEscapeSegments .}}{{$compareSeparator}}{{PathEscape $.HeadUser.Name}}/{{PathEscape $.HeadRepo.Name}}:{{PathEscapeSegments $.HeadBranch}}">{{$OwnForkCompareName}}:{{.}}</a>
|
||||
{{end}}
|
||||
{{end}}
|
||||
{{if and .RootRepo (.RootRepo.AllowsPulls ctx)}}
|
||||
{{range .RootRepoBranches}}
|
||||
<a class="item" href="{{$.RootRepo.Link}}/compare/{{PathEscapeSegments .}}{{$compareSeparator}}{{PathEscape $.HeadUser.Name}}/{{PathEscape $.HeadRepo.Name}}:{{PathEscapeSegments $.HeadBranch}}">{{$RootRepoCompareName}}:{{.}}</a>
|
||||
{{end}}
|
||||
{{end}}
|
||||
</div>
|
||||
<div class="scrolling menu reference-list-menu base-tag-list tw-hidden">
|
||||
{{range .Tags}}
|
||||
<a class="item {{if eq $.BaseBranch .}}selected{{end}}" href="{{$.RepoLink}}/compare/{{PathEscapeSegments .}}{{$compareSeparator}}{{if not $.PullRequestCtx.SameRepo}}{{PathEscape $.HeadUser.Name}}/{{PathEscape $.HeadRepo.Name}}:{{end}}{{PathEscapeSegments $.HeadBranch}}">{{$BaseCompareName}}:{{.}}</a>
|
||||
{{end}}
|
||||
{{if not .PullRequestCtx.SameRepo}}
|
||||
{{range .HeadTags}}
|
||||
<a class="item" href="{{$.HeadRepo.Link}}/compare/{{PathEscapeSegments .}}{{$compareSeparator}}{{PathEscape $.HeadUser.Name}}/{{PathEscape $.HeadRepo.Name}}:{{PathEscapeSegments $.HeadBranch}}">{{$HeadCompareName}}:{{.}}</a>
|
||||
{{end}}
|
||||
{{end}}
|
||||
{{if .OwnForkRepo}}
|
||||
{{range .OwnForkRepoTags}}
|
||||
<a class="item" href="{{$.OwnForkRepo.Link}}/compare/{{PathEscapeSegments .}}{{$compareSeparator}}{{PathEscape $.HeadUser.Name}}/{{PathEscape $.HeadRepo.Name}}:{{PathEscapeSegments $.HeadBranch}}">{{$OwnForkCompareName}}:{{.}}</a>
|
||||
{{end}}
|
||||
{{end}}
|
||||
{{if .RootRepo}}
|
||||
{{range .RootRepoTags}}
|
||||
<a class="item" href="{{$.RootRepo.Link}}/compare/{{PathEscapeSegments .}}{{$compareSeparator}}{{PathEscape $.HeadUser.Name}}/{{PathEscape $.HeadRepo.Name}}:{{PathEscapeSegments $.HeadBranch}}">{{$RootRepoCompareName}}:{{.}}</a>
|
||||
{{end}}
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<a href="{{.RepoLink}}/compare/{{PathEscapeSegments .BaseBranch}}{{$compareSeparatorSwitch}}{{if not $.PullRequestCtx.SameRepo}}{{PathEscape $.HeadUser.Name}}/{{PathEscape $.HeadRepo.Name}}:{{end}}{{PathEscapeSegments $.HeadBranch}}" title="{{ctx.Locale.Tr "repo.pulls.switch_comparison_type"}}">{{svg "octicon-arrow-left" 16}}<div class="compare-separator">{{$compareSeparator}}</div></a>
|
||||
|
||||
<div class="ui dropdown jump select-branch">
|
||||
<div class="ui basic small button">
|
||||
<span class="text">{{if $.PageIsComparePull}}{{ctx.Locale.Tr "repo.pulls.compare_compare"}}{{else}}{{ctx.Locale.Tr "repo.compare.compare_head"}}{{end}}: <strong>{{$HeadCompareName}}:{{$.HeadBranch}}</strong></span>
|
||||
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
||||
</div>
|
||||
<div class="menu">
|
||||
<div class="ui icon search input">
|
||||
<i class="icon">{{svg "octicon-filter" 16}}</i>
|
||||
<input name="search" placeholder="{{ctx.Locale.Tr "repo.filter_branch_and_tag"}}...">
|
||||
</div>
|
||||
<div class="header">
|
||||
<div class="ui grid">
|
||||
<div class="two column row">
|
||||
<a class="reference column" href="#" data-target=".head-branch-list">
|
||||
<span class="tw-text-text">
|
||||
{{svg "octicon-git-branch"}} {{ctx.Locale.Tr "repo.branches"}}
|
||||
</span>
|
||||
</a>
|
||||
<a class="reference column" href="#" data-target=".head-tag-list">
|
||||
<span class="tw-text-text">
|
||||
{{svg "octicon-tag"}} {{ctx.Locale.Tr "repo.tags"}}
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="scrolling menu reference-list-menu head-branch-list">
|
||||
{{range .HeadBranches}}
|
||||
<a class="{{if eq $.HeadBranch .}}selected{{end}} item" href="{{$.RepoLink}}/compare/{{PathEscapeSegments $.BaseBranch}}{{$compareSeparator}}{{if not $.PullRequestCtx.SameRepo}}{{PathEscape $.HeadUser.Name}}/{{PathEscape $.HeadRepo.Name}}:{{end}}{{PathEscapeSegments .}}">{{$HeadCompareName}}:{{.}}</a>
|
||||
{{end}}
|
||||
{{if not .PullRequestCtx.SameRepo}}
|
||||
{{range .Branches}}
|
||||
<a class="item" href="{{$.RepoLink}}/compare/{{PathEscapeSegments $.BaseBranch}}{{$compareSeparator}}{{PathEscape $.BaseName}}/{{PathEscape $.Repository.Name}}:{{PathEscapeSegments .}}">{{$BaseCompareName}}:{{.}}</a>
|
||||
{{end}}
|
||||
{{end}}
|
||||
{{if .OwnForkRepo}}
|
||||
{{range .OwnForkRepoBranches}}
|
||||
<a class="item" href="{{$.RepoLink}}/compare/{{PathEscapeSegments $.BaseBranch}}{{$compareSeparator}}{{PathEscape $.OwnForkRepo.OwnerName}}/{{PathEscape $.OwnForkRepo.Name}}:{{PathEscapeSegments .}}">{{$OwnForkCompareName}}:{{.}}</a>
|
||||
{{end}}
|
||||
{{end}}
|
||||
{{if .RootRepo}}
|
||||
{{range .RootRepoBranches}}
|
||||
<a class="item" href="{{$.RepoLink}}/compare/{{PathEscapeSegments $.BaseBranch}}{{$compareSeparator}}{{PathEscape $.RootRepo.OwnerName}}/{{PathEscape $.RootRepo.Name}}:{{PathEscapeSegments .}}">{{$RootRepoCompareName}}:{{.}}</a>
|
||||
{{end}}
|
||||
{{end}}
|
||||
</div>
|
||||
<div class="scrolling menu reference-list-menu head-tag-list tw-hidden">
|
||||
{{range .HeadTags}}
|
||||
<a class="{{if eq $.HeadBranch .}}selected{{end}} item" href="{{$.RepoLink}}/compare/{{PathEscapeSegments $.BaseBranch}}{{$compareSeparator}}{{if not $.PullRequestCtx.SameRepo}}{{PathEscape $.HeadUser.Name}}/{{PathEscape $.HeadRepo.Name}}:{{end}}{{PathEscapeSegments .}}">{{$HeadCompareName}}:{{.}}</a>
|
||||
{{end}}
|
||||
{{if not .PullRequestCtx.SameRepo}}
|
||||
{{range .Tags}}
|
||||
<a class="item" href="{{$.RepoLink}}/compare/{{PathEscapeSegments $.BaseBranch}}{{$compareSeparator}}{{PathEscape $.BaseName}}/{{PathEscape $.Repository.Name}}:{{PathEscapeSegments .}}">{{$BaseCompareName}}:{{.}}</a>
|
||||
{{end}}
|
||||
{{end}}
|
||||
{{if .OwnForkRepo}}
|
||||
{{range .OwnForkRepoTags}}
|
||||
<a class="item" href="{{$.RepoLink}}/compare/{{PathEscapeSegments $.BaseBranch}}{{$compareSeparator}}{{PathEscape $.OwnForkRepo.OwnerName}}/{{PathEscape $.OwnForkRepo.Name}}:{{PathEscapeSegments .}}">{{$OwnForkCompareName}}:{{.}}</a>
|
||||
{{end}}
|
||||
{{end}}
|
||||
{{if .RootRepo}}
|
||||
{{range .RootRepoTags}}
|
||||
<a class="item" href="{{$.RepoLink}}/compare/{{PathEscapeSegments $.BaseBranch}}{{$compareSeparator}}{{PathEscape $.RootRepo.OwnerName}}/{{PathEscape $.RootRepo.Name}}:{{PathEscapeSegments .}}">{{$RootRepoCompareName}}:{{.}}</a>
|
||||
{{end}}
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{$showDiffBox := and .CommitCount (not .IsNothingToCompare)}}
|
||||
{{if and .IsSigned .PageIsComparePull}}
|
||||
{{$allowCreatePR := and ($.CompareInfo.BaseRef.IsBranch) ($.CompareInfo.HeadRef.IsBranch) (not $.CompareInfo.DirectComparison) (or $.AllowEmptyPr (not .IsNothingToCompare))}}
|
||||
{{if .IsNothingToCompare}}
|
||||
<div class="ui segment">
|
||||
{{if $allowCreatePR}}
|
||||
{{ctx.Locale.Tr "repo.pulls.nothing_to_compare_and_allow_empty_pr"}}
|
||||
{{else if and $.CompareInfo.BaseRef.IsBranch $.CompareInfo.HeadRef.IsBranch}}
|
||||
{{ctx.Locale.Tr "repo.pulls.nothing_to_compare"}}
|
||||
{{else}}
|
||||
{{ctx.Locale.Tr "repo.pulls.nothing_to_compare_have_tag"}}
|
||||
{{end}}
|
||||
</div>
|
||||
{{end}}
|
||||
{{if .HasPullRequest}}
|
||||
<div class="ui segment flex-text-block tw-gap-4">
|
||||
{{template "shared/issueicon" .}}
|
||||
<div class="issue-title tw-break-anywhere">
|
||||
{{ctx.RenderUtils.RenderIssueTitle .PullRequest.Issue.Title $.Repository}}
|
||||
<span class="index">#{{.PullRequest.Issue.Index}}</span>
|
||||
</div>
|
||||
<a href="{{$.RepoLink}}/pulls/{{.PullRequest.Issue.Index}}" class="ui compact button primary">
|
||||
{{ctx.Locale.Tr "repo.pulls.view"}}
|
||||
</a>
|
||||
</div>
|
||||
{{else if .Repository.IsArchived}}
|
||||
<div class="ui warning message">
|
||||
{{if .Repository.ArchivedUnix.IsZero}}
|
||||
{{ctx.Locale.Tr "repo.archive.title"}}
|
||||
{{else}}
|
||||
{{ctx.Locale.Tr "repo.archive.title_date" (DateUtils.AbsoluteLong .Repository.ArchivedUnix)}}
|
||||
{{end}}
|
||||
</div>
|
||||
{{else if $allowCreatePR}}
|
||||
<div class="ui info message flex-text-block pullrequest-form-toggle {{if .ExpandNewPrForm}}tw-hidden{{end}}">
|
||||
<span class="tw-flex-1">{{ctx.Locale.Tr "repo.pulls.new.description"}}</span>
|
||||
<a class="ui button primary show-panel toggle" data-panel=".pullrequest-form-toggle, .pullrequest-form">{{ctx.Locale.Tr "repo.pulls.new"}}</a>
|
||||
</div>
|
||||
<div class="pullrequest-form {{if not .ExpandNewPrForm}}tw-hidden{{end}}">
|
||||
{{template "repo/issue/new_form" .}}
|
||||
</div>
|
||||
{{end}}
|
||||
{{else}}{{/* not signed-in or not for pull-request */}}
|
||||
{{if and (not .CommitCount) $.CompareInfo.CompareBase}}
|
||||
<div class="ui segment">{{ctx.Locale.Tr "repo.commits.nothing_to_compare"}}</div>
|
||||
{{end}}
|
||||
{{end}}
|
||||
</div>
|
||||
|
||||
{{if $showDiffBox}}
|
||||
<div class="ui container fluid padded tw-my-4">
|
||||
{{template "repo/commits_table" .}}
|
||||
{{template "repo/diff/box" .}}
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
{{template "base/footer" .}}
|
||||
@@ -0,0 +1,70 @@
|
||||
{{if len .comments}}
|
||||
{{$comment := index .comments 0}}
|
||||
{{$resolved := $comment.IsResolved}}
|
||||
{{$invalid := $comment.Invalidated}}
|
||||
{{$resolveDoer := $comment.ResolveDoer}}
|
||||
{{$hasReview := and $comment.Review}}
|
||||
{{$isReviewPending := and $hasReview (eq $comment.Review.Type 0)}}
|
||||
{{$referenceUrl := printf "%s#%s" $.Issue.Link $comment.HashTag}}
|
||||
<div class="conversation-holder" data-path="{{$comment.TreePath}}" data-side="{{if lt $comment.Line 0}}left{{else}}right{{end}}" data-idx="{{$comment.UnsignedLine}}">
|
||||
{{if $resolved}}
|
||||
<div class="resolved-placeholder">
|
||||
<div class="flex-text-block tw-flex-wrap tw-text-text-light">
|
||||
{{svg "octicon-check"}}
|
||||
<b>{{$resolveDoer.Name}}</b> {{ctx.Locale.Tr "repo.issues.review.resolved_by"}}
|
||||
{{if $invalid}}
|
||||
<!--
|
||||
We only handle the case $resolved=true and $invalid=true in this template because if the comment is not resolved it has the outdated label in the comments area (not the header above).
|
||||
The case $resolved=false and $invalid=true is handled in repo/diff/comments.tmpl
|
||||
-->
|
||||
<a href="{{$referenceUrl}}" class="ui label basic small tw-ml-2" data-tooltip-content="{{ctx.Locale.Tr "repo.issues.review.outdated_description"}}">
|
||||
{{ctx.Locale.Tr "repo.issues.review.outdated"}}
|
||||
</a>
|
||||
{{end}}
|
||||
</div>
|
||||
<div class="flex-text-block">
|
||||
<button id="show-outdated-{{$comment.ID}}" data-comment="{{$comment.ID}}" class="btn tiny show-outdated">
|
||||
{{svg "octicon-unfold" 16 "tw-mr-2"}}{{ctx.Locale.Tr "repo.issues.review.show_resolved"}}
|
||||
</button>
|
||||
<button id="hide-outdated-{{$comment.ID}}" data-comment="{{$comment.ID}}" class="btn tiny hide-outdated tw-hidden">
|
||||
{{svg "octicon-fold" 16 "tw-mr-2"}}{{ctx.Locale.Tr "repo.issues.review.hide_resolved"}}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
<div id="code-comments-{{$comment.ID}}" class="field comment-code-cloud {{if $resolved}}tw-hidden{{end}}">
|
||||
<div class="comment-list">
|
||||
<div class="ui comments">
|
||||
{{template "repo/diff/comments" dict "root" $ "comments" .comments}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-text-block tw-mt-2 tw-flex-wrap tw-justify-end">
|
||||
<div class="ui buttons">
|
||||
<button class="ui icon tiny basic button previous-conversation">
|
||||
{{svg "octicon-arrow-up" 12}} {{ctx.Locale.Tr "repo.issues.previous"}}
|
||||
</button>
|
||||
<button class="ui icon tiny basic button next-conversation">
|
||||
{{svg "octicon-arrow-down" 12}} {{ctx.Locale.Tr "repo.issues.next"}}
|
||||
</button>
|
||||
</div>
|
||||
{{if and $.CanMarkConversation $hasReview (not $isReviewPending)}}
|
||||
<button class="ui icon tiny basic button resolve-conversation" data-origin="diff" data-action="{{if not $resolved}}Resolve{{else}}UnResolve{{end}}" data-comment-id="{{$comment.ID}}" data-update-url="{{$.RepoLink}}/issues/resolve_conversation">
|
||||
{{if $resolved}}
|
||||
{{ctx.Locale.Tr "repo.issues.review.un_resolve_conversation"}}
|
||||
{{else}}
|
||||
{{ctx.Locale.Tr "repo.issues.review.resolve_conversation"}}
|
||||
{{end}}
|
||||
</button>
|
||||
{{end}}
|
||||
{{if and $.SignedUserID (not $.Repository.IsArchived)}}
|
||||
<button class="comment-form-reply ui primary icon tiny button">
|
||||
{{svg "octicon-reply" 12}}{{ctx.Locale.Tr "repo.diff.comment.reply"}}
|
||||
</button>
|
||||
{{end}}
|
||||
</div>
|
||||
{{template "repo/diff/comment_form_datahandler" dict "hidden" true "reply" $comment.ReviewID "root" $ "comment" $comment}}
|
||||
</div>
|
||||
</div>
|
||||
{{else}}
|
||||
{{template "repo/diff/conversation_outdated"}}
|
||||
{{end}}
|
||||
@@ -0,0 +1,3 @@
|
||||
<div class="ui segment conversation-holder conversation-not-existing">
|
||||
{{ctx.Locale.Tr "repo.issues.review.outdated_description"}}
|
||||
</div>
|
||||
@@ -0,0 +1,58 @@
|
||||
<tr>
|
||||
<td>
|
||||
{{$result := call .root.CreateCsvDiff .file .blobBase .blobHead}}
|
||||
{{if $result.Error}}
|
||||
<div class="ui center">{{$result.Error}}</div>
|
||||
{{else if $result.Sections}}
|
||||
<table class="data-table">
|
||||
{{range $i, $section := $result.Sections}}
|
||||
<tbody {{if gt $i 0}}class="section"{{end}}>
|
||||
{{range $j, $row := $section.Rows}}
|
||||
<tr>
|
||||
{{if and (eq $i 0) (eq $j 0)}}
|
||||
<th class="line-num">{{.RowIdx}}</th>
|
||||
{{range $j, $cell := $row.Cells}}
|
||||
{{if not $cell}}
|
||||
<th></th>
|
||||
{{else if eq $cell.Type 2}}
|
||||
<th class="modified"><span class="removed-code">{{.LeftCell}}</span> <span class="added-code">{{.RightCell}}</span></th>
|
||||
{{else if eq $cell.Type 3}}
|
||||
<th class="added"><span class="added-code">{{.RightCell}}</span></th>
|
||||
{{else if eq $cell.Type 4}}
|
||||
<th class="removed"><span class="removed-code">{{.LeftCell}}</span></th>
|
||||
{{else if eq $cell.Type 5}}
|
||||
<th class="moved">{{.RightCell}}</th>
|
||||
{{else if eq $cell.Type 6}}
|
||||
<th class="moved"><span class="removed-code">{{.LeftCell}}</span> <span class="added-code">{{.RightCell}}</span></th>
|
||||
{{else}}
|
||||
<th>{{.RightCell}}</th>
|
||||
{{end}}
|
||||
{{end}}
|
||||
{{else}}
|
||||
<td class="line-num">{{if .RowIdx}}{{.RowIdx}}{{end}}</td>
|
||||
{{range $j, $cell := $row.Cells}}
|
||||
{{if not $cell}}
|
||||
<td></td>
|
||||
{{else if eq $cell.Type 2}}
|
||||
<td class="modified"><span class="removed-code">{{.LeftCell}}</span> <span class="added-code">{{.RightCell}}</span></td>
|
||||
{{else if eq $cell.Type 3}}
|
||||
<td class="added"><span class="added-code">{{.RightCell}}</span></td>
|
||||
{{else if eq $cell.Type 4}}
|
||||
<td class="removed"><span class="removed-code">{{.LeftCell}}</span></td>
|
||||
{{else if eq $cell.Type 5}}
|
||||
<td class="moved">{{.RightCell}}</td>
|
||||
{{else if eq $cell.Type 6}}
|
||||
<td class="moved"><span class="removed-code">{{.LeftCell}}</span> <span class="added-code">{{.RightCell}}</span></td>
|
||||
{{else}}
|
||||
<td>{{.RightCell}}</td>
|
||||
{{end}}
|
||||
{{end}}
|
||||
{{end}}
|
||||
</tr>
|
||||
{{end}}
|
||||
</tbody>
|
||||
{{end}}
|
||||
</table>
|
||||
{{end}}
|
||||
</td>
|
||||
</tr>
|
||||
@@ -0,0 +1,83 @@
|
||||
{{if or .blobBase .blobHead}}
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<div class="image-diff"
|
||||
data-path-before="{{.root.BeforeRawPath}}/{{PathEscapeSegments .file.OldName}}"
|
||||
data-path-after="{{.root.RawPath}}/{{PathEscapeSegments .file.Name}}"
|
||||
data-mime-before="{{.sniffedTypeBase.GetMimeType}}"
|
||||
data-mime-after="{{.sniffedTypeHead.GetMimeType}}"
|
||||
>
|
||||
<overflow-menu class="ui secondary pointing tabular menu">
|
||||
<div class="overflow-menu-items tw-justify-center" data-global-init="initTabSwitcher">
|
||||
<a class="item active" data-tab="diff-side-by-side-{{.file.NameHash}}">{{ctx.Locale.Tr "repo.diff.image.side_by_side"}}</a>
|
||||
{{if and .blobBase .blobHead}}
|
||||
<a class="item" data-tab="diff-swipe-{{.file.NameHash}}">{{ctx.Locale.Tr "repo.diff.image.swipe"}}</a>
|
||||
<a class="item" data-tab="diff-overlay-{{.file.NameHash}}">{{ctx.Locale.Tr "repo.diff.image.overlay"}}</a>
|
||||
{{end}}
|
||||
</div>
|
||||
</overflow-menu>
|
||||
<div class="image-diff-tabs is-loading">
|
||||
<div class="ui bottom attached tab image-diff-container active" data-tab="diff-side-by-side-{{.file.NameHash}}">
|
||||
<div class="diff-side-by-side">
|
||||
{{if .blobBase}}
|
||||
<span class="side">
|
||||
<p class="side-header">{{ctx.Locale.Tr "repo.diff.file_before"}}</p>
|
||||
<span class="before-container"><img alt class="image-before"></span>
|
||||
<p>
|
||||
<span class="bounds-info-before">
|
||||
{{ctx.Locale.Tr "repo.diff.file_image_width"}}: <span class="text bounds-info-width"></span>
|
||||
|
|
||||
{{ctx.Locale.Tr "repo.diff.file_image_height"}}: <span class="text bounds-info-height"></span>
|
||||
|
|
||||
</span>
|
||||
{{ctx.Locale.Tr "repo.diff.file_byte_size"}}: <span class="text">{{FileSize .blobBase.Size}}</span>
|
||||
</p>
|
||||
</span>
|
||||
{{end}}
|
||||
{{if .blobHead}}
|
||||
<span class="side">
|
||||
<p class="side-header">{{ctx.Locale.Tr "repo.diff.file_after"}}</p>
|
||||
<span class="after-container"><img alt class="image-after"></span>
|
||||
<p>
|
||||
<span class="bounds-info-after">
|
||||
{{ctx.Locale.Tr "repo.diff.file_image_width"}}: <span class="text bounds-info-width"></span>
|
||||
|
|
||||
{{ctx.Locale.Tr "repo.diff.file_image_height"}}: <span class="text bounds-info-height"></span>
|
||||
|
|
||||
</span>
|
||||
{{ctx.Locale.Tr "repo.diff.file_byte_size"}}: <span class="text">{{FileSize .blobHead.Size}}</span>
|
||||
</p>
|
||||
</span>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
{{if and .blobBase .blobHead}}
|
||||
<div class="ui bottom attached tab image-diff-container" data-tab="diff-swipe-{{.file.NameHash}}">
|
||||
<div class="diff-swipe">
|
||||
<div class="swipe-frame">
|
||||
<span class="before-container"><img alt class="image-before"></span>
|
||||
<span class="swipe-container">
|
||||
<span class="after-container"><img alt class="image-after"></span>
|
||||
</span>
|
||||
<span class="swipe-bar">
|
||||
<span class="handle top-handle"></span>
|
||||
<span class="handle bottom-handle"></span>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ui bottom attached tab image-diff-container" data-tab="diff-overlay-{{.file.NameHash}}">
|
||||
<div class="diff-overlay">
|
||||
<input type="range" min="0" max="100" value="50">
|
||||
<div class="overlay-frame">
|
||||
<span class="before-container"><img alt class="image-before"></span>
|
||||
<span class="after-container"><img alt class="image-after"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{{end}}
|
||||
@@ -0,0 +1,5 @@
|
||||
<div class="conversation-holder">
|
||||
<div class="field comment-code-cloud">
|
||||
{{template "repo/diff/comment_form_datahandler" .}}
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,57 @@
|
||||
<div id="review-box" {{if $.Repository.IsArchived}}data-tooltip-content="{{ctx.Locale.Tr "repo.archive.pull.nocomment"}}"{{end}}>
|
||||
<button class="ui tiny primary button tw-pr-1 js-btn-review {{if not $.IsShowingAllCommits}}disabled{{end}}"
|
||||
{{if not $.IsShowingAllCommits}}data-tooltip-content="{{ctx.Locale.Tr "repo.pulls.review_only_possible_for_full_diff"}}"{{end}}
|
||||
{{if $.Repository.IsArchived}}disabled{{end}}
|
||||
>
|
||||
{{ctx.Locale.Tr "repo.diff.review"}}
|
||||
<span class="ui small label review-comments-counter" data-pending-comment-number="{{.PendingCodeCommentNumber}}">{{.PendingCodeCommentNumber}}</span>
|
||||
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
||||
</button>
|
||||
</div>
|
||||
{{if $.IsShowingAllCommits}}
|
||||
<div class="review-box-panel tippy-target">
|
||||
<div class="ui segment">
|
||||
<form class="ui form form-fetch-action" action="{{.Issue.Link}}/files/reviews/submit" method="post">
|
||||
<input type="hidden" name="commit_id" value="{{.AfterCommitID}}">
|
||||
<div class="field flex-text-block">
|
||||
<div class="tw-flex-1">{{ctx.Locale.Tr "repo.diff.review.header"}}</div>
|
||||
<a class="muted close">{{svg "octicon-x" 16}}</a>
|
||||
</div>
|
||||
<div class="field">
|
||||
{{template "shared/combomarkdowneditor" (dict
|
||||
"MarkdownEditorContext" (ctx.MiscUtils.MarkdownEditorComment $.Repository)
|
||||
"TextareaName" "content"
|
||||
"TextareaPlaceholder" (ctx.Locale.Tr "repo.diff.review.placeholder")
|
||||
"DropzoneParentContainer" "form"
|
||||
)}}
|
||||
</div>
|
||||
{{if .IsAttachmentEnabled}}
|
||||
<div class="field">
|
||||
{{template "repo/upload" .}}
|
||||
</div>
|
||||
{{end}}
|
||||
<div class="divider"></div>
|
||||
{{$showSelfTooltip := (and $.IsSigned ($.Issue.IsPoster $.SignedUser.ID))}}
|
||||
{{if not $.Issue.IsClosed}}
|
||||
{{if $showSelfTooltip}}
|
||||
<span class="tw-inline-block" data-tooltip-content="{{ctx.Locale.Tr "repo.diff.review.self_approve"}}">
|
||||
<button type="submit" name="type" value="approve" disabled class="ui submit primary tiny button btn-submit">{{ctx.Locale.Tr "repo.diff.review.approve"}}</button>
|
||||
</span>
|
||||
{{else}}
|
||||
<button type="submit" name="type" value="approve" class="ui submit primary tiny button btn-submit">{{ctx.Locale.Tr "repo.diff.review.approve"}}</button>
|
||||
{{end}}
|
||||
{{end}}
|
||||
<button type="submit" name="type" value="comment" class="ui submit tiny basic button btn-submit">{{ctx.Locale.Tr "repo.diff.review.comment"}}</button>
|
||||
{{if not $.Issue.IsClosed}}
|
||||
{{if $showSelfTooltip}}
|
||||
<span class="tw-inline-block" data-tooltip-content="{{ctx.Locale.Tr "repo.diff.review.self_reject"}}">
|
||||
<button type="submit" name="type" value="reject" disabled class="ui submit red tiny button btn-submit">{{ctx.Locale.Tr "repo.diff.review.reject"}}</button>
|
||||
</span>
|
||||
{{else}}
|
||||
<button type="submit" name="type" value="reject" class="ui submit red tiny button btn-submit">{{ctx.Locale.Tr "repo.diff.review.reject"}}</button>
|
||||
{{end}}
|
||||
{{end}}
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
@@ -0,0 +1,32 @@
|
||||
<div class="ui dropdown tiny basic button" data-tooltip-content="{{ctx.Locale.Tr "repo.diff.options_button"}}">
|
||||
{{svg "octicon-kebab-horizontal"}}
|
||||
<div class="menu">
|
||||
{{if .Issue.Index}}
|
||||
<a class="item" href="{{$.RepoLink}}/pulls/{{.Issue.Index}}.patch" download="{{.Issue.Index}}.patch">{{ctx.Locale.Tr "repo.diff.download_patch"}}</a>
|
||||
<a class="item" href="{{$.RepoLink}}/pulls/{{.Issue.Index}}.diff" download="{{.Issue.Index}}.diff">{{ctx.Locale.Tr "repo.diff.download_diff"}}</a>
|
||||
{{else if $.PageIsWiki}}
|
||||
<a class="item" href="{{$.RepoLink}}/wiki/commit/{{PathEscape .Commit.ID.String}}.patch" download="{{ShortSha .Commit.ID.String}}.patch">{{ctx.Locale.Tr "repo.diff.download_patch"}}</a>
|
||||
<a class="item" href="{{$.RepoLink}}/wiki/commit/{{PathEscape .Commit.ID.String}}.diff" download="{{ShortSha .Commit.ID.String}}.diff">{{ctx.Locale.Tr "repo.diff.download_diff"}}</a>
|
||||
{{else if .Commit.ID.String}}
|
||||
<a class="item" href="{{$.RepoLink}}/commit/{{PathEscape .Commit.ID.String}}.patch" download="{{ShortSha .Commit.ID.String}}.patch">{{ctx.Locale.Tr "repo.diff.download_patch"}}</a>
|
||||
<a class="item" href="{{$.RepoLink}}/commit/{{PathEscape .Commit.ID.String}}.diff" download="{{ShortSha .Commit.ID.String}}.diff">{{ctx.Locale.Tr "repo.diff.download_diff"}}</a>
|
||||
{{end}}
|
||||
<a id="expand-files-btn" class="item">{{ctx.Locale.Tr "repo.pulls.expand_files"}}</a>
|
||||
<a id="collapse-files-btn" class="item">{{ctx.Locale.Tr "repo.pulls.collapse_files"}}</a>
|
||||
{{if .Issue.Index}}
|
||||
{{if .ShowOutdatedComments}}
|
||||
<a class="item" href="?style={{if $.IsSplitStyle}}split{{else}}unified{{end}}&whitespace={{$.WhitespaceBehavior}}&show-outdated=false">
|
||||
<label class="tw-pointer-events-none">
|
||||
{{ctx.Locale.Tr "repo.issues.review.option.hide_outdated_comments"}}
|
||||
</label>
|
||||
</a>
|
||||
{{else}}
|
||||
<a class="item" href="?style={{if $.IsSplitStyle}}split{{else}}unified{{end}}&whitespace={{$.WhitespaceBehavior}}&show-outdated=true">
|
||||
<label class="tw-pointer-events-none">
|
||||
{{ctx.Locale.Tr "repo.issues.review.option.show_outdated_comments"}}
|
||||
</label>
|
||||
</a>
|
||||
{{end}}
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1 @@
|
||||
<code class="code-inner{{if .diff.EscapeStatus.Escaped}} has-escaped{{end}}">{{.diff.Content}}</code>
|
||||
@@ -0,0 +1,137 @@
|
||||
{{$file := .file}}
|
||||
{{$diffBlobExcerptData := $.root.DiffBlobExcerptData}}
|
||||
<colgroup>
|
||||
<col width="50">
|
||||
<col width="10">
|
||||
<col width="10">
|
||||
<col>
|
||||
<col width="50">
|
||||
<col width="10">
|
||||
<col width="10">
|
||||
<col>
|
||||
</colgroup>
|
||||
{{range $j, $section := $file.Sections}}
|
||||
{{range $k, $line := $section.Lines}}
|
||||
{{$hasmatch := ne $line.Match -1}}
|
||||
{{if or (ne .GetType 2) (not $hasmatch)}}
|
||||
<tr class="{{.GetHTMLDiffLineType}}-code nl-{{$k}} ol-{{$k}}" data-line-type="{{.GetHTMLDiffLineType}}">
|
||||
{{if eq .GetType 4}}
|
||||
{{$inlineDiff := $section.GetComputedInlineDiffFor $line ctx.Locale}}
|
||||
<td class="lines-num lines-num-old">{{$line.RenderBlobExcerptButtons $file.NameHash $diffBlobExcerptData}}</td>
|
||||
<td class="lines-escape lines-escape-old">{{ctx.RenderUtils.RenderUnicodeEscapeToggleButton $inlineDiff.EscapeStatus}}</td>
|
||||
<td colspan="6" class="lines-code lines-code-old">{{template "repo/diff/section_code" dict "diff" $inlineDiff}}</td>
|
||||
{{else if and (eq .GetType 3) $hasmatch}}{{/* DEL */}}
|
||||
{{$match := index $section.Lines $line.Match}}
|
||||
{{- $leftDiff := ""}}{{if $line.LeftIdx}}{{$leftDiff = $section.GetComputedInlineDiffFor $line ctx.Locale}}{{end}}
|
||||
{{- $rightDiff := ""}}{{if $match.RightIdx}}{{$rightDiff = $section.GetComputedInlineDiffFor $match ctx.Locale}}{{end}}
|
||||
<td class="lines-num lines-num-old del-code" data-line-num="{{$line.LeftIdx}}"><span rel="diff-{{$file.NameHash}}L{{$line.LeftIdx}}"></span></td>
|
||||
<td class="lines-escape del-code lines-escape-old">{{if $line.LeftIdx}}{{ctx.RenderUtils.RenderUnicodeEscapeToggleButton $leftDiff.EscapeStatus}}{{end}}</td>
|
||||
<td class="lines-type-marker lines-type-marker-old del-code"><span class="tw-font-mono" data-type-marker="{{$line.GetLineTypeMarker}}"></span></td>
|
||||
<td class="lines-code lines-code-old del-code">
|
||||
{{- if and $.root.SignedUserID $.root.PageIsPullFiles -}}
|
||||
<button type="button" aria-label="{{ctx.Locale.Tr "repo.diff.comment.add_line_comment"}}" class="ui primary button add-code-comment add-code-comment-left{{if (not $line.CanComment)}} tw-invisible{{end}}" data-side="left" data-idx="{{$line.LeftIdx}}">
|
||||
{{- svg "octicon-plus" -}}
|
||||
</button>
|
||||
{{- end -}}
|
||||
{{- if $line.LeftIdx -}}
|
||||
{{- template "repo/diff/section_code" dict "diff" $leftDiff -}}
|
||||
{{- else -}}
|
||||
<code class="code-inner"></code>
|
||||
{{- end -}}
|
||||
</td>
|
||||
<td class="lines-num lines-num-new add-code" data-line-num="{{if $match.RightIdx}}{{$match.RightIdx}}{{end}}"><span rel="{{if $match.RightIdx}}diff-{{$file.NameHash}}R{{$match.RightIdx}}{{end}}"></span></td>
|
||||
<td class="lines-escape add-code lines-escape-new">{{if $match.RightIdx}}{{ctx.RenderUtils.RenderUnicodeEscapeToggleButton $rightDiff.EscapeStatus}}{{end}}</td>
|
||||
<td class="lines-type-marker lines-type-marker-new add-code">{{if $match.RightIdx}}<span class="tw-font-mono" data-type-marker="{{$match.GetLineTypeMarker}}"></span>{{end}}</td>
|
||||
<td class="lines-code lines-code-new add-code">
|
||||
{{- if and $.root.SignedUserID $.root.PageIsPullFiles -}}
|
||||
<button type="button" aria-label="{{ctx.Locale.Tr "repo.diff.comment.add_line_comment"}}" class="ui primary button add-code-comment add-code-comment-right{{if (not $match.CanComment)}} tw-invisible{{end}}" data-side="right" data-idx="{{$match.RightIdx}}">
|
||||
{{- svg "octicon-plus" -}}
|
||||
</button>
|
||||
{{- end -}}
|
||||
{{- if $match.RightIdx -}}
|
||||
{{- template "repo/diff/section_code" dict "diff" $rightDiff -}}
|
||||
{{- else -}}
|
||||
<code class="code-inner"></code>
|
||||
{{- end -}}
|
||||
</td>
|
||||
{{else}}
|
||||
{{$inlineDiff := $section.GetComputedInlineDiffFor $line ctx.Locale}}
|
||||
<td class="lines-num lines-num-old" data-line-num="{{if $line.LeftIdx}}{{$line.LeftIdx}}{{end}}"><span rel="{{if $line.LeftIdx}}diff-{{$file.NameHash}}L{{$line.LeftIdx}}{{end}}"></span></td>
|
||||
<td class="lines-escape lines-escape-old">{{if $line.LeftIdx}}{{ctx.RenderUtils.RenderUnicodeEscapeToggleButton $inlineDiff.EscapeStatus}}{{end}}</td>
|
||||
<td class="lines-type-marker lines-type-marker-old">{{if $line.LeftIdx}}<span class="tw-font-mono" data-type-marker="{{$line.GetLineTypeMarker}}"></span>{{end}}</td>
|
||||
<td class="lines-code lines-code-old">
|
||||
{{- if and $.root.SignedUserID $.root.PageIsPullFiles (not (eq .GetType 2)) -}}
|
||||
<button type="button" aria-label="{{ctx.Locale.Tr "repo.diff.comment.add_line_comment"}}" class="ui primary button add-code-comment add-code-comment-left{{if (not $line.CanComment)}} tw-invisible{{end}}" data-side="left" data-idx="{{$line.LeftIdx}}">
|
||||
{{- svg "octicon-plus" -}}
|
||||
</button>
|
||||
{{- end -}}
|
||||
{{- if $line.LeftIdx -}}
|
||||
{{- template "repo/diff/section_code" dict "diff" $inlineDiff -}}
|
||||
{{- else -}}
|
||||
<code class="code-inner"></code>
|
||||
{{- end -}}
|
||||
</td>
|
||||
<td class="lines-num lines-num-new" data-line-num="{{if $line.RightIdx}}{{$line.RightIdx}}{{end}}"><span rel="{{if $line.RightIdx}}diff-{{$file.NameHash}}R{{$line.RightIdx}}{{end}}"></span></td>
|
||||
<td class="lines-escape lines-escape-new">{{if $line.RightIdx}}{{ctx.RenderUtils.RenderUnicodeEscapeToggleButton $inlineDiff.EscapeStatus}}{{end}}</td>
|
||||
<td class="lines-type-marker lines-type-marker-new">{{if $line.RightIdx}}<span class="tw-font-mono" data-type-marker="{{$line.GetLineTypeMarker}}"></span>{{end}}</td>
|
||||
<td class="lines-code lines-code-new">
|
||||
{{- if and $.root.SignedUserID $.root.PageIsPullFiles (not (eq .GetType 3)) -}}
|
||||
<button type="button" aria-label="{{ctx.Locale.Tr "repo.diff.comment.add_line_comment"}}" class="ui primary button add-code-comment add-code-comment-right{{if (not $line.CanComment)}} tw-invisible{{end}}" data-side="right" data-idx="{{$line.RightIdx}}">
|
||||
{{- svg "octicon-plus" -}}
|
||||
</button>
|
||||
{{- end -}}
|
||||
{{- if $line.RightIdx -}}
|
||||
{{- template "repo/diff/section_code" dict "diff" $inlineDiff -}}
|
||||
{{- else -}}
|
||||
<code class="code-inner"></code>
|
||||
{{- end -}}
|
||||
</td>
|
||||
{{end}}
|
||||
</tr>
|
||||
{{if and (eq .GetType 3) $hasmatch}}
|
||||
{{$match := index $section.Lines $line.Match}}
|
||||
{{if or $line.Comments $match.Comments}}
|
||||
<tr class="add-comment" data-line-type="{{.GetHTMLDiffLineType}}">
|
||||
<td class="add-comment-left" colspan="4">
|
||||
{{if $line.Comments}}
|
||||
{{if eq $line.GetCommentSide "previous"}}
|
||||
{{template "repo/diff/conversation" dict "." $.root "comments" $line.Comments}}
|
||||
{{end}}
|
||||
{{end}}
|
||||
{{if $match.Comments}}
|
||||
{{if eq $match.GetCommentSide "previous"}}
|
||||
{{template "repo/diff/conversation" dict "." $.root "comments" $match.Comments}}
|
||||
{{end}}
|
||||
{{end}}
|
||||
</td>
|
||||
<td class="add-comment-right" colspan="4">
|
||||
{{if $line.Comments}}
|
||||
{{if eq $line.GetCommentSide "proposed"}}
|
||||
{{template "repo/diff/conversation" dict "." $.root "comments" $line.Comments}}
|
||||
{{end}}
|
||||
{{end}}
|
||||
{{if $match.Comments}}
|
||||
{{if eq $match.GetCommentSide "proposed"}}
|
||||
{{template "repo/diff/conversation" dict "." $.root "comments" $match.Comments}}
|
||||
{{end}}
|
||||
{{end}}
|
||||
</td>
|
||||
</tr>
|
||||
{{end}}
|
||||
{{else if $line.Comments}}
|
||||
<tr class="add-comment" data-line-type="{{.GetHTMLDiffLineType}}">
|
||||
<td class="add-comment-left" colspan="4">
|
||||
{{if eq $line.GetCommentSide "previous"}}
|
||||
{{template "repo/diff/conversation" dict "." $.root "comments" $line.Comments}}
|
||||
{{end}}
|
||||
</td>
|
||||
<td class="add-comment-right" colspan="4">
|
||||
{{if eq $line.GetCommentSide "proposed"}}
|
||||
{{template "repo/diff/conversation" dict "." $.root "comments" $line.Comments}}
|
||||
{{end}}
|
||||
</td>
|
||||
</tr>
|
||||
{{end}}
|
||||
{{end}}
|
||||
{{end}}
|
||||
{{end}}
|
||||
@@ -0,0 +1,51 @@
|
||||
{{$file := .file}}
|
||||
{{/* this tmpl is also used by the PR Conversation page, so "DiffBlobExcerptData" may not exist */}}
|
||||
{{$diffBlobExcerptData := $.root.DiffBlobExcerptData}}
|
||||
<colgroup>
|
||||
<col width="50">
|
||||
<col width="50">
|
||||
<col width="10">
|
||||
<col width="10">
|
||||
<col>
|
||||
</colgroup>
|
||||
{{range $j, $section := $file.Sections}}
|
||||
{{range $k, $line := $section.Lines}}
|
||||
<tr class="{{.GetHTMLDiffLineType}}-code nl-{{$k}} ol-{{$k}}" data-line-type="{{.GetHTMLDiffLineType}}">
|
||||
{{if eq .GetType 4}}
|
||||
{{if $diffBlobExcerptData}}
|
||||
<td colspan="2" class="lines-num">{{$line.RenderBlobExcerptButtons $file.NameHash $diffBlobExcerptData}}</td>
|
||||
{{else}}
|
||||
{{/* when DiffBlobExcerptData is not available (code file preview, pull conversation diff comment), do not show the expansion arrows */}}
|
||||
<td colspan="2" class="lines-num"></td>
|
||||
{{end}}
|
||||
{{else}}
|
||||
<td class="lines-num lines-num-old" data-line-num="{{if $line.LeftIdx}}{{$line.LeftIdx}}{{end}}"><span rel="{{if $line.LeftIdx}}diff-{{$file.NameHash}}L{{$line.LeftIdx}}{{end}}"></span></td>
|
||||
<td class="lines-num lines-num-new" data-line-num="{{if $line.RightIdx}}{{$line.RightIdx}}{{end}}"><span rel="{{if $line.RightIdx}}diff-{{$file.NameHash}}R{{$line.RightIdx}}{{end}}"></span></td>
|
||||
{{end}}
|
||||
{{$inlineDiff := $section.GetComputedInlineDiffFor $line ctx.Locale -}}
|
||||
<td class="lines-escape">
|
||||
{{ctx.RenderUtils.RenderUnicodeEscapeToggleButton $inlineDiff.EscapeStatus}}
|
||||
</td>
|
||||
<td class="lines-type-marker"><span class="tw-font-mono" data-type-marker="{{$line.GetLineTypeMarker}}"></span></td>
|
||||
{{if eq .GetType 4}}
|
||||
<td class="chroma lines-code blob-hunk">{{template "repo/diff/section_code" dict "diff" $inlineDiff}}</td>
|
||||
{{else}}
|
||||
<td class="chroma lines-code{{if (not $line.RightIdx)}} lines-code-old{{end}}">
|
||||
{{- if and $.root.SignedUserID $.root.PageIsPullFiles -}}
|
||||
<button type="button" aria-label="{{ctx.Locale.Tr "repo.diff.comment.add_line_comment"}}" class="ui primary button add-code-comment add-code-comment-{{if $line.RightIdx}}right{{else}}left{{end}}{{if (not $line.CanComment)}} tw-invisible{{end}}" data-side="{{if $line.RightIdx}}right{{else}}left{{end}}" data-idx="{{if $line.RightIdx}}{{$line.RightIdx}}{{else}}{{$line.LeftIdx}}{{end}}">
|
||||
{{- svg "octicon-plus" -}}
|
||||
</button>
|
||||
{{- end -}}
|
||||
{{- template "repo/diff/section_code" dict "diff" $inlineDiff -}}
|
||||
</td>
|
||||
{{end}}
|
||||
</tr>
|
||||
{{if $line.Comments}}
|
||||
<tr class="add-comment" data-line-type="{{.GetHTMLDiffLineType}}">
|
||||
<td class="add-comment-left add-comment-right" colspan="5">
|
||||
{{template "repo/diff/conversation" dict "." $.root "comments" $line.Comments}}
|
||||
</td>
|
||||
</tr>
|
||||
{{end}}
|
||||
{{end}}
|
||||
{{end}}
|
||||
@@ -0,0 +1,17 @@
|
||||
{{/* Template Attributes:
|
||||
* Addition: Number of additions
|
||||
* Deletion: Number of deletions
|
||||
* Classes: Additional classes for the root element
|
||||
*/}}
|
||||
{{if or .Addition .Deletion}}
|
||||
<div class="flex-text-block tw-flex-shrink-0 tw-text-[13px] {{if .Classes}}{{.Classes}}{{end}}">
|
||||
<span>
|
||||
{{if .Addition}}<span class="tw-text-diff-added-fg">+{{.Addition}}</span>{{end}}
|
||||
{{if .Deletion}}<span class="tw-text-diff-removed-fg">-{{.Deletion}}</span>{{end}}
|
||||
</span>
|
||||
<span class="diff-stats-bar" data-tooltip-content="{{ctx.Locale.Tr "repo.diff.stats_desc_file" (Eval .Addition "+" .Deletion) .Addition .Deletion}}">
|
||||
{{/* if the denominator is zero, then the float result is "width: NaNpx", as before, it just works */}}
|
||||
<div class="diff-stats-add-bar" style="width: {{Eval 100 "*" .Addition "/" "(" .Addition "+" .Deletion "+" 0.0 ")"}}%"></div>
|
||||
</span>
|
||||
</div>
|
||||
{{end}}
|
||||
@@ -0,0 +1,30 @@
|
||||
<div class="ui dropdown tiny basic button" data-tooltip-content="{{ctx.Locale.Tr "repo.diff.whitespace_button"}}">
|
||||
{{svg "gitea-whitespace"}}
|
||||
<div class="menu">
|
||||
<a class="item" href="?style={{if .IsSplitStyle}}split{{else}}unified{{end}}&whitespace=show-all&show-outdated={{$.ShowOutdatedComments}}">
|
||||
<label class="tw-pointer-events-none">
|
||||
<input class="tw-mr-2 tw-pointer-events-none" type="radio"{{if eq .WhitespaceBehavior "show-all"}} checked{{end}}>
|
||||
{{ctx.Locale.Tr "repo.diff.whitespace_show_everything"}}
|
||||
</label>
|
||||
</a>
|
||||
<a class="item" href="?style={{if .IsSplitStyle}}split{{else}}unified{{end}}&whitespace=ignore-all&show-outdated={{$.ShowOutdatedComments}}">
|
||||
<label class="tw-pointer-events-none">
|
||||
<input class="tw-mr-2 tw-pointer-events-none" type="radio"{{if eq .WhitespaceBehavior "ignore-all"}} checked{{end}}>
|
||||
{{ctx.Locale.Tr "repo.diff.whitespace_ignore_all_whitespace"}}
|
||||
</label>
|
||||
</a>
|
||||
<a class="item" href="?style={{if .IsSplitStyle}}split{{else}}unified{{end}}&whitespace=ignore-change&show-outdated={{$.ShowOutdatedComments}}">
|
||||
<label class="tw-pointer-events-none">
|
||||
<input class="tw-mr-2 tw-pointer-events-none" type="radio"{{if eq .WhitespaceBehavior "ignore-change"}} checked{{end}}>
|
||||
{{ctx.Locale.Tr "repo.diff.whitespace_ignore_amount_changes"}}
|
||||
</label>
|
||||
</a>
|
||||
<a class="item" href="?style={{if .IsSplitStyle}}split{{else}}unified{{end}}&whitespace=ignore-eol&show-outdated={{$.ShowOutdatedComments}}">
|
||||
<label class="tw-pointer-events-none">
|
||||
<input class="tw-mr-2 tw-pointer-events-none" type="radio"{{if eq .WhitespaceBehavior "ignore-eol"}} checked{{end}}>
|
||||
{{ctx.Locale.Tr "repo.diff.whitespace_ignore_at_eol"}}
|
||||
</label>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<a class="ui tiny basic button" href="?style={{if .IsSplitStyle}}unified{{else}}split{{end}}&whitespace={{$.WhitespaceBehavior}}&show-outdated={{$.ShowOutdatedComments}}" data-tooltip-content="{{if .IsSplitStyle}}{{ctx.Locale.Tr "repo.diff.show_unified_view"}}{{else}}{{ctx.Locale.Tr "repo.diff.show_split_view"}}{{end}}">{{svg (Iif .IsSplitStyle "gitea-join" "gitea-split")}}</a>
|
||||
@@ -0,0 +1,28 @@
|
||||
{{template "base/head" .}}
|
||||
<div role="main" aria-label="{{.Title}}" class="page-content repository file editor edit">
|
||||
{{template "repo/header" .}}
|
||||
<div class="ui container">
|
||||
{{template "base/alert" .}}
|
||||
<form class="ui edit form form-fetch-action" method="post" action="{{.CommitFormOptions.TargetFormAction}}">
|
||||
{{template "repo/editor/common_top" .}}
|
||||
<input type="hidden" name="revert" value="{{if eq .CherryPickType "revert"}}true{{else}}false{{end}}">
|
||||
<div class="repo-editor-header">
|
||||
<div class="breadcrumb">
|
||||
{{$shaurl := printf "%s/commit/%s" $.RepoLink (PathEscape .FromCommitID)}}
|
||||
{{$shalink := HTMLFormat `<a class="ui primary sha label" href="%s">%s</a>` $shaurl (ShortSha .FromCommitID)}}
|
||||
{{if eq .CherryPickType "revert"}}
|
||||
{{ctx.Locale.Tr "repo.editor.revert" $shalink}}
|
||||
{{else}}
|
||||
{{ctx.Locale.Tr "repo.editor.cherry_pick" $shalink}}
|
||||
{{end}}
|
||||
<a class="section" href="{{$.RepoLink}}">{{.Repository.FullName}}</a>
|
||||
<div class="breadcrumb-divider">:</div>
|
||||
<a class="section" href="{{$.BranchLink}}">{{.BranchName}}</a>
|
||||
<span>{{ctx.Locale.Tr "repo.editor.or"}} <a href="{{$shaurl}}">{{ctx.Locale.Tr "repo.editor.cancel_lower"}}</a></span>
|
||||
</div>
|
||||
</div>
|
||||
{{template "repo/editor/commit_form" .}}
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
{{template "base/footer" .}}
|
||||
@@ -0,0 +1,87 @@
|
||||
<div class="commit-form-wrapper">
|
||||
{{ctx.AvatarUtils.Avatar .SignedUser 40 "commit-avatar"}}
|
||||
<div class="commit-form avatar-content-left-arrow">
|
||||
<h3>
|
||||
{{- if .CommitFormOptions.WillSign}}
|
||||
<span data-tooltip-content="{{ctx.Locale.Tr "repo.signing.will_sign" .CommitFormOptions.SigningKeyFormDisplay}}">{{svg "octicon-lock" 24}}</span>
|
||||
{{ctx.Locale.Tr "repo.editor.commit_signed_changes"}}
|
||||
{{- else}}
|
||||
<span title="{{ctx.Locale.Tr (printf "repo.signing.wont_sign.%s" .CommitFormOptions.WontSignReason)}}">{{svg "octicon-unlock" 24}}</span>
|
||||
{{ctx.Locale.Tr "repo.editor.commit_changes"}}
|
||||
{{- end}}
|
||||
</h3>
|
||||
<div class="field">
|
||||
<input name="commit_summary" maxlength="100" placeholder="{{if .PageIsDelete}}{{ctx.Locale.Tr "repo.editor.delete" .TreePath}}{{else if .PageIsUpload}}{{ctx.Locale.Tr "repo.editor.upload_files_to_dir" .TreePath}}{{else if .IsNewFile}}{{ctx.Locale.Tr "repo.editor.add_tmpl"}}{{else if .PageIsPatch}}{{ctx.Locale.Tr "repo.editor.patch"}}{{else}}{{ctx.Locale.Tr "repo.editor.update" .TreePath}}{{end}}" value="{{.commit_summary}}">
|
||||
</div>
|
||||
<div class="field">
|
||||
<textarea name="commit_message" placeholder="{{ctx.Locale.Tr "repo.editor.commit_message_desc"}}" rows="5">{{.commit_message}}</textarea>
|
||||
</div>
|
||||
<div class="inline field">
|
||||
<div class="ui checkbox">
|
||||
<input name="signoff" type="checkbox">
|
||||
<label>{{ctx.Locale.Tr "repo.editor.signoff_desc"}}</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="field quick-pull-choice js-quick-pull-choice">
|
||||
<div class="field">
|
||||
<div class="ui radio checkbox {{if not .CommitFormOptions.CanCommitToBranch}}disabled{{end}}">
|
||||
<input type="radio" class="js-quick-pull-choice-option" name="commit_choice" value="direct" data-button-text="{{ctx.Locale.Tr "repo.editor.commit_changes"}}" {{if eq .commit_choice "direct"}}checked{{end}}>
|
||||
<label>
|
||||
{{svg "octicon-git-commit"}}
|
||||
{{ctx.Locale.Tr "repo.editor.commit_directly_to_this_branch" .BranchName}}
|
||||
{{if not .CommitFormOptions.CanCommitToBranch}}
|
||||
<div class="tw-mt-2">
|
||||
{{ctx.Locale.Tr "repo.editor.no_commit_to_branch"}}
|
||||
<ul class="tw-mb-0">
|
||||
{{if not .CommitFormOptions.UserCanPush}}<li>{{ctx.Locale.Tr "repo.editor.user_no_push_to_branch"}}</li>{{end}}
|
||||
{{if and .CommitFormOptions.RequireSigned (not .CommitFormOptions.WillSign)}}<li>{{ctx.Locale.Tr "repo.editor.require_signed_commit"}}</li>{{end}}
|
||||
</ul>
|
||||
</div>
|
||||
{{end}}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
{{if and (not .Repository.IsEmpty) (not .IsEditingFileOnly)}}
|
||||
<div class="field">
|
||||
<div class="ui radio checkbox">
|
||||
{{if .CommitFormOptions.CanCreatePullRequest}}
|
||||
<input type="radio" class="js-quick-pull-choice-option" name="commit_choice" value="commit-to-new-branch" data-button-text="{{ctx.Locale.Tr "repo.editor.propose_file_change"}}" {{if eq .commit_choice "commit-to-new-branch"}}checked{{end}}>
|
||||
{{else}}
|
||||
<input type="radio" class="js-quick-pull-choice-option" name="commit_choice" value="commit-to-new-branch" data-button-text="{{ctx.Locale.Tr "repo.editor.commit_changes"}}" {{if eq .commit_choice "commit-to-new-branch"}}checked{{end}}>
|
||||
{{end}}
|
||||
<label>
|
||||
{{svg "octicon-git-pull-request"}}
|
||||
{{if .CommitFormOptions.CanCreatePullRequest}}
|
||||
{{ctx.Locale.Tr "repo.editor.create_new_branch"}}
|
||||
{{else}}
|
||||
{{ctx.Locale.Tr "repo.editor.create_new_branch_np"}}
|
||||
{{end}}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="quick-pull-branch-name {{if not (eq .commit_choice "commit-to-new-branch")}}tw-hidden{{end}}">
|
||||
<div class="new-branch-name-input field">
|
||||
{{svg "octicon-git-branch"}}
|
||||
<input type="text" name="new_branch_name" maxlength="100" value="{{.new_branch_name}}" class="input-contrast tw-mr-1 js-quick-pull-new-branch-name" placeholder="{{ctx.Locale.Tr "repo.editor.new_branch_name_desc"}}" {{if eq .commit_choice "commit-to-new-branch"}}required{{end}} title="{{ctx.Locale.Tr "repo.editor.new_branch_name"}}">
|
||||
<span class="text-muted js-quick-pull-normalization-info"></span>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
{{if and .CommitCandidateEmails (gt (len .CommitCandidateEmails) 1)}}
|
||||
<div class="field">
|
||||
<label>{{ctx.Locale.Tr "repo.editor.commit_email"}}</label>
|
||||
<select class="ui selection dropdown" name="commit_email">
|
||||
{{- range $email := .CommitCandidateEmails -}}
|
||||
<option {{if eq $email $.CommitDefaultEmail}}selected{{end}} value="{{$email}}">{{$email}}</option>
|
||||
{{- end -}}
|
||||
</select>
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
<input type="hidden" name="last_commit" value="{{.last_commit}}">
|
||||
<button id="commit-button" type="submit" class="ui primary button">
|
||||
{{if eq .commit_choice "commit-to-new-branch"}}{{ctx.Locale.Tr "repo.editor.propose_file_change"}}{{else}}{{ctx.Locale.Tr "repo.editor.commit_changes"}}{{end}}
|
||||
</button>
|
||||
<a class="ui button red" href="{{if .ReturnURI}}{{.ReturnURI}}{{else}}{{$.BranchLink}}/{{PathEscapeSegments .TreePath}}{{end}}">{{ctx.Locale.Tr "repo.editor.cancel"}}</a>
|
||||
</div>
|
||||
@@ -0,0 +1,16 @@
|
||||
<div class="breadcrumb">
|
||||
<a class="section" href="{{$.BranchLink}}">{{.Repository.Name}}</a>
|
||||
{{$n := len .TreeNames}}
|
||||
{{$l := Eval $n "-" 1}}
|
||||
{{range $i, $v := .TreeNames}}
|
||||
<div class="breadcrumb-divider">/</div>
|
||||
{{if eq $i $l}}
|
||||
<input id="file-name" maxlength="255" value="{{$v}}" placeholder="{{ctx.Locale.Tr (Iif $.PageIsUpload "repo.editor.add_subdir" "repo.editor.name_your_file")}}" {{Iif $.PageIsUpload "" "required"}}>
|
||||
<span data-tooltip-content="{{ctx.Locale.Tr "repo.editor.filename_help"}}">{{svg "octicon-info"}}</span>
|
||||
{{else}}
|
||||
<span class="section"><a href="{{$.BranchLink}}/{{index $.TreePaths $i | PathEscapeSegments}}">{{$v}}</a></span>
|
||||
{{end}}
|
||||
{{end}}
|
||||
<span>{{ctx.Locale.Tr "repo.editor.or"}} <a href="{{or .ReturnURI (print $.BranchLink "/" (PathEscapeSegments .TreePath))}}">{{ctx.Locale.Tr "repo.editor.cancel_lower"}}</a></span>
|
||||
<input type="hidden" id="tree_path" name="tree_path" value="{{.TreePath}}">
|
||||
</div>
|
||||
@@ -0,0 +1,6 @@
|
||||
{{if .CommitFormOptions.WillSubmitToFork}}
|
||||
<div class="ui blue message">
|
||||
{{$repoLinkHTML := HTMLFormat `<a href="%s">%s</a>` .CommitFormOptions.TargetRepo.Link .CommitFormOptions.TargetRepo.FullName}}
|
||||
{{ctx.Locale.Tr "repo.editor.fork_edit_description" $repoLinkHTML}}
|
||||
</div>
|
||||
{{end}}
|
||||
@@ -0,0 +1,29 @@
|
||||
{{template "base/head" .}}
|
||||
<div role="main" aria-label="{{.Title}}" class="page-content repository file editor delete">
|
||||
{{template "repo/header" .}}
|
||||
<div class="ui container fluid padded">
|
||||
{{template "base/alert" .}}
|
||||
<div class="repo-view-container">
|
||||
{{template "repo/view_file_tree" .}}
|
||||
<div class="repo-view-content">
|
||||
<form class="ui form form-fetch-action" method="post" action="{{.CommitFormOptions.TargetFormAction}}">
|
||||
{{template "repo/editor/common_top" .}}
|
||||
<div class="repo-editor-header">
|
||||
{{/* although the UI isn't good enough, this header is necessary for the "left file tree view" toggle button, this button must exist */}}
|
||||
{{template "repo/view_file_tree_toggle_button" .}}
|
||||
{{/* then, to make the page looks overall good, add the breadcrumb here to make the toggle button can be shown in a text row, but not a single button*/}}
|
||||
<div class="breadcrumb">
|
||||
<a class="section" href="{{$.BranchLink}}">{{.Repository.Name}}</a>
|
||||
{{range $i, $v := .TreeNames}}
|
||||
<div class="breadcrumb-divider">/</div>
|
||||
<span class="section"><a href="{{$.BranchLink}}/{{index $.TreePaths $i | PathEscapeSegments}}">{{$v}}</a></span>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
{{template "repo/editor/commit_form" .}}
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{template "base/footer" .}}
|
||||
@@ -0,0 +1,17 @@
|
||||
{{if .File}}
|
||||
<div class="diff-file-box">
|
||||
<div class="ui attached table segment">
|
||||
<div class="file-body file-code code-diff code-diff-unified unicode-escaped">
|
||||
<table>
|
||||
<tbody>
|
||||
{{template "repo/diff/section_unified" dict "file" .File "root" $}}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{else}}
|
||||
<div class="tw-p-6 tw-text-center">
|
||||
{{ctx.Locale.Tr "repo.editor.no_changes_to_show"}}
|
||||
</div>
|
||||
{{end}}
|
||||
@@ -0,0 +1,61 @@
|
||||
{{template "base/head" .}}
|
||||
<div role="main" aria-label="{{.Title}}" class="page-content repository file editor edit">
|
||||
{{template "repo/header" .}}
|
||||
<div class="ui container fluid padded">
|
||||
{{template "base/alert" .}}
|
||||
<div class="repo-view-container">
|
||||
{{template "repo/view_file_tree" .}}
|
||||
<div class="repo-view-content">
|
||||
<form class="ui edit form form-fetch-action" method="post" action="{{.CommitFormOptions.TargetFormAction}}"
|
||||
data-text-empty-confirm-header="{{ctx.Locale.Tr "repo.editor.commit_empty_file_header"}}"
|
||||
data-text-empty-confirm-content="{{ctx.Locale.Tr "repo.editor.commit_empty_file_text"}}"
|
||||
>
|
||||
{{template "repo/editor/common_top" .}}
|
||||
<div class="repo-editor-header">
|
||||
{{template "repo/view_file_tree_toggle_button" .}}
|
||||
{{template "repo/editor/common_breadcrumb" .}}
|
||||
</div>
|
||||
{{if not .NotEditableReason}}
|
||||
<div class="field">
|
||||
<div class="ui top attached header">
|
||||
<div class="flex-left-right">
|
||||
<div class="ui compact small menu small-menu-items repo-editor-menu" data-repo-link="{{.RepoLink}}" data-ref-sub-url="{{.RefTypeNameSubURL}}" data-branch-name="{{.BranchName}}" data-global-init="initTabSwitcher">
|
||||
<a class="active item" data-tab="write">{{svg "octicon-code"}} {{if .IsNewFile}}{{ctx.Locale.Tr "repo.editor.new_file"}}{{else}}{{ctx.Locale.Tr "repo.editor.edit_file"}}{{end}}</a>
|
||||
<a class="item {{if not .CodeEditorConfig.Previewable}}tw-hidden{{end}}" data-tab="preview">{{svg "octicon-eye"}} {{ctx.Locale.Tr "preview"}}</a>
|
||||
{{if not .IsNewFile}}
|
||||
<a class="item" data-tab="diff">{{svg "octicon-diff"}} {{ctx.Locale.Tr "repo.editor.preview_changes"}}</a>
|
||||
{{end}}
|
||||
</div>
|
||||
{{template "repo/editor/options" dict "CodeEditorConfig" $.CodeEditorConfig}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="ui bottom attached segment tw-p-0">
|
||||
<div class="ui active tab tw-rounded-b" data-tab="write">
|
||||
<textarea id="edit_area" name="content" class="tw-hidden" data-id="repo-{{.Repository.Name}}-{{.TreePath}}"
|
||||
data-code-editor-config="{{JsonUtils.EncodeToString $.CodeEditorConfig}}"
|
||||
placeholder="{{ctx.Locale.Tr "editor.code_editor.placeholder"}}">{{.FileContent}}</textarea>
|
||||
<div class="editor-loading is-loading"></div>
|
||||
</div>
|
||||
<div class="ui tab tw-px-4 tw-py-3" data-tab="preview">
|
||||
<div class="editor-loading is-loading"></div>
|
||||
</div>
|
||||
<div class="ui tab" data-tab="diff">
|
||||
<div class="editor-loading is-loading"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{else}}
|
||||
<div class="field">
|
||||
<div class="ui segment tw-text-center">
|
||||
<h4 class="tw-font-semibold tw-mb-2">{{.NotEditableReason}}</h4>
|
||||
<p>{{ctx.Locale.Tr "repo.editor.file_not_editable_hint"}}</p>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
{{template "repo/editor/commit_form" .}}
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{template "base/footer" .}}
|
||||
@@ -0,0 +1,17 @@
|
||||
{{template "base/head" .}}
|
||||
<div role="main" aria-label="{{.Title}}" class="page-content repository">
|
||||
{{template "repo/header" .}}
|
||||
<div class="ui container">
|
||||
{{template "base/alert" .}}
|
||||
<form class="ui form form-fetch-action" method="post" action="{{.RepoLink}}/_fork/{{.BranchName | PathEscapeSegments}}">
|
||||
<div class="tw-text-center">
|
||||
<div class="tw-my-[40px]">
|
||||
<h3>{{ctx.Locale.Tr "repo.editor.fork_create"}}</h3>
|
||||
<p>{{ctx.Locale.Tr "repo.editor.fork_create_description"}}</p>
|
||||
</div>
|
||||
<button class="ui primary button">{{ctx.Locale.Tr "repo.fork_repo"}}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
{{template "base/footer" .}}
|
||||
@@ -0,0 +1,32 @@
|
||||
{{$indentStyle := $.CodeEditorConfig.IndentStyle}}
|
||||
{{$indentSize := or $.CodeEditorConfig.IndentSize 4}}
|
||||
{{$lineWrap := $.CodeEditorConfig.LineWrap}}
|
||||
<div class="flex-text-block code-editor-options">
|
||||
<button type="button" class="js-code-find ui compact mini icon button" aria-label="{{ctx.Locale.Tr "editor.code_editor.find"}}">{{svg "octicon-search"}}</button>
|
||||
<button type="button" class="js-code-command-palette ui compact mini icon button" aria-label="{{ctx.Locale.Tr "editor.code_editor.command_palette"}}">{{svg "octicon-command-palette"}}</button>
|
||||
<div class="native-select">
|
||||
<select class="js-indent-style-select" aria-label="{{ctx.Locale.Tr "text_indent_style"}}">
|
||||
<optgroup label="{{ctx.Locale.Tr "text_indent_style"}}">
|
||||
<option{{if eq $indentStyle "space"}} selected{{end}} value="space">{{ctx.Locale.Tr "characters_spaces"}}</option>
|
||||
<option{{if eq $indentStyle "tab"}} selected{{end}} value="tab">{{ctx.Locale.Tr "characters_tabs"}}</option>
|
||||
</optgroup>
|
||||
</select>
|
||||
</div>
|
||||
<div class="native-select">
|
||||
<select class="js-indent-size-select" aria-label="{{ctx.Locale.Tr "text_indent_size"}}">
|
||||
<optgroup label="{{ctx.Locale.Tr "text_indent_size"}}">
|
||||
<option{{if eq $indentSize 2}} selected{{end}} value="2">2</option>
|
||||
<option{{if eq $indentSize 4}} selected{{end}} value="4">4</option>
|
||||
<option{{if eq $indentSize 8}} selected{{end}} value="8">8</option>
|
||||
</optgroup>
|
||||
</select>
|
||||
</div>
|
||||
<div class="native-select">
|
||||
<select class="js-line-wrap-select" aria-label="{{ctx.Locale.Tr "text_line_wrap_mode"}}">
|
||||
<optgroup label="{{ctx.Locale.Tr "text_line_wrap_mode"}}">
|
||||
<option{{if $lineWrap}} selected{{end}} value="on">{{ctx.Locale.Tr "text_line_wrap"}}</option>
|
||||
<option{{if not $lineWrap}} selected{{end}} value="off">{{ctx.Locale.Tr "text_line_nowrap"}}</option>
|
||||
</optgroup>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,45 @@
|
||||
{{template "base/head" .}}
|
||||
<div role="main" aria-label="{{.Title}}" class="page-content repository file editor edit">
|
||||
{{template "repo/header" .}}
|
||||
<div class="ui container">
|
||||
{{template "base/alert" .}}
|
||||
<form class="ui edit form form-fetch-action" method="post" action="{{.CommitFormOptions.TargetFormAction}}"
|
||||
data-text-empty-confirm-header="{{ctx.Locale.Tr "repo.editor.commit_empty_file_header"}}"
|
||||
data-text-empty-confirm-content="{{ctx.Locale.Tr "repo.editor.commit_empty_file_text"}}"
|
||||
>
|
||||
{{template "repo/editor/common_top" .}}
|
||||
<div class="repo-editor-header">
|
||||
<div class="breadcrumb">
|
||||
{{ctx.Locale.Tr "repo.editor.patching"}}
|
||||
<a class="section" href="{{$.RepoLink}}">{{.Repository.FullName}}</a>
|
||||
<div class="breadcrumb-divider">:</div>
|
||||
<a class="section" href="{{$.BranchLink}}">{{.BranchName}}</a>
|
||||
<span>{{ctx.Locale.Tr "repo.editor.or"}} <a href="{{$.BranchLink}}">{{ctx.Locale.Tr "repo.editor.cancel_lower"}}</a></span>
|
||||
<input type="hidden" name="tree_path" value="__dummy_for_EditRepoFileForm.TreePath(Required)__">
|
||||
<input id="file-name" type="hidden" value="diff.patch">
|
||||
</div>
|
||||
</div>
|
||||
<div class="field">
|
||||
<div class="ui top attached header">
|
||||
<div class="flex-left-right">
|
||||
<div class="ui compact small menu small-menu-items repo-editor-menu">
|
||||
<a class="active item">{{svg "octicon-code" 16 "tw-mr-1"}}{{ctx.Locale.Tr "repo.editor.new_patch"}}</a>
|
||||
</div>
|
||||
{{template "repo/editor/options" dict "CodeEditorConfig" $.CodeEditorConfig}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="ui bottom attached segment tw-p-0">
|
||||
<div class="ui active tab tw-rounded-b">
|
||||
<textarea id="edit_area" name="content" class="tw-hidden" data-id="repo-{{.Repository.Name}}-patch"
|
||||
data-code-editor-config="{{JsonUtils.EncodeToString $.CodeEditorConfig}}"
|
||||
data-context="{{.RepoLink}}"
|
||||
placeholder="{{ctx.Locale.Tr "editor.code_editor.placeholder"}}">{{.FileContent}}</textarea>
|
||||
<div class="editor-loading is-loading"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{template "repo/editor/commit_form" .}}
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
{{template "base/footer" .}}
|
||||
@@ -0,0 +1,24 @@
|
||||
{{template "base/head" .}}
|
||||
<div role="main" aria-label="{{.Title}}" class="page-content repository file editor upload">
|
||||
{{template "repo/header" .}}
|
||||
<div class="ui container fluid padded">
|
||||
{{template "base/alert" .}}
|
||||
<div class="repo-view-container">
|
||||
{{template "repo/view_file_tree" .}}
|
||||
<div class="repo-view-content">
|
||||
<form class="ui comment form form-fetch-action" method="post" action="{{.CommitFormOptions.TargetFormAction}}">
|
||||
{{template "repo/editor/common_top" .}}
|
||||
<div class="repo-editor-header">
|
||||
{{template "repo/view_file_tree_toggle_button" .}}
|
||||
{{template "repo/editor/common_breadcrumb" .}}
|
||||
</div>
|
||||
<div class="field">
|
||||
{{template "repo/upload" .}}
|
||||
</div>
|
||||
{{template "repo/editor/commit_form" .}}
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{template "base/footer" .}}
|
||||
@@ -0,0 +1,77 @@
|
||||
{{template "base/head" .}}
|
||||
<div role="main" aria-label="{{.Title}}" class="page-content repository quickstart">
|
||||
{{template "repo/header" .}}
|
||||
<div class="ui container">
|
||||
<div class="ui grid">
|
||||
<div class="sixteen wide column content">
|
||||
{{template "base/alert" .}}
|
||||
{{if .Repository.IsArchived}}
|
||||
<div class="ui warning message tw-text-center">
|
||||
{{if .Repository.ArchivedUnix.IsZero}}
|
||||
{{ctx.Locale.Tr "repo.archive.title"}}
|
||||
{{else}}
|
||||
{{ctx.Locale.Tr "repo.archive.title_date" (DateUtils.AbsoluteLong .Repository.ArchivedUnix)}}
|
||||
{{end}}
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
{{if .Repository.IsBroken}}
|
||||
<div class="ui segment center">{{ctx.Locale.Tr "repo.broken_message"}}</div>
|
||||
{{else if .RepoHasContentsWithoutBranch}}
|
||||
<div class="ui segment center">{{ctx.Locale.Tr "repo.no_branch"}}</div>
|
||||
{{else if .CanWriteCode}}
|
||||
<h4 class="ui top attached header">{{ctx.Locale.Tr "repo.quick_guide"}}</h4>
|
||||
<div class="ui attached guide table segment empty-repo-guide">
|
||||
<div class="item">
|
||||
<h3>{{ctx.Locale.Tr "repo.clone_this_repo"}} <small>{{ctx.Locale.Tr "repo.clone_helper" "http://git-scm.com/book/en/v2/Git-Basics-Getting-a-Git-Repository"}}</small></h3>
|
||||
|
||||
<div class="repo-button-row">
|
||||
{{if and .CanWriteCode (not .Repository.IsArchived)}}
|
||||
<a class="ui small button" href="{{.RepoLink}}/_new/{{.BranchName | PathEscapeSegments}}/">
|
||||
{{ctx.Locale.Tr "repo.editor.new_file"}}
|
||||
</a>
|
||||
{{if .RepositoryUploadEnabled}}
|
||||
<a class="ui small button" href="{{.RepoLink}}/_upload/{{.BranchName | PathEscapeSegments}}/">
|
||||
{{ctx.Locale.Tr "repo.editor.upload_file"}}
|
||||
</a>
|
||||
{{end}}
|
||||
{{end}}
|
||||
{{template "repo/clone_buttons" .}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{if not .Repository.IsArchived}}
|
||||
<div class="divider tw-my-0"></div>
|
||||
|
||||
<div class="item">
|
||||
<h3>{{ctx.Locale.Tr "repo.create_new_repo_command"}}</h3>
|
||||
<div class="markup">
|
||||
{{$gitRemoteName := $.SystemConfig.Repository.GitGuideRemoteName.Value ctx}}
|
||||
<pre><code>touch README.md
|
||||
git init{{if ne .Repository.ObjectFormatName "sha1"}} --object-format={{.Repository.ObjectFormatName}}{{end}}{{/* for sha256 repo, it needs to set "object-format" explicitly*/}}
|
||||
{{if ne .Repository.DefaultBranch "master"}}git checkout -b {{.Repository.DefaultBranch}}{{end}}
|
||||
git add README.md
|
||||
git commit -m "first commit"
|
||||
git remote add {{$gitRemoteName}} <span class="js-clone-url">{{$.CloneButtonOriginLink.HTTPS}}</span>
|
||||
git push -u {{$gitRemoteName}} {{.Repository.DefaultBranch}}</code></pre>
|
||||
</div>
|
||||
</div>
|
||||
<div class="divider"></div>
|
||||
|
||||
<div class="item">
|
||||
<h3>{{ctx.Locale.Tr "repo.push_exist_repo"}}</h3>
|
||||
<div class="markup">
|
||||
<pre><code>git remote add {{$gitRemoteName}} <span class="js-clone-url">{{$.CloneButtonOriginLink.HTTPS}}</span>
|
||||
git push -u {{$gitRemoteName}} {{.Repository.DefaultBranch}}</code></pre>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
{{else}}
|
||||
<div class="ui segment center">{{ctx.Locale.Tr "repo.empty_message"}}</div>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{template "base/footer" .}}
|
||||
@@ -0,0 +1,48 @@
|
||||
<div class="file-info tw-font-mono">
|
||||
{{if .FileIsSymlink}}
|
||||
<div class="file-info-entry">
|
||||
{{ctx.Locale.Tr "repo.symbolic_link"}}
|
||||
</div>
|
||||
{{end}}
|
||||
{{if ne .NumLines nil}}
|
||||
<div class="file-info-entry">
|
||||
{{.NumLines}} {{ctx.Locale.TrN .NumLines "repo.line" "repo.lines"}}
|
||||
</div>
|
||||
{{end}}
|
||||
{{if ne .FileSize nil}}
|
||||
<div class="file-info-entry">
|
||||
<span class="file-info-size">{{FileSize .FileSize}}</span>{{if .IsLFSFile}}<span class="ui label">LFS</span>{{end}}
|
||||
</div>
|
||||
{{end}}
|
||||
{{if .LFSLock}}
|
||||
<div class="file-info-entry" data-tooltip-content="{{.LFSLockHint}}">
|
||||
{{svg "octicon-lock" 16 "tw-mr-1"}}
|
||||
<a href="{{.LFSLockOwnerHomeLink}}">{{.LFSLockOwner}}</a>
|
||||
</div>
|
||||
{{end}}
|
||||
{{if .LexerName}}
|
||||
<div class="file-info-entry">
|
||||
{{.LexerName}}
|
||||
</div>
|
||||
{{end}}
|
||||
{{if .IsExecutable}}
|
||||
<div class="file-info-entry">
|
||||
{{ctx.Locale.Tr "repo.executable_file"}}
|
||||
</div>
|
||||
{{end}}
|
||||
{{if .IsVendored}}
|
||||
<div class="file-info-entry">
|
||||
{{ctx.Locale.Tr "repo.vendored"}}
|
||||
</div>
|
||||
{{end}}
|
||||
{{if .IsGenerated}}
|
||||
<div class="file-info-entry">
|
||||
{{ctx.Locale.Tr "repo.generated"}}
|
||||
</div>
|
||||
{{end}}
|
||||
{{if .ImageSize}}
|
||||
<div class="file-info-entry">
|
||||
{{.ImageSize}}
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
@@ -0,0 +1,12 @@
|
||||
{{template "base/head" .}}
|
||||
<div role="main" aria-label="{{.Title}}" class="page-content repository forks">
|
||||
{{template "repo/header" .}}
|
||||
<div class="ui container fork-list">
|
||||
<h2 class="ui dividing header">
|
||||
{{ctx.Locale.Tr "repo.forks"}}
|
||||
</h2>
|
||||
{{template "shared/repo/list" .}}
|
||||
{{template "base/paginate" .}}
|
||||
</div>
|
||||
</div>
|
||||
{{template "base/footer" .}}
|
||||
@@ -0,0 +1,55 @@
|
||||
{{template "base/head" .}}
|
||||
<div role="main" aria-label="{{.Title}}" class="page-content repository commits">
|
||||
{{template "repo/header" .}}
|
||||
<div class="ui container">
|
||||
<div id="git-graph-container" class="ui segment {{if eq .Mode "monochrome"}}monochrome{{end}}">
|
||||
<h2 class="ui header dividing">
|
||||
{{ctx.Locale.Tr "repo.commit_graph"}}
|
||||
<div class="ui icon buttons tiny color-buttons">
|
||||
<div class="ui multiple selection search dropdown" id="flow-select-refs-dropdown">
|
||||
<input type="hidden" name="flow">
|
||||
<div class="default text">{{ctx.Locale.Tr "repo.commit_graph.select"}}</div>
|
||||
<div class="menu">
|
||||
<div class="item" data-value="...flow-hide-pr-refs">
|
||||
{{svg "octicon-eye-closed"}}
|
||||
<span class="gt-ellipsis" title="{{ctx.Locale.Tr "repo.commit_graph.hide_pr_refs"}}">{{ctx.Locale.Tr "repo.commit_graph.hide_pr_refs"}}</span>
|
||||
</div>
|
||||
{{range .AllRefs}}
|
||||
{{$refGroup := .RefGroup}}
|
||||
{{if eq $refGroup "pull"}}
|
||||
<div class="item" data-value="{{.Name}}">
|
||||
{{svg "octicon-git-pull-request"}}
|
||||
<span class="gt-ellipsis" title="{{.ShortName}}">#{{.ShortName}}</span>
|
||||
</div>
|
||||
{{else if eq $refGroup "tags"}}
|
||||
<div class="item" data-value="{{.Name}}">
|
||||
{{svg "octicon-tag"}}
|
||||
<span class="gt-ellipsis" title="{{.ShortName}}">{{.ShortName}}</span>
|
||||
</div>
|
||||
{{else if eq $refGroup "remotes"}}
|
||||
<div class="item" data-value="{{.Name}}">
|
||||
{{svg "octicon-cross-reference"}}
|
||||
<span class="gt-ellipsis" title="{{.ShortName}}">{{.ShortName}}</span>
|
||||
</div>
|
||||
{{else if eq $refGroup "heads"}}
|
||||
<div class="item" data-value="{{.Name}}">
|
||||
{{svg "octicon-git-branch"}}
|
||||
<span class="gt-ellipsis" title="{{.ShortName}}">{{.ShortName}}</span>
|
||||
</div>
|
||||
{{end}}
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
<button id="flow-color-monochrome" class="ui icon button{{if eq .Mode "monochrome"}} active{{end}}" title="{{ctx.Locale.Tr "repo.commit_graph.monochrome"}}">{{svg "material-invert-colors"}}{{ctx.Locale.Tr "repo.commit_graph.monochrome"}}</button>
|
||||
<button id="flow-color-colored" class="ui icon button{{if ne .Mode "monochrome"}} active{{end}}" title="{{ctx.Locale.Tr "repo.commit_graph.color"}}">{{svg "material-palette"}}{{ctx.Locale.Tr "repo.commit_graph.color"}}</button>
|
||||
</div>
|
||||
</h2>
|
||||
<div id="git-graph-body">
|
||||
{{template "repo/graph/svgcontainer" .}}
|
||||
{{template "repo/graph/commits" .}}
|
||||
{{template "base/paginate" .}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{template "base/footer" .}}
|
||||
@@ -0,0 +1,59 @@
|
||||
<div id="rev-container">
|
||||
<ul id="rev-list">
|
||||
{{range $commitI, $commit := .Graph.Commits}}
|
||||
<li {{if $commit.Rev}}id="commit-{{$commit.Rev}}"{{end}} data-flow="{{$commit.Flow}}">
|
||||
{{if $commit.OnlyRelation}}
|
||||
<span></span>
|
||||
{{else}}
|
||||
{{/* every field must be in a span to get correctly styled */}}
|
||||
<span>
|
||||
{{template "repo/commit_sign_badge" dict "Commit" $commit.Commit "CommitBaseLink" (print $.RepoLink "/commit") "CommitSignVerification" $commit.Verification}}
|
||||
</span>
|
||||
|
||||
<span class="message tw-inline-block gt-ellipsis">
|
||||
{{ctx.RenderUtils.RenderCommitMessage $commit.Subject $.Repository}}
|
||||
</span>
|
||||
|
||||
<span class="commit-refs flex-text-inline">
|
||||
{{range $commit.Refs}}
|
||||
{{$refGroup := .RefGroup}}
|
||||
{{if eq $refGroup "pull"}}
|
||||
{{if or (not $.HidePRRefs) (SliceUtils.Contains $.SelectedBranches .Name)}}
|
||||
<!-- it's intended to use issues not pulls, if it's a pull you will get redirected -->
|
||||
<a class="ui basic tiny button" href="{{$.RepoLink}}/{{if $.Repository.UnitEnabled ctx ctx.Consts.RepoUnitTypePullRequests}}pulls{{else}}issues{{end}}/{{.ShortName|PathEscape}}">
|
||||
{{svg "octicon-git-pull-request"}} #{{.ShortName}}
|
||||
</a>
|
||||
{{end}}
|
||||
{{else if eq $refGroup "tags"}}
|
||||
{{- template "repo/tag/name" dict "AdditionalClasses" "tag-label" "RepoLink" $.Repository.Link "TagName" .ShortName -}}
|
||||
{{else if eq $refGroup "remotes"}}
|
||||
<a class="ui basic tiny button" href="{{$.RepoLink}}/src/commit/{{$commit.Rev|PathEscape}}">
|
||||
{{svg "octicon-cross-reference"}} {{.ShortName}}
|
||||
</a>
|
||||
{{else if eq $refGroup "heads"}}
|
||||
<a class="ui basic tiny button" href="{{$.RepoLink}}/src/branch/{{.ShortName|PathEscape}}">
|
||||
{{svg "octicon-git-branch"}} {{.ShortName}}
|
||||
</a>
|
||||
{{else}}
|
||||
<!-- Unknown ref type .Name -->
|
||||
{{end}}
|
||||
{{end}}
|
||||
</span>
|
||||
|
||||
<span class="flex-text-inline tw-text-12">
|
||||
{{if $commit.User}}
|
||||
{{ctx.AvatarUtils.Avatar $commit.User 18}}
|
||||
{{$commit.User.GetShortDisplayNameLinkHTML}}
|
||||
{{else}}
|
||||
{{$gitUserName := $commit.Commit.Author.Name}}
|
||||
{{ctx.AvatarUtils.AvatarByEmail $commit.Commit.Author.Email $gitUserName 18}}
|
||||
{{$gitUserName}}
|
||||
{{end}}
|
||||
</span>
|
||||
|
||||
<span class="time flex-text-inline">{{DateUtils.FullTime $commit.Date}}</span>
|
||||
{{end}}
|
||||
</li>
|
||||
{{end}}
|
||||
</ul>
|
||||
</div>
|
||||
@@ -0,0 +1,3 @@
|
||||
{{template "repo/graph/svgcontainer" .}}
|
||||
{{template "repo/graph/commits" .}}
|
||||
{{template "base/paginate" .}}
|
||||
@@ -0,0 +1,24 @@
|
||||
<div id="rel-container">
|
||||
<svg viewbox="{{Eval .Graph.MinColumn "*" 5}} {{Eval .Graph.MinRow "*" 12}} {{Eval .Graph.Width "*" 5 "+" 5}} {{Eval .Graph.Height "*" 12}}" width="{{Eval .Graph.Width "*" 10 "+" 10}}px">
|
||||
{{range $flowid, $flow := .Graph.Flows}}
|
||||
<g id="flow-{{$flow.ID}}" class="flow-group flow-color-{{$flow.ColorNumber}} flow-color-16-{{$flow.Color16}}" data-flow="{{$flow.ID}}" data-color="{{$flow.ColorNumber}}">
|
||||
<path d="{{range $i, $glyph := $flow.Glyphs -}}
|
||||
{{- if or (eq $glyph.Glyph '*') (eq $glyph.Glyph '|') -}}
|
||||
M {{Eval $glyph.Column "*" 5 "+" 5}} {{Eval $glyph.Row "*" 12 "+" 0}} v 12 {{/* */ -}}
|
||||
{{- else if eq $glyph.Glyph '/' -}}
|
||||
M {{Eval $glyph.Column "*" 5 "+" 10}} {{Eval $glyph.Row "*" 12 "+" 0}} l -10 12 {{/* */ -}}
|
||||
{{- else if eq $glyph.Glyph '\\' -}}
|
||||
M {{Eval $glyph.Column "*" 5 "+" 0}} {{Eval $glyph.Row "*" 12 "+" 0}} l 10 12 {{/* */ -}}
|
||||
{{- else if or (eq $glyph.Glyph '-') (eq $glyph.Glyph '.') -}}
|
||||
M {{Eval $glyph.Column "*" 5 "+" 0}} {{Eval $glyph.Row "*" 12 "+" 12}} h 5 {{/* */ -}}
|
||||
{{- else if eq $glyph.Glyph '_' -}}
|
||||
M {{Eval $glyph.Column "*" 5 "+" 0}} {{Eval $glyph.Row "*" 12 "+" 12}} h 10 {{/* */ -}}
|
||||
{{- end -}}
|
||||
{{- end}}" stroke-width="1" fill="none" id="flow-{{$flow.ID}}-path" stroke-linecap="round"></path>
|
||||
{{range $flow.Commits}}
|
||||
<circle class="flow-commit" cx="{{Eval .Column "*" 5 "+" 5}}" cy="{{Eval .Row "*" 12 "+" 6}}" r="2.5" stroke="none" id="flow-commit-{{.Rev}}" data-rev="{{.Rev}}"></circle>
|
||||
{{end}}
|
||||
</g>
|
||||
{{end}}
|
||||
</svg>
|
||||
</div>
|
||||
@@ -0,0 +1,195 @@
|
||||
<div class="secondary-nav">
|
||||
{{with .Repository}}
|
||||
<div class="ui container">
|
||||
<div class="repo-header flex-left-right">
|
||||
{{/* left part */}}
|
||||
<div class="flex-text-block">
|
||||
{{template "repo/icon" .}}
|
||||
<div class="flex-text-block tw-flex-wrap tw-text-18">
|
||||
<a class="muted tw-font-normal" href="{{.Owner.HomeLink}}">{{.Owner.Name}}</a>/<a class="muted" href="{{$.RepoLink}}">{{.Name}}</a>
|
||||
</div>
|
||||
<div class="flex-text-block tw-flex-wrap">
|
||||
{{if .IsArchived}}
|
||||
<span class="ui basic label not-mobile">{{ctx.Locale.Tr "repo.desc.archived"}}</span>
|
||||
<div class="repo-icon only-mobile" data-tooltip-content="{{ctx.Locale.Tr "repo.desc.archived"}}">{{svg "octicon-archive" 18}}</div>
|
||||
{{end}}
|
||||
{{if .IsPrivate}}
|
||||
<span class="ui basic label not-mobile">{{ctx.Locale.Tr "repo.desc.private"}}</span>
|
||||
<div class="repo-icon only-mobile" data-tooltip-content="{{ctx.Locale.Tr "repo.desc.private"}}">{{svg "octicon-lock" 18}}</div>
|
||||
{{else}}
|
||||
{{if .Owner.Visibility.IsPrivate}}
|
||||
<span class="ui basic label not-mobile">{{ctx.Locale.Tr "repo.desc.internal"}}</span>
|
||||
<div class="repo-icon only-mobile" data-tooltip-content="{{ctx.Locale.Tr "repo.desc.internal"}}">{{svg "octicon-shield-lock" 18}}</div>
|
||||
{{end}}
|
||||
{{end}}
|
||||
{{if $.Permission.HasAnyUnitPublicAccess}}
|
||||
<span class="ui basic orange label">{{ctx.Locale.Tr "repo.desc.public_access"}}</span>
|
||||
{{end}}
|
||||
{{if .IsTemplate}}
|
||||
<span class="ui basic label not-mobile">{{ctx.Locale.Tr "repo.desc.template"}}</span>
|
||||
<div class="repo-icon only-mobile" data-tooltip-content="{{ctx.Locale.Tr "repo.desc.template"}}">{{svg "octicon-repo-template" 18}}</div>
|
||||
{{end}}
|
||||
{{if eq .ObjectFormatName "sha256"}}
|
||||
<span class="ui basic label">{{ctx.Locale.Tr "repo.desc.sha256"}}</span>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
{{if not (or .IsBeingCreated .IsBroken)}}
|
||||
{{/* right part */}}
|
||||
<div class="flex-text-block tw-flex-wrap">
|
||||
{{if $.CanUserAcceptOrRejectTransfer}}
|
||||
<button type="button" class="ui compact small basic primary button link-action" data-url="{{$.RepoLink}}/action/accept_transfer"
|
||||
data-tooltip-content="{{ctx.Locale.Tr "repo.transfer.accept_desc" $.RepoTransfer.Recipient.GetDisplayName}}"
|
||||
>{{ctx.Locale.Tr "repo.transfer.accept"}}</button>
|
||||
<button type="button" class="ui compact small basic red button link-action" data-url="{{$.RepoLink}}/action/reject_transfer"
|
||||
data-tooltip-content="{{ctx.Locale.Tr "repo.transfer.reject_desc" $.RepoTransfer.Recipient.GetDisplayName}}"
|
||||
>{{ctx.Locale.Tr "repo.transfer.reject"}}</button>
|
||||
{{else if $.RepoTransfer}}
|
||||
<div data-tooltip-content="{{ctx.Locale.Tr "repo.transfer.is_transferring_prompt" $.RepoTransfer.Recipient.GetDisplayName}}">
|
||||
<button class="ui compact small basic red button" disabled>{{ctx.Locale.Tr "repo.transfer.is_transferring"}}</button>
|
||||
</div>
|
||||
{{end}}
|
||||
{{if $.EnableFeed}}
|
||||
{{/* An extra div-element is not necessary here, as this button does not secretly contain two buttons. */}}
|
||||
<a class="ui compact small basic button" href="{{$.RepoLink}}.rss" data-tooltip-content="{{ctx.Locale.Tr "rss_feed"}}">
|
||||
{{svg "octicon-rss" 16}}
|
||||
</a>
|
||||
{{end}}
|
||||
{{template "repo/header/watch" $}}
|
||||
{{if not $.DisableStars}}
|
||||
{{template "repo/header/star" $}}
|
||||
{{end}}
|
||||
{{if and (not .IsEmpty) ($.Permission.CanRead ctx.Consts.RepoUnitTypeCode)}}
|
||||
{{template "repo/header/fork" $}}
|
||||
{{end}}
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
|
||||
{{/* next line, secondary info */}}
|
||||
{{if $.PullMirror}}
|
||||
<div class="secondary-info">
|
||||
{{ctx.Locale.Tr "repo.mirror_from"}}
|
||||
<a target="_blank" href="{{$.PullMirror.RemoteAddress}}">{{$.PullMirror.RemoteAddress}}</a>
|
||||
{{if $.PullMirror.UpdatedUnix}}{{ctx.Locale.Tr "repo.mirror_sync"}} {{DateUtils.TimeSince $.PullMirror.UpdatedUnix}}{{end}}
|
||||
</div>
|
||||
{{end}}
|
||||
{{if .IsFork}}<div class="secondary-info">{{ctx.Locale.Tr "repo.forked_from"}} <a href="{{.BaseRepo.Link}}">{{.BaseRepo.FullName}}</a></div>{{end}}
|
||||
{{if .IsGenerated}}<div class="secondary-info">{{ctx.Locale.Tr "repo.generated_from"}} <a href="{{(.TemplateRepo ctx).Link}}">{{(.TemplateRepo ctx).FullName}}</a></div>{{end}}
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
<div class="ui container">
|
||||
<overflow-menu class="ui secondary pointing menu">
|
||||
{{if not (or .Repository.IsBeingCreated .Repository.IsBroken)}}
|
||||
<div class="overflow-menu-items">
|
||||
{{if .Permission.CanRead ctx.Consts.RepoUnitTypeCode}}
|
||||
<a class="{{if .PageIsViewCode}}active {{end}}item" href="{{.RepoLink}}{{if and (ne .BranchName .Repository.DefaultBranch) (not $.PageIsWiki)}}/src/{{.RefTypeNameSubURL}}{{end}}">
|
||||
{{svg "octicon-code"}} {{ctx.Locale.Tr "repo.code"}}
|
||||
</a>
|
||||
{{end}}
|
||||
|
||||
{{if .Permission.CanRead ctx.Consts.RepoUnitTypeIssues}}
|
||||
<a class="{{if .PageIsIssueList}}active {{end}}item" href="{{.RepoLink}}/issues">
|
||||
{{svg "octicon-issue-opened"}} {{ctx.Locale.Tr "repo.issues"}}
|
||||
{{if .Repository.NumOpenIssues}}
|
||||
<span class="ui small label">{{CountFmt .Repository.NumOpenIssues}}</span>
|
||||
{{end}}
|
||||
</a>
|
||||
{{end}}
|
||||
|
||||
{{if .Permission.CanRead ctx.Consts.RepoUnitTypeExternalTracker}}
|
||||
<a class="{{if .PageIsIssueList}}active {{end}}item" href="{{.RepoExternalIssuesLink}}" target="_blank">
|
||||
{{svg "octicon-link-external"}} {{ctx.Locale.Tr "repo.issues"}}
|
||||
</a>
|
||||
{{end}}
|
||||
|
||||
{{if and .Repository.CanEnablePulls (.Permission.CanRead ctx.Consts.RepoUnitTypePullRequests)}}
|
||||
<a class="{{if .PageIsPullList}}active {{end}}item" href="{{.RepoLink}}/pulls">
|
||||
{{svg "octicon-git-pull-request"}} {{ctx.Locale.Tr "repo.pulls"}}
|
||||
{{if .Repository.NumOpenPulls}}
|
||||
<span class="ui small label">{{CountFmt .Repository.NumOpenPulls}}</span>
|
||||
{{end}}
|
||||
</a>
|
||||
{{end}}
|
||||
|
||||
{{if and .EnableActions (.Permission.CanRead ctx.Consts.RepoUnitTypeActions) (not .IsEmptyRepo)}}
|
||||
<a class="{{if .PageIsActions}}active {{end}}item" href="{{.RepoLink}}/actions">
|
||||
{{svg "octicon-play"}} {{ctx.Locale.Tr "actions.actions"}}
|
||||
{{if .Repository.NumOpenActionRuns}}
|
||||
<span class="ui small label">{{CountFmt .Repository.NumOpenActionRuns}}</span>
|
||||
{{end}}
|
||||
</a>
|
||||
{{end}}
|
||||
|
||||
{{if .Permission.CanRead ctx.Consts.RepoUnitTypePackages}}
|
||||
<a href="{{.RepoLink}}/packages" class="{{if .IsPackagesPage}}active {{end}}item">
|
||||
{{svg "octicon-package"}} {{ctx.Locale.Tr "packages.title"}}
|
||||
</a>
|
||||
{{end}}
|
||||
|
||||
{{$projectsUnit := .Repository.MustGetUnit ctx ctx.Consts.RepoUnitTypeProjects}}
|
||||
{{if and (not ctx.Consts.RepoUnitTypeProjects.UnitGlobalDisabled) (.Permission.CanRead ctx.Consts.RepoUnitTypeProjects) ($projectsUnit.ProjectsConfig.IsProjectsAllowed "repo")}}
|
||||
<a href="{{.RepoLink}}/projects" class="{{if .IsProjectsPage}}active {{end}}item">
|
||||
{{svg "octicon-project"}} {{ctx.Locale.Tr "repo.projects"}}
|
||||
{{if .Repository.NumOpenProjects}}
|
||||
<span class="ui small label">{{CountFmt .Repository.NumOpenProjects}}</span>
|
||||
{{end}}
|
||||
</a>
|
||||
{{end}}
|
||||
|
||||
{{if and (.Permission.CanRead ctx.Consts.RepoUnitTypeReleases) (not .IsEmptyRepo)}}
|
||||
<a class="{{if or .PageIsReleaseList .PageIsTagList}}active {{end}}item" href="{{.RepoLink}}/releases">
|
||||
{{svg "octicon-tag"}} {{ctx.Locale.Tr "repo.releases"}}
|
||||
{{if .NumReleases}}
|
||||
<span class="ui small label">{{CountFmt .NumReleases}}</span>
|
||||
{{end}}
|
||||
</a>
|
||||
{{end}}
|
||||
|
||||
{{if .Permission.CanRead ctx.Consts.RepoUnitTypeWiki}}
|
||||
<a class="{{if .PageIsWiki}}active {{end}}item" href="{{.RepoLink}}/wiki">
|
||||
{{svg "octicon-book"}} {{ctx.Locale.Tr "repo.wiki"}}
|
||||
</a>
|
||||
{{end}}
|
||||
|
||||
{{if .Permission.CanRead ctx.Consts.RepoUnitTypeExternalWiki}}
|
||||
<a class="item" href="{{(.Repository.MustGetUnit ctx ctx.Consts.RepoUnitTypeExternalWiki).ExternalWikiConfig.ExternalWikiURL}}" target="_blank">
|
||||
{{svg "octicon-link-external"}} {{ctx.Locale.Tr "repo.wiki"}}
|
||||
</a>
|
||||
{{end}}
|
||||
|
||||
{{if and (.Permission.CanReadAny ctx.Consts.RepoUnitTypePullRequests ctx.Consts.RepoUnitTypeIssues ctx.Consts.RepoUnitTypeReleases ctx.Consts.RepoUnitTypeCode) (not .IsEmptyRepo)}}
|
||||
<a class="{{if .PageIsActivity}}active {{end}}item" href="{{.RepoLink}}/activity">
|
||||
{{svg "octicon-pulse"}} {{ctx.Locale.Tr "repo.activity"}}
|
||||
</a>
|
||||
{{end}}
|
||||
|
||||
{{template "custom/extra_tabs" .}}
|
||||
|
||||
{{if .Permission.IsAdmin}}
|
||||
<span class="item-flex-space"></span>
|
||||
<a class="{{if .PageIsRepoSettings}}active {{end}} item" href="{{.RepoLink}}/settings">
|
||||
{{svg "octicon-tools"}} {{ctx.Locale.Tr "repo.settings"}}
|
||||
</a>
|
||||
{{end}}
|
||||
</div>
|
||||
{{else}}
|
||||
<div class="overflow-menu-items">
|
||||
{{if(and .Repository.IsBeingCreated (.Permission.CanRead ctx.Consts.RepoUnitTypeCode))}}
|
||||
<a class="{{if not .PageIsRepoSettings}}active {{end}}item" href="{{.RepoLink}}">
|
||||
{{svg "octicon-clock"}} {{ctx.Locale.Tr "repo.migration_status"}}
|
||||
</a>
|
||||
{{end}}
|
||||
|
||||
{{if .Permission.IsAdmin}}
|
||||
<a class="{{if .PageIsRepoSettings}}active {{end}} item" href="{{.RepoLink}}/settings">
|
||||
{{svg "octicon-tools"}} {{ctx.Locale.Tr "repo.settings"}}
|
||||
</a>
|
||||
{{end}}
|
||||
</div>
|
||||
{{end}}
|
||||
</overflow-menu>
|
||||
</div>
|
||||
<div class="ui tabs divider"></div>
|
||||
</div>
|
||||
@@ -0,0 +1,47 @@
|
||||
{{$canNotForkOwn := and $.IsSigned (not $.CanSignedUserFork) (not $.UserAndOrgForks)}}
|
||||
<div class="ui labeled button"
|
||||
{{if not $.IsSigned}}
|
||||
data-tooltip-content="{{ctx.Locale.Tr "repo.fork_guest_user"}}"
|
||||
{{else if $canNotForkOwn}}
|
||||
data-tooltip-content="{{ctx.Locale.Tr "repo.fork_from_self"}}"
|
||||
{{end}}
|
||||
>
|
||||
<a role="button" class="ui compact small basic button {{if $.ShowForkModal}}show-modal{{end}}"
|
||||
{{if not $.IsSigned}}
|
||||
href="{{AppSubUrl}}/user/login"
|
||||
{{else if $.ShowForkModal}}{{/* see backend comment for this logic */}}
|
||||
href="#" data-modal="#fork-repo-modal"
|
||||
{{else if eq (len $.UserAndOrgForks) 1}}
|
||||
href="{{AppSubUrl}}/{{(index $.UserAndOrgForks 0).FullName}}"
|
||||
{{else if $canNotForkOwn}}
|
||||
href="#"
|
||||
{{else}}
|
||||
href="{{$.RepoLink}}/fork"
|
||||
{{end}}
|
||||
>
|
||||
{{svg "octicon-repo-forked"}}<span class="text not-mobile">{{ctx.Locale.Tr "repo.fork"}}</span>
|
||||
</a>
|
||||
<a class="ui basic label" href="{{$.Repository.Link}}/forks">
|
||||
{{CountFmt $.Repository.NumForks}}
|
||||
</a>
|
||||
</div>
|
||||
{{if $.ShowForkModal}}
|
||||
<div class="ui small modal" id="fork-repo-modal">
|
||||
<div class="header">
|
||||
{{ctx.Locale.Tr "repo.already_forked" $.Repository.Name}}
|
||||
</div>
|
||||
<div class="content">
|
||||
<div class="ui relaxed list">
|
||||
{{range $.UserAndOrgForks}}
|
||||
<div class="item">
|
||||
<a class="flex-text-block" href="{{.Link}}">{{svg "octicon-repo-forked"}}{{.FullName}}</a>
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
{{if $.CanSignedUserFork}}
|
||||
<div class="divider"></div>
|
||||
<a href="{{$.RepoLink}}/fork">{{ctx.Locale.Tr "repo.fork_to_different_account"}}</a>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
@@ -0,0 +1,19 @@
|
||||
<div class="ui labeled button" {{if not $.IsSigned}}data-tooltip-content="{{ctx.Locale.Tr "repo.star_guest_user"}}"{{end}}>
|
||||
{{$buttonText := ctx.Locale.Tr "repo.star"}}
|
||||
{{if $.IsStaringRepo}}{{$buttonText = ctx.Locale.Tr "repo.unstar"}}{{end}}
|
||||
<a role="button" class="ui compact small basic button" aria-label="{{$buttonText}}"
|
||||
{{if $.IsSigned}}
|
||||
data-fetch-method="post"
|
||||
data-fetch-url="{{$.RepoLink}}/action/{{if $.IsStaringRepo}}unstar{{else}}star{{end}}"
|
||||
data-fetch-sync="$closest(.ui.labeled.button)"
|
||||
{{else}}
|
||||
href="{{AppSubUrl}}/user/login"
|
||||
{{end}}
|
||||
>
|
||||
{{svg (Iif $.IsStaringRepo "octicon-star-fill" "octicon-star")}}
|
||||
<span class="not-mobile" aria-hidden="true">{{$buttonText}}</span>
|
||||
</a>
|
||||
<a class="ui basic label" href="{{$.RepoLink}}/stars">
|
||||
{{CountFmt .Repository.NumStars}}
|
||||
</a>
|
||||
</div>
|
||||
@@ -0,0 +1,19 @@
|
||||
<div class="ui labeled button" {{if not $.IsSigned}}data-tooltip-content="{{ctx.Locale.Tr "repo.watch_guest_user"}}"{{end}}>
|
||||
{{$buttonText := ctx.Locale.Tr "repo.watch"}}
|
||||
{{if $.IsWatchingRepo}}{{$buttonText = ctx.Locale.Tr "repo.unwatch"}}{{end}}
|
||||
<a role="button" class="ui compact small basic button" aria-label="{{$buttonText}}"
|
||||
{{if $.IsSigned}}
|
||||
data-fetch-method="post"
|
||||
data-fetch-url="{{$.RepoLink}}/action/{{if $.IsWatchingRepo}}unwatch{{else}}watch{{end}}"
|
||||
data-fetch-sync="$closest(.ui.labeled.button)"
|
||||
{{else}}
|
||||
href="{{AppSubUrl}}/user/login"
|
||||
{{end}}
|
||||
>
|
||||
{{svg "octicon-eye"}}
|
||||
<span class="not-mobile" aria-hidden="true">{{$buttonText}}</span>
|
||||
</a>
|
||||
<a class="ui basic label" href="{{$.RepoLink}}/watchers">
|
||||
{{CountFmt .Repository.NumWatches}}
|
||||
</a>
|
||||
</div>
|
||||
@@ -0,0 +1,32 @@
|
||||
{{template "base/head" .}}
|
||||
{{$showSidebar := and (not .TreeNames) (not .HideRepoInfo) (not .IsBlame)}}
|
||||
<div role="main" aria-label="{{.Title}}" class="page-content repository file list {{if .IsBlame}}blame{{end}}">
|
||||
{{template "repo/header" .}}
|
||||
<div class="ui container {{if or .TreeNames .IsBlame}}fluid padded{{end}}">
|
||||
{{template "base/alert" .}}
|
||||
|
||||
{{if .Repository.IsArchived}}
|
||||
<div class="ui warning message tw-text-center">
|
||||
{{if .Repository.ArchivedUnix.IsZero}}
|
||||
{{ctx.Locale.Tr "repo.archive.title"}}
|
||||
{{else}}
|
||||
{{ctx.Locale.Tr "repo.archive.title_date" (DateUtils.AbsoluteLong .Repository.ArchivedUnix)}}
|
||||
{{end}}
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
{{template "repo/code/recently_pushed_new_branches" dict "RecentBranchesPromptData" .RecentBranchesPromptData}}
|
||||
|
||||
<div class="{{Iif $showSidebar "repo-grid-filelist-sidebar" "repo-grid-filelist-only"}}">
|
||||
<div class="repo-home-filelist">
|
||||
{{template "repo/view_content" .}}
|
||||
</div>
|
||||
|
||||
{{if $showSidebar}}
|
||||
{{template "repo/home_sidebar_top" .}}
|
||||
{{template "repo/home_sidebar_bottom" .}}
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{template "base/footer" .}}
|
||||
@@ -0,0 +1,47 @@
|
||||
<div class="repo-home-sidebar-bottom flex-relaxed-list">
|
||||
{{if .LatestRelease}}
|
||||
<div class="divider"></div>
|
||||
<div class="repo-home-sidebar-header">
|
||||
<a class="item muted" href="{{.RepoLink}}/releases">
|
||||
{{ctx.Locale.Tr "repo.releases"}}
|
||||
</a>
|
||||
<span class="ui small label">{{.NumReleases}}</span>
|
||||
</div>
|
||||
<div class="flex-relaxed-list">
|
||||
<div class="flex-text-block">
|
||||
<div>{{svg "octicon-tag"}}</div>
|
||||
<a class="gt-ellipsis muted" href="{{.LatestRelease.Link}}" title="{{.LatestRelease.Title}}">{{.LatestRelease.Title}}</a>
|
||||
<div class="tw-shrink-0">
|
||||
{{template "repo/release/label" (dict "Release" .LatestRelease "IsLatest" true)}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="tw-ml-[24px]">{{DateUtils.TimeSince .LatestRelease.CreatedUnix}}</div>
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
{{if and (not .IsEmptyRepo) .LanguageStats}}
|
||||
<div class="divider"></div>
|
||||
<div class="repo-home-sidebar-header">
|
||||
{{ctx.Locale.Tr "repo.repo_lang"}}
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<div class="language-stats">
|
||||
{{range .LanguageStats}}
|
||||
<div class="bar" style="width: {{.Percentage}}%; background-color: {{.Color}}" data-tooltip-placement="top" data-tooltip-content="{{.Language}}" data-tooltip-follow-cursor="horizontal"></div>
|
||||
{{end}}
|
||||
</div>
|
||||
<div class="language-stats-details">
|
||||
{{range .LanguageStats}}
|
||||
<div class="item">
|
||||
<i class="color-icon" style="background-color: {{.Color}}"></i>
|
||||
<strong class="tw-font-semibold">
|
||||
{{Iif (eq .Language "other") (ctx.Locale.Tr "repo.language_other") .Language}}
|
||||
</strong>
|
||||
{{.Percentage}}%
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
@@ -0,0 +1,72 @@
|
||||
<div class="repo-home-sidebar-top flex-relaxed-list">
|
||||
<form class="ignore-dirty tw-flex" action="{{.RepoLink}}/search" method="get">
|
||||
<div class="ui small action input tw-flex tw-flex-1">
|
||||
<div class="ui input tw-flex tw-flex-1 global-shortcut-wrapper">
|
||||
<input name="q" size="10" placeholder="{{ctx.Locale.Tr "search.code_kind"}}">
|
||||
<kbd data-global-init="onGlobalShortcut" data-shortcut-keys="s">S</kbd>
|
||||
</div>
|
||||
{{template "shared/search/button"}}
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div class="flex-relaxed-list">
|
||||
<div class="repo-home-sidebar-header">{{ctx.Locale.Tr "repo.repo_desc"}}</div>
|
||||
|
||||
<div class="repo-description tw-break-anywhere tw-gap-2">
|
||||
{{- $description := .Repository.DescriptionHTML ctx -}}
|
||||
{{if $description}}{{$description | RenderCodeBlock}}{{else}}{{ctx.Locale.Tr "repo.repo_no_desc"}}{{end}}
|
||||
</div>
|
||||
|
||||
{{if .Repository.Website}}
|
||||
<a class="flex-text-block" href="{{.Repository.Website}}">
|
||||
{{svg "octicon-link" 16 "tw-text-text"}} <span class="tw-text-primary">{{.Repository.Website}}</span>
|
||||
</a>
|
||||
{{end}}
|
||||
|
||||
<div id="repo-topics" class="flex-text-block tw-flex-wrap tw-gap-1 tw-my-1 tw-text-text">
|
||||
{{/* !!!! it SHOULD and MUST match the code in repo-home.ts */}}
|
||||
{{range .Topics}}<a class="repo-topic ui large label gt-ellipsis" title={{.Name}} href="{{AppSubUrl}}/explore/repos?q={{.Name}}&topic=1">{{.Name}}</a>{{end}}
|
||||
</div>
|
||||
{{if and .Permission.IsAdmin (not .Repository.IsArchived)}}
|
||||
<button id="manage_topic" class="btn interact-fg tw-mb-2 tw-text-12">{{ctx.Locale.Tr "repo.topic.manage_topics"}}</button>
|
||||
<div class="ui form tw-hidden tw-my-2" id="topic_edit">
|
||||
<div class="ui fluid multiple search selection dropdown tw-flex-wrap tw-flex-1">
|
||||
<input type="hidden" name="topics" value="{{range $i, $v := .Topics}}{{.Name}}{{if Eval $i "+" 1 "<" (len $.Topics)}},{{end}}{{end}}">
|
||||
{{range .Topics}}
|
||||
{{/* keep the same layout as Fomantic UI generated labels */}}
|
||||
<a class="ui label transition visible tw-cursor-default tw-inline-block repo-topic" data-value="{{.Name}}">{{.Name}}{{svg "octicon-x" 16 "delete icon"}}</a>
|
||||
{{end}}
|
||||
<div class="text"></div>
|
||||
</div>
|
||||
<div class="tw-my-2">
|
||||
<button class="ui primary button" id="save_topic" data-link="{{.RepoLink}}/topics">{{ctx.Locale.Tr "save"}}</button>
|
||||
<button class="ui basic button" id="cancel_topic_edit">{{ctx.Locale.Tr "cancel"}}</button>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
{{if .ReadmeExist}}
|
||||
<a class="flex-text-block muted" href="{{.RepoLink}}/src/{{.RefTypeNameSubURL}}/{{PathEscapeSegments .FileTreePath}}">
|
||||
{{svg "octicon-book"}} {{ctx.Locale.Tr "readme"}}
|
||||
</a>
|
||||
{{end}}
|
||||
|
||||
{{if .DetectedRepoLicenses}}
|
||||
<a class="flex-text-block muted" href="{{.RepoLink}}/src/{{.Repository.DefaultBranch}}/{{PathEscapeSegments .LicenseFileName}}" title="{{StringUtils.Join .DetectedRepoLicenses ", "}}">
|
||||
{{svg "octicon-law"}} {{if eq (len .DetectedRepoLicenses) 1}}{{index .DetectedRepoLicenses 0}}{{else}}{{ctx.Locale.Tr "repo.multiple_licenses"}}{{end}}
|
||||
</a>
|
||||
{{end}}
|
||||
|
||||
{{if .CitiationExist}}
|
||||
{{template "repo/cite/cite_modal" .}}
|
||||
<a class="flex-text-block muted" id="cite-repo-button">
|
||||
{{svg "octicon-cross-reference"}} {{ctx.Locale.Tr "repo.cite_this_repo"}}
|
||||
</a>
|
||||
{{end}}
|
||||
<div class="flex-text-block muted" {{if not (eq .Repository.Size 0)}}data-tooltip-placement="top" data-tooltip-content="{{.Repository.SizeDetailsString}}"{{end}}>
|
||||
{{$fileSizeFormatted := FileSize .Repository.Size}}{{/* the formatted string is always "{val} {unit}" */}}
|
||||
{{$fileSizeFields := StringUtils.Split $fileSizeFormatted " "}}
|
||||
{{svg "octicon-database"}} <b>{{ctx.Locale.PrettyNumber (index $fileSizeFields 0)}}</b> {{index $fileSizeFields 1}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,10 @@
|
||||
{{$avatarLink := (.RelAvatarLink ctx)}}
|
||||
{{if $avatarLink}}
|
||||
<img class="ui avatar tw-align-middle" src="{{$avatarLink}}" width="24" height="24" alt aria-hidden="true">
|
||||
{{else if $.IsMirror}}
|
||||
{{svg "octicon-mirror" 24}}
|
||||
{{else if $.IsFork}}
|
||||
{{svg "octicon-repo-forked" 24}}
|
||||
{{else}}
|
||||
{{svg "octicon-repo" 24}}
|
||||
{{end}}
|
||||
@@ -0,0 +1,30 @@
|
||||
{{/* Status icons used for runs, jobs and steps.
|
||||
|
||||
Template Attributes:
|
||||
* Status: one of success, skipped, waiting, blocked, running, failure, cancelled, cancelling, unknown
|
||||
* Size: icon size in pixels (default 16)
|
||||
* ClassName: additional CSS classes
|
||||
* IconVariant: "circle-fill" → octicon-check-circle-fill / octicon-x-circle-fill
|
||||
|
||||
Keep this template in sync with web_src/js/components/ActionStatusIcon.vue.
|
||||
*/}}
|
||||
{{- $size := or .Size 16 -}}
|
||||
{{- $className := or .ClassName "" -}}
|
||||
{{- $circleFill := eq .IconVariant "circle-fill" -}}
|
||||
{{if eq .Status "success"}}
|
||||
{{svg (Iif $circleFill "octicon-check-circle-fill" "octicon-check") $size (printf "tw-text-green %s" $className)}}
|
||||
{{else if eq .Status "skipped"}}
|
||||
{{svg "octicon-skip" $size (printf "tw-text-text-light %s" $className)}}
|
||||
{{else if eq .Status "cancelled"}}
|
||||
{{svg "octicon-stop" $size (printf "tw-text-text-light %s" $className)}}
|
||||
{{else if eq .Status "waiting"}}
|
||||
{{svg "octicon-circle" $size (printf "tw-text-text-light %s" $className)}}
|
||||
{{else if eq .Status "blocked"}}
|
||||
{{svg "octicon-blocked" $size (printf "tw-text-yellow %s" $className)}}
|
||||
{{else if eq .Status "running"}}
|
||||
{{svg "gitea-running" $size (printf "tw-text-yellow rotate-clockwise %s" $className)}}
|
||||
{{else if eq .Status "cancelling"}}
|
||||
{{svg "octicon-stop" $size (printf "tw-text-yellow %s" $className)}}
|
||||
{{else}}{{/*failure, unknown*/}}
|
||||
{{svg (Iif $circleFill "octicon-x-circle-fill" "octicon-x") $size (printf "tw-text-red %s" $className)}}
|
||||
{{end}}
|
||||
@@ -0,0 +1,19 @@
|
||||
<!-- make sure this matches the color logic in web_src/js/components/DashboardRepoList.vue -->
|
||||
{{if eq .State "pending"}}
|
||||
{{svg "octicon-dot-fill" 18 "commit-status icon tw-text-yellow"}}
|
||||
{{end}}
|
||||
{{if eq .State "success"}}
|
||||
{{svg "octicon-check" 18 "commit-status icon tw-text-green"}}
|
||||
{{end}}
|
||||
{{if eq .State "error"}}
|
||||
{{svg "gitea-exclamation" 18 "commit-status icon tw-text-red"}}
|
||||
{{end}}
|
||||
{{if eq .State "failure"}}
|
||||
{{svg "octicon-x" 18 "commit-status icon tw-text-red"}}
|
||||
{{end}}
|
||||
{{if eq .State "warning"}}
|
||||
{{svg "gitea-exclamation" 18 "commit-status icon tw-text-yellow"}}
|
||||
{{end}}
|
||||
{{if eq .State "skipped"}}
|
||||
{{svg "octicon-skip" 18 "commit-status icon tw-text-text-light"}}
|
||||
{{end}}
|
||||
@@ -0,0 +1,63 @@
|
||||
{{/* TODO: RemoveIssueRef: the Issue.Ref will be removed in 1.24 or 1.25 if no end user really needs it or there could be better alternative then.
|
||||
PR: https://github.com/go-gitea/gitea/pull/32744
|
||||
|
||||
The Issue.Ref was added by Add possibility to record branch or tag information in an issue (#780)
|
||||
After 8 years, this "branch selector" does nothing more than saving the branch/tag name into database and displays it,
|
||||
or sometimes auto-close a ref-matched issue by a commit message when CloseIssuesViaCommitInAnyBranch=false.
|
||||
|
||||
There are still users using it:
|
||||
* @didim99: it is a really useful feature to specify a branch in which issue found.
|
||||
|
||||
Still needs to figure out:
|
||||
* Could the "recording branch/tag name" be replaced by other approaches?
|
||||
* Write the branch name in the issue title/body then it will still be displayed, eg: `[bug] (fix/ui-broken-bug) there is a bug ....`
|
||||
* Is "GitHub-like development sidebar (`#31899`)" good enough (or better) for your usage?
|
||||
*/}}
|
||||
{{if and (not .Issue.IsPull) (not .PageIsComparePull)}}
|
||||
<input id="ref_selector" name="ref" type="hidden" value="{{.Reference}}">
|
||||
<div class="ui dropdown select-branch branch-selector-dropdown ellipsis-text-items {{if not .HasIssuesOrPullsWritePermission}}disabled{{end}}"
|
||||
data-no-results="{{ctx.Locale.Tr "no_results_found"}}"
|
||||
{{if and .Issue (or .IsIssueWriter .HasIssuesOrPullsWritePermission)}}data-url-update-issueref="{{$.RepoLink}}/issues/{{.Issue.Index}}/ref"{{end}}
|
||||
>
|
||||
<div class="ui button branch-dropdown-button">
|
||||
<span class="text-branch-name gt-ellipsis">{{if .Reference}}{{$.RefEndName}}{{else}}{{ctx.Locale.Tr "repo.issues.no_ref"}}{{end}}</span>
|
||||
{{if .HasIssuesOrPullsWritePermission}}{{svg "octicon-triangle-down" 14 "dropdown icon"}}{{end}}
|
||||
</div>
|
||||
<div class="menu">
|
||||
<div class="ui icon search input">
|
||||
<i class="icon">{{svg "octicon-filter" 16}}</i>
|
||||
<input name="search" placeholder="{{ctx.Locale.Tr "repo.filter_branch_and_tag"}}...">
|
||||
</div>
|
||||
<div class="branch-tag-tab">
|
||||
<a class="branch-tag-item reference column muted active" href="#" data-target="#branch-list">
|
||||
{{svg "octicon-git-branch" 16 "tw-mr-1"}} {{ctx.Locale.Tr "repo.branches"}}
|
||||
</a>
|
||||
<a class="branch-tag-item reference column muted" href="#" data-target="#tag-list">
|
||||
{{svg "octicon-tag" 16 "tw-mr-1"}} {{ctx.Locale.Tr "repo.tags"}}
|
||||
</a>
|
||||
</div>
|
||||
<div class="branch-tag-divider"></div>
|
||||
<div id="branch-list" class="scrolling menu reference-list-menu">
|
||||
{{if or .Reference (not .Issue)}}
|
||||
<div class="item tw-text-xs" data-id="" data-name="{{ctx.Locale.Tr "repo.issues.no_ref"}}" data-id-selector="#ref_selector"><strong><a href="#">{{ctx.Locale.Tr "repo.clear_ref"}}</a></strong></div>
|
||||
{{end}}
|
||||
{{range .Branches}}
|
||||
<div class="item" data-id="refs/heads/{{.}}" data-name="{{.}}" data-id-selector="#ref_selector" title="{{.}}">{{.}}</div>
|
||||
{{else}}
|
||||
<div class="item disabled">{{ctx.Locale.Tr "no_results_found"}}</div>
|
||||
{{end}}
|
||||
</div>
|
||||
<div id="tag-list" class="scrolling menu reference-list-menu tw-hidden">
|
||||
{{if or .Reference (not .Issue)}}
|
||||
<div class="item tw-text-xs" data-id="" data-name="{{ctx.Locale.Tr "repo.issues.no_ref"}}" data-id-selector="#ref_selector"><strong><a href="#">{{ctx.Locale.Tr "repo.clear_ref"}}</a></strong></div>
|
||||
{{end}}
|
||||
{{range .Tags}}
|
||||
<div class="item" data-id="refs/tags/{{.}}" data-name="tags/{{.}}" data-id-selector="#ref_selector">{{.}}</div>
|
||||
{{else}}
|
||||
<div class="item disabled">{{ctx.Locale.Tr "no_results_found"}}</div>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="divider"></div>
|
||||
{{end}}
|
||||
@@ -0,0 +1,83 @@
|
||||
{{with .Issue}}
|
||||
{{if eq $.Page.Project.CardType 1}}{{/* Images and Text*/}}
|
||||
{{$attachments := index $.Page.issuesAttachmentMap .ID}}
|
||||
{{if $attachments}}
|
||||
<div class="card-attachment-images">
|
||||
{{range $attachments}}
|
||||
<img loading="lazy" src="{{.DownloadURL}}" alt="{{.Name}}" />
|
||||
{{end}}
|
||||
</div>
|
||||
{{end}}
|
||||
{{end}}
|
||||
<div class="content tw-w-full">
|
||||
<div class="tw-flex tw-items-start tw-gap-[5px]">
|
||||
<div class="issue-card-icon">
|
||||
{{template "shared/issueicon" .}}
|
||||
</div>
|
||||
<a class="issue-card-title muted issue-title tw-break-anywhere" href="{{.Link}}">{{.Title | ctx.RenderUtils.RenderIssueSimpleTitle}}</a>
|
||||
{{if and $.isPinnedIssueCard $.Page.IsRepoAdmin}}
|
||||
<a role="button" class="issue-card-unpin muted flex-text-inline" data-tooltip-content={{ctx.Locale.Tr "repo.issues.unpin"}} data-issue-id="{{.ID}}" data-unpin-url="{{$.Page.Link}}/unpin/{{.Index}}">
|
||||
{{svg "octicon-x" 16}}
|
||||
</a>
|
||||
{{end}}
|
||||
</div>
|
||||
<div class="meta">
|
||||
<span class="tw-text-grey-light muted-links">
|
||||
{{if not $.Page.Repository}}{{.Repo.FullName}}{{end}}#{{.Index}}
|
||||
{{$timeStr := DateUtils.TimeSince .GetLastEventTimestamp}}
|
||||
{{if .OriginalAuthor}}
|
||||
{{ctx.Locale.Tr .GetLastEventLabelFake $timeStr .OriginalAuthor}}
|
||||
{{else if gt .Poster.ID 0}}
|
||||
{{ctx.Locale.Tr .GetLastEventLabel $timeStr .Poster.HomeLink .Poster.GetDisplayName}}
|
||||
{{else}}
|
||||
{{ctx.Locale.Tr .GetLastEventLabelFake $timeStr .Poster.GetDisplayName}}
|
||||
{{end}}
|
||||
</span>
|
||||
</div>
|
||||
{{if .MilestoneID}}
|
||||
<div class="meta tw-my-1">
|
||||
<a class="milestone" href="{{.Repo.Link}}/milestone/{{.MilestoneID}}">
|
||||
{{svg "octicon-milestone" 16 "tw-mr-1 tw-align-middle"}}
|
||||
<span class="tw-align-middle">{{.Milestone.Name}}</span>
|
||||
</a>
|
||||
</div>
|
||||
{{end}}
|
||||
{{if $.Page.LinkedPRs}}
|
||||
{{range index $.Page.LinkedPRs .ID}}
|
||||
<div class="meta tw-my-1">
|
||||
<a href="{{.Repo.Link}}/pulls/{{.Index}}">
|
||||
<span class="tw-m-0 {{if .PullRequest.HasMerged}}tw-text-purple{{else if .IsClosed}}tw-text-red{{else}}tw-text-green{{end}}">{{svg "octicon-git-merge" 16 "tw-mr-1 tw-align-middle"}}</span>
|
||||
<span class="tw-align-middle">{{.Title}} <span class="tw-text-grey-light">#{{.Index}}</span></span>
|
||||
</a>
|
||||
</div>
|
||||
{{end}}
|
||||
{{end}}
|
||||
{{$tasks := .GetTasks}}
|
||||
{{if gt $tasks 0}}
|
||||
<div class="meta tw-my-1">
|
||||
{{svg "octicon-checklist" 16 "tw-mr-1 tw-align-middle"}}
|
||||
<span class="tw-align-middle">{{.GetTasksDone}} / {{$tasks}}</span>
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
|
||||
{{if or .Labels .Assignees}}
|
||||
<div class="issue-card-bottom">
|
||||
{{/* the labels container must always be present, to help the assignees list right-aligned */}}
|
||||
<div class="issue-card-bottom-part labels-list">
|
||||
{{range $label := .Labels}}
|
||||
{{$link := print $.Issue.Repo.Link "/issues"}}
|
||||
{{$link = QueryBuild $link "labels" $label.ID}}
|
||||
<a class="item" href="{{$link}}">{{ctx.RenderUtils.RenderLabel $label}}</a>
|
||||
{{end}}
|
||||
</div>
|
||||
{{if .Assignees}}
|
||||
<div class="issue-card-bottom-part tw-justify-end">
|
||||
{{range .Assignees}}
|
||||
<a target="_blank" href="{{.HomeLink}}" data-tooltip-content="{{ctx.Locale.Tr "repo.projects.column.assigned_to"}} {{.Name}}">{{ctx.AvatarUtils.Avatar . 24}}</a>
|
||||
{{end}}
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
{{end}}
|
||||
{{end}}
|
||||
@@ -0,0 +1,59 @@
|
||||
{{template "base/head" .}}
|
||||
<div role="main" aria-label="{{.Title}}" class="page-content repository new issue">
|
||||
{{template "repo/header" .}}
|
||||
<div class="ui container">
|
||||
{{template "base/alert" .}}
|
||||
<div class="issue-navbar">
|
||||
{{template "repo/issue/navbar" .}}
|
||||
</div>
|
||||
<div class="divider"></div>
|
||||
{{range .IssueTemplates}}
|
||||
<div class="ui attached segment">
|
||||
<div class="ui two column grid">
|
||||
<div class="column">
|
||||
<strong>{{.Name}}</strong>
|
||||
<br>{{.About}}
|
||||
</div>
|
||||
<div class="column tw-text-right">
|
||||
<a href="{{$.RepoLink}}/issues/new?template={{.FileName}}{{if $.milestone}}&milestone={{$.milestone}}{{end}}{{if $.project}}&project={{$.project}}{{end}}" class="ui primary button">{{ctx.Locale.Tr "repo.issues.choose.get_started"}}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
{{range .IssueConfig.ContactLinks}}
|
||||
<div class="ui attached segment">
|
||||
<div class="ui two column grid">
|
||||
<div class="column">
|
||||
<strong>{{.Name}}</strong>
|
||||
<br>{{.About}}
|
||||
</div>
|
||||
<div class="column tw-text-right">
|
||||
<a href="{{.URL}}" class="ui primary button">{{svg "octicon-link-external"}} {{ctx.Locale.Tr "repo.issues.choose.open_external_link"}}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
{{if .IssueConfig.BlankIssuesEnabled}}
|
||||
<div class="ui attached segment">
|
||||
<div class="ui two column grid">
|
||||
<div class="column">
|
||||
<strong>{{ctx.Locale.Tr "repo.issues.choose.blank"}}</strong>
|
||||
<br/>{{ctx.Locale.Tr "repo.issues.choose.blank_about"}}
|
||||
</div>
|
||||
<div class="column tw-text-right">
|
||||
<a href="{{.RepoLink}}/issues/new?{{if .milestone}}&milestone={{.milestone}}{{end}}{{if $.project}}&project={{$.project}}{{end}}" class="ui primary button">{{ctx.Locale.Tr "repo.issues.choose.get_started"}}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
{{- if .IssueConfigError}}{{/* normal warning flash makes problems here*/}}
|
||||
<div class="ui warning message">
|
||||
<div class="text left">
|
||||
<div>{{ctx.Locale.Tr "repo.issues.choose.invalid_config"}}</div>
|
||||
<div>{{.IssueConfigError}}</div>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
{{template "base/footer" .}}
|
||||
@@ -0,0 +1,21 @@
|
||||
{{$textareaContent := .BodyQuery}}
|
||||
{{if not $textareaContent}}{{$textareaContent = .IssueTemplate}}{{end}}
|
||||
{{if not $textareaContent}}{{$textareaContent = .PullRequestTemplate}}{{end}}
|
||||
{{if not $textareaContent}}{{$textareaContent = .content}}{{end}}
|
||||
|
||||
<div class="field">
|
||||
{{template "shared/combomarkdowneditor" (dict
|
||||
"CustomInit" true
|
||||
"MarkdownEditorContext" (ctx.MiscUtils.MarkdownEditorComment $.Repository)
|
||||
"TextareaName" "content"
|
||||
"TextareaContent" $textareaContent
|
||||
"TextareaPlaceholder" (ctx.Locale.Tr "repo.diff.comment.placeholder")
|
||||
"DropzoneParentContainer" "form, .ui.form"
|
||||
)}}
|
||||
</div>
|
||||
|
||||
{{if .IsAttachmentEnabled}}
|
||||
<div class="field">
|
||||
{{template "repo/upload" .}}
|
||||
</div>
|
||||
{{end}}
|
||||
@@ -0,0 +1,14 @@
|
||||
<div class="field {{if not .item.VisibleOnForm}}tw-hidden{{end}}">
|
||||
{{template "repo/issue/fields/header" .}}
|
||||
{{range $i, $opt := .item.Attributes.options}}
|
||||
<div class="field inline">
|
||||
<div class="ui checkbox tw-mr-0 {{if and ($opt.visible) (not (SliceUtils.Contains $opt.visible "form"))}}tw-hidden{{end}}">
|
||||
<input type="checkbox" name="form-field-{{$.item.ID}}-{{$i}}" {{if $opt.required}}required{{end}}>
|
||||
<label>{{ctx.RenderUtils.MarkdownToHtml $opt.label}}</label>
|
||||
</div>
|
||||
{{if $opt.required}}
|
||||
<label class="required"></label>
|
||||
{{end}}
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
@@ -0,0 +1,17 @@
|
||||
<div class="field {{if not .item.VisibleOnForm}}tw-hidden{{end}}">
|
||||
{{template "repo/issue/fields/header" .}}
|
||||
{{/* FIXME: required validation */}}
|
||||
<div class="ui fluid selection dropdown {{if .item.Attributes.multiple}}multiple clearable{{end}}">
|
||||
<input type="hidden" name="form-field-{{.item.ID}}" value="{{.item.Attributes.default}}">
|
||||
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
||||
{{if not .item.Validations.required}}
|
||||
{{svg "octicon-x" 14 "remove icon"}}
|
||||
{{end}}
|
||||
<div class="default text"></div>
|
||||
<div class="menu">
|
||||
{{range $i, $opt := .item.Attributes.options}}
|
||||
<div class="item" data-value="{{$i}}">{{$opt}}</div>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,6 @@
|
||||
{{if and (.item.Attributes.label) (not .item.Attributes.hide_label)}}
|
||||
<h3>{{.item.Attributes.label}}{{if .item.Validations.required}}<label class="required"></label>{{end}}</h3>
|
||||
{{end}}
|
||||
{{if .item.Attributes.description}}
|
||||
<span class="help">{{ctx.RenderUtils.MarkdownToHtml .item.Attributes.description}}</span>
|
||||
{{end}}
|
||||
@@ -0,0 +1,4 @@
|
||||
<div class="field {{if not .item.VisibleOnForm}}tw-hidden{{end}}">
|
||||
{{template "repo/issue/fields/header" .}}
|
||||
<input type="{{if .item.Validations.is_number}}number{{else}}text{{end}}" name="form-field-{{.item.ID}}" placeholder="{{.item.Attributes.placeholder}}" value="{{.item.Attributes.value}}" {{if .item.Validations.required}}required{{end}} {{if .item.Validations.regex}}pattern="{{.item.Validations.regex}}" title="{{.item.Validations.regex}}"{{end}}>
|
||||
</div>
|
||||
@@ -0,0 +1,3 @@
|
||||
<div class="field {{if not .item.VisibleOnForm}}tw-hidden{{end}}">
|
||||
<div class="render-content markup">{{ctx.RenderUtils.MarkdownToHtml .item.Attributes.value}}</div>
|
||||
</div>
|
||||
@@ -0,0 +1,24 @@
|
||||
{{$useMarkdownEditor := not .item.Attributes.render}}
|
||||
<div class="field {{if not .item.VisibleOnForm}}tw-hidden{{end}} {{if $useMarkdownEditor}}combo-editor-dropzone{{end}}">
|
||||
{{template "repo/issue/fields/header" .}}
|
||||
|
||||
{{/* the real form element to provide the value */}}
|
||||
<textarea class="form-field-real" name="form-field-{{.item.ID}}" placeholder="{{.item.Attributes.placeholder}}" {{if and .item.Validations.required}}required{{end}}>{{.item.Attributes.value}}</textarea>
|
||||
|
||||
{{if $useMarkdownEditor}}
|
||||
{{template "shared/combomarkdowneditor" (dict
|
||||
"CustomInit" true
|
||||
"ContainerClasses" "tw-hidden"
|
||||
"MarkdownEditorContext" (ctx.MiscUtils.MarkdownEditorComment ctx.RootData.Repository)
|
||||
"TextareaContent" .item.Attributes.value
|
||||
"TextareaPlaceholder" .item.Attributes.placeholder
|
||||
"DropzoneParentContainer" ".combo-editor-dropzone"
|
||||
)}}
|
||||
|
||||
{{if .root.IsAttachmentEnabled}}
|
||||
<div class="tw-mt-4 form-field-dropzone tw-hidden">
|
||||
{{template "repo/upload" .root}}
|
||||
</div>
|
||||
{{end}}
|
||||
{{end}}
|
||||
</div>
|
||||
@@ -0,0 +1,127 @@
|
||||
<div class="ui secondary filter menu">
|
||||
{{if not .Repository.IsArchived}}
|
||||
<!-- Action Button -->
|
||||
{{if and .IsShowClosed.Has .IsShowClosed.Value}}
|
||||
<button class="ui primary basic button issue-action" data-action="open" data-url="{{$.RepoLink}}/issues/status">{{ctx.Locale.Tr "repo.issues.action_open"}}</button>
|
||||
{{else if and .IsShowClosed.Has (not .IsShowClosed.Value)}}
|
||||
<button class="ui red basic button issue-action" data-action="close" data-url="{{$.RepoLink}}/issues/status">{{ctx.Locale.Tr "repo.issues.action_close"}}</button>
|
||||
{{end}}
|
||||
{{if $.IsRepoAdmin}}
|
||||
<button class="ui red button issue-action"
|
||||
data-action="delete" data-url="{{$.RepoLink}}/issues/delete"
|
||||
data-action-delete-confirm="{{ctx.Locale.Tr "confirm_delete_selected"}}"
|
||||
>{{ctx.Locale.Tr "repo.issues.delete"}}</button>
|
||||
{{end}}
|
||||
<!-- Labels -->
|
||||
<div class="ui {{if not .Labels}}disabled{{end}} dropdown jump item">
|
||||
<span class="text">
|
||||
{{ctx.Locale.Tr "repo.issues.action_label"}}
|
||||
</span>
|
||||
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
||||
<div class="menu">
|
||||
<div class="item issue-action" data-action="clear" data-url="{{$.RepoLink}}/issues/labels">
|
||||
{{ctx.Locale.Tr "repo.issues.new.clear_labels"}}
|
||||
</div>
|
||||
{{$previousExclusiveScope := "_no_scope"}}
|
||||
{{range .Labels}}
|
||||
{{$exclusiveScope := .ExclusiveScope}}
|
||||
{{if and (ne $previousExclusiveScope "_no_scope") (ne $previousExclusiveScope $exclusiveScope)}}
|
||||
<div class="divider"></div>
|
||||
{{end}}
|
||||
{{$previousExclusiveScope = $exclusiveScope}}
|
||||
<div class="item issue-action flex-left-right" data-action="toggle" data-element-id="{{.ID}}" data-url="{{$.RepoLink}}/issues/labels">
|
||||
{{if SliceUtils.Contains $.SelLabelIDs .ID}}{{svg (Iif $exclusiveScope "octicon-dot-fill" "octicon-check")}}{{end}} {{ctx.RenderUtils.RenderLabel .}}
|
||||
{{template "repo/issue/labels/label_archived" .}}
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Milestone -->
|
||||
<div class="ui {{if not (or .OpenMilestones .ClosedMilestones)}}disabled{{end}} dropdown jump item">
|
||||
<span class="text">
|
||||
{{ctx.Locale.Tr "repo.issues.action_milestone"}}
|
||||
</span>
|
||||
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
||||
<div class="menu">
|
||||
<div class="item issue-action" data-element-id="0" data-url="{{$.Link}}/milestone">
|
||||
{{ctx.Locale.Tr "repo.issues.action_milestone_no_select"}}
|
||||
</div>
|
||||
{{if .OpenMilestones}}
|
||||
<div class="divider"></div>
|
||||
<div class="header">{{ctx.Locale.Tr "repo.issues.filter_milestone_open"}}</div>
|
||||
{{range .OpenMilestones}}
|
||||
<div class="item issue-action" data-element-id="{{.ID}}" data-url="{{$.RepoLink}}/issues/milestone">
|
||||
{{.Name}}
|
||||
</div>
|
||||
{{end}}
|
||||
{{end}}
|
||||
{{if .ClosedMilestones}}
|
||||
<div class="divider"></div>
|
||||
<div class="header">{{ctx.Locale.Tr "repo.issues.filter_milestone_closed"}}</div>
|
||||
{{range .ClosedMilestones}}
|
||||
<div class="item issue-action" data-element-id="{{.ID}}" data-url="{{$.RepoLink}}/issues/milestone">
|
||||
{{.Name}}
|
||||
</div>
|
||||
{{end}}
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Projects -->
|
||||
<div class="ui{{if not (or .OpenProjects .ClosedProjects)}} disabled{{end}} dropdown jump item">
|
||||
<span class="text">
|
||||
{{ctx.Locale.Tr "repo.projects"}}
|
||||
</span>
|
||||
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
||||
<div class="menu">
|
||||
<div class="item issue-action" data-element-id="0" data-url="{{$.Link}}/projects">
|
||||
{{ctx.Locale.Tr "repo.issues.new.clear_projects"}}
|
||||
</div>
|
||||
{{if .OpenProjects}}
|
||||
<div class="divider"></div>
|
||||
<div class="header">
|
||||
{{ctx.Locale.Tr "repo.issues.new.open_projects"}}
|
||||
</div>
|
||||
{{range .OpenProjects}}
|
||||
<div class="item issue-action" data-element-id="{{.ID}}" data-url="{{$.RepoLink}}/issues/projects">
|
||||
{{svg .IconName 18 "tw-mr-2"}}{{.Title}}
|
||||
</div>
|
||||
{{end}}
|
||||
{{end}}
|
||||
{{if .ClosedProjects}}
|
||||
<div class="divider"></div>
|
||||
<div class="header">
|
||||
{{ctx.Locale.Tr "repo.issues.new.closed_projects"}}
|
||||
</div>
|
||||
{{range .ClosedProjects}}
|
||||
<div class="item issue-action" data-element-id="{{.ID}}" data-url="{{$.RepoLink}}/issues/projects">
|
||||
{{svg .IconName 18 "tw-mr-2"}}{{.Title}}
|
||||
</div>
|
||||
{{end}}
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Assignees -->
|
||||
<div class="ui {{if not .Assignees}}disabled{{end}} dropdown jump item">
|
||||
<span class="text">
|
||||
{{ctx.Locale.Tr "repo.issues.action_assignee"}}
|
||||
</span>
|
||||
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
||||
<div class="menu">
|
||||
<div class="item issue-action" data-action="clear" data-url="{{$.Link}}/assignee">
|
||||
{{ctx.Locale.Tr "repo.issues.new.clear_assignees"}}
|
||||
</div>
|
||||
<div class="item issue-action" data-element-id="0" data-url="{{$.Link}}/assignee">
|
||||
{{ctx.Locale.Tr "repo.issues.action_assignee_no_select"}}
|
||||
</div>
|
||||
{{range .Assignees}}
|
||||
<div class="item issue-action" data-element-id="{{.ID}}" data-url="{{$.RepoLink}}/issues/assignee">
|
||||
{{ctx.AvatarUtils.Avatar . 20}} {{.GetDisplayName}}
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
@@ -0,0 +1,48 @@
|
||||
{{/* Template Attributes:
|
||||
* "labels" from query string (needed by JS)
|
||||
* QueryLink
|
||||
* Labels
|
||||
* SupportArchivedLabel, if true, then it needs "archived_labels" from query string
|
||||
*/}}
|
||||
{{$queryLink := .QueryLink}}
|
||||
<div class="item ui dropdown jump {{if not .Labels}}disabled{{end}} label-filter">
|
||||
<span class="text">{{ctx.Locale.Tr "repo.issues.filter_label"}}</span>
|
||||
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
||||
<div class="menu flex-items-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_label"}}">
|
||||
</div>
|
||||
{{if .SupportArchivedLabel}}{{/* this checkbox has a hard dependency with the "labels" and "archived_label" query parameter */}}
|
||||
<label class="label-filter-archived-toggle flex-text-block">
|
||||
<input type="checkbox"> {{ctx.Locale.Tr "repo.issues.label_archived_filter"}}
|
||||
<span data-tooltip-content={{ctx.Locale.Tr "repo.issues.label_archive_tooltip"}}>{{svg "octicon-info"}}</span>
|
||||
</label>
|
||||
{{end}}
|
||||
<span class="label-filter-exclude-info">{{ctx.Locale.Tr "repo.issues.filter_label_exclude"}}</span>
|
||||
<div class="divider"></div>
|
||||
<a class="item label-filter-query-default" href="{{QueryBuild $queryLink "labels" NIL}}">{{ctx.Locale.Tr "repo.issues.filter_label_no_select"}}</a>
|
||||
<a class="item label-filter-query-not-set" href="{{QueryBuild $queryLink "labels" "0"}}">{{ctx.Locale.Tr "repo.issues.filter_label_select_no_label"}}</a>
|
||||
{{/* The logic here is not the same as the label selector in the issue sidebar.
|
||||
The one in the issue sidebar renders "repo labels | divider | org labels".
|
||||
Maybe the logic should be updated to be consistent.*/}}
|
||||
{{$previousExclusiveScope := "_no_scope"}}
|
||||
{{range .Labels}}
|
||||
{{$exclusiveScope := .ExclusiveScope}}
|
||||
{{if and (ne $previousExclusiveScope $exclusiveScope)}}
|
||||
<div class="divider" data-scope="{{.ExclusiveScope}}"></div>
|
||||
{{end}}
|
||||
{{$previousExclusiveScope = $exclusiveScope}}
|
||||
<a class="item label-filter-query-item" data-label-id="{{.ID}}" data-scope="{{.ExclusiveScope}}" {{if .IsArchived}}data-is-archived{{end}}
|
||||
href="{{QueryBuild $queryLink "labels" .QueryString}}">
|
||||
{{if .IsExcluded}}
|
||||
{{svg "octicon-circle-slash"}}
|
||||
{{else if .IsSelected}}
|
||||
{{Iif $exclusiveScope (svg "octicon-dot-fill") (svg "octicon-check")}}
|
||||
{{end}}
|
||||
{{ctx.RenderUtils.RenderLabel .}}
|
||||
<p class="tw-ml-auto">{{template "repo/issue/labels/label_archived" .}}</p>
|
||||
</a>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,42 @@
|
||||
{{/* Milestone filter dropdown partial
|
||||
* QueryLink: the base query link for building filter URLs
|
||||
* MilestoneID: the currently selected milestone ID (0=all, -1=none, >0=specific)
|
||||
* OpenMilestones: list of open milestones
|
||||
* ClosedMilestones: list of closed milestones
|
||||
*/}}
|
||||
{{$queryLink := .QueryLink}}
|
||||
<div class="item ui dropdown jump {{if not (or .OpenMilestones .ClosedMilestones)}}disabled{{end}}">
|
||||
<span class="text">
|
||||
{{ctx.Locale.Tr "repo.issues.filter_milestone"}}
|
||||
</span>
|
||||
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
||||
<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_milestone"}}">
|
||||
</div>
|
||||
<div class="divider"></div>
|
||||
<a class="{{if not .MilestoneID}}active selected {{end}}item" href="{{QueryBuild $queryLink "milestone" NIL}}">{{ctx.Locale.Tr "repo.issues.filter_milestone_all"}}</a>
|
||||
<a class="{{if .MilestoneID}}{{if eq .MilestoneID -1}}active selected {{end}}{{end}}item" href="{{QueryBuild $queryLink "milestone" -1}}">{{ctx.Locale.Tr "repo.issues.filter_milestone_none"}}</a>
|
||||
{{if .OpenMilestones}}
|
||||
<div class="divider"></div>
|
||||
<div class="header">{{ctx.Locale.Tr "repo.issues.filter_milestone_open"}}</div>
|
||||
{{range .OpenMilestones}}
|
||||
<a class="{{if $.MilestoneID}}{{if eq $.MilestoneID .ID}}active selected {{end}}{{end}}item" href="{{QueryBuild $queryLink "milestone" .ID}}">
|
||||
{{svg "octicon-milestone" 16 "mr-2"}}
|
||||
{{.Name}}
|
||||
</a>
|
||||
{{end}}
|
||||
{{end}}
|
||||
{{if .ClosedMilestones}}
|
||||
<div class="divider"></div>
|
||||
<div class="header">{{ctx.Locale.Tr "repo.issues.filter_milestone_closed"}}</div>
|
||||
{{range .ClosedMilestones}}
|
||||
<a class="{{if $.MilestoneID}}{{if eq $.MilestoneID .ID}}active selected {{end}}{{end}}item" href="{{QueryBuild $queryLink "milestone" .ID}}">
|
||||
{{svg "octicon-milestone" 16 "mr-2"}}
|
||||
{{.Name}}
|
||||
</a>
|
||||
{{end}}
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,39 @@
|
||||
{{/* This is a user list for filter, the data is provided by a local variable assignment
|
||||
* QueryParamKey: eg: "poster", "assignee"
|
||||
* QueryLink
|
||||
* UserSearchList
|
||||
* SelectedUserId: 0 or empty means default, -1 means "no user is set"
|
||||
* TextFilterTitle
|
||||
* TextFilterMatchNone: the text for "issues with no assignee"
|
||||
* TextFilterMatchAny: the text for "issues with any assignee"
|
||||
*/}}
|
||||
{{$queryLink := .QueryLink}}
|
||||
<div class="item ui dropdown jump {{if not .UserSearchList}}disabled{{end}}">
|
||||
{{$.TextFilterTitle}} {{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
||||
<div class="menu flex-items-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_user_placeholder"}}">
|
||||
</div>
|
||||
{{if $.TextFilterMatchNone}}
|
||||
{{$isSelected := eq .SelectedUserId "(none)"}}
|
||||
<a class="item" href="{{QueryBuild $queryLink $.QueryParamKey (Iif $isSelected NIL "(none)")}}">
|
||||
{{svg "octicon-check" 14 (Iif $isSelected "" "tw-invisible")}} {{$.TextFilterMatchNone}}
|
||||
</a>
|
||||
{{end}}
|
||||
{{if $.TextFilterMatchAny}}
|
||||
{{$isSelected := eq .SelectedUserId "(any)"}}
|
||||
<a class="item" href="{{QueryBuild $queryLink $.QueryParamKey (Iif $isSelected NIL "(any)")}}">
|
||||
{{svg "octicon-check" 14 (Iif $isSelected "" "tw-invisible")}} {{$.TextFilterMatchAny}}
|
||||
</a>
|
||||
{{end}}
|
||||
<div class="divider"></div>
|
||||
{{range $user := .UserSearchList}}
|
||||
{{$isSelected := eq $.SelectedUserId (print $user.ID)}}
|
||||
<a class="item" href="{{QueryBuild $queryLink $.QueryParamKey (Iif $isSelected NIL $user.ID)}}">
|
||||
{{svg "octicon-check" 14 (Iif $isSelected "" "tw-invisible")}}
|
||||
{{ctx.AvatarUtils.Avatar $user 20}}{{template "repo/search_name" .}}
|
||||
</a>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,23 @@
|
||||
{{/* This is a user list for filter, the data is provided by a remote "fetch" request
|
||||
* QueryParamKey: eg: "poster", "assignee"
|
||||
* QueryLink
|
||||
* UserSearchUrl
|
||||
* SelectedUsername
|
||||
* TextFilterTitle
|
||||
*/}}
|
||||
{{$queryLink := .QueryLink}}
|
||||
<div class="item ui dropdown custom user-remote-search" data-tooltip-content="{{ctx.Locale.Tr "repo.user_search_tooltip"}}"
|
||||
data-search-url="{{$.UserSearchUrl}}"
|
||||
data-selected-username="{{$.SelectedUsername}}"
|
||||
data-action-jump-url="{{QueryBuild $queryLink $.QueryParamKey NIL}}&{{$.QueryParamKey}}={username}"
|
||||
>
|
||||
{{$.TextFilterTitle}} {{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
||||
<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_user_placeholder"}}">
|
||||
</div>
|
||||
<a class="item" data-value="">{{ctx.Locale.Tr "repo.issues.filter_user_no_select"}}</a>
|
||||
<a class="item item-from-input tw-hidden"></a>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,123 @@
|
||||
{{$projectIDs := $.ProjectIDs}}
|
||||
{{$projectIDsQuery := SliceUtils.JoinInt64 $projectIDs}}
|
||||
{{$queryLink := QueryBuild "?" "q" $.Keyword "type" $.ViewType "sort" $.SortType "state" $.State "labels" $.SelectLabels "milestone" $.MilestoneID "project" $projectIDsQuery "assignee" $.AssigneeID "poster" $.PosterUsername "archived_labels" (Iif $.ShowArchivedLabels "true")}}
|
||||
{{$showAllProjects := not $projectIDs}}
|
||||
{{$showNoProjectSelected := and (eq (len $projectIDs) 1) (eq (index $projectIDs 0) -1)}}
|
||||
|
||||
{{template "repo/issue/filter_item_label" dict "Labels" .Labels "QueryLink" $queryLink "SupportArchivedLabel" true}}
|
||||
|
||||
{{if not .Milestone}}
|
||||
{{template "repo/issue/filter_item_milestone" dict
|
||||
"QueryLink" $queryLink
|
||||
"MilestoneID" $.MilestoneID
|
||||
"OpenMilestones" .OpenMilestones
|
||||
"ClosedMilestones" .ClosedMilestones
|
||||
}}
|
||||
{{end}}
|
||||
|
||||
<!-- Project -->
|
||||
<div class="item ui dropdown jump project-filter {{if not (or .OpenProjects .ClosedProjects)}}disabled{{end}}">
|
||||
<span class="text">
|
||||
{{ctx.Locale.Tr "repo.issues.filter_project"}}
|
||||
</span>
|
||||
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
||||
<div class="menu flex-items-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_project"}}">
|
||||
</div>
|
||||
<a class="item {{if $showAllProjects}}selected{{end}}" href="{{QueryBuild $queryLink "project" NIL}}">{{ctx.Locale.Tr "repo.issues.filter_project_all"}}</a>
|
||||
<a class="item {{if $showNoProjectSelected}}selected{{end}}" href="{{QueryBuild $queryLink "project" -1}}">{{ctx.Locale.Tr "repo.issues.filter_project_none"}}</a>
|
||||
{{if .OpenProjects}}
|
||||
<div class="divider"></div>
|
||||
<div class="header">
|
||||
{{ctx.Locale.Tr "repo.issues.new.open_projects"}}
|
||||
</div>
|
||||
{{range $project := .OpenProjects}}
|
||||
{{$toggle := SliceUtils.JoinToggleIDs $projectIDs $project.ID}}
|
||||
{{/* FIXME: ISSUE-MULTIPLE-PROJECTS-FILTER: no multiple project filter support yet. If the support comes, here it should use "&project=${toggle.ToggledIDs}" */}}
|
||||
<a class="item {{if $toggle.IsIncluded}}selected{{end}}" href="{{QueryBuild $queryLink "project" $project.ID}}">
|
||||
{{svg $project.IconName}}<span class="gt-ellipsis">{{$project.Title}}</span>
|
||||
</a>
|
||||
{{end}}
|
||||
{{end}}
|
||||
{{if .ClosedProjects}}
|
||||
<div class="divider"></div>
|
||||
<div class="header">
|
||||
{{ctx.Locale.Tr "repo.issues.new.closed_projects"}}
|
||||
</div>
|
||||
{{range $project := .ClosedProjects}}
|
||||
{{$toggle := SliceUtils.JoinToggleIDs $projectIDs $project.ID}}
|
||||
{{/* FIXME: ISSUE-MULTIPLE-PROJECTS-FILTER: no multiple project filter support yet. If the support comes, here it should use "&project=${toggle.ToggledIDs}" */}}
|
||||
<a class="item {{if $toggle.IsIncluded}}selected{{end}}" href="{{QueryBuild $queryLink "project" $project.ID}}">
|
||||
{{svg $project.IconName}}<span class="gt-ellipsis">{{$project.Title}}</span>
|
||||
</a>
|
||||
{{end}}
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{/* TODO: the UserSearchUrl is old logic but not right, milestone could also have "pull request" posters */}}
|
||||
{{template "repo/issue/filter_item_user_fetch" dict
|
||||
"QueryParamKey" "poster"
|
||||
"QueryLink" $queryLink
|
||||
"UserSearchUrl" (Iif .Milestone (print $.RepoLink "/issues/posters") (print $.Link "/posters"))
|
||||
"SelectedUsername" $.PosterUsername
|
||||
"TextFilterTitle" (ctx.Locale.Tr "repo.issues.filter_poster")
|
||||
}}
|
||||
|
||||
{{template "repo/issue/filter_item_user_assign" dict
|
||||
"QueryParamKey" "assignee"
|
||||
"QueryLink" $queryLink
|
||||
"UserSearchList" $.Assignees
|
||||
"SelectedUserId" $.AssigneeID
|
||||
"TextFilterTitle" (ctx.Locale.Tr "repo.issues.filter_assignee")
|
||||
"TextFilterMatchNone" (ctx.Locale.Tr "repo.issues.filter_assignee_no_assignee")
|
||||
"TextFilterMatchAny" (ctx.Locale.Tr "repo.issues.filter_assignee_any_assignee")
|
||||
}}
|
||||
|
||||
{{if .IsSigned}}
|
||||
<!-- Type -->
|
||||
<div class="item ui dropdown jump">
|
||||
<span class="text">
|
||||
{{ctx.Locale.Tr "repo.issues.filter_type"}}
|
||||
</span>
|
||||
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
||||
<div class="menu">
|
||||
<a class="{{if eq .ViewType "all"}}active {{end}}item" href="{{QueryBuild $queryLink "type" "all"}}">{{if .PageIsPullList}}{{ctx.Locale.Tr "repo.issues.filter_type.all_pull_requests"}}{{else}}{{ctx.Locale.Tr "repo.issues.filter_type.all_issues"}}{{end}}</a>
|
||||
<a class="{{if eq .ViewType "assigned"}}active {{end}}item" href="{{QueryBuild $queryLink "type" "assigned"}}">{{ctx.Locale.Tr "repo.issues.filter_type.assigned_to_you"}}</a>
|
||||
<a class="{{if eq .ViewType "created_by"}}active {{end}}item" href="{{QueryBuild $queryLink "type" "created_by"}}">{{ctx.Locale.Tr "repo.issues.filter_type.created_by_you"}}</a>
|
||||
{{if .PageIsPullList}}
|
||||
<a class="{{if eq .ViewType "review_requested"}}active {{end}}item" href="{{QueryBuild $queryLink "type" "review_requested"}}">{{ctx.Locale.Tr "repo.issues.filter_type.review_requested"}}</a>
|
||||
<a class="{{if eq .ViewType "reviewed_by"}}active {{end}}item" href="{{QueryBuild $queryLink "type" "reviewed_by"}}">{{ctx.Locale.Tr "repo.issues.filter_type.reviewed_by_you"}}</a>
|
||||
{{end}}
|
||||
<a class="{{if eq .ViewType "mentioned"}}active {{end}}item" href="{{QueryBuild $queryLink "type" "mentioned"}}">{{ctx.Locale.Tr "repo.issues.filter_type.mentioning_you"}}</a>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
<!-- Sort -->
|
||||
<div class="item ui dropdown jump">
|
||||
<span class="text">
|
||||
{{ctx.Locale.Tr "repo.issues.filter_sort"}}
|
||||
</span>
|
||||
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
||||
<div class="menu">
|
||||
<a class="{{if or (eq .SortType "latest") (not .SortType)}}active {{end}}item" href="{{QueryBuild $queryLink "sort" "latest"}}">{{ctx.Locale.Tr "repo.issues.filter_sort.latest"}}</a>
|
||||
<a class="{{if eq .SortType "oldest"}}active {{end}}item" href="{{QueryBuild $queryLink "sort" "oldest"}}">{{ctx.Locale.Tr "repo.issues.filter_sort.oldest"}}</a>
|
||||
<a class="{{if eq .SortType "recentupdate"}}active {{end}}item" href="{{QueryBuild $queryLink "sort" "recentupdate"}}">{{ctx.Locale.Tr "repo.issues.filter_sort.recentupdate"}}</a>
|
||||
<a class="{{if eq .SortType "leastupdate"}}active {{end}}item" href="{{QueryBuild $queryLink "sort" "leastupdate"}}">{{ctx.Locale.Tr "repo.issues.filter_sort.leastupdate"}}</a>
|
||||
<a class="{{if eq .SortType "mostcomment"}}active {{end}}item" href="{{QueryBuild $queryLink "sort" "mostcomment"}}">{{ctx.Locale.Tr "repo.issues.filter_sort.mostcomment"}}</a>
|
||||
<a class="{{if eq .SortType "leastcomment"}}active {{end}}item" href="{{QueryBuild $queryLink "sort" "leastcomment"}}">{{ctx.Locale.Tr "repo.issues.filter_sort.leastcomment"}}</a>
|
||||
<a class="{{if eq .SortType "nearduedate"}}active {{end}}item" href="{{QueryBuild $queryLink "sort" "nearduedate"}}">{{ctx.Locale.Tr "repo.issues.filter_sort.nearduedate"}}</a>
|
||||
<a class="{{if eq .SortType "farduedate"}}active {{end}}item" href="{{QueryBuild $queryLink "sort" "farduedate"}}">{{ctx.Locale.Tr "repo.issues.filter_sort.farduedate"}}</a>
|
||||
{{if .ExclusiveLabelScopes}}
|
||||
<div class="divider"></div>
|
||||
<div class="header">{{ctx.Locale.Tr "repo.issues.filter_label"}}</div>
|
||||
{{range $scope := .ExclusiveLabelScopes}}
|
||||
{{$sortType := (printf "scope-%s" $scope)}}
|
||||
<a class="{{if eq $.SortType $sortType}}active {{end}}item" href="{{QueryBuild $queryLink "sort" $sortType}}">{{$scope}}</a>
|
||||
{{end}}
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,26 @@
|
||||
<div id="issue-filters" class="issue-list-toolbar">
|
||||
<div class="issue-list-toolbar-left">
|
||||
{{if and $.CanWriteIssuesOrPulls .Issues}}
|
||||
<input type="checkbox" autocomplete="off" class="issue-checkbox-all tw-mr-4" title="{{ctx.Locale.Tr "repo.issues.action_check_all"}}">
|
||||
{{end}}
|
||||
{{template "repo/issue/openclose" .}}
|
||||
<!-- Total Tracked Time -->
|
||||
{{if .TotalTrackedTime}}
|
||||
<div class="ui compact tiny secondary menu">
|
||||
<span class="item" data-tooltip-content='{{ctx.Locale.Tr "tracked_time_summary"}}'>
|
||||
{{svg "octicon-clock"}}
|
||||
{{.TotalTrackedTime | Sec2Hour}}
|
||||
</span>
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
<div class="issue-list-toolbar-right">
|
||||
<div class="ui secondary filter menu labels">
|
||||
{{if .PageIsMilestones}}
|
||||
{{template "repo/issue/milestone/filter_list" .}}
|
||||
{{else}}
|
||||
{{template "repo/issue/filter_list" .}}
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,27 @@
|
||||
<div class="precolors">
|
||||
<button type="button" class="ui button generate-random-color">
|
||||
{{svg "octicon-sync"}}
|
||||
</button>
|
||||
<div>
|
||||
<div class="tw-flex">
|
||||
<a class="color" style="background-color:#e11d21" data-color-hex="#e11d21"></a>
|
||||
<a class="color" style="background-color:#eb6420" data-color-hex="#eb6420"></a>
|
||||
<a class="color" style="background-color:#fbca04" data-color-hex="#fbca04"></a>
|
||||
<a class="color" style="background-color:#009800" data-color-hex="#009800"></a>
|
||||
<a class="color" style="background-color:#006b75" data-color-hex="#006b75"></a>
|
||||
<a class="color" style="background-color:#207de5" data-color-hex="#207de5"></a>
|
||||
<a class="color" style="background-color:#0052cc" data-color-hex="#0052cc"></a>
|
||||
<a class="color" style="background-color:#5319e7" data-color-hex="#5319e7"></a>
|
||||
</div>
|
||||
<div class="tw-flex">
|
||||
<a class="color" style="background-color:#f6c6c7" data-color-hex="#f6c6c7"></a>
|
||||
<a class="color" style="background-color:#fad8c7" data-color-hex="#fad8c7"></a>
|
||||
<a class="color" style="background-color:#fef2c0" data-color-hex="#fef2c0"></a>
|
||||
<a class="color" style="background-color:#bfe5bf" data-color-hex="#bfe5bf"></a>
|
||||
<a class="color" style="background-color:#bfdadc" data-color-hex="#bfdadc"></a>
|
||||
<a class="color" style="background-color:#c7def8" data-color-hex="#c7def8"></a>
|
||||
<a class="color" style="background-color:#bfd4f2" data-color-hex="#bfd4f2"></a>
|
||||
<a class="color" style="background-color:#d4c5f9" data-color-hex="#d4c5f9"></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,18 @@
|
||||
{{template "base/head" .}}
|
||||
<div role="main" aria-label="{{.Title}}" class="page-content repository labels">
|
||||
{{template "repo/header" .}}
|
||||
<div class="ui container">
|
||||
<div class="issue-navbar tw-mb-4">
|
||||
{{template "repo/issue/navbar" .}}
|
||||
{{if and (or .CanWriteIssues .CanWritePulls) (not .Repository.IsArchived)}}
|
||||
<button class="ui small primary new-label button">{{ctx.Locale.Tr "repo.issues.new_label"}}</button>
|
||||
{{end}}
|
||||
</div>
|
||||
{{template "base/alert" .}}
|
||||
{{template "repo/issue/labels/label_list" .}}
|
||||
</div>
|
||||
{{if and (or .CanWriteIssues .CanWritePulls) (not .Repository.IsArchived)}}
|
||||
{{template "repo/issue/labels/label_edit_modal" .}}
|
||||
{{end}}
|
||||
</div>
|
||||
{{template "base/footer" .}}
|
||||
@@ -0,0 +1,5 @@
|
||||
{{if .IsArchived}}
|
||||
<span class="ui label basic small" data-tooltip-content="{{ctx.Locale.Tr "repo.issues.label_archive_tooltip"}}">
|
||||
{{ctx.Locale.Tr "archived"}}
|
||||
</span>
|
||||
{{end}}
|
||||
@@ -0,0 +1,69 @@
|
||||
<div class="ui small modal" id="issue-label-edit-modal"
|
||||
data-current-page-link="{{$.Link}}"{{/*will be used to construct "new label" and "edit label" URLs*/}}
|
||||
data-text-new-label="{{ctx.Locale.Tr "repo.issues.new_label"}}"
|
||||
data-text-edit-label="{{ctx.Locale.Tr "repo.issues.label_modify"}}"
|
||||
>
|
||||
<div class="header"></div>
|
||||
<div class="content">
|
||||
<form class="ui form ignore-dirty form-fetch-action" method="post">
|
||||
<input name="id" type="hidden">
|
||||
<div class="required field">
|
||||
<label for="name">{{ctx.Locale.Tr "repo.issues.label_title"}}</label>
|
||||
<div class="ui small input">
|
||||
<input class="label-name-input" name="title" placeholder="{{ctx.Locale.Tr "repo.issues.new_label_placeholder"}}" autofocus required maxlength="50">
|
||||
</div>
|
||||
</div>
|
||||
<div class="field label-exclusive-input-field">
|
||||
<div class="ui checkbox">
|
||||
<input class="label-exclusive-input" name="exclusive" type="checkbox">
|
||||
<label>{{ctx.Locale.Tr "repo.issues.label_exclusive"}}</label>
|
||||
</div>
|
||||
<br>
|
||||
<small class="desc">{{ctx.Locale.Tr "repo.issues.label_exclusive_desc"}}</small>
|
||||
<div class="desc tw-ml-1 tw-mt-2 tw-hidden label-exclusive-warning">
|
||||
{{svg "octicon-alert"}} {{ctx.Locale.Tr "repo.issues.label_exclusive_warning"}}
|
||||
</div>
|
||||
<div class="field label-exclusive-order-input-field tw-mt-2">
|
||||
<label class="flex-text-block">
|
||||
{{ctx.Locale.Tr "repo.issues.label_exclusive_order"}}
|
||||
<span data-tooltip-content="{{ctx.Locale.Tr "repo.issues.label_exclusive_order_tooltip"}}">{{svg "octicon-info"}}</span>
|
||||
</label>
|
||||
<input class="label-exclusive-order-input" name="exclusive_order" type="number" maxlength="4">
|
||||
</div>
|
||||
</div>
|
||||
<div class="field label-is-archived-input-field">
|
||||
<div class="ui checkbox">
|
||||
<input class="label-is-archived-input" name="is_archived" type="checkbox">
|
||||
<label>{{ctx.Locale.Tr "repo.issues.label_archive"}}</label>
|
||||
</div>
|
||||
<i class="tw-ml-1" data-tooltip-content={{ctx.Locale.Tr "repo.issues.label_archive_tooltip"}}>
|
||||
{{svg "octicon-info"}}
|
||||
</i>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="description">{{ctx.Locale.Tr "repo.issues.label_description"}}</label>
|
||||
<div class="ui small fluid input">
|
||||
<input class="label-desc-input" name="description" placeholder="{{ctx.Locale.Tr "repo.issues.new_label_desc_placeholder"}}" maxlength="200">
|
||||
</div>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="color">{{ctx.Locale.Tr "repo.issues.label_color"}}</label>
|
||||
<div class="color-picker-combo" data-global-init="initColorPicker">
|
||||
<!-- the "#" is optional because backend NormalizeColor is able to handle it, API also accepts both formats, and it is easier for users to directly copy-paste a hex value -->
|
||||
<input name="color" value="#70c24a" placeholder="#c320f6" required pattern="^#?([\dA-Fa-f]{3}|[\dA-Fa-f]{6})$" maxlength="7">
|
||||
{{template "repo/issue/label_precolors"}}
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<button class="ui small basic cancel button">
|
||||
{{svg "octicon-x"}}
|
||||
{{ctx.Locale.Tr "cancel"}}
|
||||
</button>
|
||||
<button class="ui primary small approve button">
|
||||
{{svg "fontawesome-save"}}
|
||||
{{ctx.Locale.Tr "save"}}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,89 @@
|
||||
<h4 class="ui top attached header">
|
||||
{{ctx.Locale.Tr "repo.issues.label_count" .NumLabels}}
|
||||
<div class="ui right">
|
||||
<!-- Sort -->
|
||||
<div class="item ui jump dropdown tw-py-2">
|
||||
<span class="text">
|
||||
{{ctx.Locale.Tr "repo.issues.filter_sort"}}
|
||||
</span>
|
||||
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
||||
<div class="menu">
|
||||
<a class="{{if or (eq .SortType "alphabetically") (not .SortType)}}active {{end}}item" href="?sort=alphabetically&state={{$.State}}">{{ctx.Locale.Tr "repo.issues.label.filter_sort.alphabetically"}}</a>
|
||||
<a class="{{if eq .SortType "reversealphabetically"}}active {{end}}item" href="?sort=reversealphabetically&state={{$.State}}">{{ctx.Locale.Tr "repo.issues.label.filter_sort.reverse_alphabetically"}}</a>
|
||||
<a class="{{if eq .SortType "leastissues"}}active {{end}}item" href="?sort=leastissues&state={{$.State}}">{{ctx.Locale.Tr "repo.milestones.filter_sort.least_issues"}}</a>
|
||||
<a class="{{if eq .SortType "mostissues"}}active {{end}}item" href="?sort=mostissues&state={{$.State}}">{{ctx.Locale.Tr "repo.milestones.filter_sort.most_issues"}}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div> <!-- filter menu -->
|
||||
</h4>
|
||||
|
||||
<div class="ui attached segment">
|
||||
{{if and (not $.PageIsOrgSettingsLabels) (or $.CanWriteIssues $.CanWritePulls) (eq .NumLabels 0) (not $.Repository.IsArchived)}}
|
||||
{{template "repo/issue/labels/label_load_template" .}}
|
||||
<div class="divider"></div>
|
||||
{{else if and ($.PageIsOrgSettingsLabels) (eq .NumLabels 0)}}
|
||||
{{template "repo/issue/labels/label_load_template" .}}
|
||||
<div class="divider"></div>
|
||||
{{end}}
|
||||
|
||||
<ul class="issue-label-list muted-links">
|
||||
{{$canEditLabel := and (not $.PageIsOrgSettingsLabels) (not $.Repository.IsArchived) (or $.CanWriteIssues $.CanWritePulls)}}
|
||||
{{$canEditLabel = or $canEditLabel $.PageIsOrgSettingsLabels}}
|
||||
{{range .Labels}}
|
||||
<li class="item">
|
||||
<div class="label-title">
|
||||
{{ctx.RenderUtils.RenderLabel .}}
|
||||
{{if .Description}}<br><small class="desc">{{.Description | ctx.RenderUtils.RenderEmoji}}</small>{{end}}
|
||||
</div>
|
||||
<div class="label-issues">
|
||||
{{if $.PageIsOrgSettingsLabels}}
|
||||
<a class="open-issues" href="{{AppSubUrl}}/issues?labels={{.ID}}">{{svg "octicon-issue-opened"}} {{ctx.Locale.Tr "repo.issues.label_open_issues" .NumOpenIssues}}</a>
|
||||
{{else}}
|
||||
<a class="open-issues" href="{{$.RepoLink}}/issues?labels={{.ID}}">{{svg "octicon-issue-opened"}} {{ctx.Locale.Tr "repo.issues.label_open_issues" .NumOpenIssues}}</a>
|
||||
{{end}}
|
||||
</div>
|
||||
<div class="label-operation">
|
||||
{{template "repo/issue/labels/label_archived" .}}
|
||||
{{if $canEditLabel}}
|
||||
<a class="edit-label-button" href="#"
|
||||
data-label-id="{{.ID}}" data-label-name="{{.Name}}" data-label-color="{{.Color}}"
|
||||
data-label-exclusive="{{.Exclusive}}" data-label-is-archived="{{gt .ArchivedUnix 0}}"
|
||||
data-label-num-issues="{{.NumIssues}}" data-label-description="{{.Description}}"
|
||||
data-label-exclusive-order="{{.ExclusiveOrder}}"
|
||||
>{{svg "octicon-pencil"}} {{ctx.Locale.Tr "repo.issues.label_edit"}}</a>
|
||||
<a class="link-action" href="#" data-url="{{$.Link}}/delete?id={{.ID}}"
|
||||
data-modal-confirm-header="{{ctx.Locale.Tr "repo.issues.label_deletion"}}"
|
||||
data-modal-confirm-content="{{ctx.Locale.Tr "repo.issues.label_deletion_desc"}}"
|
||||
>{{svg "octicon-trash"}} {{ctx.Locale.Tr "repo.issues.label_delete"}}</a>
|
||||
{{end}}
|
||||
</div>
|
||||
</li>
|
||||
{{end}}
|
||||
|
||||
{{if and (not .PageIsOrgSettingsLabels) (.OrgLabels)}}
|
||||
<li class="item">
|
||||
<div>{{/* parent is flex, so use block here to keep sentence spaces */}}
|
||||
{{ctx.Locale.Tr "repo.org_labels_desc"}}
|
||||
{{if .IsOrganizationOwner}}
|
||||
<a href="{{.OrganizationLink}}/settings/labels">({{ctx.Locale.Tr "repo.org_labels_desc_manage"}})</a>:
|
||||
{{end}}
|
||||
</div>
|
||||
</li>
|
||||
|
||||
{{range .OrgLabels}}
|
||||
<li class="item org-label">
|
||||
<div class="label-title">
|
||||
{{ctx.RenderUtils.RenderLabel .}}
|
||||
{{if .Description}}<br><small class="desc">{{.Description | ctx.RenderUtils.RenderEmoji}}</small>{{end}}
|
||||
</div>
|
||||
<div class="label-issues">
|
||||
<a class="open-issues" {{if .IsArchived}}data-is-archived{{end}} href="{{$.RepoLink}}/issues?labels={{.ID}}">{{svg "octicon-issue-opened"}} {{ctx.Locale.Tr "repo.issues.label_open_issues" .NumOpenRepoIssues}}</a>
|
||||
</div>
|
||||
<div class="label-operation">
|
||||
{{template "repo/issue/labels/label_archived" .}}
|
||||
</div>
|
||||
</li>
|
||||
{{end}}
|
||||
{{end}}
|
||||
</ul>
|
||||
</div>
|
||||
@@ -0,0 +1,20 @@
|
||||
<div class="ui centered grid">
|
||||
<div class="twelve wide computer column">
|
||||
<p>{{ctx.Locale.Tr "repo.issues.label_templates.info"}}</p>
|
||||
<form class="ui form center" action="{{.Link}}/initialize" method="post">
|
||||
<div class="field">
|
||||
<div class="ui selection dropdown">
|
||||
<input type="hidden" name="template_name" value="Default">
|
||||
<div class="default text">{{ctx.Locale.Tr "repo.issues.label_templates.helper"}}</div>
|
||||
<div class="menu">
|
||||
{{range .LabelTemplateFiles}}
|
||||
<div class="item" data-value="{{.DisplayName}}">{{.DisplayName}}<br><i>({{.Description}})</i></div>
|
||||
{{end}}
|
||||
</div>
|
||||
{{svg "octicon-triangle-down" 18 "dropdown icon"}}
|
||||
</div>
|
||||
</div>
|
||||
<button type="submit" class="ui primary button">{{ctx.Locale.Tr "repo.issues.label_templates.use"}}</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user