This commit is contained in:
@@ -1,4 +1,8 @@
|
||||
{{template "base/head" .}}
|
||||
|
||||
{{$showCreateWorkflowBadge := Iif .WorkflowBadge true false}}
|
||||
{{$showEnableDisableWorkflow := and .AllowDisableOrEnableWorkflow .CurWorkflowIsListed $.CurWorkflow}}
|
||||
|
||||
<div class="page-content repository actions">
|
||||
{{template "repo/header" .}}
|
||||
<div class="ui container">
|
||||
@@ -7,25 +11,60 @@
|
||||
{{if .HasWorkflowsOrRuns}}
|
||||
<div class="flex-container">
|
||||
<div class="flex-container-nav">
|
||||
<div class="ui fluid vertical menu flex-items-block">
|
||||
<a class="item {{if not $.CurWorkflow}}active{{end}}" href="?actor={{$.CurActor}}&status={{$.CurStatus}}">{{ctx.Locale.Tr "actions.runs.all_workflows"}}</a>
|
||||
<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 {{if eq .Entry.Name $.CurWorkflow}}active{{end}}" href="?workflow={{.Entry.Name}}&actor={{$.CurActor}}&status={{$.CurStatus}}">
|
||||
<span class="gt-ellipsis">{{.Entry.Name}}</span>
|
||||
<a class="item flex-text-block {{if and (eq .Entry.Name $.CurWorkflow) (not $.CurWorkflowScopedRepoID)}}active{{end}}" href="?workflow={{.Entry.Name}}&actor={{$.CurActor}}&status={{$.CurStatus}}&branch={{$.CurBranch}}">
|
||||
<span class="gt-ellipsis" data-tooltip-content="{{.DisplayName}}">{{.DisplayName}}</span>
|
||||
|
||||
{{if .ErrMsg}}
|
||||
<span class="flex-text-inline" data-tooltip-content="{{.ErrMsg}}">{{svg "octicon-alert" 16 "tw-text-red"}}</span>
|
||||
<span class="flex-text-inline tw-shrink-0" 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>
|
||||
<div class="ui red label tw-shrink-0">{{ctx.Locale.Tr "disabled"}}</div>
|
||||
{{end}}
|
||||
</a>
|
||||
{{end}}
|
||||
{{range .ScopedWorkflowGroups}}
|
||||
<details class="item scoped-workflow-group"{{if .IsActive}} open{{end}}>
|
||||
<summary>
|
||||
<span class="gt-ellipsis tw-min-w-0" data-tooltip-content="{{.SourceRepoName}}">{{if .FromInstance}}{{.SourceRepoName}}{{else}}{{.SourceRepoShortName}}{{end}}</span>
|
||||
<span class="ui label">{{if .FromInstance}}{{ctx.Locale.Tr "actions.workflow.scope_global"}}{{else}}{{ctx.Locale.Tr "actions.workflow.scope_owner"}}{{end}}</span>
|
||||
</summary>
|
||||
{{range .Workflows}}
|
||||
<a class="item flex-text-block {{if and (eq .EntryName $.CurWorkflow) (eq .SourceRepoID $.CurWorkflowScopedRepoID)}}active{{end}}" href="?workflow={{.EntryName}}&scoped_workflow_source_repo_id={{.SourceRepoID}}&actor={{$.CurActor}}&status={{$.CurStatus}}&branch={{$.CurBranch}}">
|
||||
<span class="gt-ellipsis tw-min-w-0" data-tooltip-content="{{.EntryName}}">{{.DisplayName}}</span>
|
||||
{{if .Required}}
|
||||
<span class="ui label">{{ctx.Locale.Tr "actions.workflow.required"}}</span>
|
||||
{{else if .Disabled}}
|
||||
<span class="ui red label">{{ctx.Locale.Tr "disabled"}}</span>
|
||||
{{end}}
|
||||
</a>
|
||||
{{end}}
|
||||
</details>
|
||||
{{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" data-tooltip-content="{{.}}">{{.}}</span>
|
||||
</a>
|
||||
{{end}}
|
||||
</div>
|
||||
</details>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-container-main">
|
||||
<div class="ui top attached header flex-text-block tw-flex-wrap tw-justify-between">
|
||||
<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 -->
|
||||
@@ -37,11 +76,11 @@
|
||||
<i class="icon">{{svg "octicon-search"}}</i>
|
||||
<input type="text" placeholder="{{ctx.Locale.Tr "actions.runs.actor"}}">
|
||||
</div>
|
||||
<a class="item{{if not $.CurActor}} active{{end}}" href="?workflow={{$.CurWorkflow}}&status={{$.CurStatus}}&actor=0">
|
||||
<a class="item{{if not $.CurActor}} selected{{end}}" href="?workflow={{$.CurWorkflow}}&scoped_workflow_source_repo_id={{$.CurWorkflowRepoID}}&status={{$.CurStatus}}&branch={{$.CurBranch}}&actor=0">
|
||||
{{ctx.Locale.Tr "actions.runs.actors_no_select"}}
|
||||
</a>
|
||||
{{range .Actors}}
|
||||
<a class="item{{if eq .ID $.CurActor}} active{{end}}" href="?workflow={{$.CurWorkflow}}&actor={{.ID}}&status={{$.CurStatus}}">
|
||||
<a class="item{{if eq .ID $.CurActor}} selected{{end}}" href="?workflow={{$.CurWorkflow}}&scoped_workflow_source_repo_id={{$.CurWorkflowRepoID}}&actor={{.ID}}&status={{$.CurStatus}}&branch={{$.CurBranch}}">
|
||||
{{ctx.AvatarUtils.Avatar . 20}} {{.GetDisplayName}}
|
||||
</a>
|
||||
{{end}}
|
||||
@@ -56,24 +95,53 @@
|
||||
<i class="icon">{{svg "octicon-search"}}</i>
|
||||
<input type="text" placeholder="{{ctx.Locale.Tr "actions.runs.status"}}">
|
||||
</div>
|
||||
<a class="item{{if not $.CurStatus}} active{{end}}" href="?workflow={{$.CurWorkflow}}&actor={{$.CurActor}}&status=0">
|
||||
<a class="item{{if not $.CurStatus}} selected{{end}}" href="?workflow={{$.CurWorkflow}}&scoped_workflow_source_repo_id={{$.CurWorkflowRepoID}}&actor={{$.CurActor}}&branch={{$.CurBranch}}&status=0">
|
||||
{{ctx.Locale.Tr "actions.runs.status_no_select"}}
|
||||
</a>
|
||||
{{range .StatusInfoList}}
|
||||
<a class="item{{if eq .Status $.CurStatus}} active{{end}}" href="?workflow={{$.CurWorkflow}}&actor={{$.CurActor}}&status={{.Status}}">
|
||||
{{.DisplayedStatus}}
|
||||
<a class="item{{if eq .Status $.CurStatus}} selected{{end}}" href="?workflow={{$.CurWorkflow}}&scoped_workflow_source_repo_id={{$.CurWorkflowRepoID}}&actor={{$.CurActor}}&status={{.Status}}&branch={{$.CurBranch}}">
|
||||
<span class="flex-text-inline tw-gap-2">
|
||||
{{template "repo/icons/action_status" (dict "Status" .StatusName)}}
|
||||
{{.DisplayedStatus}}
|
||||
</span>
|
||||
</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}}&scoped_workflow_source_repo_id={{$.CurWorkflowRepoID}}&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}}&scoped_workflow_source_repo_id={{$.CurWorkflowRepoID}}&actor={{$.CurActor}}&status={{$.CurStatus}}&branch={{.}}">
|
||||
{{.}}
|
||||
</a>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{if .AllowDisableOrEnableWorkflow}}
|
||||
{{if or $showCreateWorkflowBadge $showEnableDisableWorkflow}}
|
||||
<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}}">
|
||||
{{if .CurWorkflowDisabled}}{{ctx.Locale.Tr "actions.workflow.enable"}}{{else}}{{ctx.Locale.Tr "actions.workflow.disable"}}{{end}}
|
||||
{{if $showCreateWorkflowBadge}}
|
||||
<div class="item show-modal" data-modal="#workflow-status-badge-modal">
|
||||
{{ctx.Locale.Tr "actions.workflow.create_status_badge"}}
|
||||
</div>
|
||||
{{end}}
|
||||
{{if $showEnableDisableWorkflow}}
|
||||
<a class="item {{if .CurWorkflowRequired}}disabled{{else}}link-action{{end}}"{{if not .CurWorkflowRequired}} data-url="{{$.Link}}/{{if .CurWorkflowDisabled}}enable{{else}}disable{{end}}?workflow={{$.CurWorkflow}}&scoped_workflow_source_repo_id={{$.CurWorkflowRepoID}}&actor={{.CurActor}}&status={{$.CurStatus}}&branch={{$.CurBranch}}"{{end}}>
|
||||
{{if .CurWorkflowRequired}}{{ctx.Locale.Tr "actions.workflow.disable"}}{{else if .CurWorkflowDisabled}}{{ctx.Locale.Tr "actions.workflow.enable"}}{{else}}{{ctx.Locale.Tr "actions.workflow.disable"}}{{end}}
|
||||
</a>
|
||||
{{end}}
|
||||
</div>
|
||||
</button>
|
||||
{{end}}
|
||||
@@ -94,4 +162,53 @@
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{if $showCreateWorkflowBadge}}
|
||||
<div id="workflow-status-badge-modal" class="ui tiny modal">
|
||||
<div class="header">{{ctx.Locale.Tr "actions.workflow.status_badge"}}</div>
|
||||
<div class="content">
|
||||
<div class="ui form" data-global-init="initWorkflowBadgeForm"
|
||||
data-badge-url="{{.WorkflowBadge.BadgeURL}}"
|
||||
data-workflow-url="{{.WorkflowBadge.WorkflowURL}}"
|
||||
data-workflow-display-name="{{.WorkflowBadge.DisplayName}}"
|
||||
>
|
||||
<div class="field">
|
||||
<img data-workflow-badge-image src="{{.WorkflowBadge.BadgeURL}}" alt="{{.CurWorkflow}}">
|
||||
</div>
|
||||
<div class="field">
|
||||
<label>{{ctx.Locale.Tr "actions.runs.branch"}}</label>
|
||||
<div class="ui selection dropdown">
|
||||
<input type="hidden" data-workflow-badge-branch value="{{.Repository.DefaultBranch}}">
|
||||
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
||||
<div class="text">{{.Repository.DefaultBranch}}</div>
|
||||
<div class="menu">
|
||||
<div class="item selected" data-value="{{.Repository.DefaultBranch}}">{{.Repository.DefaultBranch}}</div>
|
||||
{{range $branchName := .RunBranches}}
|
||||
{{if ne $branchName $.Repository.DefaultBranch}}
|
||||
<div class="item" data-value="{{$branchName}}">{{$branchName}}</div>
|
||||
{{end}}
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label>{{ctx.Locale.Tr "actions.workflow.status_badge_url"}}</label>
|
||||
<div class="ui action input">
|
||||
<input id="workflow-badge-url" readonly autofocus>
|
||||
<button class="ui icon button" data-tooltip-content="{{ctx.Locale.Tr "copy"}}" data-clipboard-target="#workflow-badge-url">{{svg "octicon-copy" 14}}</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label>Markdown</label>
|
||||
<textarea id="workflow-badge-markdown" rows="2" readonly></textarea>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label>HTML</label>
|
||||
<textarea id="workflow-badge-html" rows="2" readonly></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
{{template "base/footer" .}}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<div class="flex-list run-list">
|
||||
<div class="flex-divided-list items-with-main run-list">
|
||||
{{if not .Runs}}
|
||||
<div class="empty-placeholder">
|
||||
{{svg "octicon-no-entry" 48}}
|
||||
@@ -6,20 +6,20 @@
|
||||
</div>
|
||||
{{end}}
|
||||
{{range $run := .Runs}}
|
||||
<div class="flex-item tw-items-center">
|
||||
<div class="flex-item-leading">
|
||||
{{template "repo/actions/status" (dict "status" $run.Status.String)}}
|
||||
</div>
|
||||
<div class="flex-item-main">
|
||||
<span class="flex-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}}
|
||||
<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 class="flex-item-body">
|
||||
<span><b>{{if not $.CurWorkflow}}{{$run.WorkflowID}} {{end}}#{{$run.Index}}</b>:</span>
|
||||
</div>
|
||||
<div class="item-main">
|
||||
<div class="item-title">
|
||||
{{$title := or $run.Title (ctx.Locale.Tr "actions.runs.empty_commit_message")}}
|
||||
{{ctx.RenderUtils.RenderCommitMessageLinkSubject $title $run.Link $.Repository}}
|
||||
</div>
|
||||
<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"}}
|
||||
@@ -38,7 +38,7 @@
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-item-trailing">
|
||||
<div class="run-list-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}}
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
<!-- This template should be kept the same as web_src/js/components/ActionRunStatus.vue
|
||||
Please also update the vue file above if this template is modified.
|
||||
action status accepted: success, skipped, waiting, blocked, running, failure, cancelled, unknown
|
||||
-->
|
||||
{{- $size := Iif .size .size 16 -}}
|
||||
{{- $className := Iif .className .className "" -}}
|
||||
<span data-tooltip-content="{{ctx.Locale.Tr (printf "actions.status.%s" .status)}}">
|
||||
{{if eq .status "success"}}
|
||||
{{svg "octicon-check-circle-fill" $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}}{{/*failure, unknown*/}}
|
||||
{{svg "octicon-x-circle-fill" $size (printf "tw-text-red %s" $className)}}
|
||||
{{end}}
|
||||
</span>
|
||||
@@ -3,9 +3,8 @@
|
||||
<div class="page-content repository">
|
||||
{{template "repo/header" .}}
|
||||
{{template "repo/actions/view_component" (dict
|
||||
"RunID" .RunID
|
||||
"JobID" .JobID
|
||||
"ActionsURL" .ActionsURL
|
||||
"ActionsViewURL" .ActionsViewURL
|
||||
)}}
|
||||
</div>
|
||||
|
||||
|
||||
@@ -1,26 +1,36 @@
|
||||
<div id="repo-action-view"
|
||||
data-run-id="{{.RunID}}"
|
||||
<div id="repo-action-view"
|
||||
data-job-id="{{.JobID}}"
|
||||
data-actions-url="{{.ActionsURL}}"
|
||||
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-runs-workflow-graph="{{ctx.Locale.Tr "actions.runs.workflow_graph"}}"
|
||||
data-locale-summary="{{ctx.Locale.Tr "actions.runs.summary"}}"
|
||||
data-locale-all-jobs="{{ctx.Locale.Tr "actions.runs.all_jobs"}}"
|
||||
data-locale-job-summaries="{{ctx.Locale.Tr "actions.runs.job_summaries"}}"
|
||||
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-rerun-triggered="{{ctx.Locale.Tr "actions.runs.rerun_triggered"}}"
|
||||
data-locale-back-to-pull-request="{{ctx.Locale.Tr "actions.runs.back_to_pull_request"}}"
|
||||
data-locale-back-to-workflow="{{ctx.Locale.Tr "actions.runs.back_to_workflow"}}"
|
||||
data-locale-status-label="{{ctx.Locale.Tr "actions.runs.status"}}"
|
||||
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-workflow-file-no-permission="{{ctx.Locale.Tr "actions.runs.workflow_file_no_permission"}}"
|
||||
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"}}"
|
||||
@@ -28,12 +38,25 @@
|
||||
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-artifact-expired-at="{{ctx.Locale.Tr "artifact_expired_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>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{{/* "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-text-block tw-flex-wrap tw-justify-between tw-z-1">
|
||||
<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>
|
||||
@@ -7,13 +7,16 @@
|
||||
</div>
|
||||
<div id="runWorkflowDispatchModal" class="ui tiny modal">
|
||||
<div class="content">
|
||||
<form id="runWorkflowDispatchForm" class="ui form" action="{{$.Link}}/run?workflow={{$.CurWorkflow}}&actor={{$.CurActor}}&status={{.Status}}" method="post">
|
||||
<form id="runWorkflowDispatchForm" class="ui form ignore-dirty" action="{{$.Link}}/run?workflow={{$.CurWorkflow}}&scoped_workflow_source_repo_id={{$.CurWorkflowRepoID}}&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" hx-sync="this:replace" hx-target="#runWorkflowDispatchModalInputs" hx-swap="innerHTML" hx-get="{{$.Link}}/workflow-dispatch-inputs?workflow={{$.CurWorkflow}}" hx-trigger="change" value="refs/heads/{{index .Branches 0}}">
|
||||
<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}}&scoped_workflow_source_repo_id={{$.CurWorkflowRepoID}}"
|
||||
>
|
||||
{{svg "octicon-git-branch" 14}}
|
||||
<div class="default text">{{index .Branches 0}}</div>
|
||||
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
||||
@@ -48,12 +51,8 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="divider"></div>
|
||||
|
||||
<div id="runWorkflowDispatchModalInputs">
|
||||
{{template "repo/actions/workflow_dispatch_inputs" .}}
|
||||
</div>
|
||||
{{template "repo/actions/workflow_dispatch_inputs" .}}
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
<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}}
|
||||
@@ -11,16 +12,14 @@
|
||||
<div class="ui field {{if .Required}}required{{end}}">
|
||||
{{if eq .Type "choice"}}
|
||||
<label>{{or .Description .Name}}:</label>
|
||||
{{/* htmx won't initialize the fomantic dropdown, so it is a standard "select" input */}}
|
||||
<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"}}
|
||||
{{/* htmx doesn't trigger our JS code to attach fomantic label to checkbox, so here we use standard checkbox */}}
|
||||
<label class="tw-flex flex-text-inline">
|
||||
<input type="checkbox" name="{{.Name}}" {{if eq .Default "true"}}checked{{end}}>
|
||||
<input type="checkbox" name="{{.Name}}" {{if .IsDefaultTrue}}checked{{end}}>
|
||||
{{or .Description .Name}}
|
||||
</label>
|
||||
{{else if eq .Type "number"}}
|
||||
@@ -44,3 +43,4 @@
|
||||
</div>
|
||||
{{end}}
|
||||
{{end}}
|
||||
</div>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<div class="flex-container-nav">
|
||||
{{template "repo/navbar" .}}
|
||||
</div>
|
||||
<div class="flex-container-main">
|
||||
<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}}
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
{{end}}
|
||||
{{end}}
|
||||
<div class="{{TabSizeClass .Editorconfig .FileTreePath}} non-diff-file-content">
|
||||
<h4 class="file-header ui top attached header tw-flex tw-items-center tw-justify-between tw-flex-wrap">
|
||||
<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>
|
||||
@@ -28,7 +28,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</h4>
|
||||
<div class="ui bottom attached table unstackable segment">
|
||||
<div class="ui bottom attached segment file-view-container">
|
||||
<div class="file-view code-view unicode-escaped">
|
||||
{{if .IsFileTooLarge}}
|
||||
{{template "shared/filetoolarge" dict "RawFileLink" .RawFileLink}}
|
||||
@@ -43,7 +43,7 @@
|
||||
<div class="blame-info">
|
||||
<div class="blame-data">
|
||||
<div class="blame-avatar">
|
||||
{{$row.Avatar}}
|
||||
{{if $row.AvatarStackData}}{{ctx.RenderUtils.AvatarStack $row.AvatarStackData}}{{end}}
|
||||
</div>
|
||||
<div class="blame-message muted-links" title="{{$row.CommitMessage}}">
|
||||
{{ctx.RenderUtils.RenderCommitMessageLinkSubject $row.CommitMessage $row.CommitURL $.Repository}}
|
||||
@@ -79,7 +79,7 @@
|
||||
{{/*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>
|
||||
<a class="item ref-in-new-issue" role="menuitem" data-url-issue-new="{{.RepoLink}}/issues/new" data-url-param-body-link="{{.Repository.HTMLURL ctx}}/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>
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
<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)}}
|
||||
@@ -14,7 +13,8 @@
|
||||
{{end}}
|
||||
</h4>
|
||||
|
||||
<div class="ui attached table segment">
|
||||
{{if .DefaultBranchBranch}}
|
||||
<div class="ui attached table segment" data-testid="branches-default-branch-list">
|
||||
<table class="ui very basic fixed table single line">
|
||||
<tbody>
|
||||
<tr>
|
||||
@@ -29,8 +29,8 @@
|
||||
</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>
|
||||
{{/* FIXME: here and below, the tw-overflow-visible is not quite right but it is still needed the moment: to show the important buttons when the width is narrow */}}
|
||||
<td class="tw-text-right tw-overflow-visible">
|
||||
<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"
|
||||
@@ -63,17 +63,20 @@
|
||||
{{svg "octicon-pencil"}}
|
||||
</button>
|
||||
{{end}}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{{else}}
|
||||
<div class="ui attached segment" data-testid="branches-default-branch-not-exist">
|
||||
{{ctx.Locale.Tr "repo.branch.default_branch_not_exist" $.Repository.DefaultBranch}}
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
<h4 class="ui top attached header tw-flex tw-items-center tw-justify-between">
|
||||
<div class="flex-text-block">
|
||||
{{ctx.Locale.Tr "repo.branches"}}
|
||||
</div>
|
||||
<h4 class="ui top attached header">
|
||||
{{ctx.Locale.Tr "repo.branches"}}
|
||||
</h4>
|
||||
|
||||
<div class="ui attached segment">
|
||||
@@ -106,7 +109,7 @@
|
||||
<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 ui">
|
||||
<td class="two wide">
|
||||
{{if and (not .DBBranch.IsDeleted) $.DefaultBranchBranch}}
|
||||
{{$tooltipDivergence := ""}}
|
||||
{{if or .CommitsBehind .CommitsAhead}}
|
||||
@@ -127,21 +130,21 @@
|
||||
</div>
|
||||
{{end}}
|
||||
</td>
|
||||
<td class="two wide tw-text-right">
|
||||
<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 href="{{$.PullRequestCtx.MakeDefaultCompareLink .DBBranch.Name}}?expand=1">
|
||||
<button id="new-pull-request" class="ui compact basic button tw-mr-0">{{if $.CanPull}}{{ctx.Locale.Tr "repo.pulls.compare_changes"}}{{else}}{{ctx.Locale.Tr "action.compare_branch"}}{{end}}</button>
|
||||
<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 href="{{$.PullRequestCtx.MakeDefaultCompareLink .DBBranch.Name}}?expand=1">
|
||||
<button id="new-pull-request" class="ui compact basic button tw-mr-0">{{if $.CanPull}}{{ctx.Locale.Tr "repo.pulls.compare_changes"}}{{else}}{{ctx.Locale.Tr "action.compare_branch"}}{{end}}</button>
|
||||
<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}}
|
||||
@@ -155,8 +158,8 @@
|
||||
{{end}}
|
||||
{{end}}
|
||||
</td>
|
||||
{{/* FIXME: here and above, the tw-overflow-visible is not quite right */}}
|
||||
<td class="three wide tw-text-right tw-overflow-visible">
|
||||
<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}}"
|
||||
@@ -197,11 +200,12 @@
|
||||
</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}}">
|
||||
<button class="btn interact-bg tw-p-2 show-modal delete-branch-button tw-text-red" data-modal="#delete-branch-modal" data-modal-form.url="{{$.Link}}/delete?name={{.DBBranch.Name}}&page={{$.Page.Paginater.Current}}" data-tooltip-content="{{ctx.Locale.Tr "repo.branch.delete" (.DBBranch.Name)}}" data-modal-name="{{.DBBranch.Name}}">
|
||||
{{svg "octicon-trash"}}
|
||||
</button>
|
||||
{{end}}
|
||||
{{end}}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{{end}}
|
||||
@@ -212,7 +216,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="ui g-modal-confirm delete modal">
|
||||
<form class="ui small modal form-fetch-action" method="post" id="delete-branch-modal">
|
||||
<div class="header">
|
||||
{{svg "octicon-trash"}}
|
||||
{{ctx.Locale.Tr "repo.branch.delete_html"}} <span class="name"></span>
|
||||
@@ -221,7 +225,7 @@
|
||||
<p>{{ctx.Locale.Tr "repo.branch.delete_desc"}}</p>
|
||||
</div>
|
||||
{{template "base/modal_actions_confirm" .}}
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div class="ui mini modal" id="create-branch-modal">
|
||||
<div class="header">
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
{{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 href="%s/pulls/%d">#%d</a>` $.RepoLink $.MergedPRIssueNumber $.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-fetch-url="{{.RepoLink}}/commit/{{.CommitID}}/load-branches-and-tags"
|
||||
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">
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<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.Summary}}">{{ctx.RenderUtils.RenderCommitMessage .Commit.Message $.Repository}}</span>{{template "repo/commit_statuses" dict "Status" .CommitStatus "Statuses" .CommitStatuses "AdditionalClasses" "tw-inline"}}</h3>
|
||||
<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}}">
|
||||
@@ -119,8 +119,8 @@
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
{{if IsMultilineCommitMessage .Commit.Message}}
|
||||
<pre class="commit-body">{{ctx.RenderUtils.RenderCommitBody .Commit.Message $.Repository}}</pre>
|
||||
{{if .Commit.MessageBody}}
|
||||
<pre class="commit-body">{{ctx.RenderUtils.RenderCommitBody .Commit.MessageUTF8 $.Repository}}</pre>
|
||||
{{end}}
|
||||
{{template "repo/commit_load_branches_and_tags" .}}
|
||||
</div>
|
||||
@@ -129,31 +129,46 @@
|
||||
<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}}
|
||||
<strong>{{.Author.GetShortDisplayNameLinkHTML}}</strong>
|
||||
{{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.Committer.When}}</span>
|
||||
|
||||
<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)}}
|
||||
{{$committerIsAuthor := and (eq .Commit.Committer.Name .Commit.Author.Name) (eq .Commit.Committer.Email .Commit.Author.Email)}}
|
||||
{{if not $committerIsAuthor}}
|
||||
<div class="flex-text-inline">
|
||||
<span class="tw-text-text-light">{{ctx.Locale.Tr "repo.diff.committed_by"}}</span>
|
||||
{{if and .Verification.CommittingUser .Verification.CommittingUser.ID}}
|
||||
{{if and .Verification.CommittingUser}}
|
||||
{{ctx.AvatarUtils.Avatar .Verification.CommittingUser 20}}
|
||||
<a href="{{.Verification.CommittingUser.HomeLink}}"><strong>{{.Commit.Committer.Name}}</strong></a>
|
||||
<strong>{{.Verification.CommittingUser.GetShortDisplayNameLinkHTML}}</strong>
|
||||
{{else}}
|
||||
{{ctx.AvatarUtils.AvatarByEmail .Commit.Committer.Email .Commit.Committer.Name 20}}
|
||||
{{ctx.AvatarUtils.AvatarByEmail .Commit.Committer.Email .Commit.Committer.Email 20}}
|
||||
<strong>{{.Commit.Committer.Name}}</strong>
|
||||
{{end}}
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
{{if .CommitOtherParticipants}}
|
||||
<div class="flex-text-inline">
|
||||
<span class="tw-text-text-light">{{ctx.Locale.Tr "repo.diff.coauthored_by"}}</span>
|
||||
{{range $participant := .CommitOtherParticipants}}
|
||||
{{$user := $participant.GiteaUser}}
|
||||
{{$gitIdentity := $participant.GitIdentity}}
|
||||
{{if $user}}
|
||||
{{ctx.AvatarUtils.Avatar $user 20}}
|
||||
<strong>{{$user.GetShortDisplayNameLinkHTML}}</strong>
|
||||
{{else}}
|
||||
{{$gitName := $gitIdentity.Name}}
|
||||
{{$gitEmail := $gitIdentity.Email}}
|
||||
{{ctx.AvatarUtils.AvatarByEmail $gitEmail $gitEmail 20}}{{/* use the same layout as the "author" above */}}
|
||||
<strong>{{$gitName}}</strong>
|
||||
{{end}}
|
||||
{{end}}
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
{{if .Verification}}
|
||||
{{template "repo/commit_sign_badge" dict "CommitSignVerification" .Verification}}
|
||||
@@ -195,7 +210,7 @@
|
||||
<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 | SanitizeHTML}}</pre>
|
||||
<pre class="commit-body">{{.NoteRendered}}</pre>
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
|
||||
@@ -64,10 +64,10 @@ so this template should be kept as small as possible, DO NOT put large component
|
||||
{{- 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>
|
||||
<span data-tooltip-content="{{$msgSigningKey}}">{{ctx.AvatarUtils.Avatar $signingUser 20}}</span>
|
||||
{{- else -}}
|
||||
<span data-tooltip-content="{{$msgReason}}">{{svg "gitea-lock-cog"}}</span>
|
||||
<span data-tooltip-content="{{$msgSigningKey}}">{{ctx.AvatarUtils.AvatarByEmail $signingEmail "" 16}}</span>
|
||||
<span data-tooltip-content="{{$msgSigningKey}}">{{ctx.AvatarUtils.AvatarByEmail $signingEmail "" 20}}</span>
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
<span data-tooltip-content="{{$msgReason}}">{{svg "gitea-unlock"}}</span>
|
||||
|
||||
@@ -1,14 +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/commit_status" .Status}}
|
||||
{{template "repo/icons/commit_status" .Status}}
|
||||
</a>
|
||||
{{else}}
|
||||
<span class="flex-text-inline {{.AdditionalClasses}}" data-global-init="initCommitStatuses" tabindex="0">
|
||||
{{template "repo/commit_status" .Status}}
|
||||
{{template "repo/icons/commit_status" .Status}}
|
||||
</span>
|
||||
{{end}}
|
||||
<div class="tippy-target">
|
||||
{{template "repo/pulls/status" (dict "CommitStatuses" .Statuses "CommitStatus" .Status)}}
|
||||
<div class="flex-divided-list items-px-default">
|
||||
{{template "repo/pulls/status_items" (dict "CommitStatuses" .Statuses)}}
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
@@ -11,18 +11,12 @@
|
||||
</thead>
|
||||
<tbody class="commit-list">
|
||||
{{$commitRepoLink := $.RepoLink}}{{if $.CommitRepoLink}}{{$commitRepoLink = $.CommitRepoLink}}{{end}}
|
||||
{{range .Commits}}
|
||||
{{range $commit := $.Commits}}
|
||||
{{$gitCommit := $commit.GitCommit}}
|
||||
{{$commitID := $gitCommit.ID.String}}
|
||||
<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>
|
||||
{{ctx.RenderUtils.AvatarStackWithNames $commit.AvatarStackData}}
|
||||
</td>
|
||||
<td class="sha">
|
||||
{{$commitBaseLink := ""}}
|
||||
@@ -30,51 +24,51 @@
|
||||
{{$commitBaseLink = printf "%s/wiki/commit" $commitRepoLink}}
|
||||
{{else if $.PageIsPullCommits}}
|
||||
{{$commitBaseLink = printf "%s/pulls/%d/commits" $commitRepoLink $.Issue.Index}}
|
||||
{{else if $.Reponame}}
|
||||
{{else}}
|
||||
{{$commitBaseLink = printf "%s/commit" $commitRepoLink}}
|
||||
{{end}}
|
||||
{{template "repo/commit_sign_badge" dict "Commit" . "CommitBaseLink" $commitBaseLink "CommitSignVerification" .Verification}}
|
||||
{{template "repo/commit_sign_badge" dict "Commit" $gitCommit "CommitBaseLink" $commitBaseLink "CommitSignVerification" .Verification}}
|
||||
</td>
|
||||
<td class="message">
|
||||
<span class="message-wrapper">
|
||||
{{if $.PageIsWiki}}
|
||||
<span class="commit-summary {{if gt .ParentCount 1}} grey text{{end}}" title="{{.Summary}}">{{.Summary | ctx.RenderUtils.RenderEmoji}}</span>
|
||||
<span class="commit-summary {{if gt $gitCommit.ParentCount 1}} grey text{{end}}" title="{{$gitCommit.MessageTitle}}">
|
||||
{{$gitCommit.MessageTitle | ctx.RenderUtils.RenderEmoji}}
|
||||
</span>
|
||||
{{else}}
|
||||
{{$commitLink:= printf "%s/commit/%s" $commitRepoLink (PathEscape .ID.String)}}
|
||||
<span class="commit-summary {{if gt .ParentCount 1}} grey text{{end}}" title="{{.Summary}}">{{ctx.RenderUtils.RenderCommitMessageLinkSubject .Message $commitLink $.Repository}}</span>
|
||||
{{$commitLink:= printf "%s/commit/%s" $commitRepoLink (PathEscape $commitID)}}
|
||||
<span class="commit-summary {{if gt $gitCommit.ParentCount 1}} grey text{{end}}" title="{{$gitCommit.MessageTitle}}">
|
||||
{{ctx.RenderUtils.RenderCommitMessageLinkSubject $gitCommit.MessageUTF8 $commitLink $.Repository}}
|
||||
</span>
|
||||
{{end}}
|
||||
</span>
|
||||
{{if IsMultilineCommitMessage .Message}}
|
||||
{{if $gitCommit.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 IsMultilineCommitMessage .Message}}
|
||||
<pre class="commit-body tw-hidden">{{ctx.RenderUtils.RenderCommitBody .Message $.Repository}}</pre>
|
||||
{{if $gitCommit.MessageBody}}
|
||||
<pre class="commit-body tw-hidden">{{ctx.RenderUtils.RenderCommitBody $gitCommit.MessageUTF8 $.Repository}}</pre>
|
||||
{{end}}
|
||||
{{if $.CommitsTagsMap}}
|
||||
{{range (index $.CommitsTagsMap .ID.String)}}
|
||||
{{range (index $.CommitsTagsMap $commitID)}}
|
||||
{{- 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">{{DateUtils.TimeSince $gitCommit.Committer.When}}</td>
|
||||
<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>
|
||||
<button class="btn interact-bg tw-p-2 copy-commit-id" data-tooltip-content="{{ctx.Locale.Tr "copy_hash"}}" data-clipboard-text="{{$commitID}}">{{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}}"
|
||||
href="{{$commitRepoLink}}/commit/{{$commitID}}?files={{$.FileTreePath}}"
|
||||
>{{svg "octicon-file-diff"}}</a>
|
||||
{{end}}
|
||||
|
||||
{{/* view at history point */}}
|
||||
{{$viewCommitLink := printf "%s/src/commit/%s" $commitRepoLink (PathEscape .ID.String)}}
|
||||
{{$viewCommitLink := printf "%s/src/commit/%s" $commitRepoLink (PathEscape $commitID)}}
|
||||
{{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}}
|
||||
|
||||
@@ -1,35 +1,32 @@
|
||||
{{$index := 0}}
|
||||
<div class="timeline-item commits-list">
|
||||
{{range .comment.Commits}}
|
||||
{{range $commit := $.comment.Commits}}
|
||||
{{$gitCommit := $commit.GitCommit}}
|
||||
{{$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}}
|
||||
{{ctx.RenderUtils.AvatarStack $commit.AvatarStackData}}
|
||||
|
||||
{{$commitBaseLink := printf "%s/commit" $.comment.Issue.PullRequest.BaseRepo.Link}}
|
||||
{{$commitLink:= printf "%s/%s" $commitBaseLink (PathEscape .ID.String)}}
|
||||
{{$commitLink:= printf "%s/%s" $commitBaseLink (PathEscape $gitCommit.ID.String)}}
|
||||
|
||||
<span class="tw-flex-1 tw-font-mono gt-ellipsis" title="{{.Summary}}">
|
||||
{{- ctx.RenderUtils.RenderCommitMessageLinkSubject .Message $commitLink $.comment.Issue.PullRequest.BaseRepo -}}
|
||||
<span class="tw-flex-1 tw-font-mono gt-ellipsis" title="{{$gitCommit.MessageTitle}}">
|
||||
{{- ctx.RenderUtils.RenderCommitMessageLinkSubject $gitCommit.MessageUTF8 $commitLink $.comment.Issue.PullRequest.BaseRepo -}}
|
||||
</span>
|
||||
|
||||
{{if IsMultilineCommitMessage .Message}}
|
||||
{{if $gitCommit.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}}
|
||||
{{template "repo/commit_statuses" dict "Status" $commit.Status "Statuses" $commit.Statuses}}
|
||||
{{template "repo/commit_sign_badge" dict "Commit" $gitCommit "CommitBaseLink" $commitBaseLink "CommitSignVerification" $commit.Verification}}
|
||||
</span>
|
||||
</div>
|
||||
{{if IsMultilineCommitMessage .Message}}
|
||||
{{if $gitCommit.MessageBody}}
|
||||
<pre class="commit-body tw-ml-[33px] tw-hidden" data-singular-commit-body-for="{{$tag}}">
|
||||
{{- ctx.RenderUtils.RenderCommitBody .Message $.comment.Issue.PullRequest.BaseRepo -}}
|
||||
{{- ctx.RenderUtils.RenderCommitBody $gitCommit.MessageUTF8 $.comment.Issue.PullRequest.BaseRepo -}}
|
||||
</pre>
|
||||
{{end}}
|
||||
{{end}}
|
||||
|
||||
@@ -1,21 +1,30 @@
|
||||
<h4 class="ui top attached header commits-table tw-flex tw-items-center tw-justify-between">
|
||||
<div class="commits-table-left flex-text-block">
|
||||
{{if or .PageIsCommits (gt .CommitCount 0)}}
|
||||
{{.CommitCount}} {{ctx.Locale.Tr "repo.commits.commits"}}
|
||||
<div class="ui top attached header flex-left-right">
|
||||
<div class="flex-text-block">
|
||||
{{if .Commits}}
|
||||
{{if gt .CommitCount 0}}{{.CommitCount}}{{end}}{{/* CommitCount is -1 when "follow rename" */}}
|
||||
{{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">
|
||||
<div class="flex-text-block">
|
||||
{{if .ShowFollowRename}}
|
||||
<div class="ui checkbox">
|
||||
<input type="checkbox" {{if .FollowRenameChecked}}checked{{end}} data-global-init="initCommitHistoryFollowRename">
|
||||
<label>{{ctx.Locale.Tr "repo.commits.history_enable_follow_renames"}}</label>
|
||||
</div>
|
||||
{{end}}
|
||||
{{if .IsDiffCompare}}
|
||||
<div class="flex-text-inline">
|
||||
<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>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{if .PageIsCommits}}
|
||||
<div class="ui attached segment">
|
||||
@@ -29,7 +38,7 @@
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
{{if and .Commits (gt .CommitCount 0)}}
|
||||
{{if .Commits}}
|
||||
{{template "repo/commits_list" .}}
|
||||
{{end}}
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
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}}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
{{svg "octicon-sidebar-collapse" 20 "icon tw-hidden"}}
|
||||
{{svg "octicon-sidebar-expand" 20 "icon tw-hidden"}}
|
||||
</button>
|
||||
<script>
|
||||
<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');
|
||||
@@ -35,7 +35,7 @@
|
||||
{{template "repo/diff/whitespace_dropdown" .}}
|
||||
{{template "repo/diff/options_dropdown" .}}
|
||||
{{if .PageIsPullFiles}}
|
||||
<div id="diff-commit-select" data-merge-base="{{.MergeBase}}" 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"}}">
|
||||
<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"}}
|
||||
@@ -62,7 +62,7 @@
|
||||
{{if $showFileTree}}
|
||||
{{$.FileIconPoolHTML}}
|
||||
<div id="diff-file-tree" class="tw-hidden not-mobile"></div>
|
||||
<script>
|
||||
<script nonce="{{ctx.CspScriptNonce}}">
|
||||
if (diffTreeVisible) document.getElementById('diff-file-tree').classList.remove('tw-hidden');
|
||||
</script>
|
||||
{{end}}
|
||||
@@ -211,7 +211,7 @@
|
||||
|
||||
{{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 tw-flex tw-items-center tw-justify-between">
|
||||
<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>
|
||||
|
||||
@@ -210,8 +210,8 @@
|
||||
{{template "repo/issue/new_form" .}}
|
||||
</div>
|
||||
{{end}}
|
||||
{{else}}{{/* not singed-in or not for pull-request */}}
|
||||
{{if and (not .CommitCount) $.CompareInfo.MergeBase}}
|
||||
{{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}}
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
data-mime-before="{{.sniffedTypeBase.GetMimeType}}"
|
||||
data-mime-after="{{.sniffedTypeHead.GetMimeType}}"
|
||||
>
|
||||
<overflow-menu class="ui secondary pointing tabular menu custom">
|
||||
<div class="overflow-menu-items tw-justify-center">
|
||||
<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>
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
{{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}}
|
||||
{{if .Addition}}<strong class="tw-text-diff-added-fg">+{{.Addition}}</strong>{{end}}
|
||||
{{if .Deletion}}<strong class="tw-text-diff-removed-fg">-{{.Deletion}}</strong>{{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 */}}
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
<label>{{ctx.Locale.Tr "repo.editor.signoff_desc"}}</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="quick-pull-choice js-quick-pull-choice">
|
||||
<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}}>
|
||||
@@ -30,9 +30,9 @@
|
||||
{{svg "octicon-git-commit"}}
|
||||
{{ctx.Locale.Tr "repo.editor.commit_directly_to_this_branch" .BranchName}}
|
||||
{{if not .CommitFormOptions.CanCommitToBranch}}
|
||||
<div class="ui visible small warning message">
|
||||
<div class="tw-mt-2">
|
||||
{{ctx.Locale.Tr "repo.editor.no_commit_to_branch"}}
|
||||
<ul>
|
||||
<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>
|
||||
|
||||
@@ -18,12 +18,12 @@
|
||||
{{if not .NotEditableReason}}
|
||||
<div class="field">
|
||||
<div class="ui top attached header">
|
||||
<div class="flex-text-block tw-justify-between tw-flex-wrap">
|
||||
<div class="ui compact small menu small-menu-items repo-editor-menu tw-self-start">
|
||||
<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" data-preview-url="{{.Repository.Link}}/markup" data-preview-context-ref="{{.RepoLink}}/src/{{.RefTypeNameSubURL}}">{{svg "octicon-eye"}} {{ctx.Locale.Tr "preview"}}</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" hx-params="context,content" hx-vals='{"context":"{{.BranchLink}}"}' hx-include="#edit_area" hx-swap="innerHTML" hx-target=".tab[data-tab='diff']" hx-indicator=".tab[data-tab='diff']" hx-post="{{.RepoLink}}/_preview/{{.BranchName | PathEscapeSegments}}/{{.TreePath | PathEscapeSegments}}">{{svg "octicon-diff"}} {{ctx.Locale.Tr "repo.editor.preview_changes"}}</a>
|
||||
<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}}
|
||||
@@ -37,10 +37,10 @@
|
||||
<div class="editor-loading is-loading"></div>
|
||||
</div>
|
||||
<div class="ui tab tw-px-4 tw-py-3" data-tab="preview">
|
||||
{{ctx.Locale.Tr "loading"}}
|
||||
<div class="editor-loading is-loading"></div>
|
||||
</div>
|
||||
<div class="ui tab" data-tab="diff">
|
||||
<div class="tw-p-16"></div>
|
||||
<div class="editor-loading is-loading"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -21,15 +21,15 @@
|
||||
</div>
|
||||
<div class="field">
|
||||
<div class="ui top attached header">
|
||||
<div class="flex-text-block tw-justify-between tw-flex-wrap">
|
||||
<div class="ui compact small menu small-menu-items repo-editor-menu tw-self-start">
|
||||
<a class="active item" data-tab="write">{{svg "octicon-code" 16 "tw-mr-1"}}{{ctx.Locale.Tr "repo.editor.new_patch"}}</a>
|
||||
<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" data-tab="write">
|
||||
<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}}"
|
||||
|
||||
@@ -41,14 +41,7 @@
|
||||
</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}}
|
||||
{{ctx.RenderUtils.AvatarStackWithNames $commit.AvatarStackData}}
|
||||
</span>
|
||||
|
||||
<span class="time flex-text-inline">{{DateUtils.FullTime $commit.Date}}</span>
|
||||
|
||||
@@ -1,17 +1,14 @@
|
||||
<div class="secondary-nav">
|
||||
{{with .Repository}}
|
||||
{{with .Repository}}
|
||||
<div class="ui container">
|
||||
<div class="repo-header">
|
||||
<div class="flex-item tw-items-center">
|
||||
<div class="flex-item-leading">
|
||||
{{template "repo/icon" .}}
|
||||
<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-item-main">
|
||||
<div class="flex-item-title tw-text-18">
|
||||
<a class="muted tw-font-normal" href="{{.Owner.HomeLink}}">{{.Owner.Name}}</a>/<a class="muted" href="{{$.RepoLink}}">{{.Name}}</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-item-trailing">
|
||||
<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>
|
||||
@@ -38,22 +35,19 @@
|
||||
</div>
|
||||
</div>
|
||||
{{if not (or .IsBeingCreated .IsBroken)}}
|
||||
{{/* right part */}}
|
||||
<div class="flex-text-block tw-flex-wrap">
|
||||
{{if $.RepoTransfer}}
|
||||
<form method="post" action="{{$.RepoLink}}/action/accept_transfer?redirect_to={{$.RepoLink}}">
|
||||
<div class="flex-text-inline" data-tooltip-content="{{if $.CanUserAcceptOrRejectTransfer}}{{ctx.Locale.Tr "repo.transfer.accept_desc" $.RepoTransfer.Recipient.DisplayName}}{{else}}{{ctx.Locale.Tr "repo.transfer.no_permission_to_accept"}}{{end}}">
|
||||
<button type="submit" class="ui compact small basic button {{if $.CanUserAcceptOrRejectTransfer}}primary {{end}} ok small"{{if not $.CanUserAcceptOrRejectTransfer}} disabled{{end}}>
|
||||
{{ctx.Locale.Tr "repo.transfer.accept"}}
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
<form method="post" action="{{$.RepoLink}}/action/reject_transfer?redirect_to={{$.RepoLink}}">
|
||||
<div class="flex-text-inline" data-tooltip-content="{{if $.CanUserAcceptOrRejectTransfer}}{{ctx.Locale.Tr "repo.transfer.reject_desc" $.RepoTransfer.Recipient.DisplayName}}{{else}}{{ctx.Locale.Tr "repo.transfer.no_permission_to_reject"}}{{end}}">
|
||||
<button type="submit" class="ui compact small basic button {{if $.CanUserAcceptOrRejectTransfer}}red {{end}}ok small"{{if not $.CanUserAcceptOrRejectTransfer}} disabled{{end}}>
|
||||
{{ctx.Locale.Tr "repo.transfer.reject"}}
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
{{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. */}}
|
||||
@@ -61,74 +55,30 @@
|
||||
{{svg "octicon-rss" 16}}
|
||||
</a>
|
||||
{{end}}
|
||||
{{template "repo/watch_unwatch" $}}
|
||||
{{template "repo/header/watch" $}}
|
||||
{{if not $.DisableStars}}
|
||||
{{template "repo/star_unstar" $}}
|
||||
{{template "repo/header/star" $}}
|
||||
{{end}}
|
||||
{{if and (not .IsEmpty) ($.Permission.CanRead ctx.Consts.RepoUnitTypeCode)}}
|
||||
<div class="ui labeled button
|
||||
{{if or (not $.IsSigned) (and (not $.CanSignedUserFork) (not $.UserAndOrgForks))}}
|
||||
disabled
|
||||
{{end}}"
|
||||
{{if not $.IsSigned}}
|
||||
data-tooltip-content="{{ctx.Locale.Tr "repo.fork_guest_user"}}"
|
||||
{{else if and (not $.CanSignedUserFork) (not $.UserAndOrgForks)}}
|
||||
data-tooltip-content="{{ctx.Locale.Tr "repo.fork_from_self"}}"
|
||||
{{end}}
|
||||
>
|
||||
<a class="ui compact{{if $.ShowForkModal}} show-modal{{end}} small basic button"
|
||||
{{if not $.CanSignedUserFork}}
|
||||
{{if gt (len $.UserAndOrgForks) 1}}
|
||||
href="#" data-modal="#fork-repo-modal"
|
||||
{{else if eq (len $.UserAndOrgForks) 1}}
|
||||
href="{{AppSubUrl}}/{{(index $.UserAndOrgForks 0).FullName}}"
|
||||
{{/*else is not required here, because the button shouldn't link to any site if you can't create a fork*/}}
|
||||
{{end}}
|
||||
{{else if not $.UserAndOrgForks}}
|
||||
href="{{$.RepoLink}}/fork"
|
||||
{{else}}
|
||||
href="#" data-modal="#fork-repo-modal"
|
||||
{{end}}
|
||||
>
|
||||
{{svg "octicon-repo-forked"}}<span class="text not-mobile">{{ctx.Locale.Tr "repo.fork"}}</span>
|
||||
</a>
|
||||
<a class="ui basic label" href="{{.Link}}/forks">
|
||||
{{CountFmt .NumForks}}
|
||||
</a>
|
||||
</div>
|
||||
<div class="ui small modal" id="fork-repo-modal">
|
||||
<div class="header">
|
||||
{{ctx.Locale.Tr "repo.already_forked" .Name}}
|
||||
</div>
|
||||
<div class="content tw-text-left">
|
||||
<div class="ui list">
|
||||
{{range $.UserAndOrgForks}}
|
||||
<div class="ui item tw-py-2">
|
||||
<a href="{{.Link}}">{{svg "octicon-repo-forked" 16 "tw-mr-2"}}{{.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>
|
||||
{{template "repo/header/fork" $}}
|
||||
{{end}}
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
|
||||
{{/* next line, secondary info */}}
|
||||
{{if $.PullMirror}}
|
||||
<div class="fork-flag">
|
||||
<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="fork-flag">{{ctx.Locale.Tr "repo.forked_from"}} <a href="{{.BaseRepo.Link}}">{{.BaseRepo.FullName}}</a></div>{{end}}
|
||||
{{if .IsGenerated}}<div class="fork-flag">{{ctx.Locale.Tr "repo.generated_from"}} <a href="{{(.TemplateRepo ctx).Link}}">{{(.TemplateRepo ctx).FullName}}</a></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}}
|
||||
{{end}}
|
||||
|
||||
<div class="ui container">
|
||||
<overflow-menu class="ui secondary pointing menu">
|
||||
{{if not (or .Repository.IsBeingCreated .Repository.IsBroken)}}
|
||||
|
||||
@@ -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>
|
||||
@@ -1,61 +1,47 @@
|
||||
<div class="repo-home-sidebar-bottom">
|
||||
<div class="flex-list">
|
||||
{{if .LatestRelease}}
|
||||
<div class="flex-item">
|
||||
<div class="flex-item-main">
|
||||
<div class="flex-item-title">
|
||||
<a class="item muted" href="{{.RepoLink}}/releases">
|
||||
{{ctx.Locale.Tr "repo.releases"}}
|
||||
</a>
|
||||
<span class="ui small label">{{.NumReleases}}</span>
|
||||
</div>
|
||||
<div class="flex-item">
|
||||
<div class="flex-item-leading">
|
||||
<div class="tw-mt-1">{{svg "octicon-tag" 16}}</div>
|
||||
</div>
|
||||
<div class="flex-item-main">
|
||||
<div class="flex-item-header">
|
||||
<div class="flex-item-title tw-gap-2">
|
||||
<a class="gt-ellipsis muted" href="{{.LatestRelease.Link}}" title="{{.LatestRelease.Title}}">{{.LatestRelease.Title}}</a>
|
||||
{{template "repo/release/label" (dict "Release" .LatestRelease "IsLatest" true)}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-item-body">
|
||||
<span class="time">{{DateUtils.TimeSince .LatestRelease.CreatedUnix}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<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}}
|
||||
{{end}}
|
||||
|
||||
{{if and (not .IsEmptyRepo) .LanguageStats}}
|
||||
<div class="flex-item">
|
||||
<div class="flex-item-main">
|
||||
<div class="flex-item-title">
|
||||
{{ctx.Locale.Tr "repo.repo_lang"}}
|
||||
</div>
|
||||
{{if and (not .IsEmptyRepo) .LanguageStats}}
|
||||
<div class="divider"></div>
|
||||
<div class="repo-home-sidebar-header">
|
||||
{{ctx.Locale.Tr "repo.repo_lang"}}
|
||||
</div>
|
||||
|
||||
<div class="flex-item-body">
|
||||
<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>
|
||||
<span class="tw-font-semibold">
|
||||
{{Iif (eq .Language "other") (ctx.Locale.Tr "repo.language_other") .Language}}
|
||||
</span>
|
||||
{{.Percentage}}%
|
||||
</div>
|
||||
{{end}}
|
||||
</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>
|
||||
{{end}}
|
||||
</div>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<div class="repo-home-sidebar-top">
|
||||
<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">
|
||||
@@ -9,71 +9,64 @@
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div class="flex-list">
|
||||
<div class="flex-item">
|
||||
<div class="flex-item-main">
|
||||
<div class="flex-item-title">{{ctx.Locale.Tr "repo.repo_desc"}}</div>
|
||||
<div class="flex-item-body tw-text-15">
|
||||
<div class="tw-flex tw-flex-col tw-gap-2 tw-mt-2">
|
||||
<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>
|
||||
<div class="flex-relaxed-list">
|
||||
<div class="repo-home-sidebar-header">{{ctx.Locale.Tr "repo.repo_desc"}}</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 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>
|
||||
|
||||
<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 .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}}
|
||||
|
||||
{{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}}
|
||||
<span 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}}
|
||||
</span>
|
||||
</div>
|
||||
<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,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}}
|
||||
@@ -14,14 +14,15 @@ Still needs to figure out:
|
||||
* Is "GitHub-like development sidebar (`#31899`)" good enough (or better) for your usage?
|
||||
*/}}
|
||||
{{if and (not .Issue.IsPull) (not .PageIsComparePull)}}
|
||||
{{$canChangeRef := or .IsIssuePoster .HasIssuesOrPullsWritePermission}}
|
||||
<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}}"
|
||||
<div class="ui dropdown select-branch branch-selector-dropdown ellipsis-text-items {{if not $canChangeRef}}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}}
|
||||
{{if and .Issue $canChangeRef}}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}}
|
||||
{{if $canChangeRef}}{{svg "octicon-triangle-down" 14 "dropdown icon"}}{{end}}
|
||||
</div>
|
||||
<div class="menu">
|
||||
<div class="ui icon search input">
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
{{range $label := .Labels}}
|
||||
{{$link := print $.Issue.Repo.Link "/issues"}}
|
||||
{{$link = QueryBuild $link "labels" $label.ID}}
|
||||
{{ctx.RenderUtils.RenderLabelWithLink $label $link}}
|
||||
<a class="item" href="{{$link}}">{{ctx.RenderUtils.RenderLabel $label}}</a>
|
||||
{{end}}
|
||||
</div>
|
||||
{{if .Assignees}}
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
<div class="divider"></div>
|
||||
{{end}}
|
||||
{{$previousExclusiveScope = $exclusiveScope}}
|
||||
<div class="item issue-action tw-flex tw-justify-between" data-action="toggle" data-element-id="{{.ID}}" data-url="{{$.RepoLink}}/issues/labels">
|
||||
<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>
|
||||
@@ -44,7 +44,7 @@
|
||||
</span>
|
||||
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
||||
<div class="menu">
|
||||
<div class="item issue-action" data-element-id="0" data-url="{{$.Link}}/milestone">
|
||||
<div class="item issue-action" data-element-id="" data-url="{{$.Link}}/milestone">
|
||||
{{ctx.Locale.Tr "repo.issues.action_milestone_no_select"}}
|
||||
</div>
|
||||
{{if .OpenMilestones}}
|
||||
@@ -75,7 +75,7 @@
|
||||
</span>
|
||||
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
||||
<div class="menu">
|
||||
<div class="item issue-action" data-element-id="0" data-url="{{$.Link}}/projects">
|
||||
<div class="item issue-action" data-element-id="" data-url="{{$.Link}}/projects">
|
||||
{{ctx.Locale.Tr "repo.issues.new.clear_projects"}}
|
||||
</div>
|
||||
{{if .OpenProjects}}
|
||||
@@ -113,9 +113,6 @@
|
||||
<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}}
|
||||
@@ -125,4 +122,3 @@
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
{{$queryLink := QueryBuild "?" "q" $.Keyword "type" $.ViewType "sort" $.SortType "state" $.State "labels" $.SelectLabels "milestone" $.MilestoneID "project" $.ProjectID "assignee" $.AssigneeID "poster" $.PosterUsername "archived_labels" (Iif $.ShowArchivedLabels "true")}}
|
||||
{{$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}}
|
||||
|
||||
@@ -12,26 +16,28 @@
|
||||
{{end}}
|
||||
|
||||
<!-- Project -->
|
||||
<div class="item ui dropdown jump {{if not (or .OpenProjects .ClosedProjects)}}disabled{{end}}">
|
||||
<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">
|
||||
<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="{{if not .ProjectID}}active selected {{end}}item" href="{{QueryBuild $queryLink "project" NIL}}">{{ctx.Locale.Tr "repo.issues.filter_project_all"}}</a>
|
||||
<a class="{{if eq .ProjectID -1}}active selected {{end}}item" href="{{QueryBuild $queryLink "project" -1}}">{{ctx.Locale.Tr "repo.issues.filter_project_none"}}</a>
|
||||
<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 .OpenProjects}}
|
||||
<a class="{{if $.ProjectID}}{{if eq $.ProjectID .ID}}active selected{{end}}{{end}} item tw-flex" href="{{QueryBuild $queryLink "project" .ID}}">
|
||||
{{svg .IconName 18 "tw-mr-2 tw-shrink-0"}}<span class="gt-ellipsis">{{.Title}}</span>
|
||||
{{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}}
|
||||
@@ -40,9 +46,11 @@
|
||||
<div class="header">
|
||||
{{ctx.Locale.Tr "repo.issues.new.closed_projects"}}
|
||||
</div>
|
||||
{{range .ClosedProjects}}
|
||||
<a class="{{if $.ProjectID}}{{if eq $.ProjectID .ID}}active selected{{end}}{{end}} item" href="{{QueryBuild $queryLink "project" .ID}}">
|
||||
{{svg .IconName 18 "tw-mr-2"}}{{.Title}}
|
||||
{{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}}
|
||||
|
||||
@@ -15,42 +15,42 @@
|
||||
{{template "repo/issue/filters" .}}
|
||||
|
||||
<!-- milestone list -->
|
||||
<div class="milestone-list">
|
||||
<div class="flex-divided-list milestone-list">
|
||||
{{range .Milestones}}
|
||||
<li class="milestone-card">
|
||||
<div class="milestone-header">
|
||||
<h3 class="flex-text-block tw-m-0">
|
||||
<div class="item flex-relaxed-list">
|
||||
<div class="flex-left-right">
|
||||
<span class="list-item-large-title">
|
||||
{{svg "octicon-milestone" 16}}
|
||||
<a class="muted" href="{{$.RepoLink}}/milestone/{{.ID}}">{{.Name}}</a>
|
||||
</h3>
|
||||
<div class="tw-flex tw-items-center">
|
||||
<span class="tw-mr-2">{{.Completeness}}%</span>
|
||||
<progress value="{{.Completeness}}" max="100"></progress>
|
||||
</span>
|
||||
<div class="flex-text-inline">
|
||||
<span>{{.Completeness}}%</span>
|
||||
<progress class="list-item-title-progress" value="{{.Completeness}}" max="100"></progress>
|
||||
</div>
|
||||
</div>
|
||||
<div class="milestone-toolbar">
|
||||
<div class="group">
|
||||
<div class="flex-text-block">
|
||||
<div class="list-item-secondary-bar">
|
||||
<div class="flex-text-block tw-flex-wrap">
|
||||
<div class="flex-text-inline">
|
||||
{{svg "octicon-issue-opened" 14}}
|
||||
{{ctx.Locale.PrettyNumber .NumOpenIssues}} {{ctx.Locale.Tr "repo.issues.open_title"}}
|
||||
</div>
|
||||
<div class="flex-text-block">
|
||||
<div class="flex-text-inline">
|
||||
{{svg "octicon-check" 14}}
|
||||
{{ctx.Locale.PrettyNumber .NumClosedIssues}} {{ctx.Locale.Tr "repo.issues.closed_title"}}
|
||||
</div>
|
||||
{{if .TotalTrackedTime}}
|
||||
<div class="flex-text-block">
|
||||
<div class="flex-text-inline">
|
||||
{{svg "octicon-clock"}}
|
||||
{{.TotalTrackedTime|Sec2Hour}}
|
||||
</div>
|
||||
{{end}}
|
||||
{{if .UpdatedUnix}}
|
||||
<div class="flex-text-block">
|
||||
<div class="flex-text-inline">
|
||||
{{svg "octicon-clock"}}
|
||||
{{ctx.Locale.Tr "repo.milestones.update_ago" (DateUtils.TimeSince .UpdatedUnix)}}
|
||||
</div>
|
||||
{{end}}
|
||||
<div class="flex-text-block">
|
||||
<div class="flex-text-inline">
|
||||
{{if .IsClosed}}
|
||||
{{$closedDate:= DateUtils.TimeSince .ClosedDateUnix}}
|
||||
{{svg "octicon-clock" 14}}
|
||||
@@ -69,7 +69,7 @@
|
||||
</div>
|
||||
</div>
|
||||
{{if and (or $.CanWriteIssues $.CanWritePulls) (not $.Repository.IsArchived)}}
|
||||
<div class="group">
|
||||
<div class="flex-text-block tw-flex-wrap">
|
||||
<a class="flex-text-inline" href="{{$.Link}}/{{.ID}}/edit">{{svg "octicon-pencil" 14}}{{ctx.Locale.Tr "repo.issues.label_edit"}}</a>
|
||||
{{if .IsClosed}}
|
||||
<a class="link-action flex-text-inline" href data-url="{{$.Link}}/{{.ID}}/open">{{svg "octicon-check" 14}}{{ctx.Locale.Tr "repo.milestones.open"}}</a>
|
||||
@@ -83,7 +83,7 @@
|
||||
{{if .Content}}
|
||||
<div class="render-content markup">{{.RenderedContent}}</div>
|
||||
{{end}}
|
||||
</li>
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
{{template "base/paginate" .}}
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
{{/* this tmpl is quite dirty, it should not mix unrelated things together .... need to split it in the future*/}}
|
||||
{{$allStatesLink := ""}}{{$openLink := ""}}{{$closedLink := ""}}
|
||||
{{$projectIDsQuery := SliceUtils.JoinInt64 $.ProjectIDs}}
|
||||
{{if .PageIsMilestones}}
|
||||
{{$allStatesLink = QueryBuild "?" "q" $.Keyword "sort" $.SortType "state" "all"}}
|
||||
{{else}}
|
||||
{{$allStatesLink = QueryBuild "?" "q" $.Keyword "type" $.ViewType "sort" $.SortType "state" "all" "labels" $.SelectLabels "milestone" $.MilestoneID "project" $.ProjectID "assignee" $.AssigneeID "poster" $.PosterUsername "archived_labels" (Iif $.ShowArchivedLabels "true")}}
|
||||
{{$allStatesLink = QueryBuild "?" "q" $.Keyword "type" $.ViewType "sort" $.SortType "state" "all" "labels" $.SelectLabels "milestone" $.MilestoneID "project" $projectIDsQuery "assignee" $.AssigneeID "poster" $.PosterUsername "archived_labels" (Iif $.ShowArchivedLabels "true")}}
|
||||
{{end}}
|
||||
{{$openLink = QueryBuild $allStatesLink "state" "open"}}
|
||||
{{$closedLink = QueryBuild $allStatesLink "state" "closed"}}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<input type="hidden" name="type" value="{{$.ViewType}}">
|
||||
<input type="hidden" name="labels" value="{{$.SelectLabels}}">
|
||||
<input type="hidden" name="milestone" value="{{$.MilestoneID}}">
|
||||
<input type="hidden" name="project" value="{{$.ProjectID}}">
|
||||
<input type="hidden" name="project" value="{{SliceUtils.JoinInt64 $.ProjectIDs}}">
|
||||
<input type="hidden" name="assignee" value="{{$.AssigneeID}}">
|
||||
<input type="hidden" name="poster" value="{{$.PosterUsername}}">
|
||||
<input type="hidden" name="sort" value="{{$.SortType}}">
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<span class="text"><strong>{{ctx.Locale.Tr "repo.issues.due_date"}}</strong></span>
|
||||
<div class="ui form tw-mt-2">
|
||||
{{if .Issue.DeadlineUnix}}
|
||||
<div class="tw-flex tw-justify-between tw-items-center tw-gap-2">
|
||||
<div class="flex-left-right">
|
||||
<div class="due-date {{if .Issue.IsOverdue}}tw-text-red{{end}}" {{if .Issue.IsOverdue}}data-tooltip-content="{{ctx.Locale.Tr "repo.issues.due_date_overdue"}}"{{end}}>
|
||||
{{svg "octicon-calendar"}} {{DateUtils.AbsoluteLong .Issue.DeadlineUnix}}
|
||||
</div>
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
</span>
|
||||
<div class="ui divided list">
|
||||
{{range .BlockingDependencies}}
|
||||
<div class="item dependency{{if .Issue.IsClosed}} is-closed{{end}} tw-flex tw-items-center tw-justify-between">
|
||||
<div class="item dependency{{if .Issue.IsClosed}} is-closed{{end}} flex-left-right">
|
||||
<div class="item-left tw-flex tw-justify-center tw-flex-col tw-flex-1 gt-ellipsis">
|
||||
<a class="muted issue-dependency-title gt-ellipsis" href="{{.Issue.Link}}" data-tooltip-content="#{{.Issue.Index}} {{.Issue.Title | ctx.RenderUtils.RenderEmoji}}">
|
||||
#{{.Issue.Index}} {{.Issue.Title | ctx.RenderUtils.RenderEmoji}}
|
||||
@@ -41,7 +41,7 @@
|
||||
</div>
|
||||
{{end}}
|
||||
{{if .BlockingDependenciesNotPermitted}}
|
||||
<div class="item tw-flex tw-items-center tw-justify-between gt-ellipsis">
|
||||
<div class="item gt-ellipsis">
|
||||
<span>{{ctx.Locale.TrN (len .BlockingDependenciesNotPermitted) "repo.issues.dependency.no_permission_1" "repo.issues.dependency.no_permission_n" (len .BlockingDependenciesNotPermitted)}}</span>
|
||||
</div>
|
||||
{{end}}
|
||||
@@ -54,7 +54,7 @@
|
||||
</span>
|
||||
<div class="ui divided list">
|
||||
{{range .BlockedByDependencies}}
|
||||
<div class="item dependency{{if .Issue.IsClosed}} is-closed{{end}} tw-flex tw-items-center tw-justify-between">
|
||||
<div class="item dependency{{if .Issue.IsClosed}} is-closed{{end}} flex-left-right">
|
||||
<div class="item-left tw-flex tw-justify-center tw-flex-col tw-flex-1 gt-ellipsis">
|
||||
<a class="muted issue-dependency-title gt-ellipsis" href="{{.Issue.Link}}" data-tooltip-content="#{{.Issue.Index}} {{.Issue.Title | ctx.RenderUtils.RenderEmoji}}">
|
||||
#{{.Issue.Index}} {{.Issue.Title | ctx.RenderUtils.RenderEmoji}}
|
||||
@@ -76,7 +76,7 @@
|
||||
{{end}}
|
||||
{{if $.CanCreateIssueDependencies}}
|
||||
{{range .BlockedByDependenciesNotPermitted}}
|
||||
<div class="item dependency{{if .Issue.IsClosed}} is-closed{{end}} tw-flex tw-items-center tw-justify-between">
|
||||
<div class="item dependency{{if .Issue.IsClosed}} is-closed{{end}} flex-left-right">
|
||||
<div class="item-left tw-flex tw-justify-center tw-flex-col tw-flex-1 gt-ellipsis">
|
||||
<div class="gt-ellipsis">
|
||||
<span data-tooltip-content="{{ctx.Locale.Tr "repo.issues.dependency.no_permission.can_remove"}}">{{svg "octicon-lock" 16}}</span>
|
||||
@@ -100,7 +100,7 @@
|
||||
</div>
|
||||
{{end}}
|
||||
{{else if .BlockedByDependenciesNotPermitted}}
|
||||
<div class="item tw-flex tw-items-center tw-justify-between gt-ellipsis">
|
||||
<div class="item gt-ellipsis">
|
||||
<span>{{ctx.Locale.TrN (len .BlockedByDependenciesNotPermitted) "repo.issues.dependency.no_permission_1" "repo.issues.dependency.no_permission_n" (len .BlockedByDependenciesNotPermitted)}}</span>
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
</div>
|
||||
|
||||
<div class="ui list labels-list">
|
||||
<span class="item empty-list {{if $data.SelectedLabelIDs}}tw-hidden{{end}}">{{ctx.Locale.Tr "repo.issues.new.no_label"}}</span>
|
||||
<span class="item empty-list {{if $data.SelectedLabelIDs}}tw-hidden{{end}}">{{ctx.Locale.Tr "repo.issues.new.no_labels"}}</span>
|
||||
{{range $data.AllLabels}}
|
||||
{{if .IsChecked}}
|
||||
<a class="item" href="{{$listBaseLink}}?labels={{.ID}}">
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
{{$pageMeta := .}}
|
||||
{{$data := .ProjectsData}}
|
||||
{{$issueProject := NIL}}{{if and $pageMeta.Issue $pageMeta.Issue.Project}}{{$issueProject = $pageMeta.Issue.Project}}{{end}}
|
||||
<div class="divider"></div>
|
||||
<div class="issue-sidebar-combo" data-selection-mode="single" data-update-algo="all"
|
||||
|
||||
{{/* project selector */}}
|
||||
<div class="issue-sidebar-combo sidebar-project-combo" data-selection-mode="multiple" data-update-algo="all"
|
||||
{{if $pageMeta.Issue}}data-update-url="{{$pageMeta.RepoLink}}/issues/projects?issue_ids={{$pageMeta.Issue.ID}}"{{end}}
|
||||
>
|
||||
<input class="combo-value" name="project_id" type="hidden" value="{{if and $pageMeta.CanModifyIssueOrPull $data.SelectedProjectIDs}}{{index $data.SelectedProjectIDs 0}}{{end}}">
|
||||
<input class="combo-value" name="project_ids" type="hidden" value="{{SliceUtils.JoinInt64 $data.SelectedProjectIDs}}">
|
||||
<div class="ui dropdown full-width {{if not $pageMeta.CanModifyIssueOrPull}}disabled{{end}}">
|
||||
<a class="fixed-text muted">
|
||||
<strong>{{ctx.Locale.Tr "repo.issues.new.projects"}}</strong> {{if $pageMeta.CanModifyIssueOrPull}}{{svg "octicon-gear"}}{{end}}
|
||||
@@ -24,7 +25,8 @@
|
||||
<div class="header">{{ctx.Locale.Tr "repo.issues.new.open_projects"}}</div>
|
||||
{{range $data.OpenProjects}}
|
||||
<a class="item muted" data-value="{{.ID}}" href="{{.Link ctx}}">
|
||||
{{svg .IconName 18 "tw-shrink-0"}}<span class="tw-flex-1 tw-break-anywhere">{{.Title}}</span>
|
||||
<span class="item-check-mark">{{svg "octicon-check"}}</span>
|
||||
{{svg .IconName 18}}<span class="tw-flex-1 gt-ellipsis">{{.Title}}</span>
|
||||
</a>
|
||||
{{end}}
|
||||
{{end}}
|
||||
@@ -33,19 +35,60 @@
|
||||
<div class="header">{{ctx.Locale.Tr "repo.issues.new.closed_projects"}}</div>
|
||||
{{range $data.ClosedProjects}}
|
||||
<a class="item muted" data-value="{{.ID}}" href="{{.Link ctx}}">
|
||||
{{svg .IconName 18 "tw-shrink-0"}}<span class="tw-flex-1 tw-break-anywhere">{{.Title}}</span>
|
||||
<span class="item-check-mark">{{svg "octicon-check"}}</span>
|
||||
{{svg .IconName 18}}<span class="tw-flex-1 gt-ellipsis">{{.Title}}</span>
|
||||
</a>
|
||||
{{end}}
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ui list muted-links flex-items-block">
|
||||
<span class="item empty-list {{if $issueProject}}tw-hidden{{end}}">{{ctx.Locale.Tr "repo.issues.new.no_projects"}}</span>
|
||||
{{if $issueProject}}
|
||||
<a class="item" href="{{$issueProject.Link ctx}}">
|
||||
{{svg $issueProject.IconName 18 "tw-shrink-0"}}<span class="tw-flex-1 tw-break-anywhere">{{$issueProject.Title}}</span>
|
||||
|
||||
{{/* project cards (column selectors) */}}
|
||||
<div class="ui list tw-my-2 flex-relaxed-list issue-sidebar-project-cards" data-combo-list-inited="true">
|
||||
<div class="item empty-list {{if $data.ProjectCards}}tw-hidden{{end}}">{{ctx.Locale.Tr "repo.issues.new.no_projects"}}</div>
|
||||
{{range $card := $data.ProjectCards}}
|
||||
{{$selectedColumn := $card.SelectedColumn}}
|
||||
{{/* only show a "project column card" if the selected column exists, otherwise only show the project title */}}
|
||||
<div class="item {{if $selectedColumn}}sidebar-project-card{{end}}">
|
||||
<a class="suppressed flex-text-block" href="{{$card.Project.Link ctx}}">
|
||||
{{svg $card.Project.IconName 16}} <span class="gt-ellipsis">{{$card.Project.Title}}</span>
|
||||
</a>
|
||||
{{end}}
|
||||
{{if and $selectedColumn $pageMeta.CanModifyIssueOrPull}}
|
||||
<div class="issue-sidebar-combo sidebar-project-column-combo" data-selection-mode="single" data-update-algo="all"
|
||||
data-update-url="{{$pageMeta.RepoLink}}/issues/projects/column?issue_id={{$pageMeta.Issue.ID}}"
|
||||
>
|
||||
<input class="combo-value" name="column_id" type="hidden" value="{{if $selectedColumn}}{{$selectedColumn.ID}}{{end}}">
|
||||
<div class="ui dropdown full-width">
|
||||
<div class="flex-text-block tw-ml-[16px]">{{/* align with the "project" icon */}}
|
||||
<div class="interact-bg tw-px-2 tw-py-1 tw-rounded flex-text-block fixed-text">
|
||||
{{if $selectedColumn}}
|
||||
{{if $card.SelectedColumn.Color}}<span class="color-icon icon-size-8" style="background-color: {{$card.SelectedColumn.Color}}"></span>{{end}}
|
||||
<div class="gt-ellipsis">{{$card.SelectedColumn.Title}}</div>
|
||||
{{else}}
|
||||
<div class="gt-ellipsis">{{ctx.Locale.Tr "repo.issues.new.no_column"}}</div>
|
||||
{{end}}
|
||||
{{svg "octicon-triangle-down" 14}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="menu flex-items-menu">
|
||||
{{range $columnItem := $card.Columns}}
|
||||
<a class="item" data-value="{{$columnItem.ID}}">
|
||||
<span class="item-check-mark">{{svg "octicon-check"}}</span>
|
||||
{{if $columnItem.Color}}<span class="color-icon icon-size-8" style="background-color: {{$columnItem.Color}}"></span>{{end}}
|
||||
<div class="gt-ellipsis">{{$columnItem.Title}}</div>
|
||||
</a>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{else if $selectedColumn}}
|
||||
<div class="flex-text-block tw-my-1 tw-ml-[22px]">{{/* align with the "project" icon */}}
|
||||
{{if $selectedColumn.Color}}<span class="color-icon icon-size-8" style="background-color: {{$selectedColumn.Color}}"></span>{{end}}
|
||||
<div class="gt-ellipsis">{{$selectedColumn.Title}}</div>
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -72,7 +72,7 @@
|
||||
{{range $user, $trackedtime := .WorkingUsers}}
|
||||
<div class="item tw-gap-3">
|
||||
{{template "shared/user/avatarlink" dict "user" $user}}
|
||||
<div>
|
||||
<div class="muted-links">
|
||||
{{template "shared/user/authorlink" $user}}
|
||||
<div class="text">{{$trackedtime|Sec2Hour}}</div>
|
||||
</div>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<div class="issue-content">
|
||||
{{$createdStr:= DateUtils.TimeSince .Issue.CreatedUnix}}
|
||||
<div class="issue-content-left comment-list prevent-before-timeline">
|
||||
<div class="ui timeline">
|
||||
<div id="{{.Issue.HashTag}}" class="timeline-item comment first">
|
||||
<div class="issue-content-left">
|
||||
<div class="comment-list">
|
||||
<div id="{{.Issue.HashTag}}" class="timeline-item comment issue-content-comment">
|
||||
{{if .Issue.OriginalAuthor}}
|
||||
<span class="timeline-avatar">
|
||||
{{ctx.AvatarUtils.Avatar nil 40}}
|
||||
@@ -171,14 +171,3 @@
|
||||
|
||||
{{template "repo/issue/view_content/reference_issue_dialog" .}}
|
||||
{{template "shared/user/block_user_dialog" .}}
|
||||
|
||||
<div class="ui g-modal-confirm delete modal">
|
||||
<div class="header">
|
||||
{{svg "octicon-trash"}}
|
||||
{{ctx.Locale.Tr "repo.branch.delete" .HeadTarget}}
|
||||
</div>
|
||||
<div class="content">
|
||||
<p>{{ctx.Locale.Tr "repo.branch.delete_desc"}}</p>
|
||||
</div>
|
||||
{{template "base/modal_actions_confirm" .}}
|
||||
</div>
|
||||
|
||||
@@ -86,7 +86,7 @@
|
||||
{{template "shared/user/avatarlink" dict "user" .Poster}}
|
||||
{{end}}
|
||||
<span class="comment-text-line">
|
||||
{{template "repo/issue/view_content/comments_authorlink" dict "ctxData" $ "comment" .}}
|
||||
{{template "repo/issue/view_content/comments_authorlink" dict "comment" .}}
|
||||
{{if .Issue.IsPull}}
|
||||
{{ctx.Locale.Tr "repo.pulls.reopened_at" .EventTag $createdStr}}
|
||||
{{else}}
|
||||
@@ -101,7 +101,7 @@
|
||||
{{template "shared/user/avatarlink" dict "user" .Poster}}
|
||||
{{end}}
|
||||
<span class="comment-text-line">
|
||||
{{template "repo/issue/view_content/comments_authorlink" dict "ctxData" $ "comment" .}}
|
||||
{{template "repo/issue/view_content/comments_authorlink" dict "comment" .}}
|
||||
{{if .Issue.IsPull}}
|
||||
{{ctx.Locale.Tr "repo.pulls.closed_at" .EventTag $createdStr}}
|
||||
{{else}}
|
||||
@@ -116,7 +116,7 @@
|
||||
{{template "shared/user/avatarlink" dict "user" .Poster}}
|
||||
{{end}}
|
||||
<span class="comment-text-line">
|
||||
{{template "repo/issue/view_content/comments_authorlink" dict "ctxData" $ "comment" .}}
|
||||
{{template "repo/issue/view_content/comments_authorlink" dict "comment" .}}
|
||||
{{$link := printf "%s/commit/%s" $.Repository.Link ($.Issue.PullRequest.MergedCommitID|PathEscape)}}
|
||||
{{if eq $.Issue.PullRequest.Status 3}}
|
||||
{{ctx.Locale.Tr "repo.issues.comment_manually_pull_merged_at" (HTMLFormat `<a class="ui sha" href="%[1]s"><b>%[2]s</b></a>` $link (ShortSha $.Issue.PullRequest.MergedCommitID)) (HTMLFormat "<b>%[1]s</b>" $.BaseTarget) $createdStr}}
|
||||
@@ -164,12 +164,12 @@
|
||||
<div class="detail flex-text-block">
|
||||
{{svg "octicon-git-commit"}}
|
||||
{{/* the content is a link like <a href="{RepoLink}/commit/{CommitID}">message title</a> (from CreateRefComment) */}}
|
||||
<span class="comment-text-line">{{.Content | SanitizeHTML}}</span>
|
||||
<span class="comment-text-line">{{.GetSanitizedContentHTML}}</span>
|
||||
</div>
|
||||
</div>
|
||||
{{else if eq .Type 7}}
|
||||
{{if or .AddedLabels .RemovedLabels}}
|
||||
<div class="timeline-item event with-labels-list-inline" id="{{.HashTag}}">
|
||||
<div class="timeline-item event" id="{{.HashTag}}">
|
||||
<span class="badge">{{svg "octicon-tag"}}</span>
|
||||
{{template "shared/user/avatarlink" dict "user" .Poster}}
|
||||
<span class="comment-text-line">
|
||||
@@ -256,7 +256,7 @@
|
||||
{{if not $timeStr}}{{$timeStr = .Content|Sec2Hour}}{{end}}
|
||||
{{ctx.Locale.Tr "repo.issues.stop_tracking_history" $timeStr $createdStr}}
|
||||
</span>
|
||||
{{template "repo/issue/view_content/comments_delete_time" dict "ctxData" $ "comment" .}}
|
||||
{{template "repo/issue/view_content/comments_delete_time" dict "comment" .}}
|
||||
</div>
|
||||
{{else if eq .Type 14}}
|
||||
<div class="timeline-item event" id="{{.HashTag}}">
|
||||
@@ -268,7 +268,7 @@
|
||||
{{if not $timeStr}}{{$timeStr = .Content|Sec2Hour}}{{end}}
|
||||
{{ctx.Locale.Tr "repo.issues.add_time_history" $timeStr $createdStr}}
|
||||
</span>
|
||||
{{template "repo/issue/view_content/comments_delete_time" dict "ctxData" $ "comment" .}}
|
||||
{{template "repo/issue/view_content/comments_delete_time" dict "comment" .}}
|
||||
</div>
|
||||
{{else if eq .Type 15}}
|
||||
<div class="timeline-item event" id="{{.HashTag}}">
|
||||
@@ -361,9 +361,10 @@
|
||||
</div>
|
||||
{{else if eq .Type 22}}
|
||||
<div class="timeline-item-group" id="{{.HashTag}}">
|
||||
<div class="timeline-item event">
|
||||
{{$reviewType := -1}}
|
||||
{{if .Review}}{{$reviewType = .Review.Type}}{{end}}
|
||||
{{/* default to the "comment" type and the comment anchor if the review record is missing */}}
|
||||
{{$reviewType := 2}}{{$reviewHashTag := .HashTag}}
|
||||
{{if .Review}}{{$reviewType = .Review.Type}}{{$reviewHashTag = .Review.HashTag}}{{end}}
|
||||
<div class="timeline-item event"{{if .Review}} id="{{$reviewHashTag}}"{{end}}>
|
||||
{{if not .OriginalAuthor}}
|
||||
{{/* Some timeline avatars need a offset to correctly align with their speech bubble.
|
||||
The condition depends on whether the comment has contents/attachments,
|
||||
@@ -372,19 +373,22 @@
|
||||
{{ctx.AvatarUtils.Avatar .Poster 40}}
|
||||
</a>
|
||||
{{end}}
|
||||
<span class="badge tw-text-white{{if eq $reviewType 1}}{{if .Review.Official}} tw-bg-green {{else}} tw-bg-grey{{end}}{{else if eq $reviewType 3}} tw-bg-red{{end}}">
|
||||
{{if .Review}}{{svg (printf "octicon-%s" .Review.Type.Icon)}}{{end}}
|
||||
<span class="badge tw-text-white {{if eq $reviewType 1}}{{Iif .Review.Official "tw-bg-green" "tw-bg-grey"}}{{else if eq $reviewType 3}}tw-bg-red{{end}}">
|
||||
{{- if .Review -}}
|
||||
{{- svg (printf "octicon-%s" .Review.Type.Icon) -}}
|
||||
{{- else -}}
|
||||
{{- svg "octicon-comment" -}}
|
||||
{{- end -}}
|
||||
</span>
|
||||
<span class="comment-text-line">
|
||||
{{template "repo/issue/view_content/comments_authorlink" dict "ctxData" $ "comment" .}}
|
||||
{{template "repo/issue/view_content/comments_authorlink" dict "comment" .}}
|
||||
{{$createdLink := HTMLFormat `<a href="#%s">%s</a>` $reviewHashTag $createdStr}}
|
||||
{{if eq $reviewType 1}}
|
||||
{{ctx.Locale.Tr "repo.issues.review.approve" $createdStr}}
|
||||
{{else if eq $reviewType 2}}
|
||||
{{ctx.Locale.Tr "repo.issues.review.comment" $createdStr}}
|
||||
{{ctx.Locale.Tr "repo.issues.review.approve" $createdLink}}
|
||||
{{else if eq $reviewType 3}}
|
||||
{{ctx.Locale.Tr "repo.issues.review.reject" $createdStr}}
|
||||
{{ctx.Locale.Tr "repo.issues.review.reject" $createdLink}}
|
||||
{{else}}
|
||||
{{ctx.Locale.Tr "repo.issues.review.comment" $createdStr}}
|
||||
{{ctx.Locale.Tr "repo.issues.review.comment" $createdLink}}
|
||||
{{end}}
|
||||
{{if and .Review .Review.Dismissed}}
|
||||
<div class="ui small label">{{ctx.Locale.Tr "repo.issues.review.dismissed_label"}}</div>
|
||||
@@ -488,7 +492,7 @@
|
||||
{{template "shared/user/avatarlink" dict "user" .Poster}}
|
||||
{{end}}
|
||||
<span class="comment-text-line">
|
||||
{{template "repo/issue/view_content/comments_authorlink" dict "ctxData" $ "comment" .}}
|
||||
{{template "repo/issue/view_content/comments_authorlink" dict "comment" .}}
|
||||
{{ctx.Locale.Tr "repo.pulls.change_target_branch_at" .OldRef .NewRef $createdStr}}
|
||||
</span>
|
||||
</div>
|
||||
@@ -663,7 +667,7 @@
|
||||
<div class="timeline-item event" id="{{.HashTag}}">
|
||||
<span class="badge">{{svg "octicon-git-merge" 16}}</span>
|
||||
<span class="comment-text-line">
|
||||
{{template "repo/issue/view_content/comments_authorlink" dict "ctxData" $ "comment" .}}
|
||||
{{template "repo/issue/view_content/comments_authorlink" dict "comment" .}}
|
||||
{{if eq .Type 34}}{{ctx.Locale.Tr "repo.pulls.auto_merge_newly_scheduled_comment" $createdStr}}
|
||||
{{else}}{{ctx.Locale.Tr "repo.pulls.auto_merge_canceled_schedule_comment" $createdStr}}{{end}}
|
||||
</span>
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
{{if .comment.OriginalAuthor}}
|
||||
<span class="tw-text-text">
|
||||
{{svg (MigrationIcon .ctxData.Repository.GetOriginalURLHostname)}}
|
||||
{{svg (MigrationIcon ctx.RootData.Repository.GetOriginalURLHostname)}}
|
||||
{{.comment.OriginalAuthor}}
|
||||
</span>
|
||||
{{if .ctxData.Repository.OriginalURL}}
|
||||
<span class="migrate">({{ctx.Locale.Tr "repo.migrated_from" .ctxData.Repository.OriginalURL .ctxData.Repository.GetOriginalURLHostname}})</span>
|
||||
{{if ctx.RootData.Repository.OriginalURL}}
|
||||
<span class="migrate">({{ctx.Locale.Tr "repo.migrated_from" ctx.RootData.Repository.OriginalURL ctx.RootData.Repository.GetOriginalURLHostname}})</span>
|
||||
{{end}}
|
||||
{{else}}
|
||||
{{template "shared/user/authorlink" .comment.Poster}}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
{{if and .comment.Time (.ctxData.Repository.IsTimetrackerEnabled ctx)}} {{/* compatibility with time comments made before v1.14 */}}
|
||||
{{if and .comment.Time (ctx.RootData.Repository.IsTimetrackerEnabled ctx)}} {{/* compatibility with time comments made before v1.14 */}}
|
||||
{{if (not .comment.Time.Deleted)}}
|
||||
{{if (or .ctxData.IsAdmin (and .ctxData.IsSigned (eq .ctxData.SignedUserID .comment.PosterID)))}}
|
||||
{{if (or ctx.RootData.IsAdmin (and ctx.RootData.IsSigned (eq ctx.RootData.SignedUserID .comment.PosterID)))}}
|
||||
<span class="tw-ml-auto">
|
||||
<button class="ui icon button compact mini link-action" data-tooltip-content="{{ctx.Locale.Tr "repo.issues.del_time"}}"
|
||||
data-url="{{.ctxData.RepoLink}}/issues/{{.ctxData.Issue.Index}}/times/{{.comment.TimeID}}/delete?id={{.comment.Time.ID}}"
|
||||
data-url="{{ctx.RootData.RepoLink}}/issues/{{ctx.RootData.Issue.Index}}/times/{{.comment.TimeID}}/delete?id={{.comment.Time.ID}}"
|
||||
data-modal-confirm="{{ctx.Locale.Tr "repo.issues.del_time"}}"
|
||||
>
|
||||
{{svg "octicon-trash"}}
|
||||
|
||||
@@ -3,13 +3,14 @@
|
||||
{{svg "octicon-kebab-horizontal"}}
|
||||
</a>
|
||||
<div class="menu">
|
||||
{{$referenceUrl := ""}}
|
||||
{{if .issue}}
|
||||
{{$referenceUrl = printf "%s#%s" ctx.RootData.Issue.Link .item.HashTag}}
|
||||
{{$issueHTMLURL := ctx.RootData.Issue.HTMLURL ctx}}
|
||||
{{$referenceHTMLURL := ""}}
|
||||
{{if .issue}}{{/* boolean value: is issue */}}
|
||||
{{$referenceHTMLURL = printf "%s#%s" $issueHTMLURL .item.HashTag}}
|
||||
{{else}}
|
||||
{{$referenceUrl = printf "%s/files#%s" ctx.RootData.Issue.Link .item.HashTag}}
|
||||
{{$referenceHTMLURL = printf "%s/files#%s" $issueHTMLURL .item.HashTag}}
|
||||
{{end}}
|
||||
<div class="item context js-aria-clickable" data-clipboard-text-type="url" data-clipboard-text="{{$referenceUrl}}">{{ctx.Locale.Tr "repo.issues.context.copy_link"}}</div>
|
||||
<div class="item context js-aria-clickable" data-clipboard-text="{{$referenceHTMLURL}}">{{ctx.Locale.Tr "repo.issues.context.copy_link"}}</div>
|
||||
<div class="item context js-aria-clickable" data-clipboard-target="#{{.item.HashTag}}-raw">{{ctx.Locale.Tr "repo.issues.context.copy_source"}}</div>
|
||||
{{if ctx.RootData.IsSigned}}
|
||||
{{$needDivider := false}}
|
||||
@@ -17,7 +18,7 @@
|
||||
{{$needDivider = true}}
|
||||
<div class="item context js-aria-clickable quote-reply {{if .diff}}quote-reply-diff{{end}}" data-target="{{.item.HashTag}}-raw">{{ctx.Locale.Tr "repo.issues.context.quote_reply"}}</div>
|
||||
{{if not ctx.Consts.RepoUnitTypeIssues.UnitGlobalDisabled}}
|
||||
<div class="item context js-aria-clickable reference-issue" data-target="{{.item.HashTag}}-raw" data-modal="#reference-issue-modal" data-poster="{{.item.Poster.GetDisplayName}}" data-poster-username="{{.item.Poster.Name}}" data-reference="{{$referenceUrl}}">{{ctx.Locale.Tr "repo.issues.context.reference_issue"}}</div>
|
||||
<div class="item context js-aria-clickable reference-issue" data-target="{{.item.HashTag}}-raw" data-modal="#reference-issue-modal" data-poster="{{.item.Poster.GetDisplayName}}" data-poster-username="{{.item.Poster.Name}}" data-reference="{{$referenceHTMLURL}}">{{ctx.Locale.Tr "repo.issues.context.reference_issue"}}</div>
|
||||
{{end}}
|
||||
{{if or ctx.RootData.Permission.IsAdmin .IsCommentPoster ctx.RootData.HasIssuesOrPullsWritePermission}}
|
||||
<div class="divider"></div>
|
||||
@@ -34,10 +35,10 @@
|
||||
<div class="divider"></div>
|
||||
{{end}}
|
||||
{{if $canUserBlock}}
|
||||
<div class="item context js-aria-clickable show-modal" data-modal="#block-user-modal" data-modal-modal-blockee="{{.item.Poster.Name}}" data-modal-modal-blockee-name="{{.item.Poster.GetDisplayName}}" data-modal-modal-form.action="{{AppSubUrl}}/user/settings/blocked_users">{{ctx.Locale.Tr "user.block.block.user"}}</div>
|
||||
<div class="item context js-aria-clickable show-modal" data-modal="#block-user-modal" data-modal-modal-blockee="{{.item.Poster.Name}}" data-modal-modal-blockee-name="{{.item.Poster.GetDisplayName}}" data-modal-modal-form.url="{{AppSubUrl}}/user/settings/blocked_users">{{ctx.Locale.Tr "user.block.block.user"}}</div>
|
||||
{{end}}
|
||||
{{if $canOrgBlock}}
|
||||
<div class="item context js-aria-clickable show-modal" data-modal="#block-user-modal" data-modal-modal-blockee="{{.item.Poster.Name}}" data-modal-modal-blockee-name="{{.item.Poster.GetDisplayName}}" data-modal-modal-form.action="{{ctx.RootData.Repository.Owner.OrganisationLink}}/settings/blocked_users">{{ctx.Locale.Tr "user.block.block.org"}}</div>
|
||||
<div class="item context js-aria-clickable show-modal" data-modal="#block-user-modal" data-modal-modal-blockee="{{.item.Poster.Name}}" data-modal-modal-blockee-name="{{.item.Poster.GetDisplayName}}" data-modal-modal-form.url="{{ctx.RootData.Repository.Owner.OrganisationLink}}/settings/blocked_users">{{ctx.Locale.Tr "user.block.block.org"}}</div>
|
||||
{{end}}
|
||||
{{end}}
|
||||
{{end}}
|
||||
|
||||
@@ -11,7 +11,7 @@ The variables in "ctx.Data" are different in each case, making this template fra
|
||||
{{$hasReview := and $comment.Review}}
|
||||
{{$isReviewPending := and $hasReview (eq $comment.Review.Type 0)}}
|
||||
<div class="ui segments conversation-holder">
|
||||
<div class="ui segment collapsible-comment-box tw-py-2 tw-flex tw-items-center tw-justify-between">
|
||||
<div class="ui segment collapsible-comment-box tw-py-2 flex-left-right">
|
||||
<div class="tw-flex tw-items-center">
|
||||
<a href="{{$comment.CodeCommentLink ctx}}" class="file-comment tw-ml-2 tw-break-anywhere">{{$comment.TreePath}}</a>
|
||||
{{if $invalid}}
|
||||
|
||||
@@ -1,408 +1,81 @@
|
||||
{{if and .Issue.PullRequest.HasMerged (not .IsPullBranchDeletable)}}
|
||||
{{/* Then the merge box will not be displayed because this page already contains enough information */}}
|
||||
{{else}}
|
||||
{{$data := $.PullMergeBoxData}}
|
||||
{{if $data.ShowMergeBox}}
|
||||
<div class="timeline-item comment pull-merge-box"
|
||||
data-global-init="initRepoPullMergeBox"
|
||||
{{if .PullMergeBoxReloadingInterval}}
|
||||
data-pull-merge-box-reloading-interval="{{.PullMergeBoxReloadingInterval}}"
|
||||
data-pull-link="{{.Issue.Link}}"
|
||||
{{if $data.ReloadingInterval}}
|
||||
data-pull-merge-box-reloading-interval="{{$data.ReloadingInterval}}"
|
||||
data-pull-link="{{$.Issue.Link}}"
|
||||
{{end}}
|
||||
>
|
||||
{{$statusCheckData := .StatusCheckData}}
|
||||
{{$requiredStatusCheckState := $statusCheckData.RequiredChecksState}}
|
||||
<div class="timeline-avatar {{if .Issue.PullRequest.HasMerged}}tw-text-purple
|
||||
{{- else if .Issue.IsClosed}}tw-text-text-light
|
||||
{{- else if .IsPullWorkInProgress}}tw-text-text-light
|
||||
{{- else if .IsFilesConflicted}}tw-text-text-light
|
||||
{{- else if .IsPullRequestBroken}}tw-text-red
|
||||
{{- else if .IsBlockedByApprovals}}tw-text-red
|
||||
{{- else if .IsBlockedByRejection}}tw-text-red
|
||||
{{- else if .IsBlockedByOfficialReviewRequests}}tw-text-red
|
||||
{{- else if .IsBlockedByOutdatedBranch}}tw-text-red
|
||||
{{- else if .IsBlockedByChangedProtectedFiles}}tw-text-red
|
||||
{{- else if and .EnableStatusCheck (or $requiredStatusCheckState.IsFailure $requiredStatusCheckState.IsError)}}tw-text-red
|
||||
{{- else if and .EnableStatusCheck (or (not $.LatestCommitStatus) $requiredStatusCheckState.IsPending $requiredStatusCheckState.IsWarning)}}tw-text-yellow
|
||||
{{- else if and .AllowMerge .RequireSigned (not .WillSign)}}tw-text-red
|
||||
{{- else if .Issue.PullRequest.IsChecking}}tw-text-yellow
|
||||
{{- else if .Issue.PullRequest.IsEmpty}}tw-text-text-light
|
||||
{{- else if .Issue.PullRequest.CanAutoMerge}}tw-text-green
|
||||
{{- else}}tw-text-red{{end}}">{{svg "octicon-git-merge" 40}}</div>
|
||||
<div class="timeline-avatar {{$data.TimelineIconClass}}">{{svg "octicon-git-merge" 40}}</div>
|
||||
<div class="content">
|
||||
{{if .LatestCommitStatus}}
|
||||
<div class="ui attached segment fitted">
|
||||
{{template "repo/pulls/status" (dict
|
||||
"CommitStatus" .LatestCommitStatus
|
||||
"CommitStatuses" .LatestCommitStatuses
|
||||
"ShowHideChecks" true
|
||||
"StatusCheckData" $statusCheckData
|
||||
)}}
|
||||
</div>
|
||||
{{end}}
|
||||
{{$showGeneralMergeForm := false}}
|
||||
<div class="ui attached segment merge-section {{if not $.LatestCommitStatus}}avatar-content-left-arrow{{end}} flex-items-block">
|
||||
{{if .Issue.PullRequest.HasMerged}}
|
||||
{{if .IsPullBranchDeletable}}
|
||||
<div class="item item-section text tw-flex-1">
|
||||
<div class="item-section-left">
|
||||
<h3 class="tw-mb-2">
|
||||
{{ctx.Locale.Tr "repo.pulls.merged_success"}}
|
||||
</h3>
|
||||
<div class="merge-section-info">
|
||||
{{ctx.Locale.Tr "repo.pulls.merged_info_text" (HTMLFormat "<code>%s</code>" .HeadTarget)}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="item-section-right">
|
||||
<div class="ui segment fitted avatar-content-left-arrow">
|
||||
<div class="merge-section flex-divided-list items-px-default">
|
||||
{{if $data.ShowStatusCheck}}
|
||||
{{template "repo/issue/view_content/pull_merge_status_checks" (dict "StatusCheckData" $data.StatusCheckData)}}
|
||||
{{end}}
|
||||
|
||||
{{if $data.ClosedInfoTitle}}
|
||||
<div class="item flex-left-right">
|
||||
<div>
|
||||
<h3 class="tw-mb-2">{{$data.ClosedInfoTitle}}</h3>
|
||||
<div>{{$data.ClosedInfoBody}}</div>
|
||||
</div>
|
||||
{{if $data.IsPullBranchDeletable}}
|
||||
<div>
|
||||
<button class="ui button link-action delete-branch-after-merge" data-url="{{.DeleteBranchLink}}">{{ctx.Locale.Tr "repo.branch.delete_html"}}</button>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
{{end}}
|
||||
{{range $infoSection := $data.InfoSections}}
|
||||
{{if $infoSection.InfoItems}}
|
||||
<div class="item">
|
||||
{{range $infoItem := $infoSection.InfoItems}}
|
||||
<div class="flex-text-block">{{$infoItem.SvgIconHTML}} {{$infoItem.InfoHTML}}</div>
|
||||
{{if $infoItem.ListItems}}
|
||||
<ul class="tw-pl-[36px]">{{/* align with the info icon and text */}}
|
||||
{{range $listItem := $infoItem.ListItems}}
|
||||
<li>{{$listItem}}</li>
|
||||
{{end}}
|
||||
</ul>
|
||||
{{end}}
|
||||
{{end}}
|
||||
</div>
|
||||
{{end}}
|
||||
{{else if .Issue.IsClosed}}
|
||||
<div class="item item-section text tw-flex-1">
|
||||
<div class="item-section-left">
|
||||
<h3 class="tw-mb-2">{{ctx.Locale.Tr "repo.pulls.closed"}}</h3>
|
||||
<div class="merge-section-info">
|
||||
{{if .IsPullRequestBroken}}
|
||||
{{ctx.Locale.Tr "repo.pulls.cant_reopen_deleted_branch"}}
|
||||
{{else}}
|
||||
{{ctx.Locale.Tr "repo.pulls.reopen_to_merge"}}
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
{{if and .IsPullBranchDeletable (not .IsPullRequestBroken)}}
|
||||
<div class="item-section-right">
|
||||
<button class="ui button link-action delete-branch-after-merge" data-url="{{.DeleteBranchLink}}">{{ctx.Locale.Tr "repo.branch.delete_html"}}</button>
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
{{else if .IsPullFilesConflicted}}
|
||||
{{end}}
|
||||
{{if $data.ShowUpdatePullInfo}}
|
||||
<div class="item">
|
||||
{{svg "octicon-x"}}
|
||||
{{ctx.Locale.Tr "repo.pulls.files_conflicted"}}
|
||||
{{template "repo/issue/view_content/update_branch_by_merge" (dict "MergeBoxData" $data "IssueLink" $.Issue.Link)}}
|
||||
</div>
|
||||
<ul>
|
||||
{{range .ConflictedFiles}}
|
||||
<li>{{.}}</li>
|
||||
{{else}}
|
||||
<li>{{ctx.Locale.Tr "repo.pulls.files_conflicted_no_listed_files"}}</li>
|
||||
{{end}}
|
||||
</ul>
|
||||
{{else if .IsPullRequestBroken}}
|
||||
<div class="item">
|
||||
{{svg "octicon-x"}}
|
||||
{{ctx.Locale.Tr "repo.pulls.data_broken"}}
|
||||
</div>
|
||||
{{else if .IsPullWorkInProgress}}
|
||||
<div class="item">
|
||||
<div class="item-section-left flex-text-inline tw-flex-1">
|
||||
{{svg "octicon-x"}}
|
||||
{{ctx.Locale.Tr "repo.pulls.cannot_merge_work_in_progress"}}
|
||||
{{end}}
|
||||
|
||||
{{if $.IsPullWorkInProgress}}
|
||||
<div class="item flex-left-right">
|
||||
<div class="flex-text-block">
|
||||
{{svg "octicon-x"}} {{ctx.Locale.Tr "repo.pulls.cannot_merge_work_in_progress"}}
|
||||
</div>
|
||||
{{if or .HasIssuesOrPullsWritePermission .IsIssuePoster}}
|
||||
<button class="ui compact button" data-global-init="initPullRequestWipToggle" data-title="{{.Issue.Title}}" data-wip-prefix="{{.WorkInProgressPrefix}}" data-update-url="{{.Issue.Link}}/title">
|
||||
{{ctx.Locale.Tr "repo.pulls.remove_prefix" .WorkInProgressPrefix}}
|
||||
</button>
|
||||
{{end}}
|
||||
</div>
|
||||
{{template "repo/issue/view_content/update_branch_by_merge" $}}
|
||||
{{else if .Issue.PullRequest.IsChecking}}
|
||||
<div class="item">
|
||||
{{svg "gitea-running" 16 "rotate-clockwise"}}
|
||||
{{ctx.Locale.Tr "repo.pulls.is_checking"}}
|
||||
</div>
|
||||
{{else if .Issue.PullRequest.IsAncestor}}
|
||||
<div class="item">
|
||||
{{svg "octicon-alert"}}
|
||||
{{ctx.Locale.Tr "repo.pulls.is_ancestor"}}
|
||||
</div>
|
||||
{{else if or .Issue.PullRequest.CanAutoMerge .Issue.PullRequest.IsEmpty}}
|
||||
{{if .IsBlockedByApprovals}}
|
||||
<div class="item">
|
||||
{{svg "octicon-x"}}
|
||||
{{if .RequireApprovalsWhitelist}}
|
||||
{{ctx.Locale.Tr "repo.pulls.blocked_by_approvals_whitelisted" .GrantedApprovals .ProtectedBranch.RequiredApprovals}}
|
||||
{{else}}
|
||||
{{ctx.Locale.Tr "repo.pulls.blocked_by_approvals" .GrantedApprovals .ProtectedBranch.RequiredApprovals}}
|
||||
{{end}}
|
||||
</div>
|
||||
{{else if .IsBlockedByRejection}}
|
||||
<div class="item">
|
||||
{{svg "octicon-x"}}
|
||||
{{ctx.Locale.Tr "repo.pulls.blocked_by_rejection"}}
|
||||
</div>
|
||||
{{else if .IsBlockedByOfficialReviewRequests}}
|
||||
<div class="item">
|
||||
{{svg "octicon-x"}}
|
||||
{{ctx.Locale.Tr "repo.pulls.blocked_by_official_review_requests"}}
|
||||
</div>
|
||||
{{else if .IsBlockedByOutdatedBranch}}
|
||||
<div class="item">
|
||||
{{svg "octicon-x"}}
|
||||
{{ctx.Locale.Tr "repo.pulls.blocked_by_outdated_branch"}}
|
||||
</div>
|
||||
{{else if .IsBlockedByChangedProtectedFiles}}
|
||||
<div class="item">
|
||||
{{svg "octicon-x"}}
|
||||
{{ctx.Locale.TrN $.ChangedProtectedFilesNum "repo.pulls.blocked_by_changed_protected_files_1" "repo.pulls.blocked_by_changed_protected_files_n"}}
|
||||
</div>
|
||||
<ul>
|
||||
{{range .ChangedProtectedFiles}}
|
||||
<li>{{.}}</li>
|
||||
{{end}}
|
||||
</ul>
|
||||
{{else if and .EnableStatusCheck (or $requiredStatusCheckState.IsError $requiredStatusCheckState.IsFailure)}}
|
||||
<div class="item">
|
||||
{{svg "octicon-x"}}
|
||||
{{ctx.Locale.Tr "repo.pulls.required_status_check_failed"}}
|
||||
</div>
|
||||
{{else if and .EnableStatusCheck (not $requiredStatusCheckState.IsSuccess)}}
|
||||
<div class="item">
|
||||
{{svg "octicon-x"}}
|
||||
{{ctx.Locale.Tr "repo.pulls.required_status_check_missing"}}
|
||||
</div>
|
||||
{{else if and .AllowMerge .RequireSigned (not .WillSign)}}
|
||||
<div class="item">
|
||||
{{svg "octicon-x"}}
|
||||
{{ctx.Locale.Tr "repo.pulls.require_signed_wont_sign"}}
|
||||
</div>
|
||||
<div class="item">
|
||||
{{svg "octicon-unlock"}}
|
||||
{{ctx.Locale.Tr (printf "repo.signing.wont_sign.%s" .WontSignReason)}}
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
{{$notAllOverridableChecksOk := or .IsBlockedByApprovals .IsBlockedByRejection .IsBlockedByOfficialReviewRequests .IsBlockedByOutdatedBranch .IsBlockedByChangedProtectedFiles (and .EnableStatusCheck (not $requiredStatusCheckState.IsSuccess))}}
|
||||
|
||||
{{/* admin can merge without checks, writer can merge when checks succeed */}}
|
||||
{{$canMergeNow := and (or (and (not $.ProtectedBranch.BlockAdminMergeOverride) $.IsRepoAdmin) (not $notAllOverridableChecksOk)) (or (not .AllowMerge) (not .RequireSigned) .WillSign)}}
|
||||
{{/* admin and writer both can make an auto merge schedule */}}
|
||||
|
||||
{{if $canMergeNow}}
|
||||
{{if $notAllOverridableChecksOk}}
|
||||
<div class="item">
|
||||
{{svg "octicon-dot-fill"}}
|
||||
{{ctx.Locale.Tr "repo.pulls.required_status_check_administrator"}}
|
||||
</div>
|
||||
{{else}}
|
||||
<div class="item">
|
||||
{{svg "octicon-check"}}
|
||||
{{ctx.Locale.Tr "repo.pulls.can_auto_merge_desc"}}
|
||||
</div>
|
||||
{{end}}
|
||||
{{if .WillSign}}
|
||||
<div class="item">
|
||||
{{svg "octicon-lock" 16 "tw-text-green"}}
|
||||
{{ctx.Locale.Tr "repo.signing.will_sign" .SigningKeyMergeDisplay}}
|
||||
</div>
|
||||
{{else if .IsSigned}}
|
||||
<div class="item">
|
||||
{{svg "octicon-unlock"}}
|
||||
{{ctx.Locale.Tr (printf "repo.signing.wont_sign.%s" .WontSignReason)}}
|
||||
</div>
|
||||
{{end}}
|
||||
{{end}}
|
||||
|
||||
{{template "repo/issue/view_content/update_branch_by_merge" $}}
|
||||
|
||||
{{if .Issue.PullRequest.IsEmpty}}
|
||||
<div class="divider"></div>
|
||||
<div class="item">
|
||||
{{svg "octicon-alert"}}
|
||||
{{ctx.Locale.Tr "repo.pulls.is_empty"}}
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
{{if .AllowMerge}} {{/* user is allowed to merge */}}
|
||||
{{$prUnit := .Repository.MustGetUnit ctx ctx.Consts.RepoUnitTypePullRequests}}
|
||||
{{if or $prUnit.PullRequestsConfig.AllowMerge $prUnit.PullRequestsConfig.AllowRebase $prUnit.PullRequestsConfig.AllowRebaseMerge $prUnit.PullRequestsConfig.AllowSquash $prUnit.PullRequestsConfig.AllowFastForwardOnly}}
|
||||
{{$hasPendingPullRequestMergeTip := ""}}
|
||||
{{if .HasPendingPullRequestMerge}}
|
||||
{{$createdPRMergeStr := DateUtils.TimeSince .PendingPullRequestMerge.CreatedUnix}}
|
||||
{{$hasPendingPullRequestMergeTip = ctx.Locale.Tr "repo.pulls.auto_merge_has_pending_schedule" .PendingPullRequestMerge.Doer.Name $createdPRMergeStr}}
|
||||
{{end}}
|
||||
<div class="divider"></div>
|
||||
<script type="module">
|
||||
(() => {
|
||||
const defaultMergeTitle = {{.DefaultMergeMessage}};
|
||||
const defaultSquashMergeTitle = {{.DefaultSquashMergeMessage}};
|
||||
const defaultMergeMessage = {{.DefaultMergeBody}};
|
||||
const defaultSquashMergeMessage = {{.DefaultSquashMergeBody}};
|
||||
const mergeForm = {
|
||||
'baseLink': {{.Issue.Link}},
|
||||
'textCancel': {{ctx.Locale.Tr "cancel"}},
|
||||
'textDeleteBranch': {{ctx.Locale.Tr "repo.branch.delete" .HeadTarget}},
|
||||
'textAutoMergeButtonWhenSucceed': {{ctx.Locale.Tr "repo.pulls.auto_merge_button_when_succeed"}},
|
||||
'textAutoMergeWhenSucceed': {{ctx.Locale.Tr "repo.pulls.auto_merge_when_succeed"}},
|
||||
'textAutoMergeCancelSchedule': {{ctx.Locale.Tr "repo.pulls.auto_merge_cancel_schedule"}},
|
||||
'textClearMergeMessage': {{ctx.Locale.Tr "repo.pulls.clear_merge_message"}},
|
||||
'textClearMergeMessageHint': {{ctx.Locale.Tr "repo.pulls.clear_merge_message_hint"}},
|
||||
'textMergeCommitId': {{ctx.Locale.Tr "repo.pulls.merge_commit_id"}},
|
||||
|
||||
'canMergeNow': {{$canMergeNow}},
|
||||
'allOverridableChecksOk': {{not $notAllOverridableChecksOk}},
|
||||
'emptyCommit': {{.Issue.PullRequest.IsEmpty}},
|
||||
'pullHeadCommitID': {{.PullHeadCommitID}},
|
||||
'isPullBranchDeletable': {{.IsPullBranchDeletable}},
|
||||
'defaultMergeStyle': {{.MergeStyle}},
|
||||
'defaultDeleteBranchAfterMerge': {{$prUnit.PullRequestsConfig.DefaultDeleteBranchAfterMerge}},
|
||||
'mergeMessageFieldPlaceHolder': {{ctx.Locale.Tr "repo.editor.commit_message_desc"}},
|
||||
'defaultMergeMessage': defaultMergeMessage,
|
||||
|
||||
'hasPendingPullRequestMerge': {{.HasPendingPullRequestMerge}},
|
||||
'hasPendingPullRequestMergeTip': {{$hasPendingPullRequestMergeTip}},
|
||||
};
|
||||
|
||||
const generalHideAutoMerge = mergeForm.canMergeNow && mergeForm.allOverridableChecksOk; // if this pr can be merged now, then hide the auto merge
|
||||
mergeForm['mergeStyles'] = [
|
||||
{
|
||||
'name': 'merge',
|
||||
'allowed': {{$prUnit.PullRequestsConfig.AllowMerge}},
|
||||
'textDoMerge': {{ctx.Locale.Tr "repo.pulls.merge_pull_request"}},
|
||||
'mergeTitleFieldText': defaultMergeTitle,
|
||||
'mergeMessageFieldText': defaultMergeMessage,
|
||||
'hideAutoMerge': generalHideAutoMerge,
|
||||
},
|
||||
{
|
||||
'name': 'rebase',
|
||||
'allowed': {{$prUnit.PullRequestsConfig.AllowRebase}},
|
||||
'textDoMerge': {{ctx.Locale.Tr "repo.pulls.rebase_merge_pull_request"}},
|
||||
'hideMergeMessageTexts': true,
|
||||
'hideAutoMerge': generalHideAutoMerge,
|
||||
},
|
||||
{
|
||||
'name': 'rebase-merge',
|
||||
'allowed': {{$prUnit.PullRequestsConfig.AllowRebaseMerge}},
|
||||
'textDoMerge': {{ctx.Locale.Tr "repo.pulls.rebase_merge_commit_pull_request"}},
|
||||
'mergeTitleFieldText': defaultMergeTitle,
|
||||
'mergeMessageFieldText': defaultMergeMessage,
|
||||
'hideAutoMerge': generalHideAutoMerge,
|
||||
},
|
||||
{
|
||||
'name': 'squash',
|
||||
'allowed': {{$prUnit.PullRequestsConfig.AllowSquash}},
|
||||
'textDoMerge': {{ctx.Locale.Tr "repo.pulls.squash_merge_pull_request"}},
|
||||
'mergeTitleFieldText': defaultSquashMergeTitle,
|
||||
'mergeMessageFieldText': {{.GetCommitMessages}} + defaultSquashMergeMessage,
|
||||
'hideAutoMerge': generalHideAutoMerge,
|
||||
},
|
||||
{
|
||||
'name': 'fast-forward-only',
|
||||
'allowed': {{and $prUnit.PullRequestsConfig.AllowFastForwardOnly (eq .Issue.PullRequest.CommitsBehind 0)}},
|
||||
'textDoMerge': {{ctx.Locale.Tr "repo.pulls.fast_forward_only_merge_pull_request"}},
|
||||
'hideMergeMessageTexts': true,
|
||||
'hideAutoMerge': generalHideAutoMerge,
|
||||
},
|
||||
{
|
||||
'name': 'manually-merged',
|
||||
'allowed': {{$prUnit.PullRequestsConfig.AllowManualMerge}},
|
||||
'textDoMerge': {{ctx.Locale.Tr "repo.pulls.merge_manually"}},
|
||||
'hideMergeMessageTexts': true,
|
||||
'hideAutoMerge': true,
|
||||
}
|
||||
];
|
||||
window.config.pageData.pullRequestMergeForm = mergeForm;
|
||||
})();
|
||||
</script>
|
||||
|
||||
{{$showGeneralMergeForm = true}}
|
||||
{{/* The merge form is a Vue component. After mounted, it has a button for choosing merge style, so make it have min-height to avoid layout shifting */}}
|
||||
<div id="pull-request-merge-form" class="tw-min-h-[40px]"></div>
|
||||
{{else}}
|
||||
{{/* no merge style was set in repo setting: not or ($prUnit.PullRequestsConfig.AllowMerge ...) */}}
|
||||
<div class="divider"></div>
|
||||
<div class="item tw-text-red">
|
||||
{{svg "octicon-x"}}
|
||||
{{ctx.Locale.Tr "repo.pulls.no_merge_desc"}}
|
||||
</div>
|
||||
<div class="item">
|
||||
{{svg "octicon-info"}}
|
||||
{{ctx.Locale.Tr "repo.pulls.no_merge_helper"}}
|
||||
</div>
|
||||
{{end}} {{/* end if the repo was set to use any merge style */}}
|
||||
{{else}}
|
||||
{{/* user is not allowed to merge */}}
|
||||
<div class="divider"></div>
|
||||
<div class="item">
|
||||
{{svg "octicon-info"}}
|
||||
{{ctx.Locale.Tr "repo.pulls.no_merge_access"}}
|
||||
</div>
|
||||
{{end}} {{/* end if user is allowed to merge or not */}}
|
||||
{{else}}
|
||||
{{/* Merge conflict without specific file. Suggest manual merge, only if all reviews and status checks OK. */}}
|
||||
{{if .IsBlockedByApprovals}}
|
||||
<div class="item tw-text-red">
|
||||
{{svg "octicon-x"}}
|
||||
{{ctx.Locale.Tr "repo.pulls.blocked_by_approvals" .GrantedApprovals .ProtectedBranch.RequiredApprovals}}
|
||||
</div>
|
||||
{{else if .IsBlockedByRejection}}
|
||||
<div class="item tw-text-red">
|
||||
{{svg "octicon-x"}}
|
||||
{{ctx.Locale.Tr "repo.pulls.blocked_by_rejection"}}
|
||||
</div>
|
||||
{{else if .IsBlockedByOfficialReviewRequests}}
|
||||
<div class="item tw-text-red">
|
||||
{{svg "octicon-x"}}
|
||||
{{ctx.Locale.Tr "repo.pulls.blocked_by_official_review_requests"}}
|
||||
</div>
|
||||
{{else if .IsBlockedByOutdatedBranch}}
|
||||
<div class="item tw-text-red">
|
||||
{{svg "octicon-x"}}
|
||||
{{ctx.Locale.Tr "repo.pulls.blocked_by_outdated_branch"}}
|
||||
</div>
|
||||
{{else if .IsBlockedByChangedProtectedFiles}}
|
||||
<div class="item tw-text-red">
|
||||
{{svg "octicon-x"}}
|
||||
{{ctx.Locale.TrN $.ChangedProtectedFilesNum "repo.pulls.blocked_by_changed_protected_files_1" "repo.pulls.blocked_by_changed_protected_files_n"}}
|
||||
</div>
|
||||
<ul>
|
||||
{{range .ChangedProtectedFiles}}
|
||||
<li>{{.}}</li>
|
||||
{{end}}
|
||||
</ul>
|
||||
{{else if and .EnableStatusCheck (not $requiredStatusCheckState.IsSuccess)}}
|
||||
<div class="item tw-text-red">
|
||||
{{svg "octicon-x"}}
|
||||
{{ctx.Locale.Tr "repo.pulls.required_status_check_failed"}}
|
||||
</div>
|
||||
{{else if and .RequireSigned (not .WillSign)}}
|
||||
<div class="item tw-text-red">
|
||||
{{svg "octicon-x"}}
|
||||
{{ctx.Locale.Tr "repo.pulls.require_signed_wont_sign"}}
|
||||
</div>
|
||||
{{else}}
|
||||
<div class="item tw-text-red">
|
||||
{{svg "octicon-x"}}
|
||||
{{ctx.Locale.Tr "repo.pulls.cannot_auto_merge_desc"}}
|
||||
</div>
|
||||
<div class="item">
|
||||
{{svg "octicon-info"}}
|
||||
{{ctx.Locale.Tr "repo.pulls.cannot_auto_merge_helper"}}
|
||||
</div>
|
||||
{{end}}
|
||||
{{end}}{{/* end if: pull request status */}}
|
||||
|
||||
{{/* Manually Merged is not a well-known feature, it is used to mark a non-mergeable PR (already merged, conflicted) as merged
|
||||
To test it:
|
||||
* Enable "Manually Merged" feature in the Repository Settings
|
||||
* Create a pull request, either:
|
||||
* - Merge the pull request branch locally and push the merged commit to Gitea
|
||||
* - Make some conflicts between the base branch and the pull request branch
|
||||
* Then the Manually Merged form will be shown in the merge form
|
||||
*/}}
|
||||
{{if and $.StillCanManualMerge (not $showGeneralMergeForm)}}
|
||||
<div class="divider"></div>
|
||||
<form class="ui form form-fetch-action" action="{{.Issue.Link}}/merge" method="post">{{/* another similar form is in PullRequestMergeForm.vue*/}}
|
||||
<div class="field">
|
||||
<input type="text" name="merge_commit_id" placeholder="{{ctx.Locale.Tr "repo.pulls.merge_commit_id"}}">
|
||||
</div>
|
||||
<button class="ui red button" type="submit" name="do" value="manually-merged">
|
||||
{{ctx.Locale.Tr "repo.pulls.merge_manually"}}
|
||||
<button class="ui compact button" data-global-init="initPullRequestWipToggle" data-title="{{.Issue.Title}}" data-wip-prefix="{{.WorkInProgressPrefix}}" data-update-url="{{.Issue.Link}}/title">
|
||||
{{ctx.Locale.Tr "repo.pulls.remove_prefix" .WorkInProgressPrefix}}
|
||||
</button>
|
||||
</form>
|
||||
{{end}}
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
{{if and .Issue.PullRequest.HeadRepo (not .Issue.PullRequest.HasMerged) (not .Issue.IsClosed)}}
|
||||
{{template "repo/issue/view_content/pull_merge_instruction" dict "PullRequest" .Issue.PullRequest "ShowMergeInstructions" .ShowMergeInstructions}}
|
||||
{{if $data.MergeFormProps}}
|
||||
{{/* The merge form is a Vue component. After mounted, it has a button for choosing merge style, so make it have min-height to avoid layout shifting */}}
|
||||
<div class="item">
|
||||
<div id="pull-request-merge-form" class="tw-min-h-[40px] tw-w-full" data-merge-form-props="{{JsonUtils.EncodeToString $data.MergeFormProps}}"></div>
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
{{if $data.ShowPullCommands}}
|
||||
<div class="item">
|
||||
{{template "repo/issue/view_content/pull_merge_instruction" dict "PullRequest" .Issue.PullRequest "MergeBoxData" $data}}
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
+27
-21
@@ -1,57 +1,63 @@
|
||||
<div class="divider"></div>
|
||||
{{$data := $.MergeBoxData}}
|
||||
{{$pull := $.PullRequest}}
|
||||
<details>
|
||||
<summary>{{ctx.Locale.Tr "repo.pulls.cmd_instruction_hint"}}</summary>
|
||||
<div class="tw-mt-2">
|
||||
<div><h3>{{ctx.Locale.Tr "repo.pulls.cmd_instruction_checkout_title"}}</h3>{{ctx.Locale.Tr "repo.pulls.cmd_instruction_checkout_desc"}}</div>
|
||||
{{$localBranch := .PullRequest.HeadBranch}}
|
||||
{{if ne .PullRequest.HeadRepo.ID .PullRequest.BaseRepo.ID}}
|
||||
{{$localBranch = print .PullRequest.HeadRepo.OwnerName "-" .PullRequest.HeadBranch}}
|
||||
<summary class="tw-pl-1">{{/* align with other item icon & text */}}
|
||||
<span class="tw-pl-2">{{ctx.Locale.Tr "repo.pulls.cmd_instruction_hint"}}</span>
|
||||
</summary>
|
||||
<div class="tw-my-[5px]">
|
||||
<div>
|
||||
<h3 class="tw-m-0">{{ctx.Locale.Tr "repo.pulls.cmd_instruction_checkout_title"}}</h3>
|
||||
{{ctx.Locale.Tr "repo.pulls.cmd_instruction_checkout_desc"}}
|
||||
</div>
|
||||
{{$localBranch := $pull.HeadBranch}}
|
||||
{{if ne $pull.HeadRepo.ID $pull.BaseRepo.ID}}
|
||||
{{$localBranch = print $pull.HeadRepo.OwnerName "-" $pull.HeadBranch}}
|
||||
{{end}}
|
||||
<div class="ui secondary segment tw-font-mono">
|
||||
{{$gitRemoteName := ctx.RootData.SystemConfig.Repository.GitGuideRemoteName.Value ctx}}
|
||||
{{if eq .PullRequest.Flow 0}}
|
||||
<div>git fetch -u {{if ne .PullRequest.HeadRepo.ID .PullRequest.BaseRepo.ID}}{{ctx.AppFullLink .PullRequest.HeadRepo.Link}}{{else}}{{$gitRemoteName}}{{end}} {{.PullRequest.HeadBranch}}:{{$localBranch}}</div>
|
||||
{{if eq $pull.Flow 0}}
|
||||
<div>git fetch -u {{if ne $pull.HeadRepo.ID $pull.BaseRepo.ID}}{{$pull.HeadRepo.HTMLURL ctx}}{{else}}{{$gitRemoteName}}{{end}} {{$pull.HeadBranch}}:{{$localBranch}}</div>
|
||||
{{else}}
|
||||
<div>git fetch -u {{$gitRemoteName}} {{.PullRequest.GetGitHeadRefName}}:{{$localBranch}}</div>
|
||||
<div>git fetch -u {{$gitRemoteName}} {{$pull.GetGitHeadRefName}}:{{$localBranch}}</div>
|
||||
{{end}}
|
||||
<div>git checkout {{$localBranch}}</div>
|
||||
</div>
|
||||
{{if .ShowMergeInstructions}}
|
||||
{{if $data.ShowMergeInstructions}}
|
||||
<div>
|
||||
<h3>{{ctx.Locale.Tr "repo.pulls.cmd_instruction_merge_title"}}</h3>
|
||||
<h3 class="tw-m-0">{{ctx.Locale.Tr "repo.pulls.cmd_instruction_merge_title"}}</h3>
|
||||
{{ctx.Locale.Tr "repo.pulls.cmd_instruction_merge_desc"}}
|
||||
{{if not .AutodetectManualMerge}}
|
||||
{{if not $data.AutodetectManualMerge}}
|
||||
<div>{{ctx.Locale.Tr "repo.pulls.cmd_instruction_merge_warning"}}</div>
|
||||
{{end}}
|
||||
</div>
|
||||
<div class="ui secondary segment tw-font-mono">
|
||||
<div data-pull-merge-style="merge">
|
||||
<div>git checkout {{.PullRequest.BaseBranch}}</div>
|
||||
<div>git checkout {{$pull.BaseBranch}}</div>
|
||||
<div>git merge --no-ff {{$localBranch}}</div>
|
||||
</div>
|
||||
<div class="tw-hidden" data-pull-merge-style="rebase">
|
||||
<div>git checkout {{.PullRequest.BaseBranch}}</div>
|
||||
<div>git checkout {{$pull.BaseBranch}}</div>
|
||||
<div>git merge --ff-only {{$localBranch}}</div>
|
||||
</div>
|
||||
<div class="tw-hidden" data-pull-merge-style="rebase-merge">
|
||||
<div>git checkout {{$localBranch}}</div>
|
||||
<div>git rebase {{.PullRequest.BaseBranch}}</div>
|
||||
<div>git checkout {{.PullRequest.BaseBranch}}</div>
|
||||
<div>git rebase {{$pull.BaseBranch}}</div>
|
||||
<div>git checkout {{$pull.BaseBranch}}</div>
|
||||
<div>git merge --no-ff {{$localBranch}}</div>
|
||||
</div>
|
||||
<div class="tw-hidden" data-pull-merge-style="squash">
|
||||
<div>git checkout {{.PullRequest.BaseBranch}}</div>
|
||||
<div>git checkout {{$pull.BaseBranch}}</div>
|
||||
<div>git merge --squash {{$localBranch}}</div>
|
||||
</div>
|
||||
<div class="tw-hidden" data-pull-merge-style="fast-forward-only">
|
||||
<div>git checkout {{.PullRequest.BaseBranch}}</div>
|
||||
<div>git checkout {{$pull.BaseBranch}}</div>
|
||||
<div>git merge --ff-only {{$localBranch}}</div>
|
||||
</div>
|
||||
<div class="tw-hidden" data-pull-merge-style="manually-merged">
|
||||
<div>git checkout {{.PullRequest.BaseBranch}}</div>
|
||||
<div>git checkout {{$pull.BaseBranch}}</div>
|
||||
<div>git merge {{$localBranch}}</div>
|
||||
</div>
|
||||
<div>git push {{$gitRemoteName}} {{.PullRequest.BaseBranch}}</div>
|
||||
<div>git push {{$gitRemoteName}} {{$pull.BaseBranch}}</div>
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
{{/* Template Attributes:
|
||||
* StatusCheckData: see backend pullCommitStatusCheckData struct
|
||||
*/}}
|
||||
{{$statusCheckData := $.StatusCheckData}}
|
||||
{{if $statusCheckData}}
|
||||
{{$commitStatuses := $statusCheckData.PullCommitStatuses}}
|
||||
<div class="item flex-left-right commit-status-toggle">
|
||||
<div>{{$statusCheckData.CommitStatusCheckPrompt ctx.Locale}}</div>
|
||||
<button data-global-click="onCommitStatusChecksToggle" class="btn interact-fg"
|
||||
data-show-all="{{ctx.Locale.Tr "repo.pulls.status_checks_show_all"}}"
|
||||
data-hide-all="{{ctx.Locale.Tr "repo.pulls.status_checks_hide_all"}}"
|
||||
>{{ctx.Locale.Tr "repo.pulls.status_checks_hide_all"}}</button>
|
||||
</div>
|
||||
|
||||
{{if $statusCheckData.RequireApprovalRunCount}}
|
||||
<div class="item flex-left-right" id="approve-status-checks">
|
||||
<div>
|
||||
<strong>{{ctx.Locale.Tr "repo.pulls.status_checks_need_approvals" $statusCheckData.RequireApprovalRunCount}}</strong>
|
||||
<p>{{ctx.Locale.Tr "repo.pulls.status_checks_need_approvals_helper"}}</p>
|
||||
</div>
|
||||
{{if $statusCheckData.CanApprove}}
|
||||
<button class="ui basic button link-action" data-url="{{$statusCheckData.ApproveLink}}">
|
||||
{{ctx.Locale.Tr "repo.pulls.status_checks_approve_all"}}
|
||||
</button>
|
||||
{{end}}
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
<div class="item tw-p-0">
|
||||
<div class="commit-status-list flex-divided-list items-px-default">
|
||||
{{template "repo/pulls/status_items" (dict "CommitStatuses" $commitStatuses "StatusCheckData" $statusCheckData)}}
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
+23
-35
@@ -1,36 +1,24 @@
|
||||
{{if and (gt $.Issue.PullRequest.CommitsBehind 0) (not $.Issue.IsClosed) (not $.Issue.PullRequest.IsChecking) (not $.IsPullFilesConflicted) (not $.IsPullRequestBroken)}}
|
||||
<div class="divider"></div>
|
||||
<div class="item item-section">
|
||||
<div class="item-section-left flex-text-inline">
|
||||
{{svg "octicon-alert"}}
|
||||
{{ctx.Locale.Tr "repo.pulls.outdated_with_base_branch"}}
|
||||
</div>
|
||||
<div class="item-section-right">
|
||||
{{if and $.UpdateAllowed $.UpdateByRebaseAllowed}}
|
||||
<div class="tw-inline-block">
|
||||
<div id="update-pr-branch-with-base" class="ui buttons">
|
||||
<button class="ui button" data-do="{{$.Issue.Link}}/update" data-redirect="{{$.Issue.Link}}">
|
||||
<span class="button-text">
|
||||
{{ctx.Locale.Tr "repo.pulls.update_branch"}}
|
||||
</span>
|
||||
</button>
|
||||
<div class="ui dropdown icon button">
|
||||
{{svg "octicon-triangle-down"}}
|
||||
<div class="menu">
|
||||
<a class="item active selected" data-do="{{$.Issue.Link}}/update">{{ctx.Locale.Tr "repo.pulls.update_branch"}}</a>
|
||||
<a class="item" data-do="{{$.Issue.Link}}/update?style=rebase">{{ctx.Locale.Tr "repo.pulls.update_branch_rebase"}}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
{{if and $.UpdateAllowed (not $.UpdateByRebaseAllowed)}}
|
||||
<form action="{{$.Issue.Link}}/update" method="post" class="ui update-branch-form">
|
||||
<button class="ui compact button">
|
||||
<span class="ui text">{{ctx.Locale.Tr "repo.pulls.update_branch"}}</span>
|
||||
</button>
|
||||
</form>
|
||||
{{end}}
|
||||
</div>
|
||||
{{$data := $.MergeBoxData}}
|
||||
<div class="tw-w-full flex-left-right">
|
||||
<div class="flex-text-block">
|
||||
{{svg "octicon-alert"}}
|
||||
{{ctx.Locale.Tr "repo.pulls.outdated_with_base_branch"}}
|
||||
</div>
|
||||
{{end}}
|
||||
{{if $data.UpdatePrimaryAction}}
|
||||
<div class="ui buttons"{{if $data.UpdateStyleOptions}} data-global-init="initRepoPullRequestUpdate"{{end}}>
|
||||
<button class="ui button link-action" data-url="{{$data.UpdatePrimaryAction.URL}}">
|
||||
{{$data.UpdatePrimaryAction.Text}}
|
||||
</button>
|
||||
{{if gt (len $data.UpdateStyleOptions) 1}}
|
||||
<div class="ui dropdown icon button">
|
||||
{{svg "octicon-triangle-down"}}
|
||||
<div class="menu">
|
||||
{{range $data.UpdateStyleOptions}}
|
||||
<a class="item {{if .Selected}}selected{{end}}" data-update-url="{{.URL}}">{{.Text}}</a>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
|
||||
@@ -1,12 +1,7 @@
|
||||
<form hx-boost="true" hx-sync="this:replace" hx-target="this" method="post" action="{{.Issue.Link}}/watch">
|
||||
<input type="hidden" name="watch" value="{{if $.IssueWatch.IsWatching}}0{{else}}1{{end}}">
|
||||
<button class="fluid ui button">
|
||||
{{if $.IssueWatch.IsWatching}}
|
||||
{{svg "octicon-mute" 16}}
|
||||
{{ctx.Locale.Tr "repo.issues.unsubscribe"}}
|
||||
{{else}}
|
||||
{{svg "octicon-unmute" 16}}
|
||||
{{ctx.Locale.Tr "repo.issues.subscribe"}}
|
||||
{{end}}
|
||||
</button>
|
||||
</form>
|
||||
<button class="fluid ui button" type="button" data-fetch-method="post" data-fetch-url="{{.Issue.Link}}/watch?watch={{not $.IssueWatch.IsWatching}}">
|
||||
{{if $.IssueWatch.IsWatching}}
|
||||
{{svg "octicon-mute" 16}} {{ctx.Locale.Tr "repo.issues.unsubscribe"}}
|
||||
{{else}}
|
||||
{{svg "octicon-unmute" 16}} {{ctx.Locale.Tr "repo.issues.subscribe"}}
|
||||
{{end}}
|
||||
</button>
|
||||
|
||||
@@ -2,25 +2,18 @@
|
||||
{{if not .LatestCommit}}
|
||||
…
|
||||
{{else}}
|
||||
<span class="author-wrapper">
|
||||
{{- if .LatestCommitUser -}}
|
||||
{{- ctx.AvatarUtils.Avatar .LatestCommitUser 20 "tw-mr-2" -}}
|
||||
<strong>{{.LatestCommitUser.GetShortDisplayNameLinkHTML}}</strong>
|
||||
{{- else if .LatestCommit.Author -}}
|
||||
{{- ctx.AvatarUtils.AvatarByEmail .LatestCommit.Author.Email .LatestCommit.Author.Name 20 "tw-mr-2" -}}
|
||||
<strong>{{.LatestCommit.Author.Name}}</strong>
|
||||
{{- end -}}
|
||||
</span>
|
||||
{{ctx.RenderUtils.AvatarStackWithNames .LatestCommitAvatarStackData}}
|
||||
|
||||
{{template "repo/commit_sign_badge" dict "Commit" .LatestCommit "CommitBaseLink" (print .RepoLink "/commit") "CommitSignVerification" .LatestCommitVerification}}
|
||||
|
||||
{{template "repo/commit_statuses" dict "Status" .LatestCommitStatus "Statuses" .LatestCommitStatuses}}
|
||||
|
||||
{{$commitLink:= printf "%s/commit/%s" .RepoLink (PathEscape .LatestCommit.ID.String)}}
|
||||
<span class="grey commit-summary" title="{{.LatestCommit.Summary}}"><span class="message-wrapper">{{ctx.RenderUtils.RenderCommitMessageLinkSubject .LatestCommit.Message $commitLink $.Repository}}</span>
|
||||
{{if IsMultilineCommitMessage .LatestCommit.Message}}
|
||||
<span class="grey commit-summary" title="{{.LatestCommit.MessageTitle}}">
|
||||
<span class="message-wrapper">{{ctx.RenderUtils.RenderCommitMessageLinkSubject .LatestCommit.MessageUTF8 $commitLink $.Repository}}</span>
|
||||
{{if .LatestCommit.MessageBody}}
|
||||
<button class="ui button ellipsis-button" aria-expanded="false" data-global-click="onRepoEllipsisButtonClick">...</button>
|
||||
<pre class="commit-body tw-hidden">{{ctx.RenderUtils.RenderCommitBody .LatestCommit.Message $.Repository}}</pre>
|
||||
<pre class="commit-body tw-hidden">{{ctx.RenderUtils.RenderCommitBody .LatestCommit.MessageUTF8 $.Repository}}</pre>
|
||||
{{end}}
|
||||
</span>
|
||||
{{end}}
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
{{ctx.Locale.Tr "repo.settings.delete_notices_fork_1"}}
|
||||
{{end}}
|
||||
</div>
|
||||
<form class="ui form" action="{{.Link}}/settings" method="post">
|
||||
<form class="ui form form-fetch-action" action="{{.Link}}/settings" method="post">
|
||||
<input type="hidden" name="action" value="delete">
|
||||
<div class="field">
|
||||
<label>
|
||||
@@ -88,7 +88,7 @@
|
||||
<div class="header">
|
||||
{{ctx.Locale.Tr "repo.migrate.cancel_migrating_title"}}
|
||||
</div>
|
||||
<form action="{{.Link}}/settings/migrate/cancel" method="post">
|
||||
<form class="form-fetch-action" action="{{.Link}}/settings/migrate/cancel" method="post">
|
||||
<div class="content">
|
||||
{{ctx.Locale.Tr "repo.migrate.cancel_migrating_confirm"}}
|
||||
</div>
|
||||
|
||||
@@ -1,63 +0,0 @@
|
||||
{{/* Template Attributes:
|
||||
* CommitStatus: summary of all commit status state
|
||||
* CommitStatuses: all commit status elements
|
||||
* ShowHideChecks: whether use a button to show/hide the checks
|
||||
* StatusCheckData: additional status check data, see backend pullCommitStatusCheckData struct
|
||||
*/}}
|
||||
{{$statusCheckData := .StatusCheckData}}
|
||||
{{if .CommitStatus}}
|
||||
<div class="commit-status-panel">
|
||||
<div class="ui top attached header commit-status-header">
|
||||
{{$statusCheckData.CommitStatusCheckPrompt ctx.Locale}}
|
||||
|
||||
{{if .ShowHideChecks}}
|
||||
<div class="ui right">
|
||||
<button class="commit-status-hide-checks btn interact-fg"
|
||||
data-show-all="{{ctx.Locale.Tr "repo.pulls.status_checks_show_all"}}"
|
||||
data-hide-all="{{ctx.Locale.Tr "repo.pulls.status_checks_hide_all"}}">
|
||||
{{ctx.Locale.Tr "repo.pulls.status_checks_hide_all"}}</button>
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
|
||||
{{if and $statusCheckData $statusCheckData.RequireApprovalRunCount}}
|
||||
<div class="ui attached segment flex-text-block tw-justify-between" id="approve-status-checks">
|
||||
<div>
|
||||
<strong>
|
||||
{{ctx.Locale.Tr "repo.pulls.status_checks_need_approvals" $statusCheckData.RequireApprovalRunCount}}
|
||||
</strong>
|
||||
<p>{{ctx.Locale.Tr "repo.pulls.status_checks_need_approvals_helper"}}</p>
|
||||
</div>
|
||||
{{if $statusCheckData.CanApprove}}
|
||||
<button class="ui basic button link-action" data-url="{{$statusCheckData.ApproveLink}}">
|
||||
{{ctx.Locale.Tr "repo.pulls.status_checks_approve_all"}}
|
||||
</button>
|
||||
{{end}}
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
<div class="commit-status-list">
|
||||
{{range .CommitStatuses}}
|
||||
<div class="commit-status-item">
|
||||
{{template "repo/commit_status" .}}
|
||||
<div class="status-context gt-ellipsis">{{.Context}} <span class="tw-text-text-light-2">{{.Description}}</span></div>
|
||||
<div class="ui status-details">
|
||||
{{if and $statusCheckData $statusCheckData.IsContextRequired}}
|
||||
{{if (call $statusCheckData.IsContextRequired .Context)}}<div class="ui label">{{ctx.Locale.Tr "repo.pulls.status_checks_requested"}}</div>{{end}}
|
||||
{{end}}
|
||||
<span>{{if .TargetURL}}<a href="{{.TargetURL}}">{{ctx.Locale.Tr "repo.pulls.status_checks_details"}}</a>{{end}}</span>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
{{if $statusCheckData}}
|
||||
{{range $statusCheckData.MissingRequiredChecks}}
|
||||
<div class="commit-status-item">
|
||||
{{svg "octicon-dot-fill" 18 "commit-status icon tw-text-yellow"}}
|
||||
<div class="status-context gt-ellipsis">{{.}}</div>
|
||||
<div class="ui label">{{ctx.Locale.Tr "repo.pulls.status_checks_requested"}}</div>
|
||||
</div>
|
||||
{{end}}
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
@@ -0,0 +1,38 @@
|
||||
{{/* Template Attributes:
|
||||
* CommitStatuses: all commit status elements
|
||||
* StatusCheckData: optional, additional status check data, see backend pullCommitStatusCheckData struct
|
||||
*/}}
|
||||
{{$statusCheckData := $.StatusCheckData}}
|
||||
{{$commitActionsStatuses := ctx.ActionsUtils.CommitStatusesToActionsStatuses $.CommitStatuses}}
|
||||
{{range $cs := $.CommitStatuses}}
|
||||
<div class="item commit-status-item">
|
||||
<div class="flex-text-block tw-flex-1">
|
||||
{{$actionStatus := $commitActionsStatuses.IconStatus $cs}}
|
||||
{{if $actionStatus}}
|
||||
{{template "repo/icons/action_status" (dict "Status" $actionStatus "Size" 18 "ClassName" "commit-status icon")}}
|
||||
{{else}}
|
||||
{{template "repo/icons/commit_status" $cs}}
|
||||
{{end}}
|
||||
<div class="gt-ellipsis">
|
||||
{{$cs.Context}} <span class="tw-text-text-light-2">{{$cs.Description}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-text-block">
|
||||
{{if and $statusCheckData $statusCheckData.IsContextRequired}}
|
||||
{{if (call $statusCheckData.IsContextRequired $cs.Context)}}
|
||||
<div class="ui label">{{ctx.Locale.Tr "repo.pulls.status_checks_requested"}}</div>
|
||||
{{end}}
|
||||
{{end}}
|
||||
{{if $cs.TargetURL}}<a href="{{$cs.TargetURL}}">{{ctx.Locale.Tr "repo.pulls.status_checks_details"}}</a>{{end}}
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
{{range $missingCheck := $statusCheckData.MissingRequiredChecks}}
|
||||
<div class="item commit-status-item">
|
||||
<div class="flex-text-block tw-flex-1">
|
||||
{{svg "octicon-dot-fill" 16 "commit-status icon tw-text-yellow"}}
|
||||
<div class="gt-ellipsis">{{$missingCheck}}</div>
|
||||
</div>
|
||||
<div class="ui label">{{ctx.Locale.Tr "repo.pulls.status_checks_requested"}}</div>
|
||||
</div>
|
||||
{{end}}
|
||||
@@ -30,7 +30,7 @@
|
||||
{{end}}
|
||||
</div>
|
||||
<div class="ui segment detail">
|
||||
<div class="tw-flex tw-items-center tw-justify-between tw-flex-wrap tw-mb-2">
|
||||
<div class="flex-left-right tw-mb-2">
|
||||
<h4 class="release-list-title tw-break-anywhere">
|
||||
{{if $.PageIsSingleTag}}{{$release.Title}}{{else}}<a class="muted" href="{{$.RepoLink}}/releases/tag/{{$release.TagName | PathEscapeSegments}}">{{$release.Title}}</a>{{end}}
|
||||
{{template "repo/commit_statuses" dict "Status" $info.CommitStatus "Statuses" $info.CommitStatuses "AdditionalClasses" "tw-flex"}}
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
</h2>
|
||||
{{template "base/alert" .}}
|
||||
|
||||
<form class="ui form" action="{{.Link}}" method="post" data-global-init="initReleaseEditForm"
|
||||
<form class="ui form form-fetch-action" action="{{.Link}}" method="post" data-global-init="initReleaseEditForm"
|
||||
data-existing-tags="{{JsonUtils.EncodeToString .Tags}}"
|
||||
data-tag-helper="{{ctx.Locale.Tr "repo.release.tag_helper"}}"
|
||||
data-tag-helper-new="{{ctx.Locale.Tr "repo.release.tag_helper_new"}}"
|
||||
|
||||
@@ -1 +1 @@
|
||||
<span class="username-display">{{.Name}} {{if .FullName}}<span class="username-fullname gt-ellipsis">({{.FullName}})</span>{{end}}</span>
|
||||
<span class="username-display">{{.Name}} {{if .FullName}}<span class="username-fullname">({{.FullName}})</span>{{end}}</span>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{{template "repo/settings/layout_head" (dict "ctxData" . "pageClass" "repository settings actions")}}
|
||||
{{template "repo/settings/layout_head" (dict "pageClass" "repository settings actions")}}
|
||||
<div class="repo-setting-content">
|
||||
{{if eq .PageType "runners"}}
|
||||
{{template "shared/actions/runner_list" .}}
|
||||
|
||||
@@ -62,18 +62,18 @@
|
||||
</h4>
|
||||
{{if len .CollaborativeOwners}}
|
||||
<div class="ui attached segment">
|
||||
<div class="flex-list">
|
||||
<div class="flex-divided-list items-with-main">
|
||||
{{range .CollaborativeOwners}}
|
||||
<div class="flex-item tw-items-center">
|
||||
<div class="flex-item-leading">
|
||||
<div class="item tw-items-center">
|
||||
<div class="item-leading">
|
||||
<a href="{{.HomeLink}}">{{ctx.AvatarUtils.Avatar . 32}}</a>
|
||||
</div>
|
||||
<div class="flex-item-main">
|
||||
<div class="flex-item-title">
|
||||
<div class="item-main">
|
||||
<div class="item-title">
|
||||
{{template "shared/user/name" .}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-item-trailing">
|
||||
<div class="item-trailing">
|
||||
<button class="ui red tiny button inline link-action"
|
||||
data-url="{{$.Link}}/collaborative_owner/delete?id={{.ID}}"
|
||||
data-modal-confirm-header="{{ctx.Locale.Tr "actions.general.remove_collaborative_owner"}}"
|
||||
@@ -86,8 +86,8 @@
|
||||
</div>
|
||||
{{end}}
|
||||
<div class="ui bottom attached segment">
|
||||
<form class="ui form form-fetch-action" action="{{.Link}}/collaborative_owner/add" method="post">
|
||||
<div id="search-user-box" class="ui search input tw-align-middle" data-include-orgs="true">
|
||||
<form class="ui form form-fetch-action flex-text-block" action="{{.Link}}/collaborative_owner/add" method="post">
|
||||
<div id="search-user-box" class="ui search input" data-include-orgs="true">
|
||||
<input class="prompt" name="collaborative_owner" placeholder="{{ctx.Locale.Tr "search.user_kind"}}" autocomplete="off" autofocus required>
|
||||
</div>
|
||||
<button class="ui primary button">{{ctx.Locale.Tr "actions.general.add_collaborative_owner"}}</button>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{{template "repo/settings/layout_head" (dict "ctxData" . "pageClass" "repository settings edit")}}
|
||||
{{template "repo/settings/layout_head" (dict "pageClass" "repository settings edit")}}
|
||||
<div class="repo-setting-content">
|
||||
{{if .Repository.IsArchived}}
|
||||
<div class="ui warning message tw-text-center">
|
||||
@@ -37,18 +37,18 @@
|
||||
</h4>
|
||||
|
||||
<div class="ui attached segment">
|
||||
<div class="flex-list" id="protected-branches-list" data-update-priority-url="{{$.Repository.Link}}/settings/branches/priority">
|
||||
<div class="flex-divided-list items-with-main" id="protected-branches-list" data-update-priority-url="{{$.Repository.Link}}/settings/branches/priority">
|
||||
{{range .ProtectedBranches}}
|
||||
<div class="flex-item tw-items-center item" data-id="{{.ID}}" >
|
||||
<div class="item tw-items-center" data-id="{{.ID}}" >
|
||||
<div class="drag-handle tw-cursor-grab">
|
||||
{{svg "octicon-grabber" 16}}
|
||||
</div>
|
||||
<div class="flex-item-main">
|
||||
<div class="flex-item-title">
|
||||
<div class="item-main">
|
||||
<div class="item-title">
|
||||
<div class="ui basic primary label">{{.RuleName}}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-item-trailing">
|
||||
<div class="item-trailing">
|
||||
<a class="ui tiny button" href="{{$.Repository.Link}}/settings/branches/edit?rule_name={{.RuleName}}">{{ctx.Locale.Tr "repo.settings.edit_protected_branch"}}</a>
|
||||
<button class="ui red tiny button link-action" data-modal-confirm="#repo-branch-protection-delete-modal" data-url="{{$.Repository.Link}}/settings/branches/{{.ID}}/delete?id={{.ID}}">
|
||||
{{ctx.Locale.Tr "repo.settings.protected_branch.delete_rule"}}
|
||||
@@ -56,7 +56,7 @@
|
||||
</div>
|
||||
</div>
|
||||
{{else}}
|
||||
<div class="flex-item tw-text-center">
|
||||
<div class="item tw-text-center">
|
||||
{{ctx.Locale.Tr "repo.settings.no_protected_branch"}}
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
{{template "repo/settings/layout_head" (dict "ctxData" . "pageClass" "repository settings collaboration")}}
|
||||
{{template "repo/settings/layout_head" (dict "pageClass" "repository settings collaboration")}}
|
||||
<div class="repo-setting-content">
|
||||
<h4 class="ui top attached header">
|
||||
{{ctx.Locale.Tr "repo.settings.collaboration"}}
|
||||
</h4>
|
||||
{{if .Collaborators}}
|
||||
<div class="ui attached segment">
|
||||
<div class="flex-list">
|
||||
<div class="flex-divided-list items-with-main">
|
||||
{{range .Collaborators}}
|
||||
<div class="flex-item tw-items-center">
|
||||
<div class="flex-item-leading">
|
||||
<div class="item tw-items-center">
|
||||
<div class="item-leading">
|
||||
<a href="{{.HomeLink}}">{{ctx.AvatarUtils.Avatar . 32}}</a>
|
||||
</div>
|
||||
<div class="flex-item-main">
|
||||
<div class="flex-item-title">
|
||||
<div class="item-main">
|
||||
<div class="item-title">
|
||||
{{template "shared/user/name" .}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-item-trailing">
|
||||
<div class="item-trailing">
|
||||
<div class="flex-text-block">
|
||||
{{svg "octicon-shield-lock"}}
|
||||
<div class="ui dropdown custom access-mode" data-url="{{$.Link}}/access_mode" data-uid="{{.ID}}" data-last-value="{{.Collaboration.Mode}}">
|
||||
@@ -39,8 +39,8 @@
|
||||
</div>
|
||||
{{end}}
|
||||
<div class="ui bottom attached segment">
|
||||
<form class="ui form" id="repo-collab-form" action="{{.Link}}" method="post">
|
||||
<div id="search-user-box" class="ui search input tw-align-middle">
|
||||
<form class="ui form flex-text-block" id="repo-collab-form" action="{{.Link}}" method="post">
|
||||
<div id="search-user-box" class="ui search input">
|
||||
<input class="prompt" name="collaborator" placeholder="{{ctx.Locale.Tr "search.user_kind"}}" autocomplete="off" autofocus required>
|
||||
</div>
|
||||
<button class="ui primary button">{{ctx.Locale.Tr "repo.settings.add_collaborator"}}</button>
|
||||
@@ -51,17 +51,17 @@
|
||||
<h4 class="ui top attached header">
|
||||
{{ctx.Locale.Tr "repo.settings.teams"}}
|
||||
</h4>
|
||||
{{$allowedToChangeTeams := (or (.Org.RepoAdminChangeTeamAccess) (.Permission.IsOwner))}}
|
||||
{{$allowedToChangeTeams := .CanChangeRepoTeamAccess}}
|
||||
{{if .Teams}}
|
||||
<div class="ui attached segment">
|
||||
<div class="flex-list">
|
||||
<div class="flex-divided-list items-with-main">
|
||||
{{range $t, $team := .Teams}}
|
||||
<div class="flex-item">
|
||||
<div class="flex-item-main">
|
||||
<a class="flex-item-title tw-text-primary" href="{{AppSubUrl}}/org/{{$.OrgName|PathEscape}}/teams/{{.LowerName|PathEscape}}">
|
||||
<div class="item">
|
||||
<div class="item-main">
|
||||
<a class="item-title tw-text-primary" href="{{AppSubUrl}}/org/{{$.OrgName|PathEscape}}/teams/{{.LowerName|PathEscape}}">
|
||||
{{.Name}}
|
||||
</a>
|
||||
<div class="flex-item-body flex-text-block">
|
||||
<div class="item-body flex-text-block">
|
||||
{{/*FIXME: TEAM-UNIT-PERMISSION this display is not right, search the fixme keyword to see more details */}}
|
||||
{{svg "octicon-shield-lock"}}
|
||||
{{if eq .AccessMode 0}}
|
||||
@@ -80,7 +80,7 @@
|
||||
</div>
|
||||
{{if or (eq .AccessMode 0) (eq .AccessMode 1) (eq .AccessMode 2)}}
|
||||
{{$first := true}}
|
||||
<div class="flex-item-body" data-tooltip-content="{{ctx.Locale.Tr "repo.settings.change_team_permission_tip"}}">
|
||||
<div class="item-body" data-tooltip-content="{{ctx.Locale.Tr "repo.settings.change_team_permission_tip"}}">
|
||||
Units:
|
||||
{{range $u, $unit := $.Units}}
|
||||
{{- if and ($.Repo.UnitEnabled ctx $unit.Type) ($team.UnitEnabled ctx $unit.Type) -}}
|
||||
@@ -93,7 +93,7 @@
|
||||
{{end}}
|
||||
</div>
|
||||
{{if $allowedToChangeTeams}}
|
||||
<div class="flex-item-trailing" {{if .IncludesAllRepositories}} data-tooltip-content="{{ctx.Locale.Tr "repo.settings.delete_team_tip"}}"{{end}}>
|
||||
<div class="item-trailing" {{if .IncludesAllRepositories}} data-tooltip-content="{{ctx.Locale.Tr "repo.settings.delete_team_tip"}}"{{end}}>
|
||||
<button class="ui red tiny button link-action {{if .IncludesAllRepositories}}disabled{{end}}" data-modal-confirm="#repo-collaborator-delete-modal" data-url="{{$.Link}}/team/delete?id={{.ID}}">
|
||||
{{ctx.Locale.Tr "repo.settings.delete_collaborator"}}
|
||||
</button>
|
||||
@@ -106,8 +106,8 @@
|
||||
{{end}}
|
||||
<div class="ui bottom attached segment">
|
||||
{{if $allowedToChangeTeams}}
|
||||
<form class="ui form" id="repo-collab-team-form" action="{{.Link}}/team" method="post">
|
||||
<div id="search-team-box" class="ui search input tw-align-middle" data-org-name="{{.OrgName}}">
|
||||
<form class="ui form flex-text-block" id="repo-collab-team-form" action="{{.Link}}/team" method="post">
|
||||
<div id="search-team-box" class="ui search input" data-org-name="{{.OrgName}}">
|
||||
<input class="prompt" name="team" placeholder="{{ctx.Locale.Tr "search.team_kind"}}" autocomplete="off" required>
|
||||
</div>
|
||||
<button class="ui primary button">{{ctx.Locale.Tr "repo.settings.add_team"}}</button>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{{template "repo/settings/layout_head" (dict "ctxData" . "pageClass" "repository settings")}}
|
||||
{{template "repo/settings/layout_head" (dict "pageClass" "repository settings")}}
|
||||
<div class="repo-setting-content">
|
||||
<h4 class="ui top attached header">
|
||||
{{ctx.Locale.Tr "repo.settings.deploy_keys"}}
|
||||
@@ -42,22 +42,22 @@
|
||||
</form>
|
||||
</div>
|
||||
{{if .Deploykeys}}
|
||||
<div class="flex-list">
|
||||
<div class="flex-divided-list items-with-main">
|
||||
{{range .Deploykeys}}
|
||||
<div class="flex-item">
|
||||
<div class="flex-item-leading">
|
||||
<div class="item">
|
||||
<div class="item-leading">
|
||||
<span class="{{if .HasRecentActivity}}tw-text-green{{end}}" {{if .HasRecentActivity}}data-tooltip-content="{{ctx.Locale.Tr "settings.key_state_desc"}}"{{end}}>{{svg "octicon-key" 32}}</span>
|
||||
</div>
|
||||
<div class="flex-item-main">
|
||||
<div class="flex-item-title">{{.Name}}</div>
|
||||
<div class="flex-item-body">
|
||||
<div class="item-main">
|
||||
<div class="item-title">{{.Name}}</div>
|
||||
<div class="item-body">
|
||||
{{.Fingerprint}}
|
||||
</div>
|
||||
<div class="flex-item-body">
|
||||
<div class="item-body">
|
||||
<i>{{ctx.Locale.Tr "settings.added_on" (DateUtils.AbsoluteShort .CreatedUnix)}} — {{svg "octicon-info"}} {{if .HasUsed}}{{ctx.Locale.Tr "settings.last_used"}} <span {{if .HasRecentActivity}}class="tw-text-green"{{end}}>{{DateUtils.AbsoluteShort .UpdatedUnix}}</span>{{else}}{{ctx.Locale.Tr "settings.no_activity"}}{{end}} - <span>{{ctx.Locale.Tr "settings.can_read_info"}}{{if not .IsReadOnly}} / {{ctx.Locale.Tr "settings.can_write_info"}} {{end}}</span></i>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-item-trailing">
|
||||
<div class="item-trailing">
|
||||
<button class="ui red tiny button link-action" data-modal-confirm="#repo-deploy-key-delete-modal" data-url="{{$.Link}}/delete?id={{.ID}}">
|
||||
{{ctx.Locale.Tr "settings.delete_key"}}
|
||||
</button>
|
||||
|
||||
@@ -1,26 +1,26 @@
|
||||
{{template "repo/settings/layout_head" (dict "ctxData" . "pageClass" "repository settings edit githook")}}
|
||||
{{template "repo/settings/layout_head" (dict "pageClass" "repository settings edit githook")}}
|
||||
<div class="repo-setting-content">
|
||||
<form class="ui form" action="{{.Link}}" method="post">
|
||||
<h4 class="ui top attached header flex-text-block tw-justify-between tw-flex-wrap">
|
||||
<h4 class="ui top attached header flex-left-right">
|
||||
{{.Hook.Name}}
|
||||
<div class="tw-font-normal tw-font-sans tw-text-base">
|
||||
{{template "repo/editor/options" dict "CodeEditorConfig" $.CodeEditorConfig}}
|
||||
</div>
|
||||
</h4>
|
||||
<div class="ui attached segment">
|
||||
<p>{{ctx.Locale.Tr "repo.settings.githook_edit_desc"}}</p>
|
||||
{{ctx.Locale.Tr "repo.settings.githook_edit_desc"}}
|
||||
</div>
|
||||
<div class="ui attached fitted segment">
|
||||
{{with .Hook}}
|
||||
<div class="field">
|
||||
<textarea id="content" name="content" class="tw-hidden"
|
||||
data-code-editor-config="{{JsonUtils.EncodeToString $.CodeEditorConfig}}"
|
||||
placeholder="{{ctx.Locale.Tr "editor.code_editor.placeholder"}}">{{if .IsActive}}{{.Content}}{{else}}{{.Sample}}{{end}}</textarea>
|
||||
<div class="editor-loading is-loading"></div>
|
||||
</div>
|
||||
<div class="inline field">
|
||||
<button class="ui primary button">{{ctx.Locale.Tr "repo.settings.update_githook"}}</button>
|
||||
</div>
|
||||
<textarea id="content" name="content" class="tw-hidden"
|
||||
data-code-editor-config="{{JsonUtils.EncodeToString $.CodeEditorConfig}}"
|
||||
placeholder="{{ctx.Locale.Tr "editor.code_editor.placeholder"}}">{{if .IsActive}}{{.Content}}{{else}}{{.Sample}}{{end}}</textarea>
|
||||
<div class="editor-loading is-loading"></div>
|
||||
{{end}}
|
||||
</div>
|
||||
<div class="ui attached segment">
|
||||
<button class="ui primary button">{{ctx.Locale.Tr "repo.settings.update_githook"}}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
{{template "repo/settings/layout_footer" .}}
|
||||
|
||||
@@ -1,16 +1,17 @@
|
||||
{{template "repo/settings/layout_head" (dict "ctxData" . "pageClass" "repository settings githooks")}}
|
||||
{{template "repo/settings/layout_head" (dict "pageClass" "repository settings githooks")}}
|
||||
<div class="repo-setting-content">
|
||||
<h4 class="ui top attached header">
|
||||
{{ctx.Locale.Tr "repo.settings.githooks"}}
|
||||
</h4>
|
||||
<div class="ui attached segment">
|
||||
<div class="ui list flex-items-block">
|
||||
<div class="item"><span>{{ctx.Locale.Tr "repo.settings.githooks_desc"}}</span></div>
|
||||
<div>{{ctx.Locale.Tr "repo.settings.githooks_desc"}}</div>
|
||||
{{if .Hooks}}<div class="divider"></div>{{end}}
|
||||
<div class="flex-divided-list">
|
||||
{{range .Hooks}}
|
||||
<div class="item">
|
||||
<div class="item flex-text-block">
|
||||
<span class="{{if .IsActive}}tw-text-green{{else}}tw-text-text-light{{end}}">{{svg "octicon-dot-fill" 22}}</span>
|
||||
<span class="gt-ellipsis tw-flex-1">{{.Name}}</span>
|
||||
<a class="muted tw-p-2" href="{{$.RepoLink}}/settings/hooks/git/{{.Name|PathEscape}}">{{svg "octicon-pencil"}}</a>
|
||||
<a class="muted tw-pr-2" href="{{$.RepoLink}}/settings/hooks/git/{{.Name|PathEscape}}">{{svg "octicon-pencil"}}</a>
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
{{template "base/head" .ctxData}}
|
||||
<div role="main" aria-label="{{.ctxData.Title}}" class="page-content {{.pageClass}}">
|
||||
{{template "repo/header" .ctxData}}
|
||||
{{template "base/head" ctx.RootData}}
|
||||
<div role="main" aria-label="{{ctx.RootData.Title}}" class="page-content {{.pageClass}}">
|
||||
{{template "repo/header" ctx.RootData}}
|
||||
<div class="ui container flex-container">
|
||||
{{template "repo/settings/navbar" .ctxData}}
|
||||
{{template "repo/settings/navbar" ctx.RootData}}
|
||||
<div class="flex-container-main">
|
||||
{{template "base/alert" .ctxData}}
|
||||
{{template "base/alert" ctx.RootData}}
|
||||
{{/* block: repo-setting-content */}}
|
||||
|
||||
{{if false}}{{/* to make html structure "likely" complete to prevent IDE warnings */}}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{{template "repo/settings/layout_head" (dict "ctxData" . "pageClass" "repository settings lfs")}}
|
||||
{{template "repo/settings/layout_head" (dict "pageClass" "repository settings lfs")}}
|
||||
<div class="repo-setting-content">
|
||||
<h4 class="ui top attached header">
|
||||
{{ctx.Locale.Tr "repo.settings.lfs_filelist"}} ({{ctx.Locale.Tr "admin.total" .Total}})
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{{template "repo/settings/layout_head" (dict "ctxData" . "pageClass" "repository settings lfs")}}
|
||||
{{template "repo/settings/layout_head" (dict "pageClass" "repository settings lfs")}}
|
||||
<div class="user-main-content twelve wide column content repository file list">
|
||||
<div class="tab-size-8 non-diff-file-content">
|
||||
<h4 class="ui top attached header">
|
||||
@@ -11,7 +11,7 @@
|
||||
<a class="ui primary tiny button" href="{{.LFSFilesLink}}/find?oid={{.LFSFile.Oid}}&size={{.LFSFile.Size}}">{{ctx.Locale.Tr "repo.settings.lfs_findcommits"}}</a>
|
||||
</div>
|
||||
</h4>
|
||||
<div class="ui bottom attached table unstackable segment">
|
||||
<div class="ui bottom attached segment file-view-container">
|
||||
{{template "repo/unicode_escape_prompt" dict "EscapeStatus" .EscapeStatus "root" $}}
|
||||
<div class="file-view {{if .IsPlainText}}plain-text{{else if .IsTextFile}}code-view{{end}}">
|
||||
{{if .IsFileTooLarge}}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{{template "repo/settings/layout_head" (dict "ctxData" . "pageClass" "repository settings lfs")}}
|
||||
{{template "repo/settings/layout_head" (dict "pageClass" "repository settings lfs")}}
|
||||
<div class="user-main-content twelve wide column content repository file list">
|
||||
<div class="tab-size-8 non-diff-file-content">
|
||||
<h4 class="ui top attached header">
|
||||
@@ -6,7 +6,7 @@
|
||||
</h4>
|
||||
<table id="lfs-files-find-table" class="ui attached segment single line table">
|
||||
<tbody>
|
||||
{{range .Results}}
|
||||
{{range $lfsItem := .Results}}
|
||||
<tr>
|
||||
<td>
|
||||
{{svg "octicon-file"}}
|
||||
@@ -14,8 +14,8 @@
|
||||
</td>
|
||||
<td class="message">
|
||||
<span class="truncate">
|
||||
<a href="{{$.RepoLink}}/commit/{{.SHA}}" title="{{.Summary}}">
|
||||
{{.Summary | ctx.RenderUtils.RenderEmoji}}
|
||||
<a href="{{$.RepoLink}}/commit/{{.SHA}}" title="{{$lfsItem.Summary}}">
|
||||
{{$lfsItem.Summary | ctx.RenderUtils.RenderEmoji}}
|
||||
</a>
|
||||
</span>
|
||||
</td>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{{template "repo/settings/layout_head" (dict "ctxData" . "pageClass" "repository settings lfs")}}
|
||||
{{template "repo/settings/layout_head" (dict "pageClass" "repository settings lfs")}}
|
||||
<div class="user-main-content twelve wide column content repository file list">
|
||||
<div class="tab-size-8 non-diff-file-content">
|
||||
<h4 class="ui top attached header">
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{{template "repo/settings/layout_head" (dict "ctxData" . "pageClass" "repository settings lfs")}}
|
||||
{{template "repo/settings/layout_head" (dict "pageClass" "repository settings lfs")}}
|
||||
<div class="repo-setting-content">
|
||||
<h4 class="ui top attached header">
|
||||
{{ctx.Locale.Tr "repo.settings.lfs_pointers.found" .NumPointers .NumAssociated .NumNotAssociated .NumNoExist}}
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
</a>
|
||||
{{end}}
|
||||
{{end}}
|
||||
<details class="item toggleable-item" {{if or .PageIsSharedSettingsRunners .PageIsSharedSettingsSecrets .PageIsSharedSettingsVariables .PageIsActionsSettingsGeneral}}open{{end}}>
|
||||
<details class="item" {{if or .PageIsSharedSettingsRunners .PageIsSharedSettingsSecrets .PageIsSharedSettingsVariables .PageIsActionsSettingsGeneral}}open{{end}}>
|
||||
<summary>{{ctx.Locale.Tr "actions.actions"}}</summary>
|
||||
<div class="menu">
|
||||
<a class="{{if .PageIsActionsSettingsGeneral}}active {{end}}item" href="{{.RepoLink}}/settings/actions/general">
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{{template "repo/settings/layout_head" (dict "ctxData" . "pageClass" "repository settings options")}}
|
||||
{{template "repo/settings/layout_head" (dict "pageClass" "repository settings options")}}
|
||||
<div class="user-main-content twelve wide column">
|
||||
<h4 class="ui top attached header">
|
||||
{{ctx.Locale.Tr "repo.settings.basic_settings"}}
|
||||
@@ -617,10 +617,34 @@
|
||||
</div>
|
||||
<div class="field">
|
||||
<div class="ui checkbox">
|
||||
<input name="pulls_allow_rebase_update" type="checkbox" {{if or (not $pullRequestEnabled) ($prUnit.PullRequestsConfig.AllowRebaseUpdate)}}checked{{end}}>
|
||||
<input name="pulls_allow_merge_update" type="checkbox" {{if $prUnit.PullRequestsConfig.AllowMergeUpdate}}checked{{end}}>
|
||||
<label>{{ctx.Locale.Tr "repo.settings.pulls.allow_merge_update"}}</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="field">
|
||||
<div class="ui checkbox">
|
||||
<input name="pulls_allow_rebase_update" type="checkbox" {{if $prUnit.PullRequestsConfig.AllowRebaseUpdate}}checked{{end}}>
|
||||
<label>{{ctx.Locale.Tr "repo.settings.pulls.allow_rebase_update"}}</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label>{{ctx.Locale.Tr "repo.settings.pulls.default_update_style"}}</label>
|
||||
<div class="ui dropdown selection">
|
||||
<select name="pulls_default_update_style">
|
||||
{{range .PullsDefaultUpdateStyleOptions}}
|
||||
<option value="{{.Value}}" {{if .Selected}}selected{{end}}>{{.Text}}</option>
|
||||
{{end}}
|
||||
</select>{{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
||||
<div class="default text">
|
||||
{{.PullsDefaultUpdateStyleText}}
|
||||
</div>
|
||||
<div class="menu">
|
||||
{{range .PullsDefaultUpdateStyleOptions}}
|
||||
<div class="item" data-value="{{.Value}}">{{.Text}}</div>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="field">
|
||||
<div class="ui checkbox">
|
||||
<input name="default_delete_branch_after_merge" type="checkbox" {{if or (not $pullRequestEnabled) ($prUnit.PullRequestsConfig.DefaultDeleteBranchAfterMerge)}}checked{{end}}>
|
||||
@@ -761,18 +785,18 @@
|
||||
{{ctx.Locale.Tr "repo.settings.danger_zone"}}
|
||||
</h4>
|
||||
<div class="ui attached error danger segment">
|
||||
<div class="flex-list">
|
||||
<div class="flex-divided-list items-with-main">
|
||||
{{if not .Repository.IsFork}}
|
||||
<div class="flex-item tw-items-center">
|
||||
<div class="flex-item-main">
|
||||
<div class="flex-item-title">{{ctx.Locale.Tr "repo.visibility"}}</div>
|
||||
<div class="item tw-items-center">
|
||||
<div class="item-main">
|
||||
<div class="item-title">{{ctx.Locale.Tr "repo.visibility"}}</div>
|
||||
{{if .Repository.IsPrivate}}
|
||||
<div class="flex-item-body">{{ctx.Locale.Tr "repo.settings.visibility.public.text"}}</div>
|
||||
<div class="item-body">{{ctx.Locale.Tr "repo.settings.visibility.public.text"}}</div>
|
||||
{{else}}
|
||||
<div class="flex-item-body">{{ctx.Locale.Tr "repo.settings.visibility.private.text"}}</div>
|
||||
<div class="item-body">{{ctx.Locale.Tr "repo.settings.visibility.private.text"}}</div>
|
||||
{{end}}
|
||||
</div>
|
||||
<div class="flex-item-trailing">
|
||||
<div class="item-trailing">
|
||||
<button class="ui basic red show-modal button" data-modal="#visibility-repo-modal">
|
||||
{{if .Repository.IsPrivate}}
|
||||
{{ctx.Locale.Tr "repo.settings.visibility.public.button"}}
|
||||
@@ -784,31 +808,31 @@
|
||||
</div>
|
||||
{{end}}
|
||||
{{if .Repository.IsMirror}}
|
||||
<div class="flex-item">
|
||||
<div class="flex-item-main">
|
||||
<div class="flex-item-title">{{ctx.Locale.Tr "repo.settings.convert"}}</div>
|
||||
<div class="flex-item-body">{{ctx.Locale.Tr "repo.settings.convert_desc"}}</div>
|
||||
<div class="item">
|
||||
<div class="item-main">
|
||||
<div class="item-title">{{ctx.Locale.Tr "repo.settings.convert"}}</div>
|
||||
<div class="item-body">{{ctx.Locale.Tr "repo.settings.convert_desc"}}</div>
|
||||
</div>
|
||||
<div class="flex-item-trailing">
|
||||
<div class="item-trailing">
|
||||
<button class="ui basic red show-modal button" data-modal="#convert-mirror-repo-modal">{{ctx.Locale.Tr "repo.settings.convert"}}</button>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
{{if .CanConvertFork}}
|
||||
<div class="flex-item">
|
||||
<div class="flex-item-main">
|
||||
<div class="flex-item-title">{{ctx.Locale.Tr "repo.settings.convert_fork"}}</div>
|
||||
<div class="flex-item-body">{{ctx.Locale.Tr "repo.settings.convert_fork_desc"}}</div>
|
||||
<div class="item">
|
||||
<div class="item-main">
|
||||
<div class="item-title">{{ctx.Locale.Tr "repo.settings.convert_fork"}}</div>
|
||||
<div class="item-body">{{ctx.Locale.Tr "repo.settings.convert_fork_desc"}}</div>
|
||||
</div>
|
||||
<div class="flex-item-trailing">
|
||||
<div class="item-trailing">
|
||||
<button class="ui basic red show-modal button" data-modal="#convert-fork-repo-modal">{{ctx.Locale.Tr "repo.settings.convert_fork"}}</button>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
<div class="flex-item">
|
||||
<div class="flex-item-main">
|
||||
<div class="flex-item-title">{{ctx.Locale.Tr "repo.settings.transfer"}}</div>
|
||||
<div class="flex-item-body">
|
||||
<div class="item">
|
||||
<div class="item-main">
|
||||
<div class="item-title">{{ctx.Locale.Tr "repo.settings.transfer"}}</div>
|
||||
<div class="item-body">
|
||||
{{if .RepoTransfer}}
|
||||
{{ctx.Locale.Tr "repo.settings.transfer_started" .RepoTransfer.Recipient.DisplayName}}
|
||||
{{else}}
|
||||
@@ -816,7 +840,7 @@
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-item-trailing">
|
||||
<div class="item-trailing">
|
||||
{{if .RepoTransfer}}
|
||||
<form class="ui form" action="{{.Link}}" method="post">
|
||||
<input type="hidden" name="action" value="cancel_transfer">
|
||||
@@ -828,37 +852,37 @@
|
||||
</div>
|
||||
</div>
|
||||
{{if .Permission.CanRead ctx.Consts.RepoUnitTypeWiki}}
|
||||
<div class="flex-item">
|
||||
<div class="flex-item-main">
|
||||
<div class="flex-item-title">{{ctx.Locale.Tr "repo.settings.wiki_delete"}}</div>
|
||||
<div class="flex-item-body">{{ctx.Locale.Tr "repo.settings.wiki_delete_desc"}}</div>
|
||||
<div class="item">
|
||||
<div class="item-main">
|
||||
<div class="item-title">{{ctx.Locale.Tr "repo.settings.wiki_delete"}}</div>
|
||||
<div class="item-body">{{ctx.Locale.Tr "repo.settings.wiki_delete_desc"}}</div>
|
||||
</div>
|
||||
<div class="flex-item-trailing">
|
||||
<div class="item-trailing">
|
||||
<button class="ui basic red show-modal button" data-modal="#delete-wiki-modal">{{ctx.Locale.Tr "repo.settings.wiki_delete"}}</button>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
<div class="flex-item">
|
||||
<div class="flex-item-main">
|
||||
<div class="flex-item-title">{{ctx.Locale.Tr "repo.settings.delete"}}</div>
|
||||
<div class="flex-item-body">{{ctx.Locale.Tr "repo.settings.delete_desc"}}</div>
|
||||
<div class="item">
|
||||
<div class="item-main">
|
||||
<div class="item-title">{{ctx.Locale.Tr "repo.settings.delete"}}</div>
|
||||
<div class="item-body">{{ctx.Locale.Tr "repo.settings.delete_desc"}}</div>
|
||||
</div>
|
||||
<div class="flex-item-trailing">
|
||||
<div class="item-trailing">
|
||||
<button class="ui basic red show-modal button" data-modal="#delete-repo-modal">{{ctx.Locale.Tr "repo.settings.delete"}}</button>
|
||||
</div>
|
||||
</div>
|
||||
{{if not .Repository.IsMirror}}
|
||||
<div class="flex-item tw-items-center">
|
||||
<div class="flex-item-main">
|
||||
<div class="item tw-items-center">
|
||||
<div class="item-main">
|
||||
{{if .Repository.IsArchived}}
|
||||
<div class="flex-item-title">{{ctx.Locale.Tr "repo.settings.unarchive.header"}}</div>
|
||||
<div class="flex-item-body">{{ctx.Locale.Tr "repo.settings.unarchive.text"}}</div>
|
||||
<div class="item-title">{{ctx.Locale.Tr "repo.settings.unarchive.header"}}</div>
|
||||
<div class="item-body">{{ctx.Locale.Tr "repo.settings.unarchive.text"}}</div>
|
||||
{{else}}
|
||||
<div class="flex-item-title">{{ctx.Locale.Tr "repo.settings.archive.header"}}</div>
|
||||
<div class="flex-item-body">{{ctx.Locale.Tr "repo.settings.archive.text"}}</div>
|
||||
<div class="item-title">{{ctx.Locale.Tr "repo.settings.archive.header"}}</div>
|
||||
<div class="item-body">{{ctx.Locale.Tr "repo.settings.archive.text"}}</div>
|
||||
{{end}}
|
||||
</div>
|
||||
<div class="flex-item-trailing">
|
||||
<div class="item-trailing">
|
||||
<button class="ui basic red show-modal button" data-modal="#archive-repo-modal">
|
||||
{{if .Repository.IsArchived}}
|
||||
{{ctx.Locale.Tr "repo.settings.unarchive.button"}}
|
||||
@@ -885,7 +909,7 @@
|
||||
<div class="ui warning message">
|
||||
{{ctx.Locale.Tr "repo.settings.convert_notices_1"}}
|
||||
</div>
|
||||
<form class="ui form" action="{{.Link}}" method="post">
|
||||
<form class="ui form form-fetch-action" action="{{.Link}}" method="post">
|
||||
<input type="hidden" name="action" value="convert">
|
||||
{{template "repo/settings/repo_name_confirm_fields" (dict "RepoName" .Repository.Name)}}
|
||||
{{template "base/modal_actions_confirm" (dict "ModalButtonDangerText" (ctx.Locale.Tr "repo.settings.convert_confirm"))}}
|
||||
@@ -902,7 +926,7 @@
|
||||
<div class="ui warning message">
|
||||
{{ctx.Locale.Tr "repo.settings.convert_fork_notices_1"}}
|
||||
</div>
|
||||
<form class="ui form" action="{{.Link}}" method="post">
|
||||
<form class="ui form form-fetch-action" action="{{.Link}}" method="post">
|
||||
<input type="hidden" name="action" value="convert_fork">
|
||||
{{template "repo/settings/repo_name_confirm_fields" (dict "RepoName" .Repository.Name)}}
|
||||
{{template "base/modal_actions_confirm" (dict "ModalButtonDangerText" (ctx.Locale.Tr "repo.settings.convert_fork_confirm"))}}
|
||||
@@ -921,7 +945,7 @@
|
||||
{{ctx.Locale.Tr "repo.settings.transfer_notices_3"}} <br>
|
||||
{{ctx.Locale.Tr "repo.settings.transfer_notices_4"}}
|
||||
</div>
|
||||
<form class="ui form" action="{{.Link}}" method="post">
|
||||
<form class="ui form form-fetch-action" action="{{.Link}}" method="post">
|
||||
<input type="hidden" name="action" value="transfer">
|
||||
{{template "repo/settings/repo_name_confirm_fields" (dict "RepoName" .Repository.Name)}}
|
||||
<div class="required field">
|
||||
@@ -946,7 +970,7 @@
|
||||
{{ctx.Locale.Tr "repo.settings.delete_notices_fork_1"}}
|
||||
{{end}}
|
||||
</div>
|
||||
<form class="ui form" action="{{.Link}}" method="post">
|
||||
<form class="ui form form-fetch-action" action="{{.Link}}" method="post">
|
||||
<input type="hidden" name="action" value="delete">
|
||||
{{template "repo/settings/repo_name_confirm_fields" (dict "RepoName" .Repository.Name)}}
|
||||
{{template "base/modal_actions_confirm" (dict "ModalButtonDangerText" (ctx.Locale.Tr "repo.settings.confirm_delete"))}}
|
||||
@@ -1012,7 +1036,7 @@
|
||||
{{ctx.Locale.Tr "repo.settings.delete_notices_1"}}<br>
|
||||
{{ctx.Locale.Tr "repo.settings.wiki_delete_notices_1" .Repository.Name}}
|
||||
</div>
|
||||
<form class="ui form" action="{{.Link}}" method="post">
|
||||
<form class="ui form form-fetch-action" action="{{.Link}}" method="post">
|
||||
<input type="hidden" name="action" value="delete-wiki">
|
||||
{{template "repo/settings/repo_name_confirm_fields" (dict "RepoName" .Repository.Name)}}
|
||||
{{template "base/modal_actions_confirm" (dict "ModalButtonDangerText" (ctx.Locale.Tr "repo.settings.confirm_wiki_delete"))}}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{{template "repo/settings/layout_head" (dict "ctxData" . "pageClass" "repository settings branches")}}
|
||||
{{template "repo/settings/layout_head" (dict "pageClass" "repository settings branches")}}
|
||||
<div class="repo-setting-content">
|
||||
<form class="ui form" action="{{.Link}}" method="post">
|
||||
<h4 class="ui top attached header">
|
||||
@@ -305,6 +305,49 @@
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
<h5 class="ui dividing header">{{ctx.Locale.Tr "repo.settings.protect_bypass_allowlist"}}</h5>
|
||||
<div class="grouped fields">
|
||||
<div class="field">
|
||||
<div class="ui checkbox">
|
||||
<input name="enable_bypass_allowlist" type="checkbox" class="toggle-target-enabled" data-target="#bypass_allowlist_box" {{if .Rule.EnableBypassAllowlist}}checked{{end}}>
|
||||
<label>{{ctx.Locale.Tr "repo.settings.protect_enable_bypass_allowlist"}}</label>
|
||||
<p class="help">{{ctx.Locale.Tr "repo.settings.protect_enable_bypass_allowlist_desc"}}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div id="bypass_allowlist_box" class="grouped fields {{if not .Rule.EnableBypassAllowlist}}disabled{{end}}">
|
||||
<div class="checkbox-sub-item field">
|
||||
<label>{{ctx.Locale.Tr "repo.settings.protect_bypass_allowlist_users"}}</label>
|
||||
<div class="ui multiple search selection dropdown">
|
||||
<input type="hidden" name="bypass_allowlist_users" value="{{.bypass_allowlist_users}}">
|
||||
<div class="default text">{{ctx.Locale.Tr "search.user_kind"}}</div>
|
||||
<div class="menu">
|
||||
{{range .Users}}
|
||||
<div class="item" data-value="{{.ID}}">
|
||||
{{ctx.AvatarUtils.Avatar . 28 "mini"}}{{template "repo/search_name" .}}
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{if .Owner.IsOrganization}}
|
||||
<div class="checkbox-sub-item field">
|
||||
<label>{{ctx.Locale.Tr "repo.settings.protect_bypass_allowlist_teams"}}</label>
|
||||
<div class="ui multiple search selection dropdown">
|
||||
<input type="hidden" name="bypass_allowlist_teams" value="{{.bypass_allowlist_teams}}">
|
||||
<div class="default text">{{ctx.Locale.Tr "search.team_kind"}}</div>
|
||||
<div class="menu">
|
||||
{{range .Teams}}
|
||||
<div class="item" data-value="{{.ID}}">
|
||||
{{svg "octicon-people"}}
|
||||
{{.Name}}
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="field">
|
||||
<div class="ui checkbox">
|
||||
<input name="block_on_rejected_reviews" type="checkbox" {{if .Rule.BlockOnRejectedReviews}}checked{{end}}>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{{template "repo/settings/layout_head" (dict "ctxData" . "pageClass" "repository settings")}}
|
||||
{{template "repo/settings/layout_head" (dict "pageClass" "repository settings")}}
|
||||
<div class="repo-setting-content">
|
||||
<h4 class="ui top attached header">
|
||||
{{ctx.Locale.Tr "repo.settings.public_access"}}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{{template "repo/settings/layout_head" (dict "ctxData" . "pageClass" "repository settings runners")}}
|
||||
{{template "repo/settings/layout_head" (dict "pageClass" "repository settings runners")}}
|
||||
<div class="repo-setting-content">
|
||||
{{template "shared/actions/runner_edit" .}}
|
||||
</div>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{{template "repo/settings/layout_head" (dict "ctxData" . "pageClass" "repository settings")}}
|
||||
{{template "repo/settings/layout_head" (dict "pageClass" "repository settings")}}
|
||||
<div class="repo-setting-content">
|
||||
{{template "shared/secrets/add_list" .}}
|
||||
</div>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{{template "repo/settings/layout_head" (dict "ctxData" . "pageClass" "repository settings edit")}}
|
||||
{{template "repo/settings/layout_head" (dict "pageClass" "repository settings edit")}}
|
||||
<div class="repo-setting-content">
|
||||
{{if .Repository.IsArchived}}
|
||||
<div class="ui warning message tw-text-center">
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{{template "repo/settings/layout_head" (dict "ctxData" . "pageClass" "repository settings webhooks")}}
|
||||
{{template "repo/settings/layout_head" (dict "pageClass" "repository settings webhooks")}}
|
||||
<div class="repo-setting-content">
|
||||
{{template "repo/settings/webhook/base_list" .}}
|
||||
</div>
|
||||
|
||||
@@ -8,17 +8,18 @@
|
||||
</div>
|
||||
</h4>
|
||||
<div class="ui attached segment">
|
||||
<div class="ui list flex-items-block">
|
||||
<div class="item"><span>{{.Description}}</span></div>
|
||||
<div>{{.Description}}</div>
|
||||
{{if .Webhooks}}<div class="divider"></div>{{end}}
|
||||
<div class="flex-divided-list">
|
||||
{{range .Webhooks}}
|
||||
<div class="item">
|
||||
<div class="item flex-text-block">
|
||||
<span class="{{if eq .LastStatus 1}}tw-text-green{{else if eq .LastStatus 2}}tw-text-red{{else}}tw-text-text-light{{end}}">{{svg "octicon-dot-fill" 22}}</span>
|
||||
<div class="gt-ellipsis tw-flex-1">
|
||||
<a title="{{.URL}}" href="{{$.BaseLink}}/{{.ID}}">{{or .Name (ctx.Locale.Tr "repo.settings.webhook.name_empty")}}</a>
|
||||
<span class="tw-ml-2 tw-text-grey-light">{{.URL}}</span>
|
||||
</div>
|
||||
<a class="muted tw-p-2" href="{{$.BaseLink}}/{{.ID}}">{{svg "octicon-pencil"}}</a>
|
||||
<a class="tw-text-red tw-p-2 link-action"
|
||||
<a class="muted" href="{{$.BaseLink}}/{{.ID}}">{{svg "octicon-pencil"}}</a>
|
||||
<a class="tw-text-red tw-pr-2 link-action"
|
||||
data-url="{{$.Link}}/delete?id={{.ID}}"
|
||||
data-modal-confirm="{{ctx.Locale.Tr "repo.settings.webhook_deletion_desc"}}"
|
||||
>{{svg "octicon-trash"}}</a>
|
||||
|
||||
@@ -1,23 +1,19 @@
|
||||
{{$isNew:=or .PageIsSettingsHooksNew .PageIsAdminDefaultHooksNew .PageIsAdminSystemHooksNew}}
|
||||
{{if .PageIsSettingsHooksEdit}}
|
||||
<h4 class="ui top attached header">
|
||||
{{ctx.Locale.Tr "repo.settings.recent_deliveries"}}
|
||||
<h4 class="ui top attached header flex-left-right">
|
||||
<span>{{ctx.Locale.Tr "repo.settings.recent_deliveries"}}</span>
|
||||
{{if .Permission.IsAdmin}}
|
||||
<div class="ui right">
|
||||
<!-- the button is wrapped with a span because the tooltip doesn't show on hover if we put data-tooltip-content directly on the button -->
|
||||
<span data-tooltip-content="{{if or $isNew .Webhook.IsActive}}{{ctx.Locale.Tr "repo.settings.webhook.test_delivery_desc"}}{{else}}{{ctx.Locale.Tr "repo.settings.webhook.test_delivery_desc_disabled"}}{{end}}">
|
||||
<button class="ui tiny button{{if not (or $isNew .Webhook.IsActive)}} disabled{{end}}" id="test-delivery" data-link="{{.Link}}/test" data-redirect="{{.Link}}">
|
||||
<span class="text">{{ctx.Locale.Tr "repo.settings.webhook.test_delivery"}}</span>
|
||||
</button>
|
||||
</span>
|
||||
</div>
|
||||
<button class="ui tiny button" id="test-delivery" data-link="{{.Link}}/test"
|
||||
data-tooltip-content="{{ctx.Locale.Tr "repo.settings.webhook.test_delivery_desc"}}"
|
||||
>
|
||||
{{ctx.Locale.Tr "repo.settings.webhook.test_delivery"}}
|
||||
</button>
|
||||
{{end}}
|
||||
</h4>
|
||||
<div class="ui attached segment">
|
||||
<div class="ui list">
|
||||
<div class="flex-divided-list">
|
||||
{{range .History}}
|
||||
<div class="item">
|
||||
<div class="flex-text-block tw-justify-between">
|
||||
<div class="flex-left-right">
|
||||
<div class="flex-text-inline">
|
||||
{{if .IsSucceed}}
|
||||
<span class="tw-text-green">{{svg "octicon-check"}}</span>
|
||||
@@ -32,8 +28,8 @@
|
||||
{{DateUtils.TimeSince .Delivered}}
|
||||
</span>
|
||||
</div>
|
||||
<div class="info tw-hidden" id="info-{{.ID}}">
|
||||
<div class="ui top attached tabular menu">
|
||||
<div class="info tw-hidden tw-mt-2" id="info-{{.ID}}">
|
||||
<div class="ui top attached tabular menu" data-global-init="initTabSwitcher">
|
||||
<a class="item active" data-tab="request-{{.ID}}">
|
||||
{{template "shared/misc/tabtitle" (ctx.Locale.Tr "repo.settings.webhook.request")}}
|
||||
</a>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{{template "repo/settings/layout_head" (dict "ctxData" . "pageClass" "repository settings new webhook")}}
|
||||
{{template "repo/settings/layout_head" (dict "pageClass" "repository settings new webhook")}}
|
||||
<div class="repo-setting-content">
|
||||
{{$CustomHeaderTitle := ctx.Locale.Tr "repo.settings.update_webhook"}}
|
||||
{{if .PageIsSettingsHooksNew}}{{$CustomHeaderTitle = ctx.Locale.Tr "repo.settings.add_webhook"}}{{end}}
|
||||
{{template "webhook/new" (dict "ctxData" . "CustomHeaderTitle" $CustomHeaderTitle)}}
|
||||
{{template "webhook/new" (dict "CustomHeaderTitle" $CustomHeaderTitle)}}
|
||||
</div>
|
||||
{{template "repo/settings/layout_footer" .}}
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
<form class="flex-text-inline" hx-boost="true" hx-target="this" method="post" action="{{$.RepoLink}}/action/{{if $.IsStaringRepo}}unstar{{else}}star{{end}}">
|
||||
<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}}
|
||||
<button type="submit" class="ui compact small basic button"{{if not $.IsSigned}} disabled{{end}} aria-label="{{$buttonText}}">
|
||||
{{svg (Iif $.IsStaringRepo "octicon-star-fill" "octicon-star")}}
|
||||
<span class="not-mobile" aria-hidden="true">{{$buttonText}}</span>
|
||||
</button>
|
||||
<a hx-boost="false" class="ui basic label" href="{{$.RepoLink}}/stars">
|
||||
{{CountFmt .Repository.NumStars}}
|
||||
</a>
|
||||
</div>
|
||||
</form>
|
||||
@@ -1,14 +1,5 @@
|
||||
<!-- Refresh the content if a htmx response contains "HX-Trigger" header.
|
||||
This usually happens when a user stays on the watchers/stargazers page
|
||||
when they watched/unwatched/starred/unstarred and the list should be refreshed.
|
||||
To test go to the watchers page and click the watch button. The user cards should reload.
|
||||
At the moment, no JS initialization would re-trigger (fortunately there is no JS for this page).
|
||||
-->
|
||||
<div class="no-loading-indicator tw-hidden"></div>
|
||||
<div class="user-cards"
|
||||
hx-trigger="refreshUserCards from:body" hx-indicator=".no-loading-indicator"
|
||||
hx-get="" hx-swap="outerHTML" hx-select=".user-cards"
|
||||
>
|
||||
{{/* need to reload after "watch/unwatch" or "star/unstar" fetch actions */}}
|
||||
<div class="user-cards" id="user-cards-container" data-fetch-trigger="fetch-reload">
|
||||
{{if .CardsTitle}}
|
||||
<h2 class="ui dividing header">
|
||||
{{.CardsTitle}}
|
||||
|
||||
@@ -92,13 +92,13 @@
|
||||
<button class="ui dropdown basic compact jump button tw-px-3" data-tooltip-content="{{ctx.Locale.Tr "repo.more_operations"}}">
|
||||
{{svg "octicon-kebab-horizontal"}}
|
||||
<div class="menu">
|
||||
<a class="item" data-clipboard-text="{{.Repository.Link}}/src/commit/{{.CommitID}}/{{PathEscapeSegments .TreePath}}" data-clipboard-text-type="url">
|
||||
<a class="item" data-clipboard-text="{{.Repository.HTMLURL ctx}}/src/commit/{{.CommitID}}/{{PathEscapeSegments .TreePath}}">
|
||||
{{svg "octicon-link" 16}}{{ctx.Locale.Tr "repo.file_copy_permalink"}}
|
||||
</a>
|
||||
{{if and (not $.DisableDownloadSourceArchives) $.RefFullName}}
|
||||
<div class="divider"></div>
|
||||
<a class="item muted archive-link" href="{{$.RepoLink}}/archive/{{PathEscapeSegments $.RefFullName.ShortName}}.zip?path={{PathEscapeSegments .TreePath}}" rel="nofollow">{{svg "octicon-file-zip"}}{{ctx.Locale.Tr "repo.download_directory_as" "ZIP"}}</a>
|
||||
<a class="item muted archive-link" href="{{$.RepoLink}}/archive/{{PathEscapeSegments $.RefFullName.ShortName}}.tar.gz?path={{PathEscapeSegments .TreePath}}" rel="nofollow">{{svg "octicon-file-zip"}}{{ctx.Locale.Tr "repo.download_directory_as" "TAR.GZ"}}</a>
|
||||
<a class="item muted archive-link" href="{{$.RepoLink}}/archive/{{PathEscapeSegments $.RefFullName.ShortName}}.zip?path={{.TreePath}}" rel="nofollow">{{svg "octicon-file-zip"}}{{ctx.Locale.Tr "repo.download_directory_as" "ZIP"}}</a>
|
||||
<a class="item muted archive-link" href="{{$.RepoLink}}/archive/{{PathEscapeSegments $.RefFullName.ShortName}}.tar.gz?path={{.TreePath}}" rel="nofollow">{{svg "octicon-file-zip"}}{{ctx.Locale.Tr "repo.download_directory_as" "TAR.GZ"}}</a>
|
||||
{{end}}
|
||||
{{if and .Repository.CanContentChange (not $isTreePathRoot)}}
|
||||
<div class="divider"></div>
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
{{end}}
|
||||
|
||||
{{if not .ReadmeInList}}
|
||||
<div id="repo-file-commit-box" class="ui segment list-header tw-mb-4 tw-flex tw-justify-between">
|
||||
<div id="repo-file-commit-box" class="ui segment list-header tw-mb-4 flex-left-right">
|
||||
{{template "repo/latest_commit" .}}
|
||||
{{if .LatestCommit}}
|
||||
{{if .LatestCommit.Committer}}
|
||||
@@ -25,7 +25,7 @@
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
<h4 class="file-header ui top attached header tw-flex tw-items-center tw-justify-between tw-flex-wrap">
|
||||
<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">
|
||||
{{if .ReadmeInList}}
|
||||
{{svg "octicon-book" 16 "tw-mr-2"}}
|
||||
@@ -91,7 +91,7 @@
|
||||
</div>
|
||||
</h4>
|
||||
|
||||
<div class="ui bottom attached table unstackable segment">
|
||||
<div class="ui bottom attached segment file-view-container">
|
||||
{{if not .RenderAsMarkup}}
|
||||
{{template "repo/unicode_escape_prompt" dict "EscapeStatus" .EscapeStatus}}
|
||||
{{end}}
|
||||
@@ -142,7 +142,7 @@
|
||||
|
||||
<div class="code-line-menu tippy-target">
|
||||
{{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>
|
||||
<a class="item ref-in-new-issue" role="menuitem" data-url-issue-new="{{.RepoLink}}/issues/new" data-url-param-body-link="{{.Repository.HTMLURL ctx}}/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 view_git_blame" role="menuitem" href="{{.Repository.Link}}/blame/commit/{{PathEscape .CommitID}}/{{PathEscapeSegments .TreePath}}">{{ctx.Locale.Tr "repo.view_git_blame"}}</a>
|
||||
<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>
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
{{/* use grid layout, still use the old ID because there are many other CSS styles depending on this ID */}}
|
||||
<div id="repo-files-table" {{if .HasFilesWithoutLatestCommit}}hx-indicator="#repo-files-table .repo-file-cell.message" hx-trigger="load" hx-swap="morph" hx-post="{{.LastCommitLoaderURL}}"{{end}}>
|
||||
<div id="repo-files-table"
|
||||
{{if .HasFilesWithoutLatestCommit}}
|
||||
data-fetch-url="{{.LastCommitLoaderURL}}"
|
||||
data-fetch-trigger="load" data-fetch-sync="$morph"
|
||||
data-fetch-indicator=".repo-file-cell.notready.message"
|
||||
{{end}}
|
||||
>
|
||||
<div class="repo-file-line repo-file-last-commit">
|
||||
{{template "repo/latest_commit" .}}
|
||||
<div>{{if and .LatestCommit .LatestCommit.Committer}}{{DateUtils.TimeSince .LatestCommit.Committer.When}}{{end}}</div>
|
||||
@@ -15,7 +21,7 @@
|
||||
{{$entry := $item.Entry}}
|
||||
{{$commit := $item.Commit}}
|
||||
{{$submoduleFile := $item.SubmoduleFile}}
|
||||
<div class="repo-file-cell name muted-links {{if not $commit}}notready{{end}}">
|
||||
<div class="repo-file-cell name muted-links">
|
||||
{{index $.FileIcons $entry.Name}}
|
||||
{{if $entry.IsSubModule}}
|
||||
{{$submoduleLink := $submoduleFile.SubmoduleWebLinkTree ctx}}
|
||||
@@ -47,10 +53,10 @@
|
||||
{{end}}
|
||||
{{end}}
|
||||
</div>
|
||||
<div class="repo-file-cell message commit-summary loading-icon-2px">
|
||||
<div class="repo-file-cell message commit-summary {{if not $commit}}notready{{end}}">
|
||||
{{if $commit}}
|
||||
{{$commitLink := printf "%s/commit/%s" $.RepoLink (PathEscape $commit.ID.String)}}
|
||||
{{ctx.RenderUtils.RenderCommitMessageLinkSubject $commit.Message $commitLink $.Repository}}
|
||||
{{ctx.RenderUtils.RenderCommitMessageLinkSubject $commit.MessageUTF8 $commitLink $.Repository}}
|
||||
{{else}}
|
||||
… {{/* will be loaded again by LastCommitLoaderURL */}}
|
||||
{{end}}
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
<form class="flex-text-inline" hx-boost="true" hx-target="this" method="post" action="{{$.RepoLink}}/action/{{if $.IsWatchingRepo}}unwatch{{else}}watch{{end}}">
|
||||
<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}}
|
||||
<button type="submit" class="ui compact small basic button"{{if not $.IsSigned}} disabled{{end}} aria-label="{{$buttonText}}">
|
||||
{{svg "octicon-eye"}}
|
||||
<span class="not-mobile" aria-hidden="true">{{$buttonText}}</span>
|
||||
</button>
|
||||
<a hx-boost="false" class="ui basic label" href="{{.RepoLink}}/watchers">
|
||||
{{CountFmt .Repository.NumWatches}}
|
||||
</a>
|
||||
</div>
|
||||
</form>
|
||||
@@ -3,7 +3,7 @@
|
||||
{{template "repo/header" .}}
|
||||
<div class="ui container">
|
||||
{{template "base/alert" .}}
|
||||
<div class="ui header flex-text-block tw-justify-between">
|
||||
<div class="ui header flex-left-right">
|
||||
{{ctx.Locale.Tr "repo.wiki.new_page"}}
|
||||
{{if .PageIsWikiEdit}}
|
||||
<a class="ui tiny primary button" href="{{.RepoLink}}/wiki?action=_new">{{ctx.Locale.Tr "repo.wiki.new_page_button"}}</a>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<div role="main" aria-label="{{.Title}}" class="page-content repository wiki pages">
|
||||
{{template "repo/header" .}}
|
||||
<div class="ui container">
|
||||
<h2 class="ui header tw-flex tw-items-center tw-justify-between">
|
||||
<h2 class="ui header flex-left-right">
|
||||
<span>{{ctx.Locale.Tr "repo.wiki.pages"}}</span>
|
||||
<span>
|
||||
{{if and .CanWriteWiki (not .Repository.IsMirror)}}
|
||||
|
||||
@@ -3,14 +3,14 @@
|
||||
{{template "repo/header" .}}
|
||||
{{$title := .title}}
|
||||
<div class="ui container">
|
||||
<div class="ui dividing header flex-text-block tw-flex-wrap tw-justify-between">
|
||||
<div class="ui dividing header flex-left-right">
|
||||
<div class="flex-text-block">
|
||||
<a class="ui basic button tw-px-3" title="{{ctx.Locale.Tr "repo.wiki.back_to_wiki"}}" href="{{.RepoLink}}/wiki/{{.PageURL}}">{{svg "octicon-home"}}</a>
|
||||
<div class="tw-flex-1 gt-ellipsis">
|
||||
{{$title}}
|
||||
<div class="ui sub header gt-ellipsis">
|
||||
{{$timeSince := DateUtils.TimeSince .Author.When}}
|
||||
{{ctx.Locale.Tr "repo.wiki.last_commit_info" .Author.Name $timeSince}}
|
||||
{{$timeSince := DateUtils.TimeSince .Committer.When}}
|
||||
{{ctx.Locale.Tr "repo.wiki.last_commit_info" .Committer.Name $timeSince}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -37,8 +37,8 @@
|
||||
<div class="tw-flex-1 gt-ellipsis">
|
||||
{{$title}}
|
||||
<div class="ui sub header gt-ellipsis">
|
||||
{{$timeSince := DateUtils.TimeSince .Author.When}}
|
||||
{{ctx.Locale.Tr "repo.wiki.last_commit_info" .Author.Name $timeSince}}
|
||||
{{$timeSince := DateUtils.TimeSince .Committer.When}}
|
||||
{{ctx.Locale.Tr "repo.wiki.last_commit_info" .Committer.Name $timeSince}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user