diff options
Diffstat (limited to 'templates/repo')
130 files changed, 1820 insertions, 1820 deletions
diff --git a/templates/repo/actions/list.tmpl b/templates/repo/actions/list.tmpl index 9d256820ae..9e0f0051a0 100644 --- a/templates/repo/actions/list.tmpl +++ b/templates/repo/actions/list.tmpl @@ -7,7 +7,7 @@ <div class="ui stackable grid"> <div class="four wide column"> <div class="ui fluid vertical menu"> - <a class="item{{if not $.CurWorkflow}} active{{end}}" href="{{$.Link}}?actor={{$.CurActor}}&status={{$.CurStatus}}">{{.locale.Tr "actions.runs.all_workflows"}}</a> + <a class="item{{if not $.CurWorkflow}} active{{end}}" href="{{$.Link}}?actor={{$.CurActor}}&status={{$.CurStatus}}">{{ctx.Locale.Tr "actions.runs.all_workflows"}}</a> {{range .workflows}} <a class="item{{if eq .Entry.Name $.CurWorkflow}} active{{end}}" href="{{$.Link}}?workflow={{.Entry.Name}}&actor={{$.CurActor}}&status={{$.CurStatus}}">{{.Entry.Name}} {{if .ErrMsg}} @@ -17,7 +17,7 @@ {{end}} {{if $.ActionsConfig.IsWorkflowDisabled .Entry.Name}} - <div class="ui red label">{{$.locale.Tr "disabled"}}</div> + <div class="ui red label">{{ctx.Locale.Tr "disabled"}}</div> {{end}} </a> {{end}} @@ -27,15 +27,15 @@ <div class="ui secondary filter menu gt-je gt-df gt-ac"> <!-- Actor --> <div class="ui{{if not .Actors}} disabled{{end}} dropdown jump item"> - <span class="text">{{.locale.Tr "actions.runs.actor"}}</span> + <span class="text">{{ctx.Locale.Tr "actions.runs.actor"}}</span> {{svg "octicon-triangle-down" 14 "dropdown icon"}} <div class="menu"> <div class="ui icon search input"> <i class="icon">{{svg "octicon-search"}}</i> - <input type="text" placeholder="{{.locale.Tr "actions.runs.actor"}}"> + <input type="text" placeholder="{{ctx.Locale.Tr "actions.runs.actor"}}"> </div> <a class="item{{if not $.CurActor}} active{{end}}" href="{{$.Link}}?workflow={{$.CurWorkflow}}&status={{$.CurStatus}}&actor=0"> - {{.locale.Tr "actions.runs.actors_no_select"}} + {{ctx.Locale.Tr "actions.runs.actors_no_select"}} </a> {{range .Actors}} <a class="item{{if eq .ID $.CurActor}} active{{end}}" href="{{$.Link}}?workflow={{$.CurWorkflow}}&actor={{.ID}}&status={{$.CurStatus}}"> @@ -46,15 +46,15 @@ </div> <!-- Status --> <div class="ui dropdown jump item"> - <span class="text">{{.locale.Tr "actions.runs.status"}}</span> + <span class="text">{{ctx.Locale.Tr "actions.runs.status"}}</span> {{svg "octicon-triangle-down" 14 "dropdown icon"}} <div class="menu"> <div class="ui icon search input"> <i class="icon">{{svg "octicon-search"}}</i> - <input type="text" placeholder="{{.locale.Tr "actions.runs.status"}}"> + <input type="text" placeholder="{{ctx.Locale.Tr "actions.runs.status"}}"> </div> <a class="item{{if not $.CurStatus}} active{{end}}" href="{{$.Link}}?workflow={{$.CurWorkflow}}&actor={{$.CurActor}}&status=0"> - {{.locale.Tr "actions.runs.status_no_select"}} + {{ctx.Locale.Tr "actions.runs.status_no_select"}} </a> {{range .StatusInfoList}} <a class="item{{if eq .Status $.CurStatus}} active{{end}}" href="{{$.Link}}?workflow={{$.CurWorkflow}}&actor={{$.CurActor}}&status={{.Status}}"> @@ -69,7 +69,7 @@ {{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}}{{.locale.Tr "actions.workflow.enable"}}{{else}}{{.locale.Tr "actions.workflow.disable"}}{{end}} + {{if .CurWorkflowDisabled}}{{ctx.Locale.Tr "actions.workflow.enable"}}{{else}}{{.locale.Tr "actions.workflow.disable"}}{{end}} </a> </div> </button> diff --git a/templates/repo/actions/runs_list.tmpl b/templates/repo/actions/runs_list.tmpl index 34b9547029..df8dba0309 100644 --- a/templates/repo/actions/runs_list.tmpl +++ b/templates/repo/actions/runs_list.tmpl @@ -2,7 +2,7 @@ {{if eq (len .Runs) 0}} <div class="empty center"> {{svg "octicon-no-entry" 48}} - <h2>{{if $.IsFiltered}}{{.locale.Tr "actions.runs.no_results"}}{{else}}{{.locale.Tr "actions.runs.no_runs"}}{{end}}</h2> + <h2>{{if $.IsFiltered}}{{ctx.Locale.Tr "actions.runs.no_results"}}{{else}}{{.locale.Tr "actions.runs.no_runs"}}{{end}}</h2> </div> {{end}} {{range .Runs}} @@ -17,11 +17,11 @@ <div class="flex-item-body"> <b>{{if not $.CurWorkflow}}{{.WorkflowID}} {{end}}#{{.Index}}</b>: {{- if .ScheduleID -}} - {{$.locale.Tr "actions.runs.scheduled"}} + {{ctx.Locale.Tr "actions.runs.scheduled"}} {{- else -}} - {{$.locale.Tr "actions.runs.commit"}} + {{ctx.Locale.Tr "actions.runs.commit"}} <a href="{{$.RepoLink}}/commit/{{.CommitSHA}}">{{ShortSha .CommitSHA}}</a> - {{$.locale.Tr "actions.runs.pushed_by"}} + {{ctx.Locale.Tr "actions.runs.pushed_by"}} <a href="{{.TriggerUser.HomeLink}}">{{.TriggerUser.GetDisplayName}}</a> {{- end -}} </div> diff --git a/templates/repo/actions/view.tmpl b/templates/repo/actions/view.tmpl index 7b07aa155b..6b07e7000a 100644 --- a/templates/repo/actions/view.tmpl +++ b/templates/repo/actions/view.tmpl @@ -6,23 +6,23 @@ data-run-index="{{.RunIndex}}" data-job-index="{{.JobIndex}}" data-actions-url="{{.ActionsURL}}" - data-locale-approve="{{.locale.Tr "repo.diff.review.approve"}}" - data-locale-cancel="{{.locale.Tr "cancel"}}" - data-locale-rerun="{{.locale.Tr "rerun"}}" - data-locale-rerun-all="{{.locale.Tr "rerun_all"}}" - data-locale-status-unknown="{{.locale.Tr "actions.status.unknown"}}" - data-locale-status-waiting="{{.locale.Tr "actions.status.waiting"}}" - data-locale-status-running="{{.locale.Tr "actions.status.running"}}" - data-locale-status-success="{{.locale.Tr "actions.status.success"}}" - data-locale-status-failure="{{.locale.Tr "actions.status.failure"}}" - data-locale-status-cancelled="{{.locale.Tr "actions.status.cancelled"}}" - data-locale-status-skipped="{{.locale.Tr "actions.status.skipped"}}" - data-locale-status-blocked="{{.locale.Tr "actions.status.blocked"}}" - data-locale-artifacts-title="{{$.locale.Tr "artifacts"}}" - data-locale-show-timestamps="{{.locale.Tr "show_timestamps"}}" - data-locale-show-log-seconds="{{.locale.Tr "show_log_seconds"}}" - data-locale-show-full-screen="{{.locale.Tr "show_full_screen"}}" - data-locale-download-logs="{{.locale.Tr "download_logs"}}" + data-locale-approve="{{ctx.Locale.Tr "repo.diff.review.approve"}}" + data-locale-cancel="{{ctx.Locale.Tr "cancel"}}" + data-locale-rerun="{{ctx.Locale.Tr "rerun"}}" + data-locale-rerun-all="{{ctx.Locale.Tr "rerun_all"}}" + 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-success="{{ctx.Locale.Tr "actions.status.success"}}" + data-locale-status-failure="{{ctx.Locale.Tr "actions.status.failure"}}" + data-locale-status-cancelled="{{ctx.Locale.Tr "actions.status.cancelled"}}" + data-locale-status-skipped="{{ctx.Locale.Tr "actions.status.skipped"}}" + data-locale-status-blocked="{{ctx.Locale.Tr "actions.status.blocked"}}" + data-locale-artifacts-title="{{ctx.Locale.Tr "artifacts"}}" + data-locale-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"}}" > </div> </div> diff --git a/templates/repo/activity.tmpl b/templates/repo/activity.tmpl index 444f21e779..252ca0264d 100644 --- a/templates/repo/activity.tmpl +++ b/templates/repo/activity.tmpl @@ -7,24 +7,24 @@ <!-- Period --> <div class="ui floating dropdown jump filter"> <div class="ui basic compact button"> - {{.locale.Tr "repo.activity.period.filter_label"}} <strong>{{.PeriodText}}</strong> + {{ctx.Locale.Tr "repo.activity.period.filter_label"}} <strong>{{.PeriodText}}</strong> {{svg "octicon-triangle-down" 14 "dropdown icon"}} </div> <div class="menu"> - <a class="{{if eq .Period "daily"}}active {{end}}item" href="{{$.RepoLink}}/activity/daily">{{.locale.Tr "repo.activity.period.daily"}}</a> - <a class="{{if eq .Period "halfweekly"}}active {{end}}item" href="{{$.RepoLink}}/activity/halfweekly">{{.locale.Tr "repo.activity.period.halfweekly"}}</a> - <a class="{{if eq .Period "weekly"}}active {{end}}item" href="{{$.RepoLink}}/activity/weekly">{{.locale.Tr "repo.activity.period.weekly"}}</a> - <a class="{{if eq .Period "monthly"}}active {{end}}item" href="{{$.RepoLink}}/activity/monthly">{{.locale.Tr "repo.activity.period.monthly"}}</a> - <a class="{{if eq .Period "quarterly"}}active {{end}}item" href="{{$.RepoLink}}/activity/quarterly">{{.locale.Tr "repo.activity.period.quarterly"}}</a> - <a class="{{if eq .Period "semiyearly"}}active {{end}}item" href="{{$.RepoLink}}/activity/semiyearly">{{.locale.Tr "repo.activity.period.semiyearly"}}</a> - <a class="{{if eq .Period "yearly"}}active {{end}}item" href="{{$.RepoLink}}/activity/yearly">{{.locale.Tr "repo.activity.period.yearly"}}</a> + <a class="{{if eq .Period "daily"}}active {{end}}item" href="{{$.RepoLink}}/activity/daily">{{ctx.Locale.Tr "repo.activity.period.daily"}}</a> + <a class="{{if eq .Period "halfweekly"}}active {{end}}item" href="{{$.RepoLink}}/activity/halfweekly">{{ctx.Locale.Tr "repo.activity.period.halfweekly"}}</a> + <a class="{{if eq .Period "weekly"}}active {{end}}item" href="{{$.RepoLink}}/activity/weekly">{{ctx.Locale.Tr "repo.activity.period.weekly"}}</a> + <a class="{{if eq .Period "monthly"}}active {{end}}item" href="{{$.RepoLink}}/activity/monthly">{{ctx.Locale.Tr "repo.activity.period.monthly"}}</a> + <a class="{{if eq .Period "quarterly"}}active {{end}}item" href="{{$.RepoLink}}/activity/quarterly">{{ctx.Locale.Tr "repo.activity.period.quarterly"}}</a> + <a class="{{if eq .Period "semiyearly"}}active {{end}}item" href="{{$.RepoLink}}/activity/semiyearly">{{ctx.Locale.Tr "repo.activity.period.semiyearly"}}</a> + <a class="{{if eq .Period "yearly"}}active {{end}}item" href="{{$.RepoLink}}/activity/yearly">{{ctx.Locale.Tr "repo.activity.period.yearly"}}</a> </div> </div> </h2> <div class="divider"></div> {{if (or (.Permission.CanRead $.UnitTypeIssues) (.Permission.CanRead $.UnitTypePullRequests))}} - <h4 class="ui top attached header">{{.locale.Tr "repo.activity.overview"}}</h4> + <h4 class="ui top attached header">{{ctx.Locale.Tr "repo.activity.overview"}}</h4> <div class="ui attached segment two column grid"> {{if .Permission.CanRead $.UnitTypePullRequests}} <div class="column"> @@ -38,7 +38,7 @@ <a class="table-cell tiny background light grey"></a> </div> {{end}} - {{.locale.TrN .Activity.ActivePRCount "repo.activity.active_prs_count_1" "repo.activity.active_prs_count_n" .Activity.ActivePRCount | Safe}} + {{ctx.Locale.TrN .Activity.ActivePRCount "repo.activity.active_prs_count_1" "repo.activity.active_prs_count_n" .Activity.ActivePRCount | Safe}} </div> {{end}} {{if .Permission.CanRead $.UnitTypeIssues}} @@ -53,7 +53,7 @@ <a class="table-cell tiny background light grey"></a> </div> {{end}} - {{.locale.TrN .Activity.ActiveIssueCount "repo.activity.active_issues_count_1" "repo.activity.active_issues_count_n" .Activity.ActiveIssueCount | Safe}} + {{ctx.Locale.TrN .Activity.ActiveIssueCount "repo.activity.active_issues_count_1" "repo.activity.active_issues_count_n" .Activity.ActiveIssueCount | Safe}} </div> {{end}} </div> @@ -61,21 +61,21 @@ {{if .Permission.CanRead $.UnitTypePullRequests}} <a href="#merged-pull-requests" class="ui attached segment text center"> <span class="text purple">{{svg "octicon-git-pull-request"}}</span> <strong>{{.Activity.MergedPRCount}}</strong><br> - {{.locale.TrN .Activity.MergedPRCount "repo.activity.merged_prs_count_1" "repo.activity.merged_prs_count_n"}} + {{ctx.Locale.TrN .Activity.MergedPRCount "repo.activity.merged_prs_count_1" "repo.activity.merged_prs_count_n"}} </a> <a href="#proposed-pull-requests" class="ui attached segment text center"> <span class="text green">{{svg "octicon-git-branch"}}</span> <strong>{{.Activity.OpenedPRCount}}</strong><br> - {{.locale.TrN .Activity.OpenedPRCount "repo.activity.opened_prs_count_1" "repo.activity.opened_prs_count_n"}} + {{ctx.Locale.TrN .Activity.OpenedPRCount "repo.activity.opened_prs_count_1" "repo.activity.opened_prs_count_n"}} </a> {{end}} {{if .Permission.CanRead $.UnitTypeIssues}} <a href="#closed-issues" class="ui attached segment text center"> <span class="text red">{{svg "octicon-issue-closed"}}</span> <strong>{{.Activity.ClosedIssueCount}}</strong><br> - {{.locale.TrN .Activity.ClosedIssueCount "repo.activity.closed_issues_count_1" "repo.activity.closed_issues_count_n"}} + {{ctx.Locale.TrN .Activity.ClosedIssueCount "repo.activity.closed_issues_count_1" "repo.activity.closed_issues_count_n"}} </a> <a href="#new-issues" class="ui attached segment text center"> <span class="text green">{{svg "octicon-issue-opened"}}</span> <strong>{{.Activity.OpenedIssueCount}}</strong><br> - {{.locale.TrN .Activity.OpenedIssueCount "repo.activity.new_issues_count_1" "repo.activity.new_issues_count_n"}} + {{ctx.Locale.TrN .Activity.OpenedIssueCount "repo.activity.new_issues_count_1" "repo.activity.new_issues_count_n"}} </a> {{end}} </div> @@ -84,26 +84,26 @@ {{if .Permission.CanRead $.UnitTypeCode}} {{if eq .Activity.Code.CommitCountInAllBranches 0}} <div class="ui center aligned segment"> - <h4 class="ui header">{{.locale.Tr "repo.activity.no_git_activity"}}</h4> + <h4 class="ui header">{{ctx.Locale.Tr "repo.activity.no_git_activity"}}</h4> </div> {{end}} {{if gt .Activity.Code.CommitCountInAllBranches 0}} <div class="ui attached segment horizontal segments"> <div class="ui attached segment text"> - {{.locale.Tr "repo.activity.git_stats_exclude_merges"}} - <strong>{{.locale.TrN .Activity.Code.AuthorCount "repo.activity.git_stats_author_1" "repo.activity.git_stats_author_n" .Activity.Code.AuthorCount}}</strong> - {{.locale.TrN .Activity.Code.AuthorCount "repo.activity.git_stats_pushed_1" "repo.activity.git_stats_pushed_n"}} - <strong>{{.locale.TrN .Activity.Code.CommitCount "repo.activity.git_stats_commit_1" "repo.activity.git_stats_commit_n" .Activity.Code.CommitCount}}</strong> - {{.locale.Tr "repo.activity.git_stats_push_to_branch" .Repository.DefaultBranch}} - <strong>{{.locale.TrN .Activity.Code.CommitCountInAllBranches "repo.activity.git_stats_commit_1" "repo.activity.git_stats_commit_n" .Activity.Code.CommitCountInAllBranches}}</strong> - {{.locale.Tr "repo.activity.git_stats_push_to_all_branches"}} - {{.locale.Tr "repo.activity.git_stats_on_default_branch" .Repository.DefaultBranch}} - <strong>{{.locale.TrN .Activity.Code.ChangedFiles "repo.activity.git_stats_file_1" "repo.activity.git_stats_file_n" .Activity.Code.ChangedFiles}}</strong> - {{.locale.TrN .Activity.Code.ChangedFiles "repo.activity.git_stats_files_changed_1" "repo.activity.git_stats_files_changed_n"}} - {{.locale.Tr "repo.activity.git_stats_additions"}} - <strong class="text green">{{.locale.TrN .Activity.Code.Additions "repo.activity.git_stats_addition_1" "repo.activity.git_stats_addition_n" .Activity.Code.Additions}}</strong> - {{.locale.Tr "repo.activity.git_stats_and_deletions"}} - <strong class="text red">{{.locale.TrN .Activity.Code.Deletions "repo.activity.git_stats_deletion_1" "repo.activity.git_stats_deletion_n" .Activity.Code.Deletions}}</strong>. + {{ctx.Locale.Tr "repo.activity.git_stats_exclude_merges"}} + <strong>{{ctx.Locale.TrN .Activity.Code.AuthorCount "repo.activity.git_stats_author_1" "repo.activity.git_stats_author_n" .Activity.Code.AuthorCount}}</strong> + {{ctx.Locale.TrN .Activity.Code.AuthorCount "repo.activity.git_stats_pushed_1" "repo.activity.git_stats_pushed_n"}} + <strong>{{ctx.Locale.TrN .Activity.Code.CommitCount "repo.activity.git_stats_commit_1" "repo.activity.git_stats_commit_n" .Activity.Code.CommitCount}}</strong> + {{ctx.Locale.Tr "repo.activity.git_stats_push_to_branch" .Repository.DefaultBranch}} + <strong>{{ctx.Locale.TrN .Activity.Code.CommitCountInAllBranches "repo.activity.git_stats_commit_1" "repo.activity.git_stats_commit_n" .Activity.Code.CommitCountInAllBranches}}</strong> + {{ctx.Locale.Tr "repo.activity.git_stats_push_to_all_branches"}} + {{ctx.Locale.Tr "repo.activity.git_stats_on_default_branch" .Repository.DefaultBranch}} + <strong>{{ctx.Locale.TrN .Activity.Code.ChangedFiles "repo.activity.git_stats_file_1" "repo.activity.git_stats_file_n" .Activity.Code.ChangedFiles}}</strong> + {{ctx.Locale.TrN .Activity.Code.ChangedFiles "repo.activity.git_stats_files_changed_1" "repo.activity.git_stats_files_changed_n"}} + {{ctx.Locale.Tr "repo.activity.git_stats_additions"}} + <strong class="text green">{{ctx.Locale.TrN .Activity.Code.Additions "repo.activity.git_stats_addition_1" "repo.activity.git_stats_addition_n" .Activity.Code.Additions}}</strong> + {{ctx.Locale.Tr "repo.activity.git_stats_and_deletions"}} + <strong class="text red">{{ctx.Locale.TrN .Activity.Code.Deletions "repo.activity.git_stats_deletion_1" "repo.activity.git_stats_deletion_n" .Activity.Code.Deletions}}</strong>. </div> <div class="ui attached segment"> <div id="repo-activity-top-authors-chart"></div> @@ -115,15 +115,15 @@ {{if gt .Activity.PublishedReleaseCount 0}} <h4 class="divider divider-text gt-normal-case" id="published-releases"> {{svg "octicon-tag" 16 "gt-mr-3"}} - {{.locale.Tr "repo.activity.title.releases_published_by" - (.locale.TrN .Activity.PublishedReleaseCount "repo.activity.title.releases_1" "repo.activity.title.releases_n" .Activity.PublishedReleaseCount) - (.locale.TrN .Activity.PublishedReleaseAuthorCount "repo.activity.title.user_1" "repo.activity.title.user_n" .Activity.PublishedReleaseAuthorCount) + {{ctx.Locale.Tr "repo.activity.title.releases_published_by" + (ctx.Locale.TrN .Activity.PublishedReleaseCount "repo.activity.title.releases_1" "repo.activity.title.releases_n" .Activity.PublishedReleaseCount) + (ctx.Locale.TrN .Activity.PublishedReleaseAuthorCount "repo.activity.title.user_1" "repo.activity.title.user_n" .Activity.PublishedReleaseAuthorCount) }} </h4> <div class="list"> {{range .Activity.PublishedReleases}} <p class="desc"> - <span class="ui green label">{{$.locale.Tr "repo.activity.published_release_label"}}</span> + <span class="ui green label">{{ctx.Locale.Tr "repo.activity.published_release_label"}}</span> {{.TagName}} {{if not .IsTag}} <a class="title" href="{{$.RepoLink}}/src/{{.TagName | PathEscapeSegments}}">{{.Title | RenderEmoji $.Context}}</a> @@ -137,15 +137,15 @@ {{if gt .Activity.MergedPRCount 0}} <h4 class="divider divider-text gt-normal-case" id="merged-pull-requests"> {{svg "octicon-git-pull-request" 16 "gt-mr-3"}} - {{.locale.Tr "repo.activity.title.prs_merged_by" - (.locale.TrN .Activity.MergedPRCount "repo.activity.title.prs_1" "repo.activity.title.prs_n" .Activity.MergedPRCount) - (.locale.TrN .Activity.MergedPRAuthorCount "repo.activity.title.user_1" "repo.activity.title.user_n" .Activity.MergedPRAuthorCount) + {{ctx.Locale.Tr "repo.activity.title.prs_merged_by" + (ctx.Locale.TrN .Activity.MergedPRCount "repo.activity.title.prs_1" "repo.activity.title.prs_n" .Activity.MergedPRCount) + (ctx.Locale.TrN .Activity.MergedPRAuthorCount "repo.activity.title.user_1" "repo.activity.title.user_n" .Activity.MergedPRAuthorCount) }} </h4> <div class="list"> {{range .Activity.MergedPRs}} <p class="desc"> - <span class="ui purple label">{{$.locale.Tr "repo.activity.merged_prs_label"}}</span> + <span class="ui purple label">{{ctx.Locale.Tr "repo.activity.merged_prs_label"}}</span> #{{.Index}} <a class="title" href="{{$.RepoLink}}/pulls/{{.Index}}">{{.Issue.Title | RenderEmoji $.Context}}</a> {{TimeSinceUnix .MergedUnix $.locale}} </p> @@ -156,15 +156,15 @@ {{if gt .Activity.OpenedPRCount 0}} <h4 class="divider divider-text gt-normal-case" id="proposed-pull-requests"> {{svg "octicon-git-branch" 16 "gt-mr-3"}} - {{.locale.Tr "repo.activity.title.prs_opened_by" - (.locale.TrN .Activity.OpenedPRCount "repo.activity.title.prs_1" "repo.activity.title.prs_n" .Activity.OpenedPRCount) - (.locale.TrN .Activity.OpenedPRAuthorCount "repo.activity.title.user_1" "repo.activity.title.user_n" .Activity.OpenedPRAuthorCount) + {{ctx.Locale.Tr "repo.activity.title.prs_opened_by" + (ctx.Locale.TrN .Activity.OpenedPRCount "repo.activity.title.prs_1" "repo.activity.title.prs_n" .Activity.OpenedPRCount) + (ctx.Locale.TrN .Activity.OpenedPRAuthorCount "repo.activity.title.user_1" "repo.activity.title.user_n" .Activity.OpenedPRAuthorCount) }} </h4> <div class="list"> {{range .Activity.OpenedPRs}} <p class="desc"> - <span class="ui green label">{{$.locale.Tr "repo.activity.opened_prs_label"}}</span> + <span class="ui green label">{{ctx.Locale.Tr "repo.activity.opened_prs_label"}}</span> #{{.Index}} <a class="title" href="{{$.RepoLink}}/pulls/{{.Index}}">{{.Issue.Title | RenderEmoji $.Context}}</a> {{TimeSinceUnix .Issue.CreatedUnix $.locale}} </p> @@ -175,15 +175,15 @@ {{if gt .Activity.ClosedIssueCount 0}} <h4 class="divider divider-text gt-normal-case" id="closed-issues"> {{svg "octicon-issue-closed" 16 "gt-mr-3"}} - {{.locale.Tr "repo.activity.title.issues_closed_from" - (.locale.TrN .Activity.ClosedIssueCount "repo.activity.title.issues_1" "repo.activity.title.issues_n" .Activity.ClosedIssueCount) - (.locale.TrN .Activity.ClosedIssueAuthorCount "repo.activity.title.user_1" "repo.activity.title.user_n" .Activity.ClosedIssueAuthorCount) + {{ctx.Locale.Tr "repo.activity.title.issues_closed_from" + (ctx.Locale.TrN .Activity.ClosedIssueCount "repo.activity.title.issues_1" "repo.activity.title.issues_n" .Activity.ClosedIssueCount) + (ctx.Locale.TrN .Activity.ClosedIssueAuthorCount "repo.activity.title.user_1" "repo.activity.title.user_n" .Activity.ClosedIssueAuthorCount) }} </h4> <div class="list"> {{range .Activity.ClosedIssues}} <p class="desc"> - <span class="ui red label">{{$.locale.Tr "repo.activity.closed_issue_label"}}</span> + <span class="ui red label">{{ctx.Locale.Tr "repo.activity.closed_issue_label"}}</span> #{{.Index}} <a class="title" href="{{$.RepoLink}}/issues/{{.Index}}">{{.Title | RenderEmoji $.Context}}</a> {{TimeSinceUnix .ClosedUnix $.locale}} </p> @@ -194,15 +194,15 @@ {{if gt .Activity.OpenedIssueCount 0}} <h4 class="divider divider-text gt-normal-case" id="new-issues"> {{svg "octicon-issue-opened" 16 "gt-mr-3"}} - {{.locale.Tr "repo.activity.title.issues_created_by" - (.locale.TrN .Activity.OpenedIssueCount "repo.activity.title.issues_1" "repo.activity.title.issues_n" .Activity.OpenedIssueCount) - (.locale.TrN .Activity.OpenedIssueAuthorCount "repo.activity.title.user_1" "repo.activity.title.user_n" .Activity.OpenedIssueAuthorCount) + {{ctx.Locale.Tr "repo.activity.title.issues_created_by" + (ctx.Locale.TrN .Activity.OpenedIssueCount "repo.activity.title.issues_1" "repo.activity.title.issues_n" .Activity.OpenedIssueCount) + (ctx.Locale.TrN .Activity.OpenedIssueAuthorCount "repo.activity.title.user_1" "repo.activity.title.user_n" .Activity.OpenedIssueAuthorCount) }} </h4> <div class="list"> {{range .Activity.OpenedIssues}} <p class="desc"> - <span class="ui green label">{{$.locale.Tr "repo.activity.new_issue_label"}}</span> + <span class="ui green label">{{ctx.Locale.Tr "repo.activity.new_issue_label"}}</span> #{{.Index}} <a class="title" href="{{$.RepoLink}}/issues/{{.Index}}">{{.Title | RenderEmoji $.Context}}</a> {{TimeSinceUnix .CreatedUnix $.locale}} </p> @@ -211,14 +211,14 @@ {{end}} {{if gt .Activity.UnresolvedIssueCount 0}} - <h4 class="divider divider-text gt-normal-case" id="unresolved-conversations" data-tooltip-content="{{.locale.Tr "repo.activity.unresolved_conv_desc"}}"> + <h4 class="divider divider-text gt-normal-case" id="unresolved-conversations" data-tooltip-content="{{ctx.Locale.Tr "repo.activity.unresolved_conv_desc"}}"> {{svg "octicon-comment-discussion" 16 "gt-mr-3"}} - {{.locale.TrN .Activity.UnresolvedIssueCount "repo.activity.title.unresolved_conv_1" "repo.activity.title.unresolved_conv_n" .Activity.UnresolvedIssueCount}} + {{ctx.Locale.TrN .Activity.UnresolvedIssueCount "repo.activity.title.unresolved_conv_1" "repo.activity.title.unresolved_conv_n" .Activity.UnresolvedIssueCount}} </h4> <div class="list"> {{range .Activity.UnresolvedIssues}} <p class="desc"> - <span class="ui green label">{{$.locale.Tr "repo.activity.unresolved_conv_label"}}</span> + <span class="ui green label">{{ctx.Locale.Tr "repo.activity.unresolved_conv_label"}}</span> #{{.Index}} {{if .IsPull}} <a class="title" href="{{$.RepoLink}}/pulls/{{.Index}}">{{.Title | RenderEmoji $.Context}}</a> diff --git a/templates/repo/blame.tmpl b/templates/repo/blame.tmpl index f164900f08..31cd5b23f6 100644 --- a/templates/repo/blame.tmpl +++ b/templates/repo/blame.tmpl @@ -2,11 +2,11 @@ {{$revsFileLink := URLJoin .RepoLink "src" .BranchNameSubURL "/.git-blame-ignore-revs"}} {{if .UsesIgnoreRevs}} <div class="ui info message"> - <p>{{.locale.Tr "repo.blame.ignore_revs" $revsFileLink (print $revsFileLink "?bypass-blame-ignore=true") | Str2html}}</p> + <p>{{ctx.Locale.Tr "repo.blame.ignore_revs" $revsFileLink (print $revsFileLink "?bypass-blame-ignore=true") | Str2html}}</p> </div> {{else}} <div class="ui error message"> - <p>{{.locale.Tr "repo.blame.ignore_revs.failed" $revsFileLink | Str2html}}</p> + <p>{{ctx.Locale.Tr "repo.blame.ignore_revs.failed" $revsFileLink | Str2html}}</p> </div> {{end}} {{end}} @@ -17,14 +17,14 @@ </div> <div class="file-header-right file-actions gt-df gt-ac gt-fw"> <div class="ui buttons"> - <a class="ui tiny button" href="{{$.RawFileLink}}">{{.locale.Tr "repo.file_raw"}}</a> + <a class="ui tiny button" href="{{$.RawFileLink}}">{{ctx.Locale.Tr "repo.file_raw"}}</a> {{if not .IsViewCommit}} - <a class="ui tiny button" href="{{.RepoLink}}/src/commit/{{.CommitID | PathEscape}}/{{.TreePath | PathEscapeSegments}}">{{.locale.Tr "repo.file_permalink"}}</a> + <a class="ui tiny button" href="{{.RepoLink}}/src/commit/{{.CommitID | PathEscape}}/{{.TreePath | PathEscapeSegments}}">{{ctx.Locale.Tr "repo.file_permalink"}}</a> {{end}} - <a class="ui tiny button" href="{{.RepoLink}}/src/{{.BranchNameSubURL}}/{{.TreePath | PathEscapeSegments}}">{{.locale.Tr "repo.normal_view"}}</a> - <a class="ui tiny button" href="{{.RepoLink}}/commits/{{.BranchNameSubURL}}/{{.TreePath | PathEscapeSegments}}">{{.locale.Tr "repo.file_history"}}</a> - <button class="ui tiny button unescape-button">{{.locale.Tr "repo.unescape_control_characters"}}</button> - <button class="ui tiny button escape-button gt-hidden">{{.locale.Tr "repo.escape_control_characters"}}</button> + <a class="ui tiny button" href="{{.RepoLink}}/src/{{.BranchNameSubURL}}/{{.TreePath | PathEscapeSegments}}">{{ctx.Locale.Tr "repo.normal_view"}}</a> + <a class="ui tiny button" href="{{.RepoLink}}/commits/{{.BranchNameSubURL}}/{{.TreePath | PathEscapeSegments}}">{{ctx.Locale.Tr "repo.file_history"}}</a> + <button class="ui tiny button unescape-button">{{ctx.Locale.Tr "repo.unescape_control_characters"}}</button> + <button class="ui tiny button escape-button gt-hidden">{{ctx.Locale.Tr "repo.escape_control_characters"}}</button> </div> </div> </h4> @@ -53,7 +53,7 @@ </td> <td class="lines-blame-btn"> {{if $row.PreviousSha}} - <a href="{{$row.PreviousShaURL}}" data-tooltip-content='{{$.locale.Tr "repo.blame_prior"}}'> + <a href="{{$row.PreviousShaURL}}" data-tooltip-content='{{ctx.Locale.Tr "repo.blame_prior"}}'> {{svg "octicon-versions"}} </a> {{end}} diff --git a/templates/repo/branch/list.tmpl b/templates/repo/branch/list.tmpl index d47c9f9686..b883589bf7 100644 --- a/templates/repo/branch/list.tmpl +++ b/templates/repo/branch/list.tmpl @@ -6,9 +6,9 @@ {{template "repo/sub_menu" .}} {{if .DefaultBranchBranch}} <h4 class="ui top attached header"> - {{.locale.Tr "repo.default_branch"}} + {{ctx.Locale.Tr "repo.default_branch"}} {{if and $.IsWriter (not $.Repository.IsArchived) (not .IsDeleted)}} - <a role="button" class="right" href="{{.RepoLink}}/settings/branches" data-tooltip-content="{{.locale.Tr "repo.settings.branches.switch_default_branch"}}"> + <a role="button" class="right" href="{{.RepoLink}}/settings/branches" data-tooltip-content="{{ctx.Locale.Tr "repo.settings.branches.switch_default_branch"}}"> {{svg "octicon-arrow-switch"}} </a> {{end}} @@ -27,7 +27,7 @@ <button class="btn interact-fg gt-p-3" data-clipboard-text="{{.DefaultBranchBranch.DBBranch.Name}}">{{svg "octicon-copy" 14}}</button> {{template "repo/commit_statuses" dict "Status" (index $.CommitStatus .DefaultBranchBranch.DBBranch.CommitID) "Statuses" (index $.CommitStatuses .DefaultBranchBranch.DBBranch.CommitID)}} </div> - <p class="info gt-df gt-ac gt-my-2">{{svg "octicon-git-commit" 16 "gt-mr-2"}}<a href="{{.RepoLink}}/commit/{{PathEscape .DefaultBranchBranch.DBBranch.CommitID}}">{{ShortSha .DefaultBranchBranch.DBBranch.CommitID}}</a> · <span class="commit-message">{{RenderCommitMessage $.Context .DefaultBranchBranch.DBBranch.CommitMessage .RepoLink .Repository.ComposeMetas}}</span> · {{.locale.Tr "org.repo_updated"}} {{TimeSince .DefaultBranchBranch.DBBranch.CommitTime.AsTime .locale}}{{if .DefaultBranchBranch.DBBranch.Pusher}} {{template "shared/user/avatarlink" dict "user" .DefaultBranchBranch.DBBranch.Pusher}}{{template "shared/user/namelink" .DefaultBranchBranch.DBBranch.Pusher}}{{end}}</p> + <p class="info gt-df gt-ac gt-my-2">{{svg "octicon-git-commit" 16 "gt-mr-2"}}<a href="{{.RepoLink}}/commit/{{PathEscape .DefaultBranchBranch.DBBranch.CommitID}}">{{ShortSha .DefaultBranchBranch.DBBranch.CommitID}}</a> · <span class="commit-message">{{RenderCommitMessage $.Context .DefaultBranchBranch.DBBranch.CommitMessage .RepoLink .Repository.ComposeMetas}}</span> · {{ctx.Locale.Tr "org.repo_updated"}} {{TimeSince .DefaultBranchBranch.DBBranch.CommitTime.AsTime .locale}}{{if .DefaultBranchBranch.DBBranch.Pusher}} {{template "shared/user/avatarlink" dict "user" .DefaultBranchBranch.DBBranch.Pusher}}{{template "shared/user/namelink" .DefaultBranchBranch.DBBranch.Pusher}}{{end}}</p> </td> <td class="right aligned middle aligned overflow-visible"> {{if and $.IsWriter (not $.Repository.IsArchived) (not .IsDeleted)}} @@ -35,7 +35,7 @@ data-modal="#create-branch-modal" data-branch-from="{{$.DefaultBranchBranch.DBBranch.Name}}" data-branch-from-urlcomponent="{{PathEscapeSegments $.DefaultBranchBranch.DBBranch.Name}}" - data-tooltip-content="{{$.locale.Tr "repo.branch.new_branch_from" ($.DefaultBranchBranch.DBBranch.Name)}}" + data-tooltip-content="{{ctx.Locale.Tr "repo.branch.new_branch_from" ($.DefaultBranchBranch.DBBranch.Name)}}" > {{svg "octicon-git-branch"}} </button> @@ -44,7 +44,7 @@ <a role="button" class="btn interact-bg gt-p-3" href="{{$.FeedURL}}/rss/branch/{{PathEscapeSegments .DefaultBranchBranch.DBBranch.Name}}">{{svg "octicon-rss"}}</a> {{end}} {{if not $.DisableDownloadSourceArchives}} - <div class="ui dropdown btn interact-bg gt-p-3" data-tooltip-content="{{$.locale.Tr "repo.branch.download" ($.DefaultBranchBranch.DBBranch.Name)}}"> + <div class="ui dropdown btn interact-bg gt-p-3" data-tooltip-content="{{ctx.Locale.Tr "repo.branch.download" ($.DefaultBranchBranch.DBBranch.Name)}}"> {{svg "octicon-download"}} <div class="menu"> <a class="item archive-link" href="{{$.RepoLink}}/archive/{{PathEscapeSegments $.DefaultBranchBranch.DBBranch.Name}}.zip" rel="nofollow">{{svg "octicon-file-zip"}} ZIP</a> @@ -57,7 +57,7 @@ data-is-default-branch="true" data-modal="#rename-branch-modal" data-old-branch-name="{{$.DefaultBranchBranch.DBBranch.Name}}" - data-tooltip-content="{{$.locale.Tr "repo.branch.rename" ($.DefaultBranchBranch.DBBranch.Name)}}" + data-tooltip-content="{{ctx.Locale.Tr "repo.branch.rename" ($.DefaultBranchBranch.DBBranch.Name)}}" > {{svg "octicon-pencil"}} </button> @@ -72,14 +72,14 @@ {{if .Branches}} <h4 class="ui top attached header gt-df gt-ac gt-sb"> <div class="gt-df gt-ac"> - {{.locale.Tr "repo.branches"}} + {{ctx.Locale.Tr "repo.branches"}} </div> <div class="gt-whitespace-nowrap"> <form class="ignore-dirty" method="get"> <div class="ui tiny search input"> - <input name="q" placeholder="{{.locale.Tr "repo.branch.search"}}" value="{{.Keyword}}" autofocus> + <input name="q" placeholder="{{ctx.Locale.Tr "repo.branch.search"}}" value="{{.Keyword}}" autofocus> </div> - <button class="ui primary tiny button gt-mr-0" data-tooltip-content={{.locale.Tr "repo.commits.search.tooltip"}}>{{.locale.Tr "repo.commits.find"}}</button> + <button class="ui primary tiny button gt-mr-0" data-tooltip-content={{ctx.Locale.Tr "repo.commits.search.tooltip"}}>{{.locale.Tr "repo.commits.find"}}</button> </form> </div> </h4> @@ -95,7 +95,7 @@ <a class="gt-ellipsis" href="{{$.RepoLink}}/src/branch/{{PathEscapeSegments .DBBranch.Name}}">{{.DBBranch.Name}}</a> <button class="btn interact-fg gt-p-3" data-clipboard-text="{{.DBBranch.Name}}">{{svg "octicon-copy" 14}}</button> </div> - <p class="info">{{$.locale.Tr "repo.branch.deleted_by" .DBBranch.DeletedBy.Name}} {{TimeSinceUnix .DBBranch.DeletedUnix $.locale}}</p> + <p class="info">{{ctx.Locale.Tr "repo.branch.deleted_by" .DBBranch.DeletedBy.Name}} {{TimeSinceUnix .DBBranch.DeletedUnix $.locale}}</p> {{else}} {{if .IsProtected}} {{svg "octicon-shield-lock"}} @@ -105,7 +105,7 @@ <button class="btn interact-fg gt-p-3" data-clipboard-text="{{.DBBranch.Name}}">{{svg "octicon-copy" 14}}</button> {{template "repo/commit_statuses" dict "Status" (index $.CommitStatus .DBBranch.CommitID) "Statuses" (index $.CommitStatuses .DBBranch.CommitID)}} </div> - <p class="info gt-df gt-ac gt-my-2">{{svg "octicon-git-commit" 16 "gt-mr-2"}}<a href="{{$.RepoLink}}/commit/{{PathEscape .DBBranch.CommitID}}">{{ShortSha .DBBranch.CommitID}}</a> · <span class="commit-message">{{RenderCommitMessage $.Context .DBBranch.CommitMessage $.RepoLink $.Repository.ComposeMetas}}</span> · {{$.locale.Tr "org.repo_updated"}} {{TimeSince .DBBranch.CommitTime.AsTime $.locale}}{{if .DBBranch.Pusher}} {{template "shared/user/avatarlink" dict "user" .DBBranch.Pusher}} {{template "shared/user/namelink" .DBBranch.Pusher}}{{end}}</p> + <p class="info gt-df gt-ac gt-my-2">{{svg "octicon-git-commit" 16 "gt-mr-2"}}<a href="{{$.RepoLink}}/commit/{{PathEscape .DBBranch.CommitID}}">{{ShortSha .DBBranch.CommitID}}</a> · <span class="commit-message">{{RenderCommitMessage $.Context .DBBranch.CommitMessage $.RepoLink $.Repository.ComposeMetas}}</span> · {{ctx.Locale.Tr "org.repo_updated"}} {{TimeSince .DBBranch.CommitTime.AsTime $.locale}}{{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"> @@ -126,28 +126,28 @@ <td class="two wide right aligned"> {{if not .LatestPullRequest}} {{if .IsIncluded}} - <span class="ui orange large label" data-tooltip-content="{{$.locale.Tr "repo.branch.included_desc"}}"> - {{svg "octicon-git-pull-request"}} {{$.locale.Tr "repo.branch.included"}} + <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="{{$.RepoLink}}/compare/{{PathEscapeSegments $.DefaultBranchBranch.DBBranch.Name}}...{{if ne $.Repository.Owner.Name $.Owner.Name}}{{PathEscape $.Owner.Name}}:{{end}}{{PathEscapeSegments .DBBranch.Name}}"> - <button id="new-pull-request" class="ui compact basic button gt-mr-0">{{if $.CanPull}}{{$.locale.Tr "repo.pulls.compare_changes"}}{{else}}{{$.locale.Tr "action.compare_branch"}}{{end}}</button> + <button id="new-pull-request" class="ui compact basic button gt-mr-0">{{if $.CanPull}}{{ctx.Locale.Tr "repo.pulls.compare_changes"}}{{else}}{{ctx.Locale.Tr "action.compare_branch"}}{{end}}</button> </a> {{end}} {{else if and .LatestPullRequest.HasMerged .MergeMovedOn}} {{if and (not .DBBranch.IsDeleted) $.AllowsPulls (gt .CommitsAhead 0)}} <a href="{{$.RepoLink}}/compare/{{PathEscapeSegments $.DefaultBranchBranch.DBBranch.Name}}...{{if ne $.Repository.Owner.Name $.Owner.Name}}{{PathEscape $.Owner.Name}}:{{end}}{{PathEscapeSegments .DBBranch.Name}}"> - <button id="new-pull-request" class="ui compact basic button gt-mr-0">{{if $.CanPull}}{{$.locale.Tr "repo.pulls.compare_changes"}}{{else}}{{$.locale.Tr "action.compare_branch"}}{{end}}</button> + <button id="new-pull-request" class="ui compact basic button gt-mr-0">{{if $.CanPull}}{{ctx.Locale.Tr "repo.pulls.compare_changes"}}{{else}}{{ctx.Locale.Tr "action.compare_branch"}}{{end}}</button> </a> {{end}} {{else}} <a href="{{.LatestPullRequest.Issue.Link}}" class="gt-vm ref-issue">{{if not .LatestPullRequest.IsSameRepo}}{{.LatestPullRequest.BaseRepo.FullName}}{{end}}#{{.LatestPullRequest.Issue.Index}}</a> {{if .LatestPullRequest.HasMerged}} - <a href="{{.LatestPullRequest.Issue.Link}}" class="ui purple large label">{{svg "octicon-git-merge" 16 "gt-mr-2"}}{{$.locale.Tr "repo.pulls.merged"}}</a> + <a href="{{.LatestPullRequest.Issue.Link}}" class="ui purple large label">{{svg "octicon-git-merge" 16 "gt-mr-2"}}{{ctx.Locale.Tr "repo.pulls.merged"}}</a> {{else if .LatestPullRequest.Issue.IsClosed}} - <a href="{{.LatestPullRequest.Issue.Link}}" class="ui red large label">{{svg "octicon-git-pull-request" 16 "gt-mr-2"}}{{$.locale.Tr "repo.issues.closed_title"}}</a> + <a href="{{.LatestPullRequest.Issue.Link}}" class="ui red large label">{{svg "octicon-git-pull-request" 16 "gt-mr-2"}}{{ctx.Locale.Tr "repo.issues.closed_title"}}</a> {{else}} - <a href="{{.LatestPullRequest.Issue.Link}}" class="ui green large label">{{svg "octicon-git-pull-request" 16 "gt-mr-2"}}{{$.locale.Tr "repo.issues.open_title"}}</a> + <a href="{{.LatestPullRequest.Issue.Link}}" class="ui green large label">{{svg "octicon-git-pull-request" 16 "gt-mr-2"}}{{ctx.Locale.Tr "repo.issues.open_title"}}</a> {{end}} {{end}} </td> @@ -156,7 +156,7 @@ <button class="btn interact-bg gt-p-3 show-modal show-create-branch-modal" data-branch-from="{{.DBBranch.Name}}" data-branch-from-urlcomponent="{{PathEscapeSegments .DBBranch.Name}}" - data-tooltip-content="{{$.locale.Tr "repo.branch.new_branch_from" .DBBranch.Name}}" + data-tooltip-content="{{ctx.Locale.Tr "repo.branch.new_branch_from" .DBBranch.Name}}" data-modal="#create-branch-modal" data-name="{{.DBBranch.Name}}" > {{svg "octicon-git-branch"}} @@ -166,7 +166,7 @@ <a role="button" class="btn interact-bg gt-p-3" href="{{$.FeedURL}}/rss/branch/{{PathEscapeSegments .DBBranch.Name}}">{{svg "octicon-rss"}}</a> {{end}} {{if and (not .DBBranch.IsDeleted) (not $.DisableDownloadSourceArchives)}} - <div class="ui dropdown btn interact-bg gt-p-3" data-tooltip-content="{{$.locale.Tr "repo.branch.download" (.DBBranch.Name)}}"> + <div class="ui dropdown btn interact-bg gt-p-3" data-tooltip-content="{{ctx.Locale.Tr "repo.branch.download" (.DBBranch.Name)}}"> {{svg "octicon-download"}} <div class="menu"> <a class="item archive-link" href="{{$.RepoLink}}/archive/{{PathEscapeSegments .DBBranch.Name}}.zip" rel="nofollow">{{svg "octicon-file-zip"}} ZIP</a> @@ -179,20 +179,20 @@ data-is-default-branch="false" data-old-branch-name="{{.DBBranch.Name}}" data-modal="#rename-branch-modal" - data-tooltip-content="{{$.locale.Tr "repo.branch.rename" (.DBBranch.Name)}}" + data-tooltip-content="{{ctx.Locale.Tr "repo.branch.rename" (.DBBranch.Name)}}" > {{svg "octicon-pencil"}} </button> {{end}} {{if and $.IsWriter (not $.IsMirror) (not $.Repository.IsArchived) (not .IsProtected)}} {{if .DBBranch.IsDeleted}} - <button class="btn interact-bg gt-p-3 link-action restore-branch-button" data-url="{{$.Link}}/restore?branch_id={{.DBBranch.ID}}&name={{.DBBranch.Name}}&page={{$.Page.Paginater.Current}}" data-tooltip-content="{{$.locale.Tr "repo.branch.restore" (.DBBranch.Name)}}"> + <button class="btn interact-bg gt-p-3 link-action restore-branch-button" data-url="{{$.Link}}/restore?branch_id={{.DBBranch.ID}}&name={{.DBBranch.Name}}&page={{$.Page.Paginater.Current}}" data-tooltip-content="{{ctx.Locale.Tr "repo.branch.restore" (.DBBranch.Name)}}"> <span class="text blue"> {{svg "octicon-reply"}} </span> </button> {{else}} - <button class="btn interact-bg gt-p-3 delete-button delete-branch-button" data-url="{{$.Link}}/delete?name={{.DBBranch.Name}}&page={{$.Page.Paginater.Current}}" data-tooltip-content="{{$.locale.Tr "repo.branch.delete" (.DBBranch.Name)}}" data-name="{{.DBBranch.Name}}"> + <button class="btn interact-bg gt-p-3 delete-button delete-branch-button" data-url="{{$.Link}}/delete?name={{.DBBranch.Name}}&page={{$.Page.Paginater.Current}}" data-tooltip-content="{{ctx.Locale.Tr "repo.branch.delete" (.DBBranch.Name)}}" data-name="{{.DBBranch.Name}}"> {{svg "octicon-trash"}} </button> {{end}} @@ -211,28 +211,28 @@ <div class="ui g-modal-confirm delete modal"> <div class="header"> {{svg "octicon-trash"}} - {{.locale.Tr "repo.branch.delete_html"}} <span class="name"></span> + {{ctx.Locale.Tr "repo.branch.delete_html"}} <span class="name"></span> </div> <div class="content"> - <p>{{.locale.Tr "repo.branch.delete_desc" | Str2html}}</p> + <p>{{ctx.Locale.Tr "repo.branch.delete_desc" | Str2html}}</p> </div> {{template "base/modal_actions_confirm" .}} </div> <div class="ui mini modal" id="create-branch-modal"> <div class="header"> - {{.locale.Tr "repo.branch.new_branch"}} + {{ctx.Locale.Tr "repo.branch.new_branch"}} </div> <form class="ui form" id="create-branch-form" action="" data-base-action="{{.Link}}/_new/branch/" method="post"> <div class="content"> {{.CsrfTokenHtml}} <div class="field"> - {{.locale.Tr "repo.branch.create_new_branch"}} + {{ctx.Locale.Tr "repo.branch.create_new_branch"}} <span id="modal-create-branch-from-span"></span> </div> <div class="required field"> - <label for="new_branch_name">{{.locale.Tr "repo.branch.name"}}</label> + <label for="new_branch_name">{{ctx.Locale.Tr "repo.branch.name"}}</label> <input id="new_branch_name" name="new_branch_name" required> </div> </div> @@ -242,16 +242,16 @@ <div class="ui mini modal" id="rename-branch-modal"> <div class="header"> - {{.locale.Tr "repo.settings.rename_branch"}} + {{ctx.Locale.Tr "repo.settings.rename_branch"}} </div> <form class="ui form" action="{{$.Repository.Link}}/settings/rename_branch" method="post"> <div class="content"> {{.CsrfTokenHtml}} <div class="field default-branch-warning"> - <span class="text red">{{.locale.Tr "repo.branch.warning_rename_default_branch"}}</span> + <span class="text red">{{ctx.Locale.Tr "repo.branch.warning_rename_default_branch"}}</span> </div> <div class="field"> - <span class="text" data-rename-branch-to="{{.locale.Tr "repo.branch.rename_branch_to"}}"></span> + <span class="text" data-rename-branch-to="{{ctx.Locale.Tr "repo.branch.rename_branch_to"}}"></span> </div> <input name="from" type="hidden" required> <div class="required field"> diff --git a/templates/repo/branch_dropdown.tmpl b/templates/repo/branch_dropdown.tmpl index d826eee4f6..bee5363296 100644 --- a/templates/repo/branch_dropdown.tmpl +++ b/templates/repo/branch_dropdown.tmpl @@ -24,17 +24,17 @@ <script type="module"> const data = { - 'textReleaseCompare': {{.root.locale.Tr "repo.release.compare"}}, - 'textCreateTag': {{.root.locale.Tr "repo.tag.create_tag"}}, - 'textCreateBranch': {{.root.locale.Tr "repo.branch.create_branch"}}, - 'textCreateBranchFrom': {{.root.locale.Tr "repo.branch.create_from"}}, - 'textBranches': {{.root.locale.Tr "repo.branches"}}, - 'textTags': {{.root.locale.Tr "repo.tags"}}, - 'textDefaultBranchLabel': {{.root.locale.Tr "repo.default_branch_label"}}, + 'textReleaseCompare': {{ctx.Locale.Tr "repo.release.compare"}}, + 'textCreateTag': {{ctx.Locale.Tr "repo.tag.create_tag"}}, + 'textCreateBranch': {{ctx.Locale.Tr "repo.branch.create_branch"}}, + 'textCreateBranchFrom': {{ctx.Locale.Tr "repo.branch.create_from"}}, + 'textBranches': {{ctx.Locale.Tr "repo.branches"}}, + 'textTags': {{ctx.Locale.Tr "repo.tags"}}, + 'textDefaultBranchLabel': {{ctx.Locale.Tr "repo.default_branch_label"}}, 'mode': '{{if or .root.IsViewTag .isTag}}tags{{else}}branches{{end}}', 'showBranchesInDropdown': {{$showBranchesInDropdown}}, - 'searchFieldPlaceholder': '{{if $.noTag}}{{.root.locale.Tr "repo.pulls.filter_branch"}}{{else if $showBranchesInDropdown}}{{.root.locale.Tr "repo.filter_branch_and_tag"}}{{else}}{{.root.locale.Tr "repo.find_tag"}}{{end}}...', + 'searchFieldPlaceholder': '{{if $.noTag}}{{ctx.Locale.Tr "repo.pulls.filter_branch"}}{{else if $showBranchesInDropdown}}{{ctx.Locale.Tr "repo.filter_branch_and_tag"}}{{else}}{{ctx.Locale.Tr "repo.find_tag"}}{{end}}...', 'branchForm': {{$.branchForm}}, 'disableCreateBranch': {{if .disableCreateBranch}}{{.disableCreateBranch}}{{else}}{{not .root.CanCreateBranch}}{{end}}, 'setAction': {{.setAction}}, @@ -56,7 +56,7 @@ 'repoLink': {{.root.RepoLink}}, 'treePath': {{.root.TreePath}}, 'branchNameSubURL': {{.root.BranchNameSubURL}}, - 'noResults': {{.root.locale.Tr "repo.pulls.no_results"}}, + 'noResults': {{ctx.Locale.Tr "repo.pulls.no_results"}}, }; {{if .release}} data.release = { @@ -73,7 +73,7 @@ <button class="branch-dropdown-button gt-ellipsis ui basic small compact button gt-df gt-m-0"> <span class="text gt-df gt-ac gt-mr-2"> {{if .release}} - {{.root.locale.Tr "repo.release.compare"}} + {{ctx.Locale.Tr "repo.release.compare"}} {{else}} {{if eq $type "tag"}} {{svg "octicon-tag"}} diff --git a/templates/repo/cite/cite_buttons.tmpl b/templates/repo/cite/cite_buttons.tmpl index 6f9315249a..c0d3bf75f2 100644 --- a/templates/repo/cite/cite_buttons.tmpl +++ b/templates/repo/cite/cite_buttons.tmpl @@ -6,6 +6,6 @@ BibTeX </button> <!-- the value will be updated by initCitationFileCopyContent, the code below is used to avoid UI flicking --> <input id="citation-copy-content" value="" size="1" readonly> -<button class="ui basic icon button" id="citation-clipboard-btn" data-tooltip-content="{{.locale.Tr "copy"}}" data-clipboard-text="" data-clipboard-target="#citation-copy-content"> +<button class="ui basic icon button" id="citation-clipboard-btn" data-tooltip-content="{{ctx.Locale.Tr "copy"}}" data-clipboard-text="" data-clipboard-target="#citation-copy-content"> {{svg "octicon-copy"}} </button> diff --git a/templates/repo/cite/cite_modal.tmpl b/templates/repo/cite/cite_modal.tmpl index e296a1d6d3..c34c77e0c4 100644 --- a/templates/repo/cite/cite_modal.tmpl +++ b/templates/repo/cite/cite_modal.tmpl @@ -1,13 +1,13 @@ <div class="ui tiny modal" id="cite-repo-modal"> <div class="header"> - {{.locale.Tr "repo.cite_this_repo"}} + {{ctx.Locale.Tr "repo.cite_this_repo"}} </div> <div class="content"> <div class="ui stackable secondary menu"> <div class="fitted item"> <div class="ui action input" id="citation-panel"> {{template "repo/cite/cite_buttons" .}} - <a id="goto-citation-btn" class="ui basic jump icon button" href="{{$.RepoLink}}/src/{{$.BranchName}}/CITATION.cff" data-tooltip-content="{{.locale.Tr "repo.find_file.go_to_file"}}"> + <a id="goto-citation-btn" class="ui basic jump icon button" href="{{$.RepoLink}}/src/{{$.BranchName}}/CITATION.cff" data-tooltip-content="{{ctx.Locale.Tr "repo.find_file.go_to_file"}}"> {{svg "octicon-file-moved"}} </a> </div> @@ -16,7 +16,7 @@ </div> <div class="actions"> <button class="ui cancel button"> - {{.locale.Tr "cancel"}} + {{ctx.Locale.Tr "cancel"}} </button> </div> </div> diff --git a/templates/repo/clone_buttons.tmpl b/templates/repo/clone_buttons.tmpl index 9f008ff5d2..78f2c34080 100644 --- a/templates/repo/clone_buttons.tmpl +++ b/templates/repo/clone_buttons.tmpl @@ -10,6 +10,6 @@ </button> {{end}} <input id="repo-clone-url" size="20" class="js-clone-url" value="{{$.CloneButtonOriginLink.HTTPS}}" readonly> -<button class="ui basic small compact icon button" id="clipboard-btn" data-tooltip-content="{{.locale.Tr "copy_url"}}" data-clipboard-target="#repo-clone-url" aria-label="{{.locale.Tr "copy_url"}}"> +<button class="ui basic small compact icon button" id="clipboard-btn" data-tooltip-content="{{ctx.Locale.Tr "copy_url"}}" data-clipboard-target="#repo-clone-url" aria-label="{{.locale.Tr "copy_url"}}"> {{svg "octicon-copy" 14}} </button> diff --git a/templates/repo/code/recently_pushed_new_branches.tmpl b/templates/repo/code/recently_pushed_new_branches.tmpl index d460fd6852..8ed751fe80 100644 --- a/templates/repo/code/recently_pushed_new_branches.tmpl +++ b/templates/repo/code/recently_pushed_new_branches.tmpl @@ -2,10 +2,10 @@ <div class="ui positive message gt-df gt-ac"> <div class="gt-f1"> {{$timeSince := TimeSince .CommitTime.AsTime $.locale}} - {{$.locale.Tr "repo.pulls.recently_pushed_new_branches" (Escape .Name) $timeSince | Safe}} + {{ctx.Locale.Tr "repo.pulls.recently_pushed_new_branches" (Escape .Name) $timeSince | Safe}} </div> <a role="button" class="ui compact positive button gt-m-0" href="{{$.Repository.ComposeBranchCompareURL $.Repository.BaseRepo .Name}}"> - {{$.locale.Tr "repo.pulls.compare_changes"}} + {{ctx.Locale.Tr "repo.pulls.compare_changes"}} </a> </div> {{end}} diff --git a/templates/repo/commit_load_branches_and_tags.tmpl b/templates/repo/commit_load_branches_and_tags.tmpl index 4d90696cb4..6d5eb29d8a 100644 --- a/templates/repo/commit_load_branches_and_tags.tmpl +++ b/templates/repo/commit_load_branches_and_tags.tmpl @@ -1,12 +1,12 @@ {{if not .PageIsWiki}} -<div class="branch-and-tag-area" data-text-default-branch-tooltip="{{.locale.Tr "repo.commit.contained_in_default_branch"}}"> +<div class="branch-and-tag-area" data-text-default-branch-tooltip="{{ctx.Locale.Tr "repo.commit.contained_in_default_branch"}}"> <button class="ui button ellipsis-button load-branches-and-tags gt-mt-3" aria-expanded="false" data-fetch-url="{{.RepoLink}}/commit/{{.CommitID}}/load-branches-and-tags" - data-tooltip-content="{{.locale.Tr "repo.commit.load_referencing_branches_and_tags"}}" + data-tooltip-content="{{ctx.Locale.Tr "repo.commit.load_referencing_branches_and_tags"}}" >...</button> <div class="branch-and-tag-detail gt-hidden"> <div class="divider"></div> - <div>{{.locale.Tr "repo.commit.contained_in"}}</div> + <div>{{ctx.Locale.Tr "repo.commit.contained_in"}}</div> <div class="gt-df gt-mt-3"> <div class="gt-p-2">{{svg "octicon-git-branch"}}</div> <div class="branch-area flex-text-block gt-f1"></div> diff --git a/templates/repo/commit_page.tmpl b/templates/repo/commit_page.tmpl index 1663e76a40..fe944e95ed 100644 --- a/templates/repo/commit_page.tmpl +++ b/templates/repo/commit_page.tmpl @@ -23,43 +23,43 @@ {{if not $.PageIsWiki}} <div> <a class="ui primary tiny button" href="{{.SourcePath}}"> - {{.locale.Tr "repo.diff.browse_source"}} + {{ctx.Locale.Tr "repo.diff.browse_source"}} </a> {{if and ($.Permission.CanWrite $.UnitTypeCode) (not $.Repository.IsArchived) (not .IsDeleted)}}{{- /* */ -}} <div class="ui dropdown primary tiny button"> - {{.locale.Tr "repo.commit.operations"}} + {{ctx.Locale.Tr "repo.commit.operations"}} {{svg "octicon-triangle-down" 14 "dropdown icon"}} <div class="menu"> - <div class="ui header">{{.locale.Tr "repo.commit.operations"}}</div> + <div class="ui header">{{ctx.Locale.Tr "repo.commit.operations"}}</div> <div class="divider"></div> <div class="item show-create-branch-modal" - data-content="{{$.locale.Tr "repo.branch.new_branch_from" (.CommitID)}}" {{/* used by the form */}} + data-content="{{ctx.Locale.Tr "repo.branch.new_branch_from" (.CommitID)}}" {{/* used by the form */}} data-branch-from="{{ShortSha .CommitID}}" data-branch-from-urlcomponent="{{.CommitID}}" data-modal="#create-branch-modal"> - {{.locale.Tr "repo.branch.create_branch_operation"}} + {{ctx.Locale.Tr "repo.branch.create_branch_operation"}} </div> <div class="item show-create-branch-modal" - data-content="{{$.locale.Tr "repo.branch.new_branch_from" (.CommitID)}}" {{/* used by the form */}} + data-content="{{ctx.Locale.Tr "repo.branch.new_branch_from" (.CommitID)}}" {{/* used by the form */}} data-branch-from="{{ShortSha .CommitID}}" data-branch-from-urlcomponent="{{.CommitID}}" data-modal="#create-tag-modal" data-modal-from-span="#modal-create-tag-from-span" data-modal-form="#create-tag-form"> - {{.locale.Tr "repo.tag.create_tag_operation"}} + {{ctx.Locale.Tr "repo.tag.create_tag_operation"}} </div> <div class="item show-modal revert-button" data-modal="#cherry-pick-modal" data-modal-cherry-pick-type="revert" - data-modal-cherry-pick-header="{{$.locale.Tr "repo.commit.revert-header" (ShortSha .CommitID)}}" - data-modal-cherry-pick-content="{{$.locale.Tr "repo.commit.revert-content"}}" - data-modal-cherry-pick-submit="{{.locale.Tr "repo.commit.revert"}}">{{.locale.Tr "repo.commit.revert"}}</div> + data-modal-cherry-pick-header="{{ctx.Locale.Tr "repo.commit.revert-header" (ShortSha .CommitID)}}" + data-modal-cherry-pick-content="{{ctx.Locale.Tr "repo.commit.revert-content"}}" + data-modal-cherry-pick-submit="{{ctx.Locale.Tr "repo.commit.revert"}}">{{.locale.Tr "repo.commit.revert"}}</div> <div class="item cherry-pick-button show-modal" data-modal="#cherry-pick-modal" data-modal-cherry-pick-type="cherry-pick" - data-modal-cherry-pick-header="{{$.locale.Tr "repo.commit.cherry-pick-header" (ShortSha .CommitID)}}" - data-modal-cherry-pick-content="{{$.locale.Tr "repo.commit.cherry-pick-content"}}" - data-modal-cherry-pick-submit="{{.locale.Tr "repo.commit.cherry-pick"}}">{{.locale.Tr "repo.commit.cherry-pick"}}</div> + data-modal-cherry-pick-header="{{ctx.Locale.Tr "repo.commit.cherry-pick-header" (ShortSha .CommitID)}}" + data-modal-cherry-pick-content="{{ctx.Locale.Tr "repo.commit.cherry-pick-content"}}" + data-modal-cherry-pick-submit="{{ctx.Locale.Tr "repo.commit.cherry-pick"}}">{{.locale.Tr "repo.commit.cherry-pick"}}</div> <div class="ui g-modal-confirm modal" id="cherry-pick-modal"> <div class="header"> <span id="cherry-pick-header"></span> @@ -81,31 +81,31 @@ </div> <div class="ui small modal" id="create-branch-modal"> <div class="header"> - {{.locale.Tr "repo.branch.new_branch"}} + {{ctx.Locale.Tr "repo.branch.new_branch"}} </div> <div class="content"> <form class="ui form" id="create-branch-form" action="" data-base-action="{{.RepoLink}}/branches/_new/commit/" method="post"> {{.CsrfTokenHtml}} <div class="field"> <label> - {{.locale.Tr "repo.branch.new_branch_from" "<span class=\"text\" id=\"modal-create-branch-from-span\"></span>" | Safe}} + {{ctx.Locale.Tr "repo.branch.new_branch_from" "<span class=\"text\" id=\"modal-create-branch-from-span\"></span>" | Safe}} </label> </div> <div class="required field"> - <label for="new_branch_name">{{.locale.Tr "repo.branch.name"}}</label> + <label for="new_branch_name">{{ctx.Locale.Tr "repo.branch.name"}}</label> <input id="new_branch_name" name="new_branch_name" required> </div> <div class="text right actions"> - <button class="ui cancel button">{{.locale.Tr "settings.cancel"}}</button> - <button class="ui primary button">{{.locale.Tr "repo.branch.confirm_create_branch"}}</button> + <button class="ui cancel button">{{ctx.Locale.Tr "settings.cancel"}}</button> + <button class="ui primary button">{{ctx.Locale.Tr "repo.branch.confirm_create_branch"}}</button> </div> </form> </div> </div> <div class="ui small modal" id="create-tag-modal"> <div class="header"> - {{.locale.Tr "repo.tag.create_tag_operation"}} + {{ctx.Locale.Tr "repo.tag.create_tag_operation"}} </div> <div class="content"> <form class="ui form" id="create-tag-form" action="" data-base-action="{{.RepoLink}}/branches/_new/commit/" method="post"> @@ -113,17 +113,17 @@ <input type="hidden" name="create_tag" value="true"> <div class="field"> <label> - {{.locale.Tr "repo.tag.create_tag_from" "<span class=\"text\" id=\"modal-create-tag-from-span\"></span>" | Safe}} + {{ctx.Locale.Tr "repo.tag.create_tag_from" "<span class=\"text\" id=\"modal-create-tag-from-span\"></span>" | Safe}} </label> </div> <div class="required field"> - <label for="new_branch_name">{{.locale.Tr "repo.release.tag_name"}}</label> + <label for="new_branch_name">{{ctx.Locale.Tr "repo.release.tag_name"}}</label> <input id="new_branch_name" name="new_branch_name" required> </div> <div class="text right actions"> - <button class="ui cancel button">{{.locale.Tr "settings.cancel"}}</button> - <button class="ui primary button">{{.locale.Tr "repo.tag.confirm_create_tag"}}</button> + <button class="ui cancel button">{{ctx.Locale.Tr "settings.cancel"}}</button> + <button class="ui primary button">{{ctx.Locale.Tr "repo.tag.confirm_create_tag"}}</button> </div> </form> </div> @@ -154,7 +154,7 @@ {{end}} <span class="text grey gt-ml-3" id="authored-time">{{TimeSince .Commit.Author.When $.locale}}</span> {{if or (ne .Commit.Committer.Name .Commit.Author.Name) (ne .Commit.Committer.Email .Commit.Author.Email)}} - <span class="text grey gt-mx-3">{{.locale.Tr "repo.diff.committed_by"}}</span> + <span class="text grey gt-mx-3">{{ctx.Locale.Tr "repo.diff.committed_by"}}</span> {{if ne .Verification.CommittingUser.ID 0}} {{ctx.AvatarUtils.Avatar .Verification.CommittingUser 28 "gt-mx-3"}} <a href="{{.Verification.CommittingUser.HomeLink}}"><strong>{{.Commit.Committer.Name}}</strong></a> @@ -167,7 +167,7 @@ <div class="ui horizontal list gt-df gt-ac"> {{if .Parents}} <div class="item"> - <span>{{.locale.Tr "repo.diff.parent"}}</span> + <span>{{ctx.Locale.Tr "repo.diff.parent"}}</span> {{range .Parents}} {{if $.PageIsWiki}} <a class="ui primary sha label" href="{{$.RepoLink}}/wiki/commit/{{PathEscape .}}">{{ShortSha .}}</a> @@ -178,7 +178,7 @@ </div> {{end}} <div class="item"> - <span>{{.locale.Tr "repo.diff.commit"}}</span> + <span>{{ctx.Locale.Tr "repo.diff.commit"}}</span> <span class="ui primary sha label">{{ShortSha .CommitID}}</span> </div> </div> @@ -190,23 +190,23 @@ {{if ne .Verification.SigningUser.ID 0}} {{svg "gitea-lock" 16 "gt-mr-3"}} {{if eq .Verification.TrustStatus "trusted"}} - <span class="ui text gt-mr-3">{{.locale.Tr "repo.commits.signed_by"}}:</span> + <span class="ui text gt-mr-3">{{ctx.Locale.Tr "repo.commits.signed_by"}}:</span> {{else if eq .Verification.TrustStatus "untrusted"}} - <span class="ui text gt-mr-3">{{.locale.Tr "repo.commits.signed_by_untrusted_user"}}:</span> + <span class="ui text gt-mr-3">{{ctx.Locale.Tr "repo.commits.signed_by_untrusted_user"}}:</span> {{else}} - <span class="ui text gt-mr-3">{{.locale.Tr "repo.commits.signed_by_untrusted_user_unmatched"}}:</span> + <span class="ui text gt-mr-3">{{ctx.Locale.Tr "repo.commits.signed_by_untrusted_user_unmatched"}}:</span> {{end}} {{ctx.AvatarUtils.Avatar .Verification.SigningUser 28 "gt-mr-3"}} <a href="{{.Verification.SigningUser.HomeLink}}"><strong>{{.Verification.SigningUser.GetDisplayName}}</strong></a> {{else}} - <span title="{{.locale.Tr "gpg.default_key"}}">{{svg "gitea-lock-cog" 16 "gt-mr-3"}}</span> - <span class="ui text gt-mr-3">{{.locale.Tr "repo.commits.signed_by"}}:</span> + <span title="{{ctx.Locale.Tr "gpg.default_key"}}">{{svg "gitea-lock-cog" 16 "gt-mr-3"}}</span> + <span class="ui text gt-mr-3">{{ctx.Locale.Tr "repo.commits.signed_by"}}:</span> {{ctx.AvatarUtils.AvatarByEmail .Verification.SigningEmail "" 28}} <strong>{{.Verification.SigningUser.GetDisplayName}}</strong> {{end}} {{else}} {{svg "gitea-unlock" 16 "gt-mr-3"}} - <span class="ui text">{{.locale.Tr .Verification.Reason}}</span> + <span class="ui text">{{ctx.Locale.Tr .Verification.Reason}}</span> {{end}} </div> <div class="gt-df gt-ac"> @@ -214,43 +214,43 @@ {{if ne .Verification.SigningUser.ID 0}} {{svg "octicon-verified" 16 "gt-mr-3"}} {{if .Verification.SigningSSHKey}} - <span class="ui text gt-mr-3">{{.locale.Tr "repo.commits.ssh_key_fingerprint"}}:</span> + <span class="ui text gt-mr-3">{{ctx.Locale.Tr "repo.commits.ssh_key_fingerprint"}}:</span> {{.Verification.SigningSSHKey.Fingerprint}} {{else}} - <span class="ui text gt-mr-3">{{.locale.Tr "repo.commits.gpg_key_id"}}:</span> + <span class="ui text gt-mr-3">{{ctx.Locale.Tr "repo.commits.gpg_key_id"}}:</span> {{.Verification.SigningKey.PaddedKeyID}} {{end}} {{else}} {{svg "octicon-unverified" 16 "gt-mr-3"}} {{if .Verification.SigningSSHKey}} - <span class="ui text gt-mr-3" data-tooltip-content="{{.locale.Tr "gpg.default_key"}}">{{.locale.Tr "repo.commits.ssh_key_fingerprint"}}:</span> + <span class="ui text gt-mr-3" data-tooltip-content="{{ctx.Locale.Tr "gpg.default_key"}}">{{.locale.Tr "repo.commits.ssh_key_fingerprint"}}:</span> {{.Verification.SigningSSHKey.Fingerprint}} {{else}} - <span class="ui text gt-mr-3" data-tooltip-content="{{.locale.Tr "gpg.default_key"}}">{{.locale.Tr "repo.commits.gpg_key_id"}}:</span> + <span class="ui text gt-mr-3" data-tooltip-content="{{ctx.Locale.Tr "gpg.default_key"}}">{{.locale.Tr "repo.commits.gpg_key_id"}}:</span> {{.Verification.SigningKey.PaddedKeyID}} {{end}} {{end}} {{else if .Verification.Warning}} {{svg "octicon-unverified" 16 "gt-mr-3"}} {{if .Verification.SigningSSHKey}} - <span class="ui text gt-mr-3">{{.locale.Tr "repo.commits.ssh_key_fingerprint"}}:</span> + <span class="ui text gt-mr-3">{{ctx.Locale.Tr "repo.commits.ssh_key_fingerprint"}}:</span> {{.Verification.SigningSSHKey.Fingerprint}} {{else}} - <span class="ui text gt-mr-3">{{.locale.Tr "repo.commits.gpg_key_id"}}:</span> + <span class="ui text gt-mr-3">{{ctx.Locale.Tr "repo.commits.gpg_key_id"}}:</span> {{.Verification.SigningKey.PaddedKeyID}} {{end}} {{else}} {{if .Verification.SigningKey}} {{if ne .Verification.SigningKey.KeyID ""}} {{svg "octicon-verified" 16 "gt-mr-3"}} - <span class="ui text gt-mr-3">{{.locale.Tr "repo.commits.gpg_key_id"}}:</span> + <span class="ui text gt-mr-3">{{ctx.Locale.Tr "repo.commits.gpg_key_id"}}:</span> {{.Verification.SigningKey.PaddedKeyID}} {{end}} {{end}} {{if .Verification.SigningSSHKey}} {{if ne .Verification.SigningSSHKey.Fingerprint ""}} {{svg "octicon-verified" 16 "gt-mr-3"}} - <span class="ui text gt-mr-3">{{.locale.Tr "repo.commits.ssh_key_fingerprint"}}:</span> + <span class="ui text gt-mr-3">{{ctx.Locale.Tr "repo.commits.ssh_key_fingerprint"}}:</span> {{.Verification.SigningSSHKey.Fingerprint}} {{end}} {{end}} @@ -261,7 +261,7 @@ {{if .Note}} <div class="ui top attached header segment git-notes"> {{svg "octicon-note" 16 "gt-mr-3"}} - {{.locale.Tr "repo.diff.git-notes"}}: + {{ctx.Locale.Tr "repo.diff.git-notes"}}: {{if .NoteAuthor}} <a href="{{.NoteAuthor.HomeLink}}"> {{if .NoteAuthor.FullName}} diff --git a/templates/repo/commits.tmpl b/templates/repo/commits.tmpl index 18bb78cb06..42004c2610 100644 --- a/templates/repo/commits.tmpl +++ b/templates/repo/commits.tmpl @@ -8,7 +8,7 @@ {{template "repo/branch_dropdown" dict "root" . "ContainerClasses" "gt-mr-2"}} <a href="{{.RepoLink}}/graph" class="ui basic small compact button"> {{svg "octicon-git-branch"}} - {{.locale.Tr "repo.commit_graph"}} + {{ctx.Locale.Tr "repo.commit_graph"}} </a> </div> </div> diff --git a/templates/repo/commits_list.tmpl b/templates/repo/commits_list.tmpl index 7ecbc8f884..1125d2eeb9 100644 --- a/templates/repo/commits_list.tmpl +++ b/templates/repo/commits_list.tmpl @@ -2,10 +2,10 @@ <table class="ui very basic striped table unstackable" id="commits-table"> <thead> <tr> - <th class="three wide">{{.locale.Tr "repo.commits.author"}}</th> + <th class="three wide">{{ctx.Locale.Tr "repo.commits.author"}}</th> <th class="two wide sha">SHA1</th> - <th class="nine wide message">{{.locale.Tr "repo.commits.message"}}</th> - <th class="two wide right aligned">{{.locale.Tr "repo.commits.date"}}</th> + <th class="nine wide message">{{ctx.Locale.Tr "repo.commits.message"}}</th> + <th class="two wide right aligned">{{ctx.Locale.Tr "repo.commits.date"}}</th> </tr> </thead> <tbody class="commit-list"> diff --git a/templates/repo/commits_table.tmpl b/templates/repo/commits_table.tmpl index 0670635baf..4ee321cc0a 100644 --- a/templates/repo/commits_table.tmpl +++ b/templates/repo/commits_table.tmpl @@ -1,25 +1,25 @@ <h4 class="ui top attached header commits-table gt-df gt-ac gt-sb"> <div class="commits-table-left gt-df gt-ac"> {{if or .PageIsCommits (gt .CommitCount 0)}} - {{.CommitCount}} {{.locale.Tr "repo.commits.commits"}} + {{.CommitCount}} {{ctx.Locale.Tr "repo.commits.commits"}} {{else if .IsNothingToCompare}} - {{.locale.Tr "repo.commits.nothing_to_compare"}} + {{ctx.Locale.Tr "repo.commits.nothing_to_compare"}} {{else}} - {{.locale.Tr "repo.commits.no_commits" $.BaseBranch $.HeadBranch}} + {{ctx.Locale.Tr "repo.commits.no_commits" $.BaseBranch $.HeadBranch}} {{end}} </div> <div class="commits-table-right gt-whitespace-nowrap"> {{if .PageIsCommits}} <form class="ignore-dirty" action="{{.RepoLink}}/commits/{{.BranchNameSubURL}}/search"> <div class="ui tiny search input"> - <input name="q" placeholder="{{.locale.Tr "repo.commits.search"}}" value="{{.Keyword}}" autofocus> + <input name="q" placeholder="{{ctx.Locale.Tr "repo.commits.search"}}" value="{{.Keyword}}" autofocus> </div> <div class="ui tiny checkbox"> <input type="checkbox" name="all" value="true" {{.All}}> - <label>{{.locale.Tr "repo.commits.search_all"}}</label> + <label>{{ctx.Locale.Tr "repo.commits.search_all"}}</label> </div> - <button class="ui primary tiny button gt-mr-0" data-panel="#add-deploy-key-panel" data-tooltip-content={{.locale.Tr "repo.commits.search.tooltip"}}>{{.locale.Tr "repo.commits.find"}}</button> + <button class="ui primary tiny button gt-mr-0" data-panel="#add-deploy-key-panel" data-tooltip-content={{ctx.Locale.Tr "repo.commits.search.tooltip"}}>{{.locale.Tr "repo.commits.find"}}</button> </form> {{else if .IsDiffCompare}} <a href="{{$.CommitRepoLink}}/commit/{{.BeforeCommitID | PathEscape}}" class="ui green sha label gt-mx-0">{{if not .BaseIsCommit}}{{if .BaseIsBranch}}{{svg "octicon-git-branch"}}{{else if .BaseIsTag}}{{svg "octicon-tag"}}{{end}}{{.BaseBranch}}{{else}}{{ShortSha .BaseBranch}}{{end}}</a> diff --git a/templates/repo/create.tmpl b/templates/repo/create.tmpl index 4125cb9c8f..7b2e51130f 100644 --- a/templates/repo/create.tmpl +++ b/templates/repo/create.tmpl @@ -5,7 +5,7 @@ <form class="ui form" action="{{.Link}}" method="post"> {{.CsrfTokenHtml}} <h3 class="ui top attached header"> - {{.locale.Tr "new_repo"}} + {{ctx.Locale.Tr "new_repo"}} </h3> <div class="ui attached segment"> {{template "base/alert" .}} @@ -13,11 +13,11 @@ {{if not .CanCreateRepo}} <div class="ui negative message"> - <p>{{.locale.TrN .MaxCreationLimit "repo.form.reach_limit_of_creation_1" "repo.form.reach_limit_of_creation_n" .MaxCreationLimit}}</p> + <p>{{ctx.Locale.TrN .MaxCreationLimit "repo.form.reach_limit_of_creation_1" "repo.form.reach_limit_of_creation_n" .MaxCreationLimit}}</p> </div> {{end}} <div class="inline required field {{if .Err_Owner}}error{{end}}"> - <label>{{.locale.Tr "repo.owner"}}</label> + <label>{{ctx.Locale.Tr "repo.owner"}}</label> <div class="ui selection owner dropdown"> <input type="hidden" id="uid" name="uid" value="{{.ContextUser.ID}}" required> <span class="text truncated-item-container" title="{{.ContextUser.Name}}"> @@ -38,33 +38,33 @@ {{end}} </div> </div> - <span class="help">{{.locale.Tr "repo.owner_helper"}}</span> + <span class="help">{{ctx.Locale.Tr "repo.owner_helper"}}</span> </div> <div class="inline required field {{if .Err_RepoName}}error{{end}}"> - <label for="repo_name">{{.locale.Tr "repo.repo_name"}}</label> + <label for="repo_name">{{ctx.Locale.Tr "repo.repo_name"}}</label> <input id="repo_name" name="repo_name" value="{{.repo_name}}" autofocus required maxlength="100"> - <span class="help">{{.locale.Tr "repo.repo_name_helper"}}</span> + <span class="help">{{ctx.Locale.Tr "repo.repo_name_helper"}}</span> </div> <div class="inline field"> - <label>{{.locale.Tr "repo.visibility"}}</label> + <label>{{ctx.Locale.Tr "repo.visibility"}}</label> <div class="ui checkbox"> {{if .IsForcedPrivate}} <input name="private" type="checkbox" checked readonly> - <label>{{.locale.Tr "repo.visibility_helper_forced" | Safe}}</label> + <label>{{ctx.Locale.Tr "repo.visibility_helper_forced" | Safe}}</label> {{else}} <input name="private" type="checkbox" {{if .private}}checked{{end}}> - <label>{{.locale.Tr "repo.visibility_helper" | Safe}}</label> + <label>{{ctx.Locale.Tr "repo.visibility_helper" | Safe}}</label> {{end}} </div> - <span class="help">{{.locale.Tr "repo.visibility_description"}}</span> + <span class="help">{{ctx.Locale.Tr "repo.visibility_description"}}</span> </div> <div class="inline field {{if .Err_Description}}error{{end}}"> - <label for="description">{{.locale.Tr "repo.repo_desc"}}</label> - <textarea id="description" name="description" placeholder="{{.locale.Tr "repo.repo_desc_helper"}}" maxlength="2048">{{.description}}</textarea> + <label for="description">{{ctx.Locale.Tr "repo.repo_desc"}}</label> + <textarea id="description" name="description" placeholder="{{ctx.Locale.Tr "repo.repo_desc_helper"}}" maxlength="2048">{{.description}}</textarea> </div> <div class="inline field"> - <label>{{.locale.Tr "repo.template"}}</label> + <label>{{ctx.Locale.Tr "repo.template"}}</label> <div id="repo_template_search" class="ui search normal selection dropdown"> <input type="hidden" id="repo_template" name="repo_template" value="{{.repo_template}}"> <div class="default text">{{.repo_template_name}}</div> @@ -75,55 +75,55 @@ <div id="template_units" class="gt-hidden"> <div class="inline field"> - <label>{{.locale.Tr "repo.template.items"}}</label> + <label>{{ctx.Locale.Tr "repo.template.items"}}</label> <div class="ui checkbox"> <input name="git_content" type="checkbox" {{if .git_content}}checked{{end}}> - <label>{{.locale.Tr "repo.template.git_content"}}</label> + <label>{{ctx.Locale.Tr "repo.template.git_content"}}</label> </div> - <div class="ui checkbox" {{if not .SignedUser.CanEditGitHook}}data-tooltip-content="{{.locale.Tr "repo.template.git_hooks_tooltip"}}"{{end}}> + <div class="ui checkbox" {{if not .SignedUser.CanEditGitHook}}data-tooltip-content="{{ctx.Locale.Tr "repo.template.git_hooks_tooltip"}}"{{end}}> <input name="git_hooks" type="checkbox" {{if .git_hooks}}checked{{end}}> - <label>{{.locale.Tr "repo.template.git_hooks"}}</label> + <label>{{ctx.Locale.Tr "repo.template.git_hooks"}}</label> </div> </div> <div class="inline field"> <label></label> <div class="ui checkbox"> <input name="webhooks" type="checkbox" {{if .webhooks}}checked{{end}}> - <label>{{.locale.Tr "repo.template.webhooks"}}</label> + <label>{{ctx.Locale.Tr "repo.template.webhooks"}}</label> </div> <div class="ui checkbox"> <input name="topics" type="checkbox" {{if .topics}}checked{{end}}> - <label>{{.locale.Tr "repo.template.topics"}}</label> + <label>{{ctx.Locale.Tr "repo.template.topics"}}</label> </div> </div> <div class="inline field"> <label></label> <div class="ui checkbox"> <input name="avatar" type="checkbox" {{if .avatar}}checked{{end}}> - <label>{{.locale.Tr "repo.template.avatar"}}</label> + <label>{{ctx.Locale.Tr "repo.template.avatar"}}</label> </div> <div class="ui checkbox"> <input name="labels" type="checkbox" {{if .labels}}checked{{end}}> - <label>{{.locale.Tr "repo.template.issue_labels"}}</label> + <label>{{ctx.Locale.Tr "repo.template.issue_labels"}}</label> </div> </div> <div class="inline field"> <label></label> <div class="ui checkbox"> <input name="protected_branch" type="checkbox" {{if .protected_branch}}checked{{end}}> - <label>{{.locale.Tr "repo.settings.protected_branch"}}</label> + <label>{{ctx.Locale.Tr "repo.settings.protected_branch"}}</label> </div> </div> </div> <div id="non_template"> <div class="inline field"> - <label>{{.locale.Tr "repo.issue_labels"}}</label> + <label>{{ctx.Locale.Tr "repo.issue_labels"}}</label> <div class="ui search normal selection dropdown"> <input type="hidden" name="issue_labels" value="{{.issueLabels}}"> - <div class="default text">{{.locale.Tr "repo.issue_labels_helper"}}</div> + <div class="default text">{{ctx.Locale.Tr "repo.issue_labels_helper"}}</div> <div class="menu"> - <div class="item" data-value="">{{.locale.Tr "repo.issue_labels_helper"}}</div> + <div class="item" data-value="">{{ctx.Locale.Tr "repo.issue_labels_helper"}}</div> {{range .LabelTemplateFiles}} <div class="item" data-value="{{.DisplayName}}">{{.DisplayName}}<br><i>({{.Description}})</i></div> {{end}} @@ -137,82 +137,82 @@ <label>.gitignore</label> <div class="ui multiple search normal selection dropdown"> <input type="hidden" name="gitignores" value="{{.gitignores}}"> - <div class="default text">{{.locale.Tr "repo.repo_gitignore_helper"}}</div> + <div class="default text">{{ctx.Locale.Tr "repo.repo_gitignore_helper"}}</div> <div class="menu"> {{range .Gitignores}} <div class="item" data-value="{{.}}">{{.}}</div> {{end}} </div> </div> - <span class="help">{{.locale.Tr "repo.repo_gitignore_helper_desc"}}</span> + <span class="help">{{ctx.Locale.Tr "repo.repo_gitignore_helper_desc"}}</span> </div> <div class="inline field"> - <label>{{.locale.Tr "repo.license"}}</label> + <label>{{ctx.Locale.Tr "repo.license"}}</label> <div class="ui search selection dropdown"> <input type="hidden" name="license" value="{{.license}}"> - <div class="default text">{{.locale.Tr "repo.license_helper"}}</div> + <div class="default text">{{ctx.Locale.Tr "repo.license_helper"}}</div> <div class="menu"> - <div class="item" data-value="">{{.locale.Tr "repo.license_helper"}}</div> + <div class="item" data-value="">{{ctx.Locale.Tr "repo.license_helper"}}</div> {{range .Licenses}} <div class="item" data-value="{{.}}">{{.}}</div> {{end}} </div> </div> - <span class="help">{{.locale.Tr "repo.license_helper_desc" "https://choosealicense.com/" | Str2html}}</span> + <span class="help">{{ctx.Locale.Tr "repo.license_helper_desc" "https://choosealicense.com/" | Str2html}}</span> </div> <div class="inline field"> - <label>{{.locale.Tr "repo.readme"}}</label> + <label>{{ctx.Locale.Tr "repo.readme"}}</label> <div class="ui selection dropdown"> <input type="hidden" name="readme" value="{{.readme}}"> - <div class="default text">{{.locale.Tr "repo.readme_helper"}}</div> + <div class="default text">{{ctx.Locale.Tr "repo.readme_helper"}}</div> <div class="menu"> {{range .Readmes}} <div class="item" data-value="{{.}}">{{.}}</div> {{end}} </div> </div> - <span class="help">{{.locale.Tr "repo.readme_helper_desc"}}</span> + <span class="help">{{ctx.Locale.Tr "repo.readme_helper_desc"}}</span> </div> <div class="inline field"> <div class="ui checkbox" id="auto-init"> <input name="auto_init" type="checkbox" {{if .auto_init}}checked{{end}}> - <label>{{.locale.Tr "repo.auto_init"}}</label> + <label>{{ctx.Locale.Tr "repo.auto_init"}}</label> </div> </div> <div class="inline field"> - <label for="default_branch">{{.locale.Tr "repo.default_branch"}}</label> + <label for="default_branch">{{ctx.Locale.Tr "repo.default_branch"}}</label> <input id="default_branch" name="default_branch" value="{{.default_branch}}" placeholder="{{.default_branch}}"> - <span class="help">{{.locale.Tr "repo.default_branch_helper"}}</span> + <span class="help">{{ctx.Locale.Tr "repo.default_branch_helper"}}</span> </div> <div class="inline field"> - <label>{{.locale.Tr "repo.settings.trust_model"}}</label> + <label>{{ctx.Locale.Tr "repo.settings.trust_model"}}</label> <div class="ui selection owner dropdown"> <input type="hidden" id="trust_model" name="trust_model" value="default" required> - <div class="default text">{{.locale.Tr "repo.settings.trust_model"}}</div> + <div class="default text">{{ctx.Locale.Tr "repo.settings.trust_model"}}</div> {{svg "octicon-triangle-down" 14 "dropdown icon"}} <div class="menu"> - <div class="item" data-value="default">{{.locale.Tr "repo.settings.trust_model.default"}}</div> - <div class="item" data-value="collaborator">{{.locale.Tr "repo.settings.trust_model.collaborator"}}</div> - <div class="item" data-value="committer">{{.locale.Tr "repo.settings.trust_model.committer"}}</div> - <div class="item" data-value="collaboratorcommitter">{{.locale.Tr "repo.settings.trust_model.collaboratorcommitter"}}</div> + <div class="item" data-value="default">{{ctx.Locale.Tr "repo.settings.trust_model.default"}}</div> + <div class="item" data-value="collaborator">{{ctx.Locale.Tr "repo.settings.trust_model.collaborator"}}</div> + <div class="item" data-value="committer">{{ctx.Locale.Tr "repo.settings.trust_model.committer"}}</div> + <div class="item" data-value="collaboratorcommitter">{{ctx.Locale.Tr "repo.settings.trust_model.collaboratorcommitter"}}</div> </div> </div> <div class="help"> - {{.locale.Tr "repo.trust_model_helper"}} + {{ctx.Locale.Tr "repo.trust_model_helper"}} <ul> - <li>{{.locale.Tr "repo.trust_model_helper_collaborator"}}</li> - <li>{{.locale.Tr "repo.trust_model_helper_committer"}}</li> - <li>{{.locale.Tr "repo.trust_model_helper_collaborator_committer"}}</li> - <li>{{.locale.Tr "repo.trust_model_helper_default"}}</li> + <li>{{ctx.Locale.Tr "repo.trust_model_helper_collaborator"}}</li> + <li>{{ctx.Locale.Tr "repo.trust_model_helper_committer"}}</li> + <li>{{ctx.Locale.Tr "repo.trust_model_helper_collaborator_committer"}}</li> + <li>{{ctx.Locale.Tr "repo.trust_model_helper_default"}}</li> </ul> </div> </div> <div class="inline field"> - <label>{{.locale.Tr "repo.template"}}</label> + <label>{{ctx.Locale.Tr "repo.template"}}</label> <div class="ui checkbox"> <input name="template" type="checkbox"> - <label>{{.locale.Tr "repo.template_helper"}}</label> + <label>{{ctx.Locale.Tr "repo.template_helper"}}</label> </div> </div> </div> @@ -221,7 +221,7 @@ <div class="inline field"> <label></label> <button class="ui primary button{{if not .CanCreateRepo}} disabled{{end}}"> - {{.locale.Tr "repo.create_repo"}} + {{ctx.Locale.Tr "repo.create_repo"}} </button> </div> </div> diff --git a/templates/repo/create_helper.tmpl b/templates/repo/create_helper.tmpl index 4b91cdf075..653955efc9 100644 --- a/templates/repo/create_helper.tmpl +++ b/templates/repo/create_helper.tmpl @@ -1,3 +1,3 @@ {{if not $.DisableMigrations}} - <p class="ui center">{{.locale.Tr "repo.new_repo_helper" ((print AppSubUrl "/repo/migrate")|Escape) | Safe}}</p> + <p class="ui center">{{ctx.Locale.Tr "repo.new_repo_helper" ((print AppSubUrl "/repo/migrate")|Escape) | Safe}}</p> {{end}} diff --git a/templates/repo/diff/box.tmpl b/templates/repo/diff/box.tmpl index ff3fc7aef7..0ec268f065 100644 --- a/templates/repo/diff/box.tmpl +++ b/templates/repo/diff/box.tmpl @@ -2,7 +2,7 @@ <div class="diff-detail-box diff-box sticky gt-df gt-sb gt-ac"> <div class="gt-df gt-ac gt-fw"> {{if not .DiffNotAvailable}} - <button class="diff-toggle-file-tree-button gt-df gt-ac not-mobile" data-show-text="{{.locale.Tr "repo.diff.show_file_tree"}}" data-hide-text="{{.locale.Tr "repo.diff.hide_file_tree"}}"> + <button class="diff-toggle-file-tree-button gt-df gt-ac not-mobile" data-show-text="{{ctx.Locale.Tr "repo.diff.show_file_tree"}}" data-hide-text="{{.locale.Tr "repo.diff.hide_file_tree"}}"> {{/* the icon meaning is reversed here, "octicon-sidebar-collapse" means show the file tree */}} {{svg "octicon-sidebar-collapse" 20 "icon gt-hidden"}} {{svg "octicon-sidebar-expand" 20 "icon gt-hidden"}} @@ -16,15 +16,15 @@ diffTreeBtn.setAttribute('data-tooltip-content', diffTreeBtn.getAttribute(diffTreeVisible ? 'data-hide-text' : 'data-show-text')); </script> <div class="diff-detail-stats gt-df gt-ac gt-fw"> - {{svg "octicon-diff" 16 "gt-mr-2"}}{{.locale.Tr "repo.diff.stats_desc" .Diff.NumFiles .Diff.TotalAddition .Diff.TotalDeletion | Str2html}} + {{svg "octicon-diff" 16 "gt-mr-2"}}{{ctx.Locale.Tr "repo.diff.stats_desc" .Diff.NumFiles .Diff.TotalAddition .Diff.TotalDeletion | Str2html}} </div> {{end}} </div> <div class="diff-detail-actions"> {{if and .PageIsPullFiles $.SignedUserID (not .IsArchived) (not .DiffNotAvailable)}} <div class="gt-df gt-ac gt-fc gt-whitespace-nowrap gt-mr-2"> - <label for="viewed-files-summary" id="viewed-files-summary-label" data-text-changed-template="{{.locale.Tr "repo.pulls.viewed_files_label"}}"> - {{.locale.Tr "repo.pulls.viewed_files_label" .Diff.NumViewedFiles .Diff.NumFiles}} + <label for="viewed-files-summary" id="viewed-files-summary-label" data-text-changed-template="{{ctx.Locale.Tr "repo.pulls.viewed_files_label"}}"> + {{ctx.Locale.Tr "repo.pulls.viewed_files_label" .Diff.NumViewedFiles .Diff.NumFiles}} </label> <progress id="viewed-files-summary" value="{{.Diff.NumViewedFiles}}" max="{{.Diff.NumFiles}}"></progress> </div> @@ -32,7 +32,7 @@ {{template "repo/diff/whitespace_dropdown" .}} {{template "repo/diff/options_dropdown" .}} {{if .PageIsPullFiles}} - <div id="diff-commit-select" data-issuelink="{{$.Issue.Link}}" data-queryparams="?style={{if $.IsSplitStyle}}split{{else}}unified{{end}}&whitespace={{$.WhitespaceBehavior}}&show-outdated={{$.ShowOutdatedComments}}" data-filter_changes_by_commit="{{.locale.Tr "repo.pulls.filter_changes_by_commit"}}"> + <div id="diff-commit-select" 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 @@ -50,21 +50,21 @@ {{if not .DiffNotAvailable}} {{if and .IsShowingOnlySingleCommit .PageIsPullFiles}} <div class="ui info message"> - <div>{{.locale.Tr "repo.pulls.showing_only_single_commit" (ShortSha .BeforeCommitID)}} - <a href="{{$.Issue.Link}}/files?style={{if $.IsSplitStyle}}split{{else}}unified{{end}}&whitespace={{$.WhitespaceBehavior}}&show-outdated={{$.ShowOutdatedComments}}">{{.locale.Tr "repo.pulls.show_all_commits"}}</a></div> + <div>{{ctx.Locale.Tr "repo.pulls.showing_only_single_commit" (ShortSha .BeforeCommitID)}} - <a href="{{$.Issue.Link}}/files?style={{if $.IsSplitStyle}}split{{else}}unified{{end}}&whitespace={{$.WhitespaceBehavior}}&show-outdated={{$.ShowOutdatedComments}}">{{.locale.Tr "repo.pulls.show_all_commits"}}</a></div> </div> {{else if and (not .IsShowingAllCommits) .PageIsPullFiles}} <div class="ui info message"> - <div>{{.locale.Tr "repo.pulls.showing_specified_commit_range" (ShortSha .BeforeCommitID) (ShortSha .AfterCommitID)}} - <a href="{{$.Issue.Link}}/files?style={{if $.IsSplitStyle}}split{{else}}unified{{end}}&whitespace={{$.WhitespaceBehavior}}&show-outdated={{$.ShowOutdatedComments}}">{{.locale.Tr "repo.pulls.show_all_commits"}}</a></div> + <div>{{ctx.Locale.Tr "repo.pulls.showing_specified_commit_range" (ShortSha .BeforeCommitID) (ShortSha .AfterCommitID)}} - <a href="{{$.Issue.Link}}/files?style={{if $.IsSplitStyle}}split{{else}}unified{{end}}&whitespace={{$.WhitespaceBehavior}}&show-outdated={{$.ShowOutdatedComments}}">{{.locale.Tr "repo.pulls.show_all_commits"}}</a></div> </div> {{end}} <script id="diff-data-script" type="module"> const diffDataFiles = [{{range $i, $file := .Diff.Files}}{Name:"{{$file.Name}}",NameHash:"{{$file.NameHash}}",Type:{{$file.Type}},IsBin:{{$file.IsBin}},Addition:{{$file.Addition}},Deletion:{{$file.Deletion}},IsViewed:{{$file.IsViewed}}},{{end}}]; const diffData = { isIncomplete: {{.Diff.IsIncomplete}}, - tooManyFilesMessage: "{{$.locale.Tr "repo.diff.too_many_files"}}", - binaryFileMessage: "{{$.locale.Tr "repo.diff.bin"}}", - showMoreMessage: "{{.locale.Tr "repo.diff.show_more"}}", - statisticsMessage: "{{.locale.Tr "repo.diff.stats_desc_file"}}", + tooManyFilesMessage: "{{ctx.Locale.Tr "repo.diff.too_many_files"}}", + binaryFileMessage: "{{ctx.Locale.Tr "repo.diff.bin"}}", + showMoreMessage: "{{ctx.Locale.Tr "repo.diff.show_more"}}", + statisticsMessage: "{{ctx.Locale.Tr "repo.diff.stats_desc_file"}}", linkLoadMore: "{{$.Link}}?skip-to={{.Diff.End}}&file-only=true", }; @@ -86,7 +86,7 @@ {{end}} <div id="diff-container"> {{if .DiffNotAvailable}} - <h4>{{.locale.Tr "repo.diff.data_not_available"}}</h4> + <h4>{{ctx.Locale.Tr "repo.diff.data_not_available"}}</h4> {{else}} <div id="diff-file-tree" class="gt-hidden"></div> <script> @@ -115,55 +115,55 @@ <div class="gt-font-semibold gt-df gt-ac gt-mono"> {{if $file.IsBin}} <span class="gt-ml-1 gt-mr-3"> - {{$.locale.Tr "repo.diff.bin"}} + {{ctx.Locale.Tr "repo.diff.bin"}} </span> {{else}} {{template "repo/diff/stats" dict "file" . "root" $}} {{end}} </div> - <span class="file gt-mono"><a class="muted file-link" title="{{if $file.IsRenamed}}{{$file.OldName}} → {{end}}{{$file.Name}}" href="#diff-{{$file.NameHash}}">{{if $file.IsRenamed}}{{$file.OldName}} → {{end}}{{$file.Name}}</a>{{if .IsLFSFile}} ({{$.locale.Tr "repo.stored_lfs"}}){{end}}</span> + <span class="file gt-mono"><a class="muted file-link" title="{{if $file.IsRenamed}}{{$file.OldName}} → {{end}}{{$file.Name}}" href="#diff-{{$file.NameHash}}">{{if $file.IsRenamed}}{{$file.OldName}} → {{end}}{{$file.Name}}</a>{{if .IsLFSFile}} ({{ctx.Locale.Tr "repo.stored_lfs"}}){{end}}</span> <button class="btn interact-fg gt-p-3" data-clipboard-text="{{$file.Name}}">{{svg "octicon-copy" 14}}</button> {{if $file.IsGenerated}} - <span class="ui label">{{$.locale.Tr "repo.diff.generated"}}</span> + <span class="ui label">{{ctx.Locale.Tr "repo.diff.generated"}}</span> {{end}} {{if $file.IsVendored}} - <span class="ui label">{{$.locale.Tr "repo.diff.vendored"}}</span> + <span class="ui label">{{ctx.Locale.Tr "repo.diff.vendored"}}</span> {{end}} {{if and $file.Mode $file.OldMode}} - {{$old := $.locale.Tr ($file.ModeTranslationKey $file.OldMode)}} - {{$new := $.locale.Tr ($file.ModeTranslationKey $file.Mode)}} - <span class="gt-ml-4 gt-mono">{{$.locale.Tr "git.filemode.changed_filemode" $old $new}}</span> + {{$old := ctx.Locale.Tr ($file.ModeTranslationKey $file.OldMode)}} + {{$new := ctx.Locale.Tr ($file.ModeTranslationKey $file.Mode)}} + <span class="gt-ml-4 gt-mono">{{ctx.Locale.Tr "git.filemode.changed_filemode" $old $new}}</span> {{else if $file.Mode}} - <span class="gt-ml-4 gt-mono">{{$.locale.Tr ($file.ModeTranslationKey $file.Mode)}}</span> + <span class="gt-ml-4 gt-mono">{{ctx.Locale.Tr ($file.ModeTranslationKey $file.Mode)}}</span> {{end}} </div> <div class="diff-file-header-actions gt-df gt-ac gt-gap-2 gt-fw"> {{if $showFileViewToggle}} <div class="ui compact icon buttons"> - <button class="ui tiny basic button file-view-toggle" data-toggle-selector="#diff-source-{{$file.NameHash}}" data-tooltip-content="{{$.locale.Tr "repo.file_view_source"}}">{{svg "octicon-code"}}</button> - <button class="ui tiny basic button file-view-toggle active" data-toggle-selector="#diff-rendered-{{$file.NameHash}}" data-tooltip-content="{{$.locale.Tr "repo.file_view_rendered"}}">{{svg "octicon-file"}}</button> + <button class="ui tiny basic button file-view-toggle" data-toggle-selector="#diff-source-{{$file.NameHash}}" data-tooltip-content="{{ctx.Locale.Tr "repo.file_view_source"}}">{{svg "octicon-code"}}</button> + <button class="ui tiny basic button file-view-toggle active" data-toggle-selector="#diff-rendered-{{$file.NameHash}}" data-tooltip-content="{{ctx.Locale.Tr "repo.file_view_rendered"}}">{{svg "octicon-file"}}</button> </div> {{end}} {{if $file.IsProtected}} - <span class="ui basic label">{{$.locale.Tr "repo.diff.protected"}}</span> + <span class="ui basic label">{{ctx.Locale.Tr "repo.diff.protected"}}</span> {{end}} {{if and $isReviewFile $file.HasChangedSinceLastReview}} - <span class="changed-since-last-review unselectable not-mobile">{{$.locale.Tr "repo.pulls.has_changed_since_last_review"}}</span> + <span class="changed-since-last-review unselectable not-mobile">{{ctx.Locale.Tr "repo.pulls.has_changed_since_last_review"}}</span> {{end}} {{if not (or $file.IsIncomplete $file.IsBin $file.IsSubmodule)}} - <button class="ui basic tiny button unescape-button not-mobile">{{$.locale.Tr "repo.unescape_control_characters"}}</button> - <button class="ui basic tiny button escape-button gt-hidden">{{$.locale.Tr "repo.escape_control_characters"}}</button> + <button class="ui basic tiny button unescape-button not-mobile">{{ctx.Locale.Tr "repo.unescape_control_characters"}}</button> + <button class="ui basic tiny button escape-button gt-hidden">{{ctx.Locale.Tr "repo.escape_control_characters"}}</button> {{end}} {{if and (not $file.IsSubmodule) (not $.PageIsWiki)}} {{if $file.IsDeleted}} - <a class="ui basic tiny button" rel="nofollow" href="{{$.BeforeSourcePath}}/{{PathEscapeSegments .Name}}">{{$.locale.Tr "repo.diff.view_file"}}</a> + <a class="ui basic tiny button" rel="nofollow" href="{{$.BeforeSourcePath}}/{{PathEscapeSegments .Name}}">{{ctx.Locale.Tr "repo.diff.view_file"}}</a> {{else}} - <a class="ui basic tiny button" rel="nofollow" href="{{$.SourcePath}}/{{PathEscapeSegments .Name}}">{{$.locale.Tr "repo.diff.view_file"}}</a> + <a class="ui basic tiny button" rel="nofollow" href="{{$.SourcePath}}/{{PathEscapeSegments .Name}}">{{ctx.Locale.Tr "repo.diff.view_file"}}</a> {{end}} {{end}} {{if $isReviewFile}} <label data-link="{{$.Issue.Link}}/viewed-files" data-headcommit="{{$.AfterCommitID}}" class="viewed-file-form unselectable{{if $file.IsViewed}} viewed-file-checked-form{{end}}"> - <input type="checkbox" name="{{$file.GetDiffFileName}}" autocomplete="off"{{if $file.IsViewed}} checked{{end}}> {{$.locale.Tr "repo.pulls.has_viewed_file"}} + <input type="checkbox" name="{{$file.GetDiffFileName}}" autocomplete="off"{{if $file.IsViewed}} checked{{end}}> {{ctx.Locale.Tr "repo.pulls.has_viewed_file"}} </label> {{end}} </div> @@ -174,13 +174,13 @@ <div class="diff-file-body binary" style="padding: 5px 10px;"> {{if $file.IsIncomplete}} {{if $file.IsIncompleteLineTooLong}} - {{$.locale.Tr "repo.diff.file_suppressed_line_too_long"}} + {{ctx.Locale.Tr "repo.diff.file_suppressed_line_too_long"}} {{else}} - {{$.locale.Tr "repo.diff.file_suppressed"}} - <a class="ui basic tiny button diff-load-button" data-href="{{$.Link}}?file-only=true&files={{$file.Name}}&files={{$file.OldName}}">{{$.locale.Tr "repo.diff.load"}}</a> + {{ctx.Locale.Tr "repo.diff.file_suppressed"}} + <a class="ui basic tiny button diff-load-button" data-href="{{$.Link}}?file-only=true&files={{$file.Name}}&files={{$file.OldName}}">{{ctx.Locale.Tr "repo.diff.load"}}</a> {{end}} {{else}} - {{$.locale.Tr "repo.diff.bin_not_shown"}} + {{ctx.Locale.Tr "repo.diff.bin_not_shown"}} {{end}} </div> {{else}} @@ -212,8 +212,8 @@ {{if .Diff.IsIncomplete}} <div class="diff-file-box diff-box file-content gt-mt-3" id="diff-incomplete"> <h4 class="ui top attached normal header gt-df gt-ac gt-sb"> - {{$.locale.Tr "repo.diff.too_many_files"}} - <a class="ui basic tiny button" id="diff-show-more-files" data-href="{{$.Link}}?skip-to={{.Diff.End}}&file-only=true">{{.locale.Tr "repo.diff.show_more"}}</a> + {{ctx.Locale.Tr "repo.diff.too_many_files"}} + <a class="ui basic tiny button" id="diff-show-more-files" data-href="{{$.Link}}?skip-to={{.Diff.End}}&file-only=true">{{ctx.Locale.Tr "repo.diff.show_more"}}</a> </h4> </div> {{end}} @@ -231,8 +231,8 @@ "DropzoneParentContainer" ".ui.form" )}} <div class="text right edit buttons"> - <button class="ui cancel button" tabindex="3">{{.locale.Tr "repo.issues.cancel"}}</button> - <button class="ui primary save button" tabindex="2">{{.locale.Tr "repo.issues.save"}}</button> + <button class="ui cancel button" tabindex="3">{{ctx.Locale.Tr "repo.issues.cancel"}}</button> + <button class="ui primary save button" tabindex="2">{{ctx.Locale.Tr "repo.issues.save"}}</button> </div> </div> </template> diff --git a/templates/repo/diff/comment_form.tmpl b/templates/repo/diff/comment_form.tmpl index 13dd91143c..767c2613a0 100644 --- a/templates/repo/diff/comment_form.tmpl +++ b/templates/repo/diff/comment_form.tmpl @@ -14,7 +14,7 @@ "MarkdownPreviewUrl" (print $.root.Repository.Link "/markup") "MarkdownPreviewContext" $.root.RepoLink "TextareaName" "content" - "TextareaPlaceholder" ($.locale.Tr "repo.diff.comment.placeholder") + "TextareaPlaceholder" (ctx.Locale.Tr "repo.diff.comment.placeholder") "DropzoneParentContainer" "form" "DisableAutosize" "true" )}} diff --git a/templates/repo/diff/compare.tmpl b/templates/repo/diff/compare.tmpl index 4d57fd6148..9926f43eeb 100644 --- a/templates/repo/diff/compare.tmpl +++ b/templates/repo/diff/compare.tmpl @@ -5,10 +5,10 @@ <div class="ui container"> <h2 class="ui header"> {{if and $.PageIsComparePull $.IsSigned (not .Repository.IsArchived)}} - {{.locale.Tr "repo.pulls.compare_changes"}} - <div class="sub header">{{.locale.Tr "repo.pulls.compare_changes_desc"}}</div> + {{ctx.Locale.Tr "repo.pulls.compare_changes"}} + <div class="sub header">{{ctx.Locale.Tr "repo.pulls.compare_changes_desc"}}</div> {{else}} - {{.locale.Tr "action.compare_commits_general"}} + {{ctx.Locale.Tr "action.compare_commits_general"}} {{end}} </h2> {{if .Flash.WarningMsg}} @@ -36,28 +36,28 @@ {{- end -}} {{- end -}} <div class="ui segment choose branch"> - <a href="{{$.HeadRepo.Link}}/compare/{{PathEscapeSegments $.HeadBranch}}{{$.CompareSeparator}}{{if not $.PullRequestCtx.SameRepo}}{{PathEscape $.BaseName}}/{{PathEscape $.Repository.Name}}:{{end}}{{PathEscapeSegments $.BaseBranch}}" title="{{.locale.Tr "repo.pulls.switch_head_and_base"}}">{{svg "octicon-git-compare"}}</a> - <div class="ui floating filter dropdown" data-no-results="{{.locale.Tr "repo.pulls.no_results"}}"> + <a href="{{$.HeadRepo.Link}}/compare/{{PathEscapeSegments $.HeadBranch}}{{$.CompareSeparator}}{{if not $.PullRequestCtx.SameRepo}}{{PathEscape $.BaseName}}/{{PathEscape $.Repository.Name}}:{{end}}{{PathEscapeSegments $.BaseBranch}}" title="{{ctx.Locale.Tr "repo.pulls.switch_head_and_base"}}">{{svg "octicon-git-compare"}}</a> + <div class="ui floating filter dropdown" data-no-results="{{ctx.Locale.Tr "repo.pulls.no_results"}}"> <div class="ui basic small button"> - <span class="text">{{if $.PageIsComparePull}}{{.locale.Tr "repo.pulls.compare_base"}}{{else}}{{.locale.Tr "repo.compare.compare_base"}}{{end}}: {{$BaseCompareName}}:{{$.BaseBranch}}</span> + <span class="text">{{if $.PageIsComparePull}}{{ctx.Locale.Tr "repo.pulls.compare_base"}}{{else}}{{.locale.Tr "repo.compare.compare_base"}}{{end}}: {{$BaseCompareName}}:{{$.BaseBranch}}</span> {{svg "octicon-triangle-down" 14 "dropdown icon"}} </div> <div class="menu"> <div class="ui icon search input"> <i class="icon">{{svg "octicon-filter" 16}}</i> - <input name="search" placeholder="{{.locale.Tr "repo.filter_branch_and_tag"}}..."> + <input name="search" placeholder="{{ctx.Locale.Tr "repo.filter_branch_and_tag"}}..."> </div> <div class="header"> <div class="ui grid"> <div class="two column row"> <a class="reference column" href="#" data-target=".base-branch-list"> <span class="text black"> - {{svg "octicon-git-branch" 16 "gt-mr-2"}}{{.locale.Tr "repo.branches"}} + {{svg "octicon-git-branch" 16 "gt-mr-2"}}{{ctx.Locale.Tr "repo.branches"}} </span> </a> <a class="reference column" href="#" data-target=".base-tag-list"> <span class="text black"> - {{svg "octicon-tag" 16 "gt-mr-2"}}{{.locale.Tr "repo.tags"}} + {{svg "octicon-tag" 16 "gt-mr-2"}}{{ctx.Locale.Tr "repo.tags"}} </span> </a> </div> @@ -105,28 +105,28 @@ </div> </div> </div> - <a href="{{.RepoLink}}/compare/{{PathEscapeSegments .BaseBranch}}{{.OtherCompareSeparator}}{{if not $.PullRequestCtx.SameRepo}}{{PathEscape $.HeadUser.Name}}/{{PathEscape $.HeadRepo.Name}}:{{end}}{{PathEscapeSegments $.HeadBranch}}" title="{{.locale.Tr "repo.pulls.switch_comparison_type"}}">{{.CompareSeparator}}</a> + <a href="{{.RepoLink}}/compare/{{PathEscapeSegments .BaseBranch}}{{.OtherCompareSeparator}}{{if not $.PullRequestCtx.SameRepo}}{{PathEscape $.HeadUser.Name}}/{{PathEscape $.HeadRepo.Name}}:{{end}}{{PathEscapeSegments $.HeadBranch}}" title="{{ctx.Locale.Tr "repo.pulls.switch_comparison_type"}}">{{.CompareSeparator}}</a> <div class="ui floating filter dropdown"> <div class="ui basic small button"> - <span class="text">{{if $.PageIsComparePull}}{{.locale.Tr "repo.pulls.compare_compare"}}{{else}}{{.locale.Tr "repo.compare.compare_head"}}{{end}}: {{$HeadCompareName}}:{{$.HeadBranch}}</span> + <span class="text">{{if $.PageIsComparePull}}{{ctx.Locale.Tr "repo.pulls.compare_compare"}}{{else}}{{.locale.Tr "repo.compare.compare_head"}}{{end}}: {{$HeadCompareName}}:{{$.HeadBranch}}</span> {{svg "octicon-triangle-down" 14 "dropdown icon"}} </div> <div class="menu"> <div class="ui icon search input"> <i class="icon">{{svg "octicon-filter" 16}}</i> - <input name="search" placeholder="{{.locale.Tr "repo.filter_branch_and_tag"}}..."> + <input name="search" placeholder="{{ctx.Locale.Tr "repo.filter_branch_and_tag"}}..."> </div> <div class="header"> <div class="ui grid"> <div class="two column row"> <a class="reference column" href="#" data-target=".head-branch-list"> <span class="text black"> - {{svg "octicon-git-branch" 16 "gt-mr-2"}}{{.locale.Tr "repo.branches"}} + {{svg "octicon-git-branch" 16 "gt-mr-2"}}{{ctx.Locale.Tr "repo.branches"}} </span> </a> <a class="reference column" href="#" data-target=".head-tag-list"> <span class="text black"> - {{svg "octicon-tag" 16 "gt-mr-2"}}{{.locale.Tr "repo.tags"}} + {{svg "octicon-tag" 16 "gt-mr-2"}}{{ctx.Locale.Tr "repo.tags"}} </span> </a> </div> @@ -178,21 +178,21 @@ {{if .IsNothingToCompare}} {{if and $.IsSigned $.AllowEmptyPr (not .Repository.IsArchived)}} - <div class="ui segment">{{.locale.Tr "repo.pulls.nothing_to_compare_and_allow_empty_pr"}}</div> + <div class="ui segment">{{ctx.Locale.Tr "repo.pulls.nothing_to_compare_and_allow_empty_pr"}}</div> <div class="ui info message show-form-container {{if .Flash}}gt-hidden{{end}}"> - <button class="ui button primary show-form">{{.locale.Tr "repo.pulls.new"}}</button> + <button class="ui button primary show-form">{{ctx.Locale.Tr "repo.pulls.new"}}</button> </div> <div class="pullrequest-form {{if not .Flash}}gt-hidden{{end}}"> {{template "repo/issue/new_form" .}} </div> {{else}} - <div class="ui segment">{{.locale.Tr "repo.pulls.nothing_to_compare"}}</div> + <div class="ui segment">{{ctx.Locale.Tr "repo.pulls.nothing_to_compare"}}</div> {{end}} {{else if and .PageIsComparePull (gt .CommitCount 0)}} {{if .HasPullRequest}} <div class="ui segment grid title"> <div class="twelve wide column issue-title"> - {{.locale.Tr "repo.pulls.has_pull_request" (print (Escape $.RepoLink) "/pulls/" .PullRequest.Issue.Index) (Escape $.RepoRelPath) .PullRequest.Index | Safe}} + {{ctx.Locale.Tr "repo.pulls.has_pull_request" (print (Escape $.RepoLink) "/pulls/" .PullRequest.Issue.Index) (Escape $.RepoRelPath) .PullRequest.Index | Safe}} <h1> <span id="issue-title">{{RenderIssueTitle $.Context .PullRequest.Issue.Title $.RepoLink $.Repository.ComposeMetas}}</span> <span class="index">#{{.PullRequest.Issue.Index}}</span> @@ -200,25 +200,25 @@ </div> <div class="four wide column middle aligned text right"> {{- if .PullRequest.HasMerged -}} - <a href="{{Escape $.RepoLink}}/pulls/{{.PullRequest.Issue.Index}}" class="ui button purple show-form">{{svg "octicon-git-merge" 16}} {{.locale.Tr "repo.pulls.view"}}</a> + <a href="{{Escape $.RepoLink}}/pulls/{{.PullRequest.Issue.Index}}" class="ui button purple show-form">{{svg "octicon-git-merge" 16}} {{ctx.Locale.Tr "repo.pulls.view"}}</a> {{else if .Issue.IsClosed}} - <a href="{{Escape $.RepoLink}}/pulls/{{.PullRequest.Issue.Index}}" class="ui button red show-form">{{svg "octicon-issue-closed" 16}} {{.locale.Tr "repo.pulls.view"}}</a> + <a href="{{Escape $.RepoLink}}/pulls/{{.PullRequest.Issue.Index}}" class="ui button red show-form">{{svg "octicon-issue-closed" 16}} {{ctx.Locale.Tr "repo.pulls.view"}}</a> {{else}} - <a href="{{Escape $.RepoLink}}/pulls/{{.PullRequest.Issue.Index}}" class="ui button primary show-form">{{svg "octicon-git-pull-request" 16}} {{.locale.Tr "repo.pulls.view"}}</a> + <a href="{{Escape $.RepoLink}}/pulls/{{.PullRequest.Issue.Index}}" class="ui button primary show-form">{{svg "octicon-git-pull-request" 16}} {{ctx.Locale.Tr "repo.pulls.view"}}</a> {{end}} </div> </div> {{else}} {{if and $.IsSigned (not .Repository.IsArchived)}} <div class="ui info message show-form-container {{if .Flash}}gt-hidden{{end}}"> - <button class="ui button primary show-form">{{.locale.Tr "repo.pulls.new"}}</button> + <button class="ui button primary show-form">{{ctx.Locale.Tr "repo.pulls.new"}}</button> </div> {{else if .Repository.IsArchived}} <div class="ui warning message gt-text-center"> {{if .Repository.ArchivedUnix.IsZero}} - {{.locale.Tr "repo.archive.title"}} + {{ctx.Locale.Tr "repo.archive.title"}} {{else}} - {{.locale.Tr "repo.archive.title_date" (DateTime "long" .Repository.ArchivedUnix) | Safe}} + {{ctx.Locale.Tr "repo.archive.title_date" (DateTime "long" .Repository.ArchivedUnix) | Safe}} {{end}} </div> {{end}} diff --git a/templates/repo/diff/conversation.tmpl b/templates/repo/diff/conversation.tmpl index c6ada10caf..feca7b6c0b 100644 --- a/templates/repo/diff/conversation.tmpl +++ b/templates/repo/diff/conversation.tmpl @@ -8,25 +8,25 @@ <div class="ui attached header resolved-placeholder gt-df gt-ac gt-sb"> <div class="ui grey text gt-df gt-ac gt-fw gt-gap-2"> {{svg "octicon-check" 16 "icon gt-mr-2"}} - <b>{{$resolveDoer.Name}}</b> {{$.locale.Tr "repo.issues.review.resolved_by"}} + <b>{{$resolveDoer.Name}}</b> {{ctx.Locale.Tr "repo.issues.review.resolved_by"}} {{if $invalid}} <!-- We only handle the case $resolved=true and $invalid=true in this template because if the comment is not resolved it has the outdated label in the comments area (not the header above). The case $resolved=false and $invalid=true is handled in repo/diff/comments.tmpl --> - <a href="{{AppSubUrl}}{{$referenceUrl}}" class="ui label basic small gt-ml-3" data-tooltip-content="{{$.locale.Tr "repo.issues.review.outdated_description"}}"> - {{$.locale.Tr "repo.issues.review.outdated"}} + <a href="{{AppSubUrl}}{{$referenceUrl}}" class="ui label basic small gt-ml-3" data-tooltip-content="{{ctx.Locale.Tr "repo.issues.review.outdated_description"}}"> + {{ctx.Locale.Tr "repo.issues.review.outdated"}} </a> {{end}} </div> <div class="gt-df gt-ac gt-gap-3"> <button id="show-outdated-{{(index .comments 0).ID}}" data-comment="{{(index .comments 0).ID}}" class="ui tiny labeled button show-outdated gt-df gt-ac"> {{svg "octicon-unfold" 16 "gt-mr-3"}} - {{$.locale.Tr "repo.issues.review.show_resolved"}} + {{ctx.Locale.Tr "repo.issues.review.show_resolved"}} </button> <button id="hide-outdated-{{(index .comments 0).ID}}" data-comment="{{(index .comments 0).ID}}" class="ui tiny labeled button hide-outdated gt-df gt-ac gt-hidden"> {{svg "octicon-fold" 16 "gt-mr-3"}} - {{$.locale.Tr "repo.issues.review.hide_resolved"}} + {{ctx.Locale.Tr "repo.issues.review.hide_resolved"}} </button> </div> </div> @@ -40,24 +40,24 @@ <div class="gt-df gt-je gt-ac gt-fw gt-mt-3"> <div class="ui buttons gt-mr-2"> <button class="ui icon tiny basic button previous-conversation"> - {{svg "octicon-arrow-up" 12 "icon"}} {{$.locale.Tr "repo.issues.previous"}} + {{svg "octicon-arrow-up" 12 "icon"}} {{ctx.Locale.Tr "repo.issues.previous"}} </button> <button class="ui icon tiny basic button next-conversation"> - {{svg "octicon-arrow-down" 12 "icon"}} {{$.locale.Tr "repo.issues.next"}} + {{svg "octicon-arrow-down" 12 "icon"}} {{ctx.Locale.Tr "repo.issues.next"}} </button> </div> {{if and $.CanMarkConversation $isNotPending}} <button class="ui icon tiny basic button resolve-conversation" data-origin="diff" data-action="{{if not $resolved}}Resolve{{else}}UnResolve{{end}}" data-comment-id="{{(index .comments 0).ID}}" data-update-url="{{$.RepoLink}}/issues/resolve_conversation"> {{if $resolved}} - {{$.locale.Tr "repo.issues.review.un_resolve_conversation"}} + {{ctx.Locale.Tr "repo.issues.review.un_resolve_conversation"}} {{else}} - {{$.locale.Tr "repo.issues.review.resolve_conversation"}} + {{ctx.Locale.Tr "repo.issues.review.resolve_conversation"}} {{end}} </button> {{end}} {{if and $.SignedUserID (not $.Repository.IsArchived)}} <button class="comment-form-reply ui primary tiny labeled icon button gt-ml-2 gt-mr-0"> - {{svg "octicon-reply" 16 "reply icon gt-mr-2"}}{{$.locale.Tr "repo.diff.comment.reply"}} + {{svg "octicon-reply" 16 "reply icon gt-mr-2"}}{{ctx.Locale.Tr "repo.diff.comment.reply"}} </button> {{end}} </div> diff --git a/templates/repo/diff/image_diff.tmpl b/templates/repo/diff/image_diff.tmpl index bd461d2800..8abce9479e 100644 --- a/templates/repo/diff/image_diff.tmpl +++ b/templates/repo/diff/image_diff.tmpl @@ -4,10 +4,10 @@ <div class="image-diff" data-path-before="{{.root.BeforeRawPath}}/{{PathEscapeSegments .file.OldName}}" data-path-after="{{.root.RawPath}}/{{PathEscapeSegments .file.Name}}"> <div class="ui secondary pointing tabular top attached borderless menu new-menu"> <div class="new-menu-inner"> - <a class="item active" data-tab="diff-side-by-side-{{.file.Index}}">{{.root.locale.Tr "repo.diff.image.side_by_side"}}</a> + <a class="item active" data-tab="diff-side-by-side-{{.file.Index}}">{{ctx.Locale.Tr "repo.diff.image.side_by_side"}}</a> {{if and .blobBase .blobHead}} - <a class="item" data-tab="diff-swipe-{{.file.Index}}">{{.root.locale.Tr "repo.diff.image.swipe"}}</a> - <a class="item" data-tab="diff-overlay-{{.file.Index}}">{{.root.locale.Tr "repo.diff.image.overlay"}}</a> + <a class="item" data-tab="diff-swipe-{{.file.Index}}">{{ctx.Locale.Tr "repo.diff.image.swipe"}}</a> + <a class="item" data-tab="diff-overlay-{{.file.Index}}">{{ctx.Locale.Tr "repo.diff.image.overlay"}}</a> {{end}} </div> </div> @@ -16,31 +16,31 @@ <div class="diff-side-by-side"> {{if .blobBase}} <span class="side"> - <p class="side-header">{{.root.locale.Tr "repo.diff.file_before"}}</p> + <p class="side-header">{{ctx.Locale.Tr "repo.diff.file_before"}}</p> <span class="before-container"><img class="image-before"></span> <p> <span class="bounds-info-before"> - {{.root.locale.Tr "repo.diff.file_image_width"}}: <span class="text bounds-info-width"></span> + {{ctx.Locale.Tr "repo.diff.file_image_width"}}: <span class="text bounds-info-width"></span> | - {{.root.locale.Tr "repo.diff.file_image_height"}}: <span class="text bounds-info-height"></span> + {{ctx.Locale.Tr "repo.diff.file_image_height"}}: <span class="text bounds-info-height"></span> | </span> - {{.root.locale.Tr "repo.diff.file_byte_size"}}: <span class="text">{{FileSize .blobBase.Size}}</span> + {{ctx.Locale.Tr "repo.diff.file_byte_size"}}: <span class="text">{{FileSize .blobBase.Size}}</span> </p> </span> {{end}} {{if .blobHead}} <span class="side"> - <p class="side-header">{{.root.locale.Tr "repo.diff.file_after"}}</p> + <p class="side-header">{{ctx.Locale.Tr "repo.diff.file_after"}}</p> <span class="after-container"><img class="image-after"></span> <p> <span class="bounds-info-after"> - {{.root.locale.Tr "repo.diff.file_image_width"}}: <span class="text bounds-info-width"></span> + {{ctx.Locale.Tr "repo.diff.file_image_width"}}: <span class="text bounds-info-width"></span> | - {{.root.locale.Tr "repo.diff.file_image_height"}}: <span class="text bounds-info-height"></span> + {{ctx.Locale.Tr "repo.diff.file_image_height"}}: <span class="text bounds-info-height"></span> | </span> - {{.root.locale.Tr "repo.diff.file_byte_size"}}: <span class="text">{{FileSize .blobHead.Size}}</span> + {{ctx.Locale.Tr "repo.diff.file_byte_size"}}: <span class="text">{{FileSize .blobHead.Size}}</span> </p> </span> {{end}} diff --git a/templates/repo/diff/new_review.tmpl b/templates/repo/diff/new_review.tmpl index 6cdd625790..ae7182c930 100644 --- a/templates/repo/diff/new_review.tmpl +++ b/templates/repo/diff/new_review.tmpl @@ -1,6 +1,6 @@ <div id="review-box"> - <button class="ui tiny primary button gt-pr-2 gt-df js-btn-review {{if not $.IsShowingAllCommits}}disabled{{end}}" {{if not $.IsShowingAllCommits}}data-tooltip-content="{{$.locale.Tr "repo.pulls.review_only_possible_for_full_diff"}}"{{end}}> - {{.locale.Tr "repo.diff.review"}} + <button class="ui tiny primary button gt-pr-2 gt-df js-btn-review {{if not $.IsShowingAllCommits}}disabled{{end}}" {{if not $.IsShowingAllCommits}}data-tooltip-content="{{ctx.Locale.Tr "repo.pulls.review_only_possible_for_full_diff"}}"{{end}}> + {{ctx.Locale.Tr "repo.diff.review"}} <span class="ui small label review-comments-counter" data-pending-comment-number="{{.PendingCodeCommentNumber}}">{{.PendingCodeCommentNumber}}</span> {{svg "octicon-triangle-down" 14 "dropdown icon"}} </button> @@ -11,7 +11,7 @@ {{.CsrfTokenHtml}} <input type="hidden" name="commit_id" value="{{.AfterCommitID}}"> <div class="field gt-df gt-ac"> - <div class="gt-f1">{{$.locale.Tr "repo.diff.review.header"}}</div> + <div class="gt-f1">{{ctx.Locale.Tr "repo.diff.review.header"}}</div> <a class="muted close">{{svg "octicon-x" 16}}</a> </div> <div class="field"> @@ -19,7 +19,7 @@ "MarkdownPreviewUrl" (print .Repository.Link "/markup") "MarkdownPreviewContext" .RepoLink "TextareaName" "content" - "TextareaPlaceholder" ($.locale.Tr "repo.diff.review.placeholder") + "TextareaPlaceholder" (ctx.Locale.Tr "repo.diff.review.placeholder") "DropzoneParentContainer" "form" )}} </div> @@ -31,19 +31,19 @@ <div class="divider"></div> {{$showSelfTooltip := (and $.IsSigned ($.Issue.IsPoster $.SignedUser.ID))}} {{if $showSelfTooltip}} - <span class="gt-dib" data-tooltip-content="{{$.locale.Tr "repo.diff.review.self_approve"}}"> - <button type="submit" name="type" value="approve" disabled class="ui submit primary tiny button btn-submit">{{$.locale.Tr "repo.diff.review.approve"}}</button> + <span class="gt-dib" data-tooltip-content="{{ctx.Locale.Tr "repo.diff.review.self_approve"}}"> + <button type="submit" name="type" value="approve" disabled class="ui submit primary tiny button btn-submit">{{ctx.Locale.Tr "repo.diff.review.approve"}}</button> </span> {{else}} - <button type="submit" name="type" value="approve" class="ui submit primary tiny button btn-submit">{{$.locale.Tr "repo.diff.review.approve"}}</button> + <button type="submit" name="type" value="approve" class="ui submit primary tiny button btn-submit">{{ctx.Locale.Tr "repo.diff.review.approve"}}</button> {{end}} - <button type="submit" name="type" value="comment" class="ui submit tiny basic button btn-submit">{{$.locale.Tr "repo.diff.review.comment"}}</button> + <button type="submit" name="type" value="comment" class="ui submit tiny basic button btn-submit">{{ctx.Locale.Tr "repo.diff.review.comment"}}</button> {{if $showSelfTooltip}} - <span class="gt-dib" data-tooltip-content="{{$.locale.Tr "repo.diff.review.self_reject"}}"> - <button type="submit" name="type" value="reject" disabled class="ui submit red tiny button btn-submit">{{$.locale.Tr "repo.diff.review.reject"}}</button> + <span class="gt-dib" data-tooltip-content="{{ctx.Locale.Tr "repo.diff.review.self_reject"}}"> + <button type="submit" name="type" value="reject" disabled class="ui submit red tiny button btn-submit">{{ctx.Locale.Tr "repo.diff.review.reject"}}</button> </span> {{else}} - <button type="submit" name="type" value="reject" class="ui submit red tiny button btn-submit">{{$.locale.Tr "repo.diff.review.reject"}}</button> + <button type="submit" name="type" value="reject" class="ui submit red tiny button btn-submit">{{ctx.Locale.Tr "repo.diff.review.reject"}}</button> {{end}} </form> </div> diff --git a/templates/repo/diff/options_dropdown.tmpl b/templates/repo/diff/options_dropdown.tmpl index 172e674770..3bcb877cc6 100644 --- a/templates/repo/diff/options_dropdown.tmpl +++ b/templates/repo/diff/options_dropdown.tmpl @@ -1,30 +1,30 @@ -<div class="ui dropdown tiny basic button" data-tooltip-content="{{.locale.Tr "repo.diff.options_button"}}"> +<div class="ui dropdown tiny basic button" data-tooltip-content="{{ctx.Locale.Tr "repo.diff.options_button"}}"> {{svg "octicon-kebab-horizontal"}} <div class="menu"> - <a class="item" id="show-file-list-btn">{{.locale.Tr "repo.diff.show_diff_stats"}}</a> + <a class="item" id="show-file-list-btn">{{ctx.Locale.Tr "repo.diff.show_diff_stats"}}</a> {{if .Issue.Index}} - <a class="item" href="{{$.RepoLink}}/pulls/{{.Issue.Index}}.patch" download="{{.Issue.Index}}.patch">{{.locale.Tr "repo.diff.download_patch"}}</a> - <a class="item" href="{{$.RepoLink}}/pulls/{{.Issue.Index}}.diff" download="{{.Issue.Index}}.diff">{{.locale.Tr "repo.diff.download_diff"}}</a> + <a class="item" href="{{$.RepoLink}}/pulls/{{.Issue.Index}}.patch" download="{{.Issue.Index}}.patch">{{ctx.Locale.Tr "repo.diff.download_patch"}}</a> + <a class="item" href="{{$.RepoLink}}/pulls/{{.Issue.Index}}.diff" download="{{.Issue.Index}}.diff">{{ctx.Locale.Tr "repo.diff.download_diff"}}</a> {{else if $.PageIsWiki}} - <a class="item" href="{{$.RepoLink}}/wiki/commit/{{PathEscape .Commit.ID.String}}.patch" download="{{ShortSha .Commit.ID.String}}.patch">{{.locale.Tr "repo.diff.download_patch"}}</a> - <a class="item" href="{{$.RepoLink}}/wiki/commit/{{PathEscape .Commit.ID.String}}.diff" download="{{ShortSha .Commit.ID.String}}.diff">{{.locale.Tr "repo.diff.download_diff"}}</a> + <a class="item" href="{{$.RepoLink}}/wiki/commit/{{PathEscape .Commit.ID.String}}.patch" download="{{ShortSha .Commit.ID.String}}.patch">{{ctx.Locale.Tr "repo.diff.download_patch"}}</a> + <a class="item" href="{{$.RepoLink}}/wiki/commit/{{PathEscape .Commit.ID.String}}.diff" download="{{ShortSha .Commit.ID.String}}.diff">{{ctx.Locale.Tr "repo.diff.download_diff"}}</a> {{else if .Commit.ID.String}} - <a class="item" href="{{$.RepoLink}}/commit/{{PathEscape .Commit.ID.String}}.patch" download="{{ShortSha .Commit.ID.String}}.patch">{{.locale.Tr "repo.diff.download_patch"}}</a> - <a class="item" href="{{$.RepoLink}}/commit/{{PathEscape .Commit.ID.String}}.diff" download="{{ShortSha .Commit.ID.String}}.diff">{{.locale.Tr "repo.diff.download_diff"}}</a> + <a class="item" href="{{$.RepoLink}}/commit/{{PathEscape .Commit.ID.String}}.patch" download="{{ShortSha .Commit.ID.String}}.patch">{{ctx.Locale.Tr "repo.diff.download_patch"}}</a> + <a class="item" href="{{$.RepoLink}}/commit/{{PathEscape .Commit.ID.String}}.diff" download="{{ShortSha .Commit.ID.String}}.diff">{{ctx.Locale.Tr "repo.diff.download_diff"}}</a> {{end}} - <a id="expand-files-btn" class="item">{{.locale.Tr "repo.pulls.expand_files"}}</a> - <a id="collapse-files-btn"class="item">{{.locale.Tr "repo.pulls.collapse_files"}}</a> + <a id="expand-files-btn" class="item">{{ctx.Locale.Tr "repo.pulls.expand_files"}}</a> + <a id="collapse-files-btn"class="item">{{ctx.Locale.Tr "repo.pulls.collapse_files"}}</a> {{if .Issue.Index}} {{if .ShowOutdatedComments}} <a class="item" href="?style={{if $.IsSplitStyle}}split{{else}}unified{{end}}&whitespace={{$.WhitespaceBehavior}}&show-outdated=false"> <label class="gt-pointer-events-none"> - {{.locale.Tr "repo.issues.review.option.hide_outdated_comments"}} + {{ctx.Locale.Tr "repo.issues.review.option.hide_outdated_comments"}} </label> </a> {{else}} <a class="item" href="?style={{if $.IsSplitStyle}}split{{else}}unified{{end}}&whitespace={{$.WhitespaceBehavior}}&show-outdated=true"> <label class="gt-pointer-events-none"> - {{.locale.Tr "repo.issues.review.option.show_outdated_comments"}} + {{ctx.Locale.Tr "repo.issues.review.option.show_outdated_comments"}} </label> </a> {{end}} diff --git a/templates/repo/diff/stats.tmpl b/templates/repo/diff/stats.tmpl index ff7e90d29c..db468ab6c8 100644 --- a/templates/repo/diff/stats.tmpl +++ b/templates/repo/diff/stats.tmpl @@ -1,5 +1,5 @@ {{Eval .file.Addition "+" .file.Deletion}} -<span class="diff-stats-bar gt-mx-3" data-tooltip-content="{{.root.locale.Tr "repo.diff.stats_desc_file" (Eval .file.Addition "+" .file.Deletion) .file.Addition .file.Deletion | Str2html}}"> +<span class="diff-stats-bar gt-mx-3" data-tooltip-content="{{ctx.Locale.Tr "repo.diff.stats_desc_file" (Eval .file.Addition "+" .file.Deletion) .file.Addition .file.Deletion | Str2html}}"> {{/* if the denominator is zero, then the float result is "width: NaNpx", as before, it just works */}} <div class="diff-stats-add-bar" style="width: {{Eval 100 "*" .file.Addition "/" "(" .file.Addition "+" .file.Deletion "+" 0.0 ")"}}%"></div> </span> diff --git a/templates/repo/diff/whitespace_dropdown.tmpl b/templates/repo/diff/whitespace_dropdown.tmpl index a1830cb288..1c3b01fd80 100644 --- a/templates/repo/diff/whitespace_dropdown.tmpl +++ b/templates/repo/diff/whitespace_dropdown.tmpl @@ -1,30 +1,30 @@ -<div class="ui dropdown tiny basic button" data-tooltip-content="{{.locale.Tr "repo.diff.whitespace_button"}}"> +<div class="ui dropdown tiny basic button" data-tooltip-content="{{ctx.Locale.Tr "repo.diff.whitespace_button"}}"> {{svg "gitea-whitespace"}} <div class="menu"> <a class="item" href="?style={{if .IsSplitStyle}}split{{else}}unified{{end}}&whitespace=show-all&show-outdated={{$.ShowOutdatedComments}}"> <label class="gt-pointer-events-none"> <input class="gt-mr-3 gt-pointer-events-none" type="radio"{{if eq .WhitespaceBehavior "show-all"}} checked{{end}}> - {{.locale.Tr "repo.diff.whitespace_show_everything"}} + {{ctx.Locale.Tr "repo.diff.whitespace_show_everything"}} </label> </a> <a class="item" href="?style={{if .IsSplitStyle}}split{{else}}unified{{end}}&whitespace=ignore-all&show-outdated={{$.ShowOutdatedComments}}"> <label class="gt-pointer-events-none"> <input class="gt-mr-3 gt-pointer-events-none" type="radio"{{if eq .WhitespaceBehavior "ignore-all"}} checked{{end}}> - {{.locale.Tr "repo.diff.whitespace_ignore_all_whitespace"}} + {{ctx.Locale.Tr "repo.diff.whitespace_ignore_all_whitespace"}} </label> </a> <a class="item" href="?style={{if .IsSplitStyle}}split{{else}}unified{{end}}&whitespace=ignore-change&show-outdated={{$.ShowOutdatedComments}}"> <label class="gt-pointer-events-none"> <input class="gt-mr-3 gt-pointer-events-none" type="radio"{{if eq .WhitespaceBehavior "ignore-change"}} checked{{end}}> - {{.locale.Tr "repo.diff.whitespace_ignore_amount_changes"}} + {{ctx.Locale.Tr "repo.diff.whitespace_ignore_amount_changes"}} </label> </a> <a class="item" href="?style={{if .IsSplitStyle}}split{{else}}unified{{end}}&whitespace=ignore-eol&show-outdated={{$.ShowOutdatedComments}}"> <label class="gt-pointer-events-none"> <input class="gt-mr-3 gt-pointer-events-none" type="radio"{{if eq .WhitespaceBehavior "ignore-eol"}} checked{{end}}> - {{.locale.Tr "repo.diff.whitespace_ignore_at_eol"}} + {{ctx.Locale.Tr "repo.diff.whitespace_ignore_at_eol"}} </label> </a> </div> </div> -<a class="ui tiny basic button" href="?style={{if .IsSplitStyle}}unified{{else}}split{{end}}&whitespace={{$.WhitespaceBehavior}}&show-outdated={{$.ShowOutdatedComments}}" data-tooltip-content="{{if .IsSplitStyle}}{{.locale.Tr "repo.diff.show_unified_view"}}{{else}}{{.locale.Tr "repo.diff.show_split_view"}}{{end}}">{{if .IsSplitStyle}}{{svg "gitea-join"}}{{else}}{{svg "gitea-split"}}{{end}}</a> +<a class="ui tiny basic button" href="?style={{if .IsSplitStyle}}unified{{else}}split{{end}}&whitespace={{$.WhitespaceBehavior}}&show-outdated={{$.ShowOutdatedComments}}" data-tooltip-content="{{if .IsSplitStyle}}{{ctx.Locale.Tr "repo.diff.show_unified_view"}}{{else}}{{.locale.Tr "repo.diff.show_split_view"}}{{end}}">{{if .IsSplitStyle}}{{svg "gitea-join"}}{{else}}{{svg "gitea-split"}}{{end}}</a> diff --git a/templates/repo/editor/cherry_pick.tmpl b/templates/repo/editor/cherry_pick.tmpl index 59948f2837..75cb2e2c50 100644 --- a/templates/repo/editor/cherry_pick.tmpl +++ b/templates/repo/editor/cherry_pick.tmpl @@ -13,14 +13,14 @@ {{$shaurl := printf "%s/commit/%s" $.RepoLink (PathEscape .SHA)}} {{$shalink := printf `<a class="ui primary sha label" href="%s">%s</a>` (Escape $shaurl) (ShortSha .SHA)}} {{if eq .CherryPickType "revert"}} - {{.locale.Tr "repo.editor.revert" $shalink | Str2html}} + {{ctx.Locale.Tr "repo.editor.revert" $shalink | Str2html}} {{else}} - {{.locale.Tr "repo.editor.cherry_pick" $shalink | Str2html}} + {{ctx.Locale.Tr "repo.editor.cherry_pick" $shalink | Str2html}} {{end}} <a class="section" href="{{$.RepoLink}}">{{.Repository.FullName}}</a> <div class="breadcrumb-divider">:</div> <a class="section" href="{{$.BranchLink}}">{{.BranchName}}</a> - <span>{{.locale.Tr "repo.editor.or"}} <a href="{{$shaurl}}">{{.locale.Tr "repo.editor.cancel_lower"}}</a></span> + <span>{{ctx.Locale.Tr "repo.editor.or"}} <a href="{{$shaurl}}">{{.locale.Tr "repo.editor.cancel_lower"}}</a></span> </div> </div> {{template "repo/editor/commit_form" .}} diff --git a/templates/repo/editor/commit_form.tmpl b/templates/repo/editor/commit_form.tmpl index dd6537e1a0..a49b6f9b4c 100644 --- a/templates/repo/editor/commit_form.tmpl +++ b/templates/repo/editor/commit_form.tmpl @@ -2,37 +2,37 @@ {{ctx.AvatarUtils.Avatar .SignedUser 48 "commit-avatar"}} <div class="commit-form"> <h3>{{- if .CanCommitToBranch.WillSign}} - <span title="{{.locale.Tr "repo.signing.will_sign" .CanCommitToBranch.SigningKey}}">{{svg "octicon-lock" 24}}</span> - {{.locale.Tr "repo.editor.commit_signed_changes"}} + <span title="{{ctx.Locale.Tr "repo.signing.will_sign" .CanCommitToBranch.SigningKey}}">{{svg "octicon-lock" 24}}</span> + {{ctx.Locale.Tr "repo.editor.commit_signed_changes"}} {{- else}} - <span title="{{.locale.Tr (printf "repo.signing.wont_sign.%s" .CanCommitToBranch.WontSignReason)}}">{{svg "octicon-unlock" 24}}</span> - {{.locale.Tr "repo.editor.commit_changes"}} + <span title="{{ctx.Locale.Tr (printf "repo.signing.wont_sign.%s" .CanCommitToBranch.WontSignReason)}}">{{svg "octicon-unlock" 24}}</span> + {{ctx.Locale.Tr "repo.editor.commit_changes"}} {{- end}}</h3> <div class="field"> - <input name="commit_summary" placeholder="{{if .PageIsDelete}}{{.locale.Tr "repo.editor.delete" .TreePath}}{{else if .PageIsUpload}}{{.locale.Tr "repo.editor.upload_files_to_dir" .TreePath}}{{else if .IsNewFile}}{{.locale.Tr "repo.editor.add_tmpl"}}{{else if .PageIsPatch}}{{.locale.Tr "repo.editor.patch"}}{{else}}{{.locale.Tr "repo.editor.update" .TreePath}}{{end}}" value="{{.commit_summary}}" autofocus> + <input name="commit_summary" placeholder="{{if .PageIsDelete}}{{ctx.Locale.Tr "repo.editor.delete" .TreePath}}{{else if .PageIsUpload}}{{.locale.Tr "repo.editor.upload_files_to_dir" .TreePath}}{{else if .IsNewFile}}{{.locale.Tr "repo.editor.add_tmpl"}}{{else if .PageIsPatch}}{{.locale.Tr "repo.editor.patch"}}{{else}}{{.locale.Tr "repo.editor.update" .TreePath}}{{end}}" value="{{.commit_summary}}" autofocus> </div> <div class="field"> - <textarea name="commit_message" placeholder="{{.locale.Tr "repo.editor.commit_message_desc"}}" rows="5">{{.commit_message}}</textarea> + <textarea name="commit_message" placeholder="{{ctx.Locale.Tr "repo.editor.commit_message_desc"}}" rows="5">{{.commit_message}}</textarea> </div> <div class="inline field"> <div class="ui checkbox"> <input name="signoff" type="checkbox"> - <label>{{.locale.Tr "repo.editor.signoff_desc"}}</label> + <label>{{ctx.Locale.Tr "repo.editor.signoff_desc"}}</label> </div> </div> <div class="quick-pull-choice js-quick-pull-choice"> <div class="field"> <div class="ui radio checkbox {{if not .CanCommitToBranch.CanCommitToBranch}}disabled{{end}}"> - <input type="radio" class="js-quick-pull-choice-option" name="commit_choice" value="direct" button_text="{{.locale.Tr "repo.editor.commit_changes"}}" {{if eq .commit_choice "direct"}}checked{{end}}> + <input type="radio" class="js-quick-pull-choice-option" name="commit_choice" value="direct" button_text="{{ctx.Locale.Tr "repo.editor.commit_changes"}}" {{if eq .commit_choice "direct"}}checked{{end}}> <label> {{svg "octicon-git-commit"}} - {{.locale.Tr "repo.editor.commit_directly_to_this_branch" (.BranchName|Escape) | Safe}} + {{ctx.Locale.Tr "repo.editor.commit_directly_to_this_branch" (.BranchName|Escape) | Safe}} {{if not .CanCommitToBranch.CanCommitToBranch}} <div class="ui visible small warning message"> - {{.locale.Tr "repo.editor.no_commit_to_branch"}} + {{ctx.Locale.Tr "repo.editor.no_commit_to_branch"}} <ul> - {{if not .CanCommitToBranch.UserCanPush}}<li>{{.locale.Tr "repo.editor.user_no_push_to_branch"}}</li>{{end}} - {{if and .CanCommitToBranch.RequireSigned (not .CanCommitToBranch.WillSign)}}<li>{{.locale.Tr "repo.editor.require_signed_commit"}}</li>{{end}} + {{if not .CanCommitToBranch.UserCanPush}}<li>{{ctx.Locale.Tr "repo.editor.user_no_push_to_branch"}}</li>{{end}} + {{if and .CanCommitToBranch.RequireSigned (not .CanCommitToBranch.WillSign)}}<li>{{ctx.Locale.Tr "repo.editor.require_signed_commit"}}</li>{{end}} </ul> </div> {{end}} @@ -43,16 +43,16 @@ <div class="field"> <div class="ui radio checkbox"> {{if .CanCreatePullRequest}} - <input type="radio" class="js-quick-pull-choice-option" name="commit_choice" value="commit-to-new-branch" button_text="{{.locale.Tr "repo.editor.propose_file_change"}}" {{if eq .commit_choice "commit-to-new-branch"}}checked{{end}}> + <input type="radio" class="js-quick-pull-choice-option" name="commit_choice" value="commit-to-new-branch" button_text="{{ctx.Locale.Tr "repo.editor.propose_file_change"}}" {{if eq .commit_choice "commit-to-new-branch"}}checked{{end}}> {{else}} - <input type="radio" class="js-quick-pull-choice-option" name="commit_choice" value="commit-to-new-branch" button_text="{{.locale.Tr "repo.editor.commit_changes"}}" {{if eq .commit_choice "commit-to-new-branch"}}checked{{end}}> + <input type="radio" class="js-quick-pull-choice-option" name="commit_choice" value="commit-to-new-branch" button_text="{{ctx.Locale.Tr "repo.editor.commit_changes"}}" {{if eq .commit_choice "commit-to-new-branch"}}checked{{end}}> {{end}} <label> {{svg "octicon-git-pull-request"}} {{if .CanCreatePullRequest}} - {{.locale.Tr "repo.editor.create_new_branch" | Safe}} + {{ctx.Locale.Tr "repo.editor.create_new_branch" | Safe}} {{else}} - {{.locale.Tr "repo.editor.create_new_branch_np" | Safe}} + {{ctx.Locale.Tr "repo.editor.create_new_branch_np" | Safe}} {{end}} </label> </div> @@ -60,7 +60,7 @@ <div class="quick-pull-branch-name {{if not (eq .commit_choice "commit-to-new-branch")}}gt-hidden{{end}}"> <div class="new-branch-name-input field {{if .Err_NewBranchName}}error{{end}}"> {{svg "octicon-git-branch"}} - <input type="text" name="new_branch_name" value="{{.new_branch_name}}" class="input-contrast gt-mr-2 js-quick-pull-new-branch-name" placeholder="{{.locale.Tr "repo.editor.new_branch_name_desc"}}" {{if eq .commit_choice "commit-to-new-branch"}}required{{end}} title="{{.locale.Tr "repo.editor.new_branch_name"}}"> + <input type="text" name="new_branch_name" value="{{.new_branch_name}}" class="input-contrast gt-mr-2 js-quick-pull-new-branch-name" placeholder="{{ctx.Locale.Tr "repo.editor.new_branch_name_desc"}}" {{if eq .commit_choice "commit-to-new-branch"}}required{{end}} title="{{.locale.Tr "repo.editor.new_branch_name"}}"> <span class="text-muted js-quick-pull-normalization-info"></span> </div> </div> @@ -68,7 +68,7 @@ </div> </div> <button id="commit-button" type="submit" class="ui primary button"> - {{if eq .commit_choice "commit-to-new-branch"}}{{.locale.Tr "repo.editor.propose_file_change"}}{{else}}{{.locale.Tr "repo.editor.commit_changes"}}{{end}} + {{if eq .commit_choice "commit-to-new-branch"}}{{ctx.Locale.Tr "repo.editor.propose_file_change"}}{{else}}{{.locale.Tr "repo.editor.commit_changes"}}{{end}} </button> - <a class="ui button red" href="{{$.BranchLink}}/{{PathEscapeSegments .TreePath}}">{{.locale.Tr "repo.editor.cancel"}}</a> + <a class="ui button red" href="{{$.BranchLink}}/{{PathEscapeSegments .TreePath}}">{{ctx.Locale.Tr "repo.editor.cancel"}}</a> </div> diff --git a/templates/repo/editor/edit.tmpl b/templates/repo/editor/edit.tmpl index abe2e345fc..465434f0a6 100644 --- a/templates/repo/editor/edit.tmpl +++ b/templates/repo/editor/edit.tmpl @@ -15,22 +15,22 @@ {{range $i, $v := .TreeNames}} <div class="breadcrumb-divider">/</div> {{if eq $i $l}} - <input id="file-name" value="{{$v}}" placeholder="{{$.locale.Tr "repo.editor.name_your_file"}}" data-editorconfig="{{$.EditorconfigJson}}" required autofocus> - <span data-tooltip-content="{{$.locale.Tr "repo.editor.filename_help"}}">{{svg "octicon-info"}}</span> + <input id="file-name" value="{{$v}}" placeholder="{{ctx.Locale.Tr "repo.editor.name_your_file"}}" data-editorconfig="{{$.EditorconfigJson}}" required autofocus> + <span data-tooltip-content="{{ctx.Locale.Tr "repo.editor.filename_help"}}">{{svg "octicon-info"}}</span> {{else}} <span class="section"><a href="{{$.BranchLink}}/{{index $.TreePaths $i | PathEscapeSegments}}">{{$v}}</a></span> {{end}} {{end}} - <span>{{.locale.Tr "repo.editor.or"}} <a href="{{$.BranchLink}}{{if not .IsNewFile}}/{{PathEscapeSegments .TreePath}}{{end}}">{{.locale.Tr "repo.editor.cancel_lower"}}</a></span> + <span>{{ctx.Locale.Tr "repo.editor.or"}} <a href="{{$.BranchLink}}{{if not .IsNewFile}}/{{PathEscapeSegments .TreePath}}{{end}}">{{.locale.Tr "repo.editor.cancel_lower"}}</a></span> <input type="hidden" id="tree_path" name="tree_path" value="{{.TreePath}}" required> </div> </div> <div class="field"> <div class="ui top attached tabular menu" data-write="write" data-preview="preview" data-diff="diff"> - <a class="active item" data-tab="write">{{svg "octicon-code"}} {{if .IsNewFile}}{{.locale.Tr "repo.editor.new_file"}}{{else}}{{.locale.Tr "repo.editor.edit_file"}}{{end}}</a> - <a class="item" data-tab="preview" data-url="{{.Repository.Link}}/markup" data-context="{{.RepoLink}}/src/{{.BranchNameSubURL}}" data-markup-mode="file">{{svg "octicon-eye"}} {{.locale.Tr "preview"}}</a> + <a class="active item" data-tab="write">{{svg "octicon-code"}} {{if .IsNewFile}}{{ctx.Locale.Tr "repo.editor.new_file"}}{{else}}{{.locale.Tr "repo.editor.edit_file"}}{{end}}</a> + <a class="item" data-tab="preview" data-url="{{.Repository.Link}}/markup" data-context="{{.RepoLink}}/src/{{.BranchNameSubURL}}" data-markup-mode="file">{{svg "octicon-eye"}} {{ctx.Locale.Tr "preview"}}</a> {{if not .IsNewFile}} - <a class="item" data-tab="diff" data-url="{{.RepoLink}}/_preview/{{.BranchName | PathEscapeSegments}}/{{.TreePath | PathEscapeSegments}}" data-context="{{.BranchLink}}">{{svg "octicon-diff"}} {{.locale.Tr "repo.editor.preview_changes"}}</a> + <a class="item" data-tab="diff" data-url="{{.RepoLink}}/_preview/{{.BranchName | PathEscapeSegments}}/{{.TreePath | PathEscapeSegments}}" data-context="{{.BranchLink}}">{{svg "octicon-diff"}} {{ctx.Locale.Tr "repo.editor.preview_changes"}}</a> {{end}} </div> <div class="ui bottom attached active tab segment" data-tab="write"> @@ -44,10 +44,10 @@ <div class="editor-loading is-loading"></div> </div> <div class="ui bottom attached tab segment markup" data-tab="preview"> - {{.locale.Tr "loading"}} + {{ctx.Locale.Tr "loading"}} </div> <div class="ui bottom attached tab segment diff edit-diff" data-tab="diff"> - {{.locale.Tr "loading"}} + {{ctx.Locale.Tr "loading"}} </div> </div> {{template "repo/editor/commit_form" .}} @@ -56,19 +56,19 @@ <div class="ui g-modal-confirm modal" id="edit-empty-content-modal"> <div class="header"> {{svg "octicon-file"}} - {{.locale.Tr "repo.editor.commit_empty_file_header"}} + {{ctx.Locale.Tr "repo.editor.commit_empty_file_header"}} </div> <div class="center content"> - <p>{{.locale.Tr "repo.editor.commit_empty_file_text"}}</p> + <p>{{ctx.Locale.Tr "repo.editor.commit_empty_file_text"}}</p> </div> <div class="actions"> <button class="ui cancel button"> {{svg "octicon-x"}} - {{.locale.Tr "repo.editor.cancel"}} + {{ctx.Locale.Tr "repo.editor.cancel"}} </button> <button class="ui primary ok button"> {{svg "fontawesome-save"}} - {{.locale.Tr "repo.editor.commit_changes"}} + {{ctx.Locale.Tr "repo.editor.commit_changes"}} </button> </div> </div> diff --git a/templates/repo/editor/patch.tmpl b/templates/repo/editor/patch.tmpl index 57126c09ab..e2d014ab2e 100644 --- a/templates/repo/editor/patch.tmpl +++ b/templates/repo/editor/patch.tmpl @@ -9,18 +9,18 @@ <input type="hidden" name="page_has_posted" value="{{.PageHasPosted}}"> <div class="repo-editor-header"> <div class="ui breadcrumb field {{if .Err_TreePath}}error{{end}}"> - {{.locale.Tr "repo.editor.patching"}} + {{ctx.Locale.Tr "repo.editor.patching"}} <a class="section" href="{{$.RepoLink}}">{{.Repository.FullName}}</a> <div class="breadcrumb-divider">:</div> <a class="section" href="{{$.BranchLink}}">{{.BranchName}}</a> - <span>{{.locale.Tr "repo.editor.or"}} <a href="{{$.BranchLink}}">{{.locale.Tr "repo.editor.cancel_lower"}}</a></span> + <span>{{ctx.Locale.Tr "repo.editor.or"}} <a href="{{$.BranchLink}}">{{.locale.Tr "repo.editor.cancel_lower"}}</a></span> <input type="hidden" id="tree_path" name="tree_path" value="" required> <input id="file-name" type="hidden" value="diff.patch"> </div> </div> <div class="field"> <div class="ui top attached tabular menu" data-write="write"> - <a class="active item" data-tab="write">{{svg "octicon-code" 16 "gt-mr-2"}}{{.locale.Tr "repo.editor.new_patch"}}</a> + <a class="active item" data-tab="write">{{svg "octicon-code" 16 "gt-mr-2"}}{{ctx.Locale.Tr "repo.editor.new_patch"}}</a> </div> <div class="ui bottom attached active tab segment" data-tab="write"> <textarea id="edit_area" name="content" class="gt-hidden" data-id="repo-{{.Repository.Name}}-patch" @@ -37,19 +37,19 @@ <div class="ui g-modal-confirm modal" id="edit-empty-content-modal"> <div class="header"> {{svg "octicon-file"}} - {{.locale.Tr "repo.editor.commit_empty_file_header"}} + {{ctx.Locale.Tr "repo.editor.commit_empty_file_header"}} </div> <div class="center content"> - <p>{{.locale.Tr "repo.editor.commit_empty_file_text"}}</p> + <p>{{ctx.Locale.Tr "repo.editor.commit_empty_file_text"}}</p> </div> <div class="actions"> <button class="ui cancel button"> {{svg "octicon-x"}} - {{.locale.Tr "repo.editor.cancel"}} + {{ctx.Locale.Tr "repo.editor.cancel"}} </button> <button class="ui primary ok button"> {{svg "fontawesome-save"}} - {{.locale.Tr "repo.editor.commit_changes"}} + {{ctx.Locale.Tr "repo.editor.commit_changes"}} </button> </div> </div> diff --git a/templates/repo/editor/upload.tmpl b/templates/repo/editor/upload.tmpl index bfb6f150c1..3c22c412ed 100644 --- a/templates/repo/editor/upload.tmpl +++ b/templates/repo/editor/upload.tmpl @@ -13,13 +13,13 @@ {{range $i, $v := .TreeNames}} <div class="breadcrumb-divider">/</div> {{if eq $i $l}} - <input type="text" id="file-name" value="{{$v}}" placeholder="{{$.locale.Tr "repo.editor.add_subdir"}}" autofocus> - <span data-tooltip-content="{{$.locale.Tr "repo.editor.filename_help"}}">{{svg "octicon-info"}}</span> + <input type="text" id="file-name" value="{{$v}}" placeholder="{{ctx.Locale.Tr "repo.editor.add_subdir"}}" autofocus> + <span data-tooltip-content="{{ctx.Locale.Tr "repo.editor.filename_help"}}">{{svg "octicon-info"}}</span> {{else}} <span class="section"><a href="{{$.BranchLink}}/{{index $.TreePaths $i | PathEscapeSegments}}">{{$v}}</a></span> {{end}} {{end}} - <span>{{.locale.Tr "repo.editor.or"}} <a href="{{$.BranchLink}}{{if not .IsNewFile}}/{{.TreePath | PathEscapeSegments}}{{end}}">{{.locale.Tr "repo.editor.cancel_lower"}}</a></span> + <span>{{ctx.Locale.Tr "repo.editor.or"}} <a href="{{$.BranchLink}}{{if not .IsNewFile}}/{{.TreePath | PathEscapeSegments}}{{end}}">{{.locale.Tr "repo.editor.cancel_lower"}}</a></span> <input type="hidden" id="tree_path" name="tree_path" value="{{.TreePath}}" required> </div> </div> diff --git a/templates/repo/empty.tmpl b/templates/repo/empty.tmpl index b2476cfea8..c5535742c4 100644 --- a/templates/repo/empty.tmpl +++ b/templates/repo/empty.tmpl @@ -8,32 +8,32 @@ {{if .Repository.IsArchived}} <div class="ui warning message gt-text-center"> {{if .Repository.ArchivedUnix.IsZero}} - {{.locale.Tr "repo.archive.title"}} + {{ctx.Locale.Tr "repo.archive.title"}} {{else}} - {{.locale.Tr "repo.archive.title_date" (DateTime "long" .Repository.ArchivedUnix) | Safe}} + {{ctx.Locale.Tr "repo.archive.title_date" (DateTime "long" .Repository.ArchivedUnix) | Safe}} {{end}} </div> {{end}} {{if .Repository.IsBroken}} <div class="ui segment center"> - {{.locale.Tr "repo.broken_message"}} + {{ctx.Locale.Tr "repo.broken_message"}} </div> {{else if .CanWriteCode}} <h4 class="ui top attached header"> - {{.locale.Tr "repo.quick_guide"}} + {{ctx.Locale.Tr "repo.quick_guide"}} </h4> <div class="ui attached guide table segment empty-repo-guide"> <div class="item"> - <h3>{{.locale.Tr "repo.clone_this_repo"}} <small>{{.locale.Tr "repo.clone_helper" "http://git-scm.com/book/en/Git-Basics-Getting-a-Git-Repository" | Str2html}}</small></h3> + <h3>{{ctx.Locale.Tr "repo.clone_this_repo"}} <small>{{.locale.Tr "repo.clone_helper" "http://git-scm.com/book/en/Git-Basics-Getting-a-Git-Repository" | Str2html}}</small></h3> <div class="repo-button-row"> {{if and .CanWriteCode (not .Repository.IsArchived)}} <a class="ui small button" href="{{.RepoLink}}/_new/{{.BranchName | PathEscapeSegments}}/"> - {{.locale.Tr "repo.editor.new_file"}} + {{ctx.Locale.Tr "repo.editor.new_file"}} </a> {{if .RepositoryUploadEnabled}} <a class="ui small button" href="{{.RepoLink}}/_upload/{{.BranchName | PathEscapeSegments}}/"> - {{.locale.Tr "repo.editor.upload_file"}} + {{ctx.Locale.Tr "repo.editor.upload_file"}} </a> {{end}} {{end}} @@ -47,7 +47,7 @@ <div class="divider gt-my-0"></div> <div class="item"> - <h3>{{.locale.Tr "repo.create_new_repo_command"}}</h3> + <h3>{{ctx.Locale.Tr "repo.create_new_repo_command"}}</h3> <div class="markup"> <pre><code>touch README.md git init @@ -61,7 +61,7 @@ git push -u origin {{.Repository.DefaultBranch}}</code></pre> <div class="divider"></div> <div class="item"> - <h3>{{.locale.Tr "repo.push_exist_repo"}}</h3> + <h3>{{ctx.Locale.Tr "repo.push_exist_repo"}}</h3> <div class="markup"> <pre><code>git remote add origin <span class="js-clone-url">{{$.CloneButtonOriginLink.HTTPS}}</span> git push -u origin {{.Repository.DefaultBranch}}</code></pre> @@ -70,7 +70,7 @@ git push -u origin {{.Repository.DefaultBranch}}</code></pre> {{end}} {{else}} <div class="ui segment center"> - {{.locale.Tr "repo.empty_message"}} + {{ctx.Locale.Tr "repo.empty_message"}} </div> {{end}} {{template "repo/clone_script" .}} diff --git a/templates/repo/file_info.tmpl b/templates/repo/file_info.tmpl index 7323b30d77..3003fbbdb6 100644 --- a/templates/repo/file_info.tmpl +++ b/templates/repo/file_info.tmpl @@ -1,17 +1,17 @@ <div class="file-info text grey normal gt-mono"> {{if .FileIsSymlink}} <div class="file-info-entry"> - {{.locale.Tr "repo.symbolic_link"}} + {{ctx.Locale.Tr "repo.symbolic_link"}} </div> {{end}} {{if .NumLinesSet}}{{/* Explicit attribute needed to show 0 line changes */}} <div class="file-info-entry"> - {{.NumLines}} {{.locale.TrN .NumLines "repo.line" "repo.lines"}} + {{.NumLines}} {{ctx.Locale.TrN .NumLines "repo.line" "repo.lines"}} </div> {{end}} {{if .FileSize}} <div class="file-info-entry"> - {{FileSize .FileSize}}{{if .IsLFSFile}} ({{.locale.Tr "repo.stored_lfs"}}){{end}} + {{FileSize .FileSize}}{{if .IsLFSFile}} ({{ctx.Locale.Tr "repo.stored_lfs"}}){{end}} </div> {{end}} {{if .LFSLock}} @@ -27,7 +27,7 @@ {{end}} {{if .IsExecutable}} <div class="file-info-entry"> - {{.locale.Tr "repo.executable_file"}} + {{ctx.Locale.Tr "repo.executable_file"}} </div> {{end}} {{if .ImageSize}} diff --git a/templates/repo/find/files.tmpl b/templates/repo/find/files.tmpl index dab46cf362..eac6ec2011 100644 --- a/templates/repo/find/files.tmpl +++ b/templates/repo/find/files.tmpl @@ -14,7 +14,7 @@ </tbody> </table> <div id="repo-find-file-no-result" class="ui row center gt-mt-5 gt-hidden"> - <h3>{{.locale.Tr "repo.find_file.no_matching"}}</h3> + <h3>{{ctx.Locale.Tr "repo.find_file.no_matching"}}</h3> </div> </div> </div> diff --git a/templates/repo/forks.tmpl b/templates/repo/forks.tmpl index 481c0e67e0..b27b55c131 100644 --- a/templates/repo/forks.tmpl +++ b/templates/repo/forks.tmpl @@ -3,7 +3,7 @@ {{template "repo/header" .}} <div class="ui container"> <h2 class="ui dividing header"> - {{.locale.Tr "repo.forks"}} + {{ctx.Locale.Tr "repo.forks"}} </h2> {{range .Forks}} <div class="gt-df gt-ac gt-py-3"> diff --git a/templates/repo/graph.tmpl b/templates/repo/graph.tmpl index b4cfee84f7..ccb757405c 100644 --- a/templates/repo/graph.tmpl +++ b/templates/repo/graph.tmpl @@ -4,15 +4,15 @@ <div class="ui container"> <div id="git-graph-container" class="ui segment{{if eq .Mode "monochrome"}} monochrome{{end}}"> <h2 class="ui header dividing"> - {{.locale.Tr "repo.commit_graph"}} + {{ctx.Locale.Tr "repo.commit_graph"}} <div class="ui icon buttons tiny color-buttons"> <div class="ui multiple selection search dropdown" id="flow-select-refs-dropdown"> <input type="hidden" name="flow"> - <div class="default text">{{.locale.Tr "repo.commit_graph.select"}}</div> + <div class="default text">{{ctx.Locale.Tr "repo.commit_graph.select"}}</div> <div class="menu"> <div class="item" data-value="...flow-hide-pr-refs"> <span class="truncate"> - {{svg "octicon-eye-closed" 16 "gt-mr-2"}}<span title="{{.locale.Tr "repo.commit_graph.hide_pr_refs"}}">{{.locale.Tr "repo.commit_graph.hide_pr_refs"}}</span> + {{svg "octicon-eye-closed" 16 "gt-mr-2"}}<span title="{{ctx.Locale.Tr "repo.commit_graph.hide_pr_refs"}}">{{.locale.Tr "repo.commit_graph.hide_pr_refs"}}</span> </span> </div> {{range .AllRefs}} @@ -45,8 +45,8 @@ {{end}} </div> </div> - <button id="flow-color-monochrome" class="ui labelled icon button{{if eq .Mode "monochrome"}} active{{end}}" title="{{.locale.Tr "repo.commit_graph.monochrome"}}">{{svg "material-invert-colors" 16 "gt-mr-2"}}{{.locale.Tr "repo.commit_graph.monochrome"}}</button> - <button id="flow-color-colored" class="ui labelled icon button{{if ne .Mode "monochrome"}} active{{end}}" title="{{.locale.Tr "repo.commit_graph.color"}}">{{svg "material-palette" 16 "gt-mr-2"}}{{.locale.Tr "repo.commit_graph.color"}}</button> + <button id="flow-color-monochrome" class="ui labelled icon button{{if eq .Mode "monochrome"}} active{{end}}" title="{{ctx.Locale.Tr "repo.commit_graph.monochrome"}}">{{svg "material-invert-colors" 16 "gt-mr-2"}}{{.locale.Tr "repo.commit_graph.monochrome"}}</button> + <button id="flow-color-colored" class="ui labelled icon button{{if ne .Mode "monochrome"}} active{{end}}" title="{{ctx.Locale.Tr "repo.commit_graph.color"}}">{{svg "material-palette" 16 "gt-mr-2"}}{{.locale.Tr "repo.commit_graph.color"}}</button> </div> </h2> <div class="ui dividing"></div> diff --git a/templates/repo/header.tmpl b/templates/repo/header.tmpl index d0f24949c9..5d4bc64734 100644 --- a/templates/repo/header.tmpl +++ b/templates/repo/header.tmpl @@ -13,60 +13,60 @@ <div class="labels gt-df gt-ac gt-fw"> {{if .IsTemplate}} {{if .IsPrivate}} - <span class="ui basic label">{{$.locale.Tr "repo.desc.private_template"}}</span> + <span class="ui basic label">{{ctx.Locale.Tr "repo.desc.private_template"}}</span> {{else}} {{if .Owner.Visibility.IsPrivate}} - <span class="ui basic label">{{$.locale.Tr "repo.desc.internal_template"}}</span> + <span class="ui basic label">{{ctx.Locale.Tr "repo.desc.internal_template"}}</span> {{end}} {{end}} {{else}} {{if .IsPrivate}} - <span class="ui basic label">{{$.locale.Tr "repo.desc.private"}}</span> + <span class="ui basic label">{{ctx.Locale.Tr "repo.desc.private"}}</span> {{else}} {{if .Owner.Visibility.IsPrivate}} - <span class="ui basic label">{{$.locale.Tr "repo.desc.internal"}}</span> + <span class="ui basic label">{{ctx.Locale.Tr "repo.desc.internal"}}</span> {{end}} {{end}} {{end}} {{if .IsArchived}} - <span class="ui basic label">{{$.locale.Tr "repo.desc.archived"}}</span> + <span class="ui basic label">{{ctx.Locale.Tr "repo.desc.archived"}}</span> {{end}} </div> {{if $.EnableFeed}} - <a class="rss-icon gt-ml-3" href="{{$.RepoLink}}.rss" data-tooltip-content="{{$.locale.Tr "rss_feed"}}">{{svg "octicon-rss" 18}}</a> + <a class="rss-icon gt-ml-3" href="{{$.RepoLink}}.rss" data-tooltip-content="{{ctx.Locale.Tr "rss_feed"}}">{{svg "octicon-rss" 18}}</a> {{end}} </div> {{if $.PullMirror}} - <div class="fork-flag">{{$.locale.Tr "repo.mirror_from"}} <a target="_blank" rel="noopener noreferrer" href="{{$.PullMirror.RemoteAddress}}">{{$.PullMirror.RemoteAddress}}</a></div> + <div class="fork-flag">{{ctx.Locale.Tr "repo.mirror_from"}} <a target="_blank" rel="noopener noreferrer" href="{{$.PullMirror.RemoteAddress}}">{{$.PullMirror.RemoteAddress}}</a></div> {{end}} - {{if .IsFork}}<div class="fork-flag">{{$.locale.Tr "repo.forked_from"}} <a href="{{.BaseRepo.Link}}">{{.BaseRepo.FullName}}</a></div>{{end}} - {{if .IsGenerated}}<div class="fork-flag">{{$.locale.Tr "repo.generated_from"}} <a href="{{.TemplateRepo.Link}}">{{.TemplateRepo.FullName}}</a></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.Link}}">{{.TemplateRepo.FullName}}</a></div>{{end}} </div> {{if not (or .IsBeingCreated .IsBroken)}} <div class="repo-buttons"> {{if $.RepoTransfer}} <form method="post" action="{{$.RepoLink}}/action/accept_transfer?redirect_to={{$.RepoLink}}"> {{$.CsrfTokenHtml}} - <div data-tooltip-content="{{if $.CanUserAcceptTransfer}}{{$.locale.Tr "repo.transfer.accept_desc" $.RepoTransfer.Recipient.DisplayName}}{{else}}{{$.locale.Tr "repo.transfer.no_permission_to_accept"}}{{end}}"> + <div data-tooltip-content="{{if $.CanUserAcceptTransfer}}{{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 basic button {{if $.CanUserAcceptTransfer}}primary {{end}} ok small"{{if not $.CanUserAcceptTransfer}} disabled{{end}}> - {{$.locale.Tr "repo.transfer.accept"}} + {{ctx.Locale.Tr "repo.transfer.accept"}} </button> </div> </form> <form method="post" action="{{$.RepoLink}}/action/reject_transfer?redirect_to={{$.RepoLink}}"> {{$.CsrfTokenHtml}} - <div data-tooltip-content="{{if $.CanUserAcceptTransfer}}{{$.locale.Tr "repo.transfer.reject_desc" $.RepoTransfer.Recipient.DisplayName}}{{else}}{{$.locale.Tr "repo.transfer.no_permission_to_reject"}}{{end}}"> + <div data-tooltip-content="{{if $.CanUserAcceptTransfer}}{{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 basic button {{if $.CanUserAcceptTransfer}}red {{end}}ok small"{{if not $.CanUserAcceptTransfer}} disabled{{end}}> - {{$.locale.Tr "repo.transfer.reject"}} + {{ctx.Locale.Tr "repo.transfer.reject"}} </button> </div> </form> {{end}} <form method="post" action="{{$.RepoLink}}/action/{{if $.IsWatchingRepo}}un{{end}}watch?redirect_to={{$.Link}}"> {{$.CsrfTokenHtml}} - <div class="ui labeled button" {{if not $.IsSigned}}data-tooltip-content="{{$.locale.Tr "repo.watch_guest_user"}}"{{end}}> + <div class="ui labeled button" {{if not $.IsSigned}}data-tooltip-content="{{ctx.Locale.Tr "repo.watch_guest_user"}}"{{end}}> <button type="submit" class="ui compact small basic button"{{if not $.IsSigned}} disabled{{end}}> - {{if $.IsWatchingRepo}}{{svg "octicon-eye-closed" 16}}{{$.locale.Tr "repo.unwatch"}}{{else}}{{svg "octicon-eye"}}{{$.locale.Tr "repo.watch"}}{{end}} + {{if $.IsWatchingRepo}}{{svg "octicon-eye-closed" 16}}{{ctx.Locale.Tr "repo.unwatch"}}{{else}}{{svg "octicon-eye"}}{{ctx.Locale.Tr "repo.watch"}}{{end}} </button> <a class="ui basic label" href="{{.Link}}/watchers"> {{CountFmt .NumWatches}} @@ -76,9 +76,9 @@ {{if not $.DisableStars}} <form method="post" action="{{$.RepoLink}}/action/{{if $.IsStaringRepo}}un{{end}}star?redirect_to={{$.Link}}"> {{$.CsrfTokenHtml}} - <div class="ui labeled button" {{if not $.IsSigned}}data-tooltip-content="{{$.locale.Tr "repo.star_guest_user"}}"{{end}}> + <div class="ui labeled button" {{if not $.IsSigned}}data-tooltip-content="{{ctx.Locale.Tr "repo.star_guest_user"}}"{{end}}> <button type="submit" class="ui compact small basic button"{{if not $.IsSigned}} disabled{{end}}> - {{if $.IsStaringRepo}}{{svg "octicon-star-fill"}}{{$.locale.Tr "repo.unstar"}}{{else}}{{svg "octicon-star"}}{{$.locale.Tr "repo.star"}}{{end}} + {{if $.IsStaringRepo}}{{svg "octicon-star-fill"}}{{ctx.Locale.Tr "repo.unstar"}}{{else}}{{svg "octicon-star"}}{{ctx.Locale.Tr "repo.star"}}{{end}} </button> <a class="ui basic label" href="{{.Link}}/stars"> {{CountFmt .NumStars}} @@ -92,9 +92,9 @@ disabled {{end}}" {{if not $.IsSigned}} - data-tooltip-content="{{$.locale.Tr "repo.fork_guest_user"}}" + data-tooltip-content="{{ctx.Locale.Tr "repo.fork_guest_user"}}" {{else if and (not $.CanSignedUserFork) (eq (len $.UserAndOrgForks) 0)}} - data-tooltip-content="{{$.locale.Tr "repo.fork_from_self"}}" + data-tooltip-content="{{ctx.Locale.Tr "repo.fork_from_self"}}" {{end}} > <a class="ui compact{{if $.ShowForkModal}} show-modal{{end}} small basic button" @@ -111,11 +111,11 @@ data-modal="#fork-repo-modal" {{end}} > - {{svg "octicon-repo-forked"}}{{$.locale.Tr "repo.fork"}} + {{svg "octicon-repo-forked"}}{{ctx.Locale.Tr "repo.fork"}} </a> <div class="ui small modal" id="fork-repo-modal"> <div class="header"> - {{$.locale.Tr "repo.already_forked" .Name}} + {{ctx.Locale.Tr "repo.already_forked" .Name}} </div> <div class="content gt-text-left"> <div class="ui list"> @@ -130,7 +130,7 @@ {{if $.CanSignedUserFork}} <div class="divider"></div> <a href="{{AppSubUrl}}/repo/fork/{{.ID}}"> - {{$.locale.Tr "repo.fork_to_different_account"}} + {{ctx.Locale.Tr "repo.fork_to_different_account"}} </a> {{end}} </div> @@ -150,13 +150,13 @@ <div class="ui tabular menu navbar gt-overflow-x-auto gt-overflow-y-hidden"> {{if .Permission.CanRead $.UnitTypeCode}} <a class="{{if .PageIsViewCode}}active {{end}}item" href="{{.RepoLink}}{{if (ne .BranchName .Repository.DefaultBranch)}}/src/{{.BranchNameSubURL}}{{end}}"> - {{svg "octicon-code"}} {{.locale.Tr "repo.code"}} + {{svg "octicon-code"}} {{ctx.Locale.Tr "repo.code"}} </a> {{end}} {{if .Permission.CanRead $.UnitTypeIssues}} <a class="{{if .PageIsIssueList}}active {{end}}item" href="{{.RepoLink}}/issues"> - {{svg "octicon-issue-opened"}} {{.locale.Tr "repo.issues"}} + {{svg "octicon-issue-opened"}} {{ctx.Locale.Tr "repo.issues"}} {{if .Repository.NumOpenIssues}} <span class="ui small label">{{CountFmt .Repository.NumOpenIssues}}</span> {{end}} @@ -165,13 +165,13 @@ {{if .Permission.CanRead $.UnitTypeExternalTracker}} <a class="{{if .PageIsIssueList}}active {{end}}item" href="{{.RepoExternalIssuesLink}}" target="_blank" rel="noopener noreferrer"> - {{svg "octicon-link-external"}} {{.locale.Tr "repo.issues"}} + {{svg "octicon-link-external"}} {{ctx.Locale.Tr "repo.issues"}} </a> {{end}} {{if and .Repository.CanEnablePulls (.Permission.CanRead $.UnitTypePullRequests)}} <a class="{{if .PageIsPullList}}active {{end}}item" href="{{.RepoLink}}/pulls"> - {{svg "octicon-git-pull-request"}} {{.locale.Tr "repo.pulls"}} + {{svg "octicon-git-pull-request"}} {{ctx.Locale.Tr "repo.pulls"}} {{if .Repository.NumOpenPulls}} <span class="ui small label">{{CountFmt .Repository.NumOpenPulls}}</span> {{end}} @@ -180,7 +180,7 @@ {{if and .EnableActions (not .UnitActionsGlobalDisabled) (.Permission.CanRead $.UnitTypeActions)}} <a class="{{if .PageIsActions}}active {{end}}item" href="{{.RepoLink}}/actions"> - {{svg "octicon-play"}} {{.locale.Tr "actions.actions"}} + {{svg "octicon-play"}} {{ctx.Locale.Tr "actions.actions"}} {{if .Repository.NumOpenActionRuns}} <span class="ui small label">{{CountFmt .Repository.NumOpenActionRuns}}</span> {{end}} @@ -189,13 +189,13 @@ {{if .Permission.CanRead $.UnitTypePackages}} <a href="{{.RepoLink}}/packages" class="{{if .IsPackagesPage}}active {{end}}item"> - {{svg "octicon-package"}} {{.locale.Tr "packages.title"}} + {{svg "octicon-package"}} {{ctx.Locale.Tr "packages.title"}} </a> {{end}} {{if and (not .UnitProjectsGlobalDisabled) (.Permission.CanRead $.UnitTypeProjects)}} <a href="{{.RepoLink}}/projects" class="{{if .IsProjectsPage}}active {{end}}item"> - {{svg "octicon-project"}} {{.locale.Tr "repo.project_board"}} + {{svg "octicon-project"}} {{ctx.Locale.Tr "repo.project_board"}} {{if .Repository.NumOpenProjects}} <span class="ui small label">{{CountFmt .Repository.NumOpenProjects}}</span> {{end}} @@ -204,7 +204,7 @@ {{if and (.Permission.CanRead $.UnitTypeReleases) (not .IsEmptyRepo)}} <a class="{{if or .PageIsReleaseList .PageIsTagList}}active {{end}}item" href="{{.RepoLink}}/releases"> - {{svg "octicon-tag"}} {{.locale.Tr "repo.releases"}} + {{svg "octicon-tag"}} {{ctx.Locale.Tr "repo.releases"}} {{if .NumReleases}} <span class="ui small label">{{CountFmt .NumReleases}}</span> {{end}} @@ -213,19 +213,19 @@ {{if .Permission.CanRead $.UnitTypeWiki}} <a class="{{if .PageIsWiki}}active {{end}}item" href="{{.RepoLink}}/wiki"> - {{svg "octicon-book"}} {{.locale.Tr "repo.wiki"}} + {{svg "octicon-book"}} {{ctx.Locale.Tr "repo.wiki"}} </a> {{end}} {{if .Permission.CanRead $.UnitTypeExternalWiki}} <a class="item" href="{{(.Repository.MustGetUnit $.Context $.UnitTypeExternalWiki).ExternalWikiConfig.ExternalWikiURL}}" target="_blank" rel="noopener noreferrer"> - {{svg "octicon-link-external"}} {{.locale.Tr "repo.wiki"}} + {{svg "octicon-link-external"}} {{ctx.Locale.Tr "repo.wiki"}} </a> {{end}} {{if and (.Permission.CanReadAny $.UnitTypePullRequests $.UnitTypeIssues $.UnitTypeReleases) (not .IsEmptyRepo)}} <a class="{{if .PageIsActivity}}active {{end}}item" href="{{.RepoLink}}/activity"> - {{svg "octicon-pulse"}} {{.locale.Tr "repo.activity"}} + {{svg "octicon-pulse"}} {{ctx.Locale.Tr "repo.activity"}} </a> {{end}} @@ -233,14 +233,14 @@ {{if .Permission.IsAdmin}} <a class="{{if .PageIsRepoSettings}}active {{end}}right item" href="{{.RepoLink}}/settings"> - {{svg "octicon-tools"}} {{.locale.Tr "repo.settings"}} + {{svg "octicon-tools"}} {{ctx.Locale.Tr "repo.settings"}} </a> {{end}} </div> {{else if .Permission.IsAdmin}} <div class="ui tabular menu navbar gt-overflow-x-auto gt-overflow-y-hidden"> <a class="{{if .PageIsRepoSettings}}active {{end}}right item" href="{{.RepoLink}}/settings"> - {{svg "octicon-tools"}} {{.locale.Tr "repo.settings"}} + {{svg "octicon-tools"}} {{ctx.Locale.Tr "repo.settings"}} </a> </div> {{end}} diff --git a/templates/repo/home.tmpl b/templates/repo/home.tmpl index 616cb7a938..33c43b0d18 100644 --- a/templates/repo/home.tmpl +++ b/templates/repo/home.tmpl @@ -8,15 +8,15 @@ <div class="ui repo-description"> <div id="repo-desc" class="gt-font-16"> {{$description := .Repository.DescriptionHTML $.Context}} - {{if $description}}<span class="description">{{$description | RenderCodeBlock}}</span>{{else if .IsRepositoryAdmin}}<span class="no-description text-italic">{{.locale.Tr "repo.no_desc"}}</span>{{end}} + {{if $description}}<span class="description">{{$description | RenderCodeBlock}}</span>{{else if .IsRepositoryAdmin}}<span class="no-description text-italic">{{ctx.Locale.Tr "repo.no_desc"}}</span>{{end}} <a class="link" href="{{.Repository.Website}}">{{.Repository.Website}}</a> </div> {{if .RepoSearchEnabled}} <div class="ui repo-search"> <form class="ui form ignore-dirty" action="{{.RepoLink}}/search" method="get"> <div class="field"> - <div class="ui small action input{{if .CodeIndexerUnavailable}} disabled left icon{{end}}"{{if .CodeIndexerUnavailable}} data-tooltip-content="{{.locale.Tr "repo.search.code_search_unavailable"}}"{{end}}> - <input name="q" value="{{.Keyword}}"{{if .CodeIndexerUnavailable}} disabled{{end}} placeholder="{{.locale.Tr "repo.search.search_repo"}}"> + <div class="ui small action input{{if .CodeIndexerUnavailable}} disabled left icon{{end}}"{{if .CodeIndexerUnavailable}} data-tooltip-content="{{ctx.Locale.Tr "repo.search.code_search_unavailable"}}"{{end}}> + <input name="q" value="{{.Keyword}}"{{if .CodeIndexerUnavailable}} disabled{{end}} placeholder="{{ctx.Locale.Tr "repo.search.search_repo"}}"> {{if .CodeIndexerUnavailable}} <i class="icon">{{svg "octicon-alert"}}</i> {{end}} @@ -31,13 +31,13 @@ </div> <div class="gt-df gt-ac gt-fw gt-gap-2" id="repo-topics"> {{range .Topics}}<a class="ui repo-topic large label topic gt-m-0" href="{{AppSubUrl}}/explore/repos?q={{.Name}}&topic=1">{{.Name}}</a>{{end}} - {{if and .Permission.IsAdmin (not .Repository.IsArchived)}}<button id="manage_topic" class="btn interact-fg gt-font-12">{{.locale.Tr "repo.topic.manage_topics"}}</button>{{end}} + {{if and .Permission.IsAdmin (not .Repository.IsArchived)}}<button id="manage_topic" class="btn interact-fg gt-font-12">{{ctx.Locale.Tr "repo.topic.manage_topics"}}</button>{{end}} </div> {{end}} {{if and .Permission.IsAdmin (not .Repository.IsArchived)}} <div class="ui form gt-hidden gt-df gt-mt-4" id="topic_edit"> <div class="field gt-f1 gt-mr-3"> - <div class="ui fluid multiple search selection dropdown" data-text-count-prompt="{{.locale.Tr "repo.topic.count_prompt"}}" data-text-format-prompt="{{.locale.Tr "repo.topic.format_prompt"}}"> + <div class="ui fluid multiple search selection dropdown" data-text-count-prompt="{{ctx.Locale.Tr "repo.topic.count_prompt"}}" data-text-format-prompt="{{.locale.Tr "repo.topic.format_prompt"}}"> <input type="hidden" name="topics" value="{{range $i, $v := .Topics}}{{.Name}}{{if Eval $i "+" 1 "<" (len $.Topics)}},{{end}}{{end}}"> {{range .Topics}} {{/* keey the same layout as Fomantic UI generated labels */}} @@ -47,17 +47,17 @@ </div> </div> <div> - <button class="ui basic button" id="cancel_topic_edit">{{.locale.Tr "cancel"}}</button> - <button class="ui primary button" id="save_topic" data-link="{{.RepoLink}}/topics">{{.locale.Tr "save"}}</button> + <button class="ui basic button" id="cancel_topic_edit">{{ctx.Locale.Tr "cancel"}}</button> + <button class="ui primary button" id="save_topic" data-link="{{.RepoLink}}/topics">{{ctx.Locale.Tr "save"}}</button> </div> </div> {{end}} {{if .Repository.IsArchived}} <div class="ui warning message gt-text-center"> {{if .Repository.ArchivedUnix.IsZero}} - {{.locale.Tr "repo.archive.title"}} + {{ctx.Locale.Tr "repo.archive.title"}} {{else}} - {{.locale.Tr "repo.archive.title_date" (DateTime "long" .Repository.ArchivedUnix) | Safe}} + {{ctx.Locale.Tr "repo.archive.title_date" (DateTime "long" .Repository.ArchivedUnix) | Safe}} {{end}} </div> {{end}} @@ -73,7 +73,7 @@ {{$cmpBranch = print $cmpBranch (.BranchName|PathEscapeSegments)}} {{$compareLink := printf "%s/compare/%s...%s" .BaseRepo.Link (.BaseRepo.DefaultBranch|PathEscapeSegments) $cmpBranch}} <a id="new-pull-request" role="button" class="ui compact basic button" href="{{$compareLink}}" - data-tooltip-content="{{if .PullRequestCtx.Allowed}}{{.locale.Tr "repo.pulls.compare_changes"}}{{else}}{{.locale.Tr "action.compare_branch"}}{{end}}"> + data-tooltip-content="{{if .PullRequestCtx.Allowed}}{{ctx.Locale.Tr "repo.pulls.compare_changes"}}{{else}}{{.locale.Tr "action.compare_branch"}}{{end}}"> {{svg "octicon-git-pull-request"}} </a> {{end}} @@ -81,24 +81,24 @@ {{$n := len .TreeNames}} {{$l := Eval $n "-" 1}} {{if eq $n 0}} - <a href="{{.Repository.Link}}/find/{{.BranchNameSubURL}}" class="ui compact basic button">{{.locale.Tr "repo.find_file.go_to_file"}}</a> + <a href="{{.Repository.Link}}/find/{{.BranchNameSubURL}}" class="ui compact basic button">{{ctx.Locale.Tr "repo.find_file.go_to_file"}}</a> {{end}} {{if and .CanWriteCode .IsViewBranch (not .Repository.IsMirror) (not .Repository.IsArchived) (not .IsViewFile)}} <button class="ui dropdown basic compact jump button gt-mr-2"{{if not .Repository.CanEnableEditor}} disabled{{end}}> - {{.locale.Tr "repo.editor.add_file"}} + {{ctx.Locale.Tr "repo.editor.add_file"}} {{svg "octicon-triangle-down" 14 "dropdown icon"}} <div class="menu"> <a class="item" href="{{.RepoLink}}/_new/{{.BranchName | PathEscapeSegments}}/{{.TreePath | PathEscapeSegments}}"> - {{.locale.Tr "repo.editor.new_file"}} + {{ctx.Locale.Tr "repo.editor.new_file"}} </a> {{if .RepositoryUploadEnabled}} <a class="item" href="{{.RepoLink}}/_upload/{{.BranchName | PathEscapeSegments}}/{{.TreePath | PathEscapeSegments}}"> - {{.locale.Tr "repo.editor.upload_file"}} + {{ctx.Locale.Tr "repo.editor.upload_file"}} </a> {{end}} <a class="item" href="{{.RepoLink}}/_diffpatch/{{.BranchName | PathEscapeSegments}}/{{.TreePath | PathEscapeSegments}}"> - {{.locale.Tr "repo.editor.patch"}} + {{ctx.Locale.Tr "repo.editor.patch"}} </a> </div> </button> @@ -106,7 +106,7 @@ {{if and (eq $n 0) (.Repository.IsTemplate)}} <a role="button" class="ui primary compact button" href="{{AppSubUrl}}/repo/create?template_id={{.Repository.ID}}"> - {{.locale.Tr "repo.use_template"}} + {{ctx.Locale.Tr "repo.use_template"}} </a> {{end}} {{if ne $n 0}} @@ -128,18 +128,18 @@ {{if eq $n 0}} <div class="ui action tiny input" id="clone-panel"> {{template "repo/clone_buttons" .}} - <button id="more-btn" class="ui basic small compact jump dropdown icon button" data-tooltip-content="{{.locale.Tr "repo.more_operations"}}"> + <button id="more-btn" class="ui basic small compact jump dropdown icon button" data-tooltip-content="{{ctx.Locale.Tr "repo.more_operations"}}"> {{svg "octicon-kebab-horizontal"}} <div class="menu"> {{if not $.DisableDownloadSourceArchives}} - <a class="item archive-link" href="{{$.RepoLink}}/archive/{{PathEscapeSegments $.RefName}}.zip" rel="nofollow">{{svg "octicon-file-zip" 16 "gt-mr-3"}}{{.locale.Tr "repo.download_zip"}}</a> - <a class="item archive-link" href="{{$.RepoLink}}/archive/{{PathEscapeSegments $.RefName}}.tar.gz" rel="nofollow">{{svg "octicon-file-zip" 16 "gt-mr-3"}}{{.locale.Tr "repo.download_tar"}}</a> - <a class="item archive-link" href="{{$.RepoLink}}/archive/{{PathEscapeSegments $.RefName}}.bundle" rel="nofollow">{{svg "octicon-package" 16 "gt-mr-3"}}{{.locale.Tr "repo.download_bundle"}}</a> + <a class="item archive-link" href="{{$.RepoLink}}/archive/{{PathEscapeSegments $.RefName}}.zip" rel="nofollow">{{svg "octicon-file-zip" 16 "gt-mr-3"}}{{ctx.Locale.Tr "repo.download_zip"}}</a> + <a class="item archive-link" href="{{$.RepoLink}}/archive/{{PathEscapeSegments $.RefName}}.tar.gz" rel="nofollow">{{svg "octicon-file-zip" 16 "gt-mr-3"}}{{ctx.Locale.Tr "repo.download_tar"}}</a> + <a class="item archive-link" href="{{$.RepoLink}}/archive/{{PathEscapeSegments $.RefName}}.bundle" rel="nofollow">{{svg "octicon-package" 16 "gt-mr-3"}}{{ctx.Locale.Tr "repo.download_bundle"}}</a> {{if .CitiationExist}} - <a class="item" id="cite-repo-button">{{svg "octicon-cross-reference" 16 "gt-mr-3"}}{{.locale.Tr "repo.cite_this_repo"}}</a> + <a class="item" id="cite-repo-button">{{svg "octicon-cross-reference" 16 "gt-mr-3"}}{{ctx.Locale.Tr "repo.cite_this_repo"}}</a> {{end}} {{end}} - <a class="item js-clone-url-vsc" href="vscode://vscode.git/clone?url={{.CloneButtonOriginLink.HTTPS}}">{{svg "gitea-vscode" 16 "gt-mr-3"}}{{.locale.Tr "repo.clone_in_vsc"}}</a> + <a class="item js-clone-url-vsc" href="vscode://vscode.git/clone?url={{.CloneButtonOriginLink.HTTPS}}">{{svg "gitea-vscode" 16 "gt-mr-3"}}{{ctx.Locale.Tr "repo.clone_in_vsc"}}</a> </div> </button> {{template "repo/clone_script" .}}{{/* the script will update `.js-clone-url` and related elements */}} @@ -148,7 +148,7 @@ {{end}} {{if and (ne $n 0) (not .IsViewFile) (not .IsBlame)}} <a class="ui button" href="{{.RepoLink}}/commits/{{.BranchNameSubURL}}/{{.TreePath | PathEscapeSegments}}"> - {{svg "octicon-history" 16 "gt-mr-3"}}{{.locale.Tr "repo.file_history"}} + {{svg "octicon-history" 16 "gt-mr-3"}}{{ctx.Locale.Tr "repo.file_history"}} </a> {{end}} </div> diff --git a/templates/repo/issue/branch_selector_field.tmpl b/templates/repo/issue/branch_selector_field.tmpl index 33b2af9c40..9b7a05ce35 100644 --- a/templates/repo/issue/branch_selector_field.tmpl +++ b/templates/repo/issue/branch_selector_field.tmpl @@ -5,27 +5,27 @@ {{$.CsrfTokenHtml}} </form> -<div class="ui {{if not .HasIssuesOrPullsWritePermission}}disabled{{end}} floating filter select-branch dropdown" data-no-results="{{.locale.Tr "repo.pulls.no_results"}}"> +<div class="ui {{if not .HasIssuesOrPullsWritePermission}}disabled{{end}} floating filter select-branch dropdown" data-no-results="{{ctx.Locale.Tr "repo.pulls.no_results"}}"> <div class="ui basic small button"> - <span class="text branch-name">{{if .Reference}}{{$.RefEndName}}{{else}}{{.locale.Tr "repo.issues.no_ref"}}{{end}}</span> + <span class="text branch-name">{{if .Reference}}{{$.RefEndName}}{{else}}{{ctx.Locale.Tr "repo.issues.no_ref"}}{{end}}</span> {{if .HasIssuesOrPullsWritePermission}}{{svg "octicon-triangle-down" 14 "dropdown icon"}}{{end}} </div> <div class="menu"> <div class="ui icon search input"> <i class="icon">{{svg "octicon-filter" 16}}</i> - <input name="search" placeholder="{{.locale.Tr "repo.filter_branch_and_tag"}}..."> + <input name="search" placeholder="{{ctx.Locale.Tr "repo.filter_branch_and_tag"}}..."> </div> <div class="header"> <div class="ui grid"> <div class="two column row"> <a class="reference column" href="#" data-target="#branch-list"> <span class="text black"> - {{svg "octicon-git-branch" 16 "gt-mr-2"}}{{.locale.Tr "repo.branches"}} + {{svg "octicon-git-branch" 16 "gt-mr-2"}}{{ctx.Locale.Tr "repo.branches"}} </span> </a> <a class="reference column" href="#" data-target="#tag-list"> <span class="text"> - {{svg "octicon-tag" 16 "gt-mr-2"}}{{.locale.Tr "repo.tags"}} + {{svg "octicon-tag" 16 "gt-mr-2"}}{{ctx.Locale.Tr "repo.tags"}} </span> </a> </div> @@ -33,7 +33,7 @@ </div> <div id="branch-list" class="scrolling menu reference-list-menu {{if not .Issue}}new-issue{{end}}"> {{if .Reference}} - <div class="item text small" data-id="" data-id-selector="#ref_selector"><strong><a href="#">{{$.locale.Tr "repo.clear_ref"}}</a></strong></div> + <div class="item text small" data-id="" data-id-selector="#ref_selector"><strong><a href="#">{{ctx.Locale.Tr "repo.clear_ref"}}</a></strong></div> {{end}} {{range .Branches}} <div class="item" data-id="refs/heads/{{.}}" data-name="{{.}}" data-id-selector="#ref_selector">{{.}}</div> @@ -41,7 +41,7 @@ </div> <div id="tag-list" class="scrolling menu reference-list-menu {{if not .Issue}}new-issue{{end}} gt-hidden"> {{if .Reference}} - <div class="item text small" data-id="" data-id-selector="#ref_selector"><strong><a href="#">{{.locale.Tr "repo.clear_ref"}}</a></strong></div> + <div class="item text small" data-id="" data-id-selector="#ref_selector"><strong><a href="#">{{ctx.Locale.Tr "repo.clear_ref"}}</a></strong></div> {{end}} {{range .Tags}} <div class="item" data-id="refs/tags/{{.}}" data-name="tags/{{.}}" data-id-selector="#ref_selector">{{.}}</div> diff --git a/templates/repo/issue/choose.tmpl b/templates/repo/issue/choose.tmpl index 9cc666a4bd..127b9d7d87 100644 --- a/templates/repo/issue/choose.tmpl +++ b/templates/repo/issue/choose.tmpl @@ -15,7 +15,7 @@ <br>{{.About | RenderEmojiPlain}} </div> <div class="column right aligned"> - <a href="{{$.RepoLink}}/issues/new?template={{.FileName}}{{if $.milestone}}&milestone={{$.milestone}}{{end}}{{if $.project}}&project={{$.project}}{{end}}" class="ui primary button">{{$.locale.Tr "repo.issues.choose.get_started"}}</a> + <a href="{{$.RepoLink}}/issues/new?template={{.FileName}}{{if $.milestone}}&milestone={{$.milestone}}{{end}}{{if $.project}}&project={{$.project}}{{end}}" class="ui primary button">{{ctx.Locale.Tr "repo.issues.choose.get_started"}}</a> </div> </div> </div> @@ -28,7 +28,7 @@ <br>{{.About | RenderEmojiPlain}} </div> <div class="column right aligned"> - <a href="{{.URL}}" class="ui primary button">{{svg "octicon-link-external"}} {{$.locale.Tr "repo.issues.choose.open_external_link"}}</a> + <a href="{{.URL}}" class="ui primary button">{{svg "octicon-link-external"}} {{ctx.Locale.Tr "repo.issues.choose.open_external_link"}}</a> </div> </div> </div> @@ -37,11 +37,11 @@ <div class="ui attached segment"> <div class="ui two column grid"> <div class="column left aligned"> - <strong>{{.locale.Tr "repo.issues.choose.blank"}}</strong> - <br/>{{.locale.Tr "repo.issues.choose.blank_about"}} + <strong>{{ctx.Locale.Tr "repo.issues.choose.blank"}}</strong> + <br/>{{ctx.Locale.Tr "repo.issues.choose.blank_about"}} </div> <div class="column right aligned"> - <a href="{{.RepoLink}}/issues/new?{{if .milestone}}&milestone={{.milestone}}{{end}}{{if $.project}}&project={{$.project}}{{end}}" class="ui primary button">{{$.locale.Tr "repo.issues.choose.get_started"}}</a> + <a href="{{.RepoLink}}/issues/new?{{if .milestone}}&milestone={{.milestone}}{{end}}{{if $.project}}&project={{$.project}}{{end}}" class="ui primary button">{{ctx.Locale.Tr "repo.issues.choose.get_started"}}</a> </div> </div> </div> @@ -49,7 +49,7 @@ {{- if .IssueConfigError}}{{/* normal warning flash makes problems here*/}} <div class="ui warning message"> <div class="text left"> - <div>{{.locale.Tr "repo.issues.choose.invalid_config"}}</div> + <div>{{ctx.Locale.Tr "repo.issues.choose.invalid_config"}}</div> <div>{{.IssueConfigError}}</div> </div> </div> diff --git a/templates/repo/issue/comment_tab.tmpl b/templates/repo/issue/comment_tab.tmpl index d167055ca5..4197ea4f65 100644 --- a/templates/repo/issue/comment_tab.tmpl +++ b/templates/repo/issue/comment_tab.tmpl @@ -9,7 +9,7 @@ "MarkdownPreviewContext" .RepoLink "TextareaName" "content" "TextareaContent" $textareaContent - "TextareaPlaceholder" ($.locale.Tr "repo.diff.comment.placeholder") + "TextareaPlaceholder" (ctx.Locale.Tr "repo.diff.comment.placeholder") "DropzoneParentContainer" "form, .ui.form" )}} </div> diff --git a/templates/repo/issue/filters.tmpl b/templates/repo/issue/filters.tmpl index 1805a23e37..dca2fb0dba 100644 --- a/templates/repo/issue/filters.tmpl +++ b/templates/repo/issue/filters.tmpl @@ -1,7 +1,7 @@ <div id="issue-filters" class="issue-list-toolbar"> <div class="issue-list-toolbar-left"> {{if and ($.CanWriteIssuesOrPulls) (gt (len .Issues) 0)}} - <input type="checkbox" autocomplete="off" class="issue-checkbox-all gt-mr-4" title="{{.locale.Tr "repo.issues.action_check_all"}}"> + <input type="checkbox" autocomplete="off" class="issue-checkbox-all gt-mr-4" title="{{ctx.Locale.Tr "repo.issues.action_check_all"}}"> {{end}} {{template "repo/issue/openclose" .}} </div> @@ -10,18 +10,18 @@ <!-- Label --> <div class="ui {{if not .Labels}}disabled{{end}} dropdown jump item label-filter"> <span class="text"> - {{.locale.Tr "repo.issues.filter_label"}} + {{ctx.Locale.Tr "repo.issues.filter_label"}} </span> {{svg "octicon-triangle-down" 14 "dropdown icon"}} <div class="menu"> <div class="ui icon search input"> <i class="icon">{{svg "octicon-search" 16}}</i> - <input type="text" placeholder="{{.locale.Tr "repo.issues.filter_label"}}"> + <input type="text" placeholder="{{ctx.Locale.Tr "repo.issues.filter_label"}}"> </div> - <span class="info">{{.locale.Tr "repo.issues.filter_label_exclude" | Safe}}</span> + <span class="info">{{ctx.Locale.Tr "repo.issues.filter_label_exclude" | Safe}}</span> <div class="divider"></div> - <a class="{{if .AllLabels}}active selected {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_label_no_select"}}</a> - <a class="{{if .NoLabel}}active selected {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels=0&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_label_select_no_label"}}</a> + <a class="{{if .AllLabels}}active selected {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{ctx.Locale.Tr "repo.issues.filter_label_no_select"}}</a> + <a class="{{if .NoLabel}}active selected {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels=0&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{ctx.Locale.Tr "repo.issues.filter_label_select_no_label"}}</a> {{$previousExclusiveScope := "_no_scope"}} {{range .Labels}} {{$exclusiveScope := .ExclusiveScope}} @@ -41,20 +41,20 @@ <!-- Milestone --> <div class="ui {{if not (or .OpenMilestones .ClosedMilestones)}}disabled{{end}} dropdown jump item"> <span class="text"> - {{.locale.Tr "repo.issues.filter_milestone"}} + {{ctx.Locale.Tr "repo.issues.filter_milestone"}} </span> {{svg "octicon-triangle-down" 14 "dropdown icon"}} <div class="menu"> <div class="ui icon search input"> <i class="icon">{{svg "octicon-search" 16}}</i> - <input type="text" placeholder="{{.locale.Tr "repo.issues.filter_milestone"}}"> + <input type="text" placeholder="{{ctx.Locale.Tr "repo.issues.filter_milestone"}}"> </div> <div class="divider"></div> - <a class="{{if not $.MilestoneID}}active selected {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone=0&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_milestone_all"}}</a> - <a class="{{if $.MilestoneID}}{{if eq $.MilestoneID -1}}active selected {{end}}{{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone=-1&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_milestone_none"}}</a> + <a class="{{if not $.MilestoneID}}active selected {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone=0&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{ctx.Locale.Tr "repo.issues.filter_milestone_all"}}</a> + <a class="{{if $.MilestoneID}}{{if eq $.MilestoneID -1}}active selected {{end}}{{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone=-1&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{ctx.Locale.Tr "repo.issues.filter_milestone_none"}}</a> {{if .OpenMilestones}} <div class="divider"></div> - <div class="header">{{.locale.Tr "repo.issues.filter_milestone_open"}}</div> + <div class="header">{{ctx.Locale.Tr "repo.issues.filter_milestone_open"}}</div> {{range .OpenMilestones}} <a class="{{if $.MilestoneID}}{{if eq $.MilestoneID .ID}}active selected {{end}}{{end}}item" href="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{.ID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}"> {{svg "octicon-milestone" 16 "mr-2"}} @@ -64,7 +64,7 @@ {{end}} {{if .ClosedMilestones}} <div class="divider"></div> - <div class="header">{{.locale.Tr "repo.issues.filter_milestone_closed"}}</div> + <div class="header">{{ctx.Locale.Tr "repo.issues.filter_milestone_closed"}}</div> {{range .ClosedMilestones}} <a class="{{if $.MilestoneID}}{{if eq $.MilestoneID .ID}}active selected {{end}}{{end}}item" href="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{.ID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}"> {{svg "octicon-milestone" 16 "mr-2"}} @@ -79,20 +79,20 @@ <!-- Project --> <div class="ui{{if not (or .OpenProjects .ClosedProjects)}} disabled{{end}} dropdown jump item"> <span class="text"> - {{.locale.Tr "repo.issues.filter_project"}} + {{ctx.Locale.Tr "repo.issues.filter_project"}} </span> {{svg "octicon-triangle-down" 14 "dropdown icon"}} <div class="menu"> <div class="ui icon search input"> <i class="icon">{{svg "octicon-search" 16}}</i> - <input type="text" placeholder="{{.locale.Tr "repo.issues.filter_project"}}"> + <input type="text" placeholder="{{ctx.Locale.Tr "repo.issues.filter_project"}}"> </div> - <a class="{{if not .ProjectID}}active selected {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_project_all"}}</a> - <a class="{{if eq .ProjectID -1}}active selected {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&project=-1&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_project_none"}}</a> + <a class="{{if not .ProjectID}}active selected {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{ctx.Locale.Tr "repo.issues.filter_project_all"}}</a> + <a class="{{if eq .ProjectID -1}}active selected {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&project=-1&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{ctx.Locale.Tr "repo.issues.filter_project_none"}}</a> {{if .OpenProjects}} <div class="divider"></div> <div class="header"> - {{.locale.Tr "repo.issues.new.open_projects"}} + {{ctx.Locale.Tr "repo.issues.new.open_projects"}} </div> {{range .OpenProjects}} <a class="{{if $.ProjectID}}{{if eq $.ProjectID .ID}}active selected{{end}}{{end}} item gt-df" href="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{$.MilestoneID}}&project={{.ID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}"> @@ -103,7 +103,7 @@ {{if .ClosedProjects}} <div class="divider"></div> <div class="header"> - {{.locale.Tr "repo.issues.new.closed_projects"}} + {{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="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{$.MilestoneID}}&project={{.ID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}"> @@ -115,37 +115,37 @@ </div> <!-- Author --> - <div class="ui dropdown jump item user-remote-search" data-tooltip-content="{{.locale.Tr "repo.author_search_tooltip"}}" + <div class="ui dropdown jump item user-remote-search" data-tooltip-content="{{ctx.Locale.Tr "repo.author_search_tooltip"}}" data-search-url="{{if .Milestone}}{{$.RepoLink}}/issues/posters{{else}}{{$.Link}}/posters{{end}}" data-selected-user-id="{{$.PosterID}}" data-action-jump-url="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={user_id}" > <span class="text"> - {{.locale.Tr "repo.issues.filter_poster"}} + {{ctx.Locale.Tr "repo.issues.filter_poster"}} </span> {{svg "octicon-triangle-down" 14 "dropdown icon"}} <div class="menu"> <div class="ui icon search input"> <i class="icon">{{svg "octicon-search" 16}}</i> - <input type="text" placeholder="{{.locale.Tr "repo.issues.filter_poster"}}"> + <input type="text" placeholder="{{ctx.Locale.Tr "repo.issues.filter_poster"}}"> </div> - <a class="item" data-value="0">{{.locale.Tr "repo.issues.filter_poster_no_select"}}</a> + <a class="item" data-value="0">{{ctx.Locale.Tr "repo.issues.filter_poster_no_select"}}</a> </div> </div> <!-- Assignee --> <div class="ui {{if not .Assignees}}disabled{{end}} dropdown jump item"> <span class="text"> - {{.locale.Tr "repo.issues.filter_assignee"}} + {{ctx.Locale.Tr "repo.issues.filter_assignee"}} </span> {{svg "octicon-triangle-down" 14 "dropdown icon"}} <div class="menu"> <div class="ui icon search input"> <i class="icon">{{svg "octicon-search" 16}}</i> - <input type="text" placeholder="{{.locale.Tr "repo.issues.filter_assignee"}}"> + <input type="text" placeholder="{{ctx.Locale.Tr "repo.issues.filter_assignee"}}"> </div> - <a class="{{if not .AssigneeID}}active selected {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_assginee_no_select"}}</a> - <a class="{{if eq .AssigneeID -1}}active selected {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee=-1&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_assginee_no_assignee"}}</a> + <a class="{{if not .AssigneeID}}active selected {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&poster={{$.PosterID}}">{{ctx.Locale.Tr "repo.issues.filter_assginee_no_select"}}</a> + <a class="{{if eq .AssigneeID -1}}active selected {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee=-1&poster={{$.PosterID}}">{{ctx.Locale.Tr "repo.issues.filter_assginee_no_assignee"}}</a> <div class="divider"></div> {{range .Assignees}} <a class="{{if eq $.AssigneeID .ID}}active selected{{end}} item gt-df" href="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{.ID}}&poster={{$.PosterID}}"> @@ -159,18 +159,18 @@ <!-- Type --> <div class="ui dropdown type jump item"> <span class="text"> - {{.locale.Tr "repo.issues.filter_type"}} + {{ctx.Locale.Tr "repo.issues.filter_type"}} </span> {{svg "octicon-triangle-down" 14 "dropdown icon"}} <div class="menu"> - <a class="{{if eq .ViewType "all"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type=all&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_type.all_issues"}}</a> - <a class="{{if eq .ViewType "assigned"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type=assigned&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_type.assigned_to_you"}}</a> - <a class="{{if eq .ViewType "created_by"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type=created_by&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_type.created_by_you"}}</a> + <a class="{{if eq .ViewType "all"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type=all&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{ctx.Locale.Tr "repo.issues.filter_type.all_issues"}}</a> + <a class="{{if eq .ViewType "assigned"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type=assigned&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{ctx.Locale.Tr "repo.issues.filter_type.assigned_to_you"}}</a> + <a class="{{if eq .ViewType "created_by"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type=created_by&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{ctx.Locale.Tr "repo.issues.filter_type.created_by_you"}}</a> {{if .PageIsPullList}} - <a class="{{if eq .ViewType "review_requested"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type=review_requested&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_type.review_requested"}}</a> - <a class="{{if eq .ViewType "reviewed_by"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type=reviewed_by&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_type.reviewed_by_you"}}</a> + <a class="{{if eq .ViewType "review_requested"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type=review_requested&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{ctx.Locale.Tr "repo.issues.filter_type.review_requested"}}</a> + <a class="{{if eq .ViewType "reviewed_by"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type=reviewed_by&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{ctx.Locale.Tr "repo.issues.filter_type.reviewed_by_you"}}</a> {{end}} - <a class="{{if eq .ViewType "mentioned"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type=mentioned&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_type.mentioning_you"}}</a> + <a class="{{if eq .ViewType "mentioned"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type=mentioned&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{ctx.Locale.Tr "repo.issues.filter_type.mentioning_you"}}</a> </div> </div> {{end}} @@ -178,18 +178,18 @@ <!-- Sort --> <div class="list-header-sort ui small dropdown downward type jump item"> <span class="text"> - {{.locale.Tr "repo.issues.filter_sort"}} + {{ctx.Locale.Tr "repo.issues.filter_sort"}} </span> {{svg "octicon-triangle-down" 14 "dropdown icon"}} <div class="menu"> - <a class="{{if or (eq .SortType "latest") (not .SortType)}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort=latest&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_sort.latest"}}</a> - <a class="{{if eq .SortType "oldest"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort=oldest&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_sort.oldest"}}</a> - <a class="{{if eq .SortType "recentupdate"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort=recentupdate&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_sort.recentupdate"}}</a> - <a class="{{if eq .SortType "leastupdate"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort=leastupdate&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_sort.leastupdate"}}</a> - <a class="{{if eq .SortType "mostcomment"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort=mostcomment&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_sort.mostcomment"}}</a> - <a class="{{if eq .SortType "leastcomment"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort=leastcomment&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_sort.leastcomment"}}</a> - <a class="{{if eq .SortType "nearduedate"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort=nearduedate&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_sort.nearduedate"}}</a> - <a class="{{if eq .SortType "farduedate"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort=farduedate&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_sort.farduedate"}}</a> + <a class="{{if or (eq .SortType "latest") (not .SortType)}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort=latest&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{ctx.Locale.Tr "repo.issues.filter_sort.latest"}}</a> + <a class="{{if eq .SortType "oldest"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort=oldest&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{ctx.Locale.Tr "repo.issues.filter_sort.oldest"}}</a> + <a class="{{if eq .SortType "recentupdate"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort=recentupdate&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{ctx.Locale.Tr "repo.issues.filter_sort.recentupdate"}}</a> + <a class="{{if eq .SortType "leastupdate"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort=leastupdate&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{ctx.Locale.Tr "repo.issues.filter_sort.leastupdate"}}</a> + <a class="{{if eq .SortType "mostcomment"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort=mostcomment&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{ctx.Locale.Tr "repo.issues.filter_sort.mostcomment"}}</a> + <a class="{{if eq .SortType "leastcomment"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort=leastcomment&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{ctx.Locale.Tr "repo.issues.filter_sort.leastcomment"}}</a> + <a class="{{if eq .SortType "nearduedate"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort=nearduedate&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{ctx.Locale.Tr "repo.issues.filter_sort.nearduedate"}}</a> + <a class="{{if eq .SortType "farduedate"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort=farduedate&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{ctx.Locale.Tr "repo.issues.filter_sort.farduedate"}}</a> </div> </div> </div> diff --git a/templates/repo/issue/labels.tmpl b/templates/repo/issue/labels.tmpl index 7de1b0f0ba..86e4bae0f7 100644 --- a/templates/repo/issue/labels.tmpl +++ b/templates/repo/issue/labels.tmpl @@ -5,7 +5,7 @@ <div class="navbar gt-mb-4"> {{template "repo/issue/navbar" .}} {{if and (or .CanWriteIssues .CanWritePulls) (not .Repository.IsArchived)}} - <button class="ui small primary new-label button">{{.locale.Tr "repo.issues.new_label"}}</button> + <button class="ui small primary new-label button">{{ctx.Locale.Tr "repo.issues.new_label"}}</button> {{end}} </div> {{if and (or .CanWriteIssues .CanWritePulls) (not .Repository.IsArchived)}} diff --git a/templates/repo/issue/labels/edit_delete_label.tmpl b/templates/repo/issue/labels/edit_delete_label.tmpl index 98efc6aa94..f41b4ee2c6 100644 --- a/templates/repo/issue/labels/edit_delete_label.tmpl +++ b/templates/repo/issue/labels/edit_delete_label.tmpl @@ -1,57 +1,57 @@ <div class="ui g-modal-confirm delete modal"> <div class="header"> {{svg "octicon-trash"}} - {{.locale.Tr "repo.issues.label_deletion"}} + {{ctx.Locale.Tr "repo.issues.label_deletion"}} </div> <div class="content"> - <p>{{.locale.Tr "repo.issues.label_deletion_desc"}}</p> + <p>{{ctx.Locale.Tr "repo.issues.label_deletion_desc"}}</p> </div> {{template "base/modal_actions_confirm" .}} </div> <div class="ui small edit-label modal"> <div class="header"> - {{.locale.Tr "repo.issues.label_modify"}} + {{ctx.Locale.Tr "repo.issues.label_modify"}} </div> <div class="content"> <form class="ui edit-label form ignore-dirty" action="{{$.Link}}/edit" method="post"> {{.CsrfTokenHtml}} <input id="label-modal-id" name="id" type="hidden"> <div class="required field"> - <label for="name">{{.locale.Tr "repo.issues.label_title"}}</label> + <label for="name">{{ctx.Locale.Tr "repo.issues.label_title"}}</label> <div class="ui small input"> - <input class="label-name-input" name="title" placeholder="{{.locale.Tr "repo.issues.new_label_placeholder"}}" autofocus required maxlength="50"> + <input class="label-name-input" name="title" placeholder="{{ctx.Locale.Tr "repo.issues.new_label_placeholder"}}" autofocus required maxlength="50"> </div> </div> <div class="field label-exclusive-input-field"> <div class="ui checkbox"> <input class="label-exclusive-input" name="exclusive" type="checkbox"> - <label>{{.locale.Tr "repo.issues.label_exclusive"}}</label> + <label>{{ctx.Locale.Tr "repo.issues.label_exclusive"}}</label> </div> <br> - <small class="desc">{{.locale.Tr "repo.issues.label_exclusive_desc" | Safe}}</small> + <small class="desc">{{ctx.Locale.Tr "repo.issues.label_exclusive_desc" | Safe}}</small> <div class="desc gt-ml-2 gt-mt-3 gt-hidden label-exclusive-warning"> - {{svg "octicon-alert"}} {{.locale.Tr "repo.issues.label_exclusive_warning" | Safe}} + {{svg "octicon-alert"}} {{ctx.Locale.Tr "repo.issues.label_exclusive_warning" | Safe}} </div> <br> </div> <div class="field label-is-archived-input-field"> <div class="ui checkbox"> <input class="label-is-archived-input" name="is_archived" type="checkbox"> - <label>{{.locale.Tr "repo.issues.label_archive"}}</label> + <label>{{ctx.Locale.Tr "repo.issues.label_archive"}}</label> </div> - <i class="gt-ml-2" data-tooltip-content={{.locale.Tr "repo.issues.label_archive_tooltip"}}> + <i class="gt-ml-2" data-tooltip-content={{ctx.Locale.Tr "repo.issues.label_archive_tooltip"}}> {{svg "octicon-info"}} </i> </div> <div class="field"> - <label for="description">{{.locale.Tr "repo.issues.label_description"}}</label> + <label for="description">{{ctx.Locale.Tr "repo.issues.label_description"}}</label> <div class="ui small fluid input"> - <input class="label-desc-input" name="description" placeholder="{{.locale.Tr "repo.issues.new_label_desc_placeholder"}}" maxlength="200"> + <input class="label-desc-input" name="description" placeholder="{{ctx.Locale.Tr "repo.issues.new_label_desc_placeholder"}}" maxlength="200"> </div> </div> <div class="field color-field"> - <label for="color">{{$.locale.Tr "repo.issues.label_color"}}</label> + <label for="color">{{ctx.Locale.Tr "repo.issues.label_color"}}</label> <div class="color picker column"> <input class="color-picker" name="color" value="#70c24a" required maxlength="7"> {{template "repo/issue/label_precolors"}} @@ -62,11 +62,11 @@ <div class="actions"> <button class="ui small basic cancel button"> {{svg "octicon-x"}} - {{.locale.Tr "cancel"}} + {{ctx.Locale.Tr "cancel"}} </button> <button class="ui primary small approve button"> {{svg "fontawesome-save"}} - {{.locale.Tr "save"}} + {{ctx.Locale.Tr "save"}} </button> </div> </div> diff --git a/templates/repo/issue/labels/label_list.tmpl b/templates/repo/issue/labels/label_list.tmpl index b9d349cb2b..9a6065a407 100644 --- a/templates/repo/issue/labels/label_list.tmpl +++ b/templates/repo/issue/labels/label_list.tmpl @@ -1,18 +1,18 @@ <h4 class="ui top attached header"> - {{.locale.Tr "repo.issues.label_count" .NumLabels}} + {{ctx.Locale.Tr "repo.issues.label_count" .NumLabels}} <div class="ui right"> <div class="ui secondary menu"> <!-- Sort --> <div class="item ui jump dropdown gt-py-3"> <span class="text"> - {{.locale.Tr "repo.issues.filter_sort"}} + {{ctx.Locale.Tr "repo.issues.filter_sort"}} </span> {{svg "octicon-triangle-down" 14 "dropdown icon"}} <div class="left menu"> - <a class="{{if or (eq .SortType "alphabetically") (not .SortType)}}active {{end}}item" href="{{$.Link}}?sort=alphabetically&state={{$.State}}">{{.locale.Tr "repo.issues.label.filter_sort.alphabetically"}}</a> - <a class="{{if eq .SortType "reversealphabetically"}}active {{end}}item" href="{{$.Link}}?sort=reversealphabetically&state={{$.State}}">{{.locale.Tr "repo.issues.label.filter_sort.reverse_alphabetically"}}</a> - <a class="{{if eq .SortType "leastissues"}}active {{end}}item" href="{{$.Link}}?sort=leastissues&state={{$.State}}">{{.locale.Tr "repo.milestones.filter_sort.least_issues"}}</a> - <a class="{{if eq .SortType "mostissues"}}active {{end}}item" href="{{$.Link}}?sort=mostissues&state={{$.State}}">{{.locale.Tr "repo.milestones.filter_sort.most_issues"}}</a> + <a class="{{if or (eq .SortType "alphabetically") (not .SortType)}}active {{end}}item" href="{{$.Link}}?sort=alphabetically&state={{$.State}}">{{ctx.Locale.Tr "repo.issues.label.filter_sort.alphabetically"}}</a> + <a class="{{if eq .SortType "reversealphabetically"}}active {{end}}item" href="{{$.Link}}?sort=reversealphabetically&state={{$.State}}">{{ctx.Locale.Tr "repo.issues.label.filter_sort.reverse_alphabetically"}}</a> + <a class="{{if eq .SortType "leastissues"}}active {{end}}item" href="{{$.Link}}?sort=leastissues&state={{$.State}}">{{ctx.Locale.Tr "repo.milestones.filter_sort.least_issues"}}</a> + <a class="{{if eq .SortType "mostissues"}}active {{end}}item" href="{{$.Link}}?sort=mostissues&state={{$.State}}">{{ctx.Locale.Tr "repo.milestones.filter_sort.most_issues"}}</a> </div> </div> </div> @@ -37,20 +37,20 @@ </div> <div class="label-issues"> {{if $.PageIsOrgSettingsLabels}} - <a class="open-issues" href="{{AppSubUrl}}/issues?labels={{.ID}}">{{svg "octicon-issue-opened"}} {{$.locale.Tr "repo.issues.label_open_issues" .NumOpenIssues}}</a> + <a class="open-issues" href="{{AppSubUrl}}/issues?labels={{.ID}}">{{svg "octicon-issue-opened"}} {{ctx.Locale.Tr "repo.issues.label_open_issues" .NumOpenIssues}}</a> {{else}} - <a class="open-issues" href="{{$.RepoLink}}/issues?labels={{.ID}}">{{svg "octicon-issue-opened"}} {{$.locale.Tr "repo.issues.label_open_issues" .NumOpenIssues}}</a> + <a class="open-issues" href="{{$.RepoLink}}/issues?labels={{.ID}}">{{svg "octicon-issue-opened"}} {{ctx.Locale.Tr "repo.issues.label_open_issues" .NumOpenIssues}}</a> {{end}} </div> <div class="label-operation gt-df"> {{template "repo/issue/labels/label_archived" .}} <div class="gt-df gt-ml-auto"> {{if and (not $.PageIsOrgSettingsLabels) (not $.Repository.IsArchived) (or $.CanWriteIssues $.CanWritePulls)}} - <a class="edit-label-button" href="#" data-id="{{.ID}}" data-title="{{.Name}}" {{if .Exclusive}}data-exclusive{{end}} {{if gt .ArchivedUnix 0}}data-is-archived{{end}} data-num-issues="{{.NumIssues}}" data-description="{{.Description}}" data-color={{.Color}}>{{svg "octicon-pencil"}} {{$.locale.Tr "repo.issues.label_edit"}}</a> - <a class="delete-button" href="#" data-url="{{$.Link}}/delete" data-id="{{.ID}}">{{svg "octicon-trash"}} {{$.locale.Tr "repo.issues.label_delete"}}</a> + <a class="edit-label-button" href="#" data-id="{{.ID}}" data-title="{{.Name}}" {{if .Exclusive}}data-exclusive{{end}} {{if gt .ArchivedUnix 0}}data-is-archived{{end}} data-num-issues="{{.NumIssues}}" data-description="{{.Description}}" data-color={{.Color}}>{{svg "octicon-pencil"}} {{ctx.Locale.Tr "repo.issues.label_edit"}}</a> + <a class="delete-button" href="#" data-url="{{$.Link}}/delete" data-id="{{.ID}}">{{svg "octicon-trash"}} {{ctx.Locale.Tr "repo.issues.label_delete"}}</a> {{else if $.PageIsOrgSettingsLabels}} - <a class="edit-label-button" href="#" data-id="{{.ID}}" data-title="{{.Name}}" {{if .Exclusive}}data-exclusive{{end}} {{if gt .ArchivedUnix 0}}data-is-archived{{end}} data-num-issues="{{.NumIssues}}" data-description="{{.Description}}" data-color={{.Color}}>{{svg "octicon-pencil"}} {{$.locale.Tr "repo.issues.label_edit"}}</a> - <a class="delete-button" href="#" data-url="{{$.Link}}/delete" data-id="{{.ID}}">{{svg "octicon-trash"}} {{$.locale.Tr "repo.issues.label_delete"}}</a> + <a class="edit-label-button" href="#" data-id="{{.ID}}" data-title="{{.Name}}" {{if .Exclusive}}data-exclusive{{end}} {{if gt .ArchivedUnix 0}}data-is-archived{{end}} data-num-issues="{{.NumIssues}}" data-description="{{.Description}}" data-color={{.Color}}>{{svg "octicon-pencil"}} {{ctx.Locale.Tr "repo.issues.label_edit"}}</a> + <a class="delete-button" href="#" data-url="{{$.Link}}/delete" data-id="{{.ID}}">{{svg "octicon-trash"}} {{ctx.Locale.Tr "repo.issues.label_delete"}}</a> {{end}} </div> </div> @@ -61,9 +61,9 @@ <li class="item"> <div class="ui grid middle aligned"> <div class="ten wide column"> - {{$.locale.Tr "repo.org_labels_desc" | Str2html}} + {{ctx.Locale.Tr "repo.org_labels_desc" | Str2html}} {{if .IsOrganizationOwner}} - <a href="{{.OrganizationLink}}/settings/labels">({{$.locale.Tr "repo.org_labels_desc_manage"}})</a>: + <a href="{{.OrganizationLink}}/settings/labels">({{ctx.Locale.Tr "repo.org_labels_desc_manage"}})</a>: {{end}} </div> </div> @@ -76,7 +76,7 @@ {{if .Description}}<br><small class="desc">{{.Description | RenderEmoji $.Context}}</small>{{end}} </div> <div class="label-issues"> - <a class="open-issues" {{if .IsArchived}}data-is-archived{{end}} href="{{$.RepoLink}}/issues?labels={{.ID}}">{{svg "octicon-issue-opened"}} {{$.locale.Tr "repo.issues.label_open_issues" .NumOpenRepoIssues}}</a> + <a class="open-issues" {{if .IsArchived}}data-is-archived{{end}} href="{{$.RepoLink}}/issues?labels={{.ID}}">{{svg "octicon-issue-opened"}} {{ctx.Locale.Tr "repo.issues.label_open_issues" .NumOpenRepoIssues}}</a> </div> <div class="label-operation"> {{template "repo/issue/labels/label_archived" .}} diff --git a/templates/repo/issue/labels/label_load_template.tmpl b/templates/repo/issue/labels/label_load_template.tmpl index d883953bf6..0499afea19 100644 --- a/templates/repo/issue/labels/label_load_template.tmpl +++ b/templates/repo/issue/labels/label_load_template.tmpl @@ -1,14 +1,14 @@ <div class="ui centered grid"> <div class="twelve wide computer column"> <div class="ui attached left aligned segment"> - <p>{{.locale.Tr "repo.issues.label_templates.info"}}</p> + <p>{{ctx.Locale.Tr "repo.issues.label_templates.info"}}</p> <br> <form class="ui form center" action="{{.Link}}/initialize" method="post"> {{.CsrfTokenHtml}} <div class="field"> <div class="ui selection dropdown"> <input type="hidden" name="template_name" value="Default"> - <div class="default text">{{.locale.Tr "repo.issues.label_templates.helper"}}</div> + <div class="default text">{{ctx.Locale.Tr "repo.issues.label_templates.helper"}}</div> <div class="menu"> {{range .LabelTemplateFiles}} <div class="item" data-value="{{.DisplayName}}">{{.DisplayName}}<br><i>({{.Description}})</i></div> @@ -17,7 +17,7 @@ {{svg "octicon-triangle-down" 18 "dropdown icon"}} </div> </div> - <button type="submit" class="ui primary button">{{.locale.Tr "repo.issues.label_templates.use"}}</button> + <button type="submit" class="ui primary button">{{ctx.Locale.Tr "repo.issues.label_templates.use"}}</button> </form> </div> </div> diff --git a/templates/repo/issue/labels/label_new.tmpl b/templates/repo/issue/labels/label_new.tmpl index 8edd6d4e8a..e7fb1e5ff6 100644 --- a/templates/repo/issue/labels/label_new.tmpl +++ b/templates/repo/issue/labels/label_new.tmpl @@ -1,32 +1,32 @@ <div class="ui small new-label modal"> <div class="header"> - {{.locale.Tr "repo.issues.new_label"}} + {{ctx.Locale.Tr "repo.issues.new_label"}} </div> <div class="content"> <form class="ui new-label form ignore-dirty" action="{{$.Link}}/new" method="post"> {{.CsrfTokenHtml}} <div class="required field"> - <label for="name">{{.locale.Tr "repo.issues.label_title"}}</label> + <label for="name">{{ctx.Locale.Tr "repo.issues.label_title"}}</label> <div class="ui small input"> - <input class="label-name-input" name="title" placeholder="{{.locale.Tr "repo.issues.new_label_placeholder"}}" autofocus required maxlength="50"> + <input class="label-name-input" name="title" placeholder="{{ctx.Locale.Tr "repo.issues.new_label_placeholder"}}" autofocus required maxlength="50"> </div> </div> <div class="field label-exclusive-input-field"> <div class="ui checkbox"> <input class="label-exclusive-input" name="exclusive" type="checkbox"> - <label>{{.locale.Tr "repo.issues.label_exclusive"}}</label> + <label>{{ctx.Locale.Tr "repo.issues.label_exclusive"}}</label> </div> <br> - <small class="desc">{{.locale.Tr "repo.issues.label_exclusive_desc" | Safe}}</small> + <small class="desc">{{ctx.Locale.Tr "repo.issues.label_exclusive_desc" | Safe}}</small> </div> <div class="field"> - <label for="description">{{.locale.Tr "repo.issues.label_description"}}</label> + <label for="description">{{ctx.Locale.Tr "repo.issues.label_description"}}</label> <div class="ui small fluid input"> - <input class="label-desc-input" name="description" placeholder="{{.locale.Tr "repo.issues.new_label_desc_placeholder"}}" maxlength="200"> + <input class="label-desc-input" name="description" placeholder="{{ctx.Locale.Tr "repo.issues.new_label_desc_placeholder"}}" maxlength="200"> </div> </div> <div class="field color-field"> - <label for="color">{{$.locale.Tr "repo.issues.label_color"}}</label> + <label for="color">{{ctx.Locale.Tr "repo.issues.label_color"}}</label> <div class="color picker column"> <input class="color-picker" name="color" value="#70c24a" required maxlength="7"> {{template "repo/issue/label_precolors"}} @@ -38,11 +38,11 @@ <div class="actions"> <button class="ui cancel button"> {{svg "octicon-x"}} - {{.locale.Tr "cancel"}} + {{ctx.Locale.Tr "cancel"}} </button> <button class="ui primary ok button"> {{svg "octicon-check"}} - {{.locale.Tr "repo.issues.create_label"}} + {{ctx.Locale.Tr "repo.issues.create_label"}} </button> </div> </div> diff --git a/templates/repo/issue/labels/labels_selector_field.tmpl b/templates/repo/issue/labels/labels_selector_field.tmpl index f8d38d035f..1599f2deb6 100644 --- a/templates/repo/issue/labels/labels_selector_field.tmpl +++ b/templates/repo/issue/labels/labels_selector_field.tmpl @@ -1,6 +1,6 @@ <div class="ui {{if or (not .HasIssuesOrPullsWritePermission) .Repository.IsArchived}}disabled{{end}} floating jump select-label dropdown"> <span class="text muted flex-text-block"> - <strong>{{.locale.Tr "repo.issues.new.labels"}}</strong> + <strong>{{ctx.Locale.Tr "repo.issues.new.labels"}}</strong> {{if and .HasIssuesOrPullsWritePermission (not .Repository.IsArchived)}} {{svg "octicon-gear" 16 "gt-ml-2"}} {{end}} @@ -9,10 +9,10 @@ {{if or .Labels .OrgLabels}} <div class="ui icon search input"> <i class="icon">{{svg "octicon-search" 16}}</i> - <input type="text" placeholder="{{.locale.Tr "repo.issues.filter_labels"}}"> + <input type="text" placeholder="{{ctx.Locale.Tr "repo.issues.filter_labels"}}"> </div> {{end}} - <a class="no-select item" href="#">{{.locale.Tr "repo.issues.new.clear_labels"}}</a> + <a class="no-select item" href="#">{{ctx.Locale.Tr "repo.issues.new.clear_labels"}}</a> {{if or .Labels .OrgLabels}} {{$previousExclusiveScope := "_no_scope"}} {{range .Labels}} @@ -36,7 +36,7 @@ {{if .Description}}<br><small class="desc">{{.Description | RenderEmoji $.Context}}</small>{{end}}</a> {{end}} {{else}} - <div class="disabled item">{{.locale.Tr "repo.issues.new.no_items"}}</div> + <div class="disabled item">{{ctx.Locale.Tr "repo.issues.new.no_items"}}</div> {{end}} </div> </div> diff --git a/templates/repo/issue/labels/labels_sidebar.tmpl b/templates/repo/issue/labels/labels_sidebar.tmpl index 89fe26b755..4f41054a91 100644 --- a/templates/repo/issue/labels/labels_sidebar.tmpl +++ b/templates/repo/issue/labels/labels_sidebar.tmpl @@ -1,5 +1,5 @@ <div class="ui labels list"> - <span class="no-select item {{if .root.HasSelectedLabel}}gt-hidden{{end}}">{{.root.locale.Tr "repo.issues.new.no_label"}}</span> + <span class="no-select item {{if .root.HasSelectedLabel}}gt-hidden{{end}}">{{ctx.Locale.Tr "repo.issues.new.no_label"}}</span> <span class="labels-list"> {{range .root.Labels}} {{template "repo/issue/labels/label" dict "root" $.root "label" .}} diff --git a/templates/repo/issue/list.tmpl b/templates/repo/issue/list.tmpl index cc8c647c1e..75d4234324 100644 --- a/templates/repo/issue/list.tmpl +++ b/templates/repo/issue/list.tmpl @@ -18,13 +18,13 @@ {{template "repo/issue/search" .}} {{if not .Repository.IsArchived}} {{if .PageIsIssueList}} - <a class="ui small primary button issue-list-new" href="{{.RepoLink}}/issues/new{{if .NewIssueChooseTemplate}}/choose{{end}}">{{.locale.Tr "repo.issues.new"}}</a> + <a class="ui small primary button issue-list-new" href="{{.RepoLink}}/issues/new{{if .NewIssueChooseTemplate}}/choose{{end}}">{{ctx.Locale.Tr "repo.issues.new"}}</a> {{else}} - <a class="ui small primary button new-pr-button issue-list-new{{if not .PullRequestCtx.Allowed}} disabled{{end}}" href="{{if .PullRequestCtx.Allowed}}{{.Repository.Link}}/compare/{{.Repository.DefaultBranch | PathEscapeSegments}}...{{if ne .Repository.Owner.Name .PullRequestCtx.BaseRepo.Owner.Name}}{{PathEscape .Repository.Owner.Name}}:{{end}}{{.Repository.DefaultBranch | PathEscapeSegments}}{{end}}">{{.locale.Tr "repo.pulls.new"}}</a> + <a class="ui small primary button new-pr-button issue-list-new{{if not .PullRequestCtx.Allowed}} disabled{{end}}" href="{{if .PullRequestCtx.Allowed}}{{.Repository.Link}}/compare/{{.Repository.DefaultBranch | PathEscapeSegments}}...{{if ne .Repository.Owner.Name .PullRequestCtx.BaseRepo.Owner.Name}}{{PathEscape .Repository.Owner.Name}}:{{end}}{{.Repository.DefaultBranch | PathEscapeSegments}}{{end}}">{{ctx.Locale.Tr "repo.pulls.new"}}</a> {{end}} {{else}} {{if not .PageIsIssueList}} - <a class="ui small primary small button issue-list-new{{if not .PullRequestCtx.Allowed}} disabled{{end}}" href="{{if .PullRequestCtx.Allowed}}{{.PullRequestCtx.BaseRepo.Link}}/compare/{{.PullRequestCtx.BaseRepo.DefaultBranch | PathEscapeSegments}}...{{if ne .Repository.Owner.Name .PullRequestCtx.BaseRepo.Owner.Name}}{{PathEscape .Repository.Owner.Name}}:{{end}}{{.Repository.DefaultBranch | PathEscapeSegments}}{{end}}">{{$.locale.Tr "action.compare_commits_general"}}</a> + <a class="ui small primary small button issue-list-new{{if not .PullRequestCtx.Allowed}} disabled{{end}}" href="{{if .PullRequestCtx.Allowed}}{{.PullRequestCtx.BaseRepo.Link}}/compare/{{.PullRequestCtx.BaseRepo.DefaultBranch | PathEscapeSegments}}...{{if ne .Repository.Owner.Name .PullRequestCtx.BaseRepo.Owner.Name}}{{PathEscape .Repository.Owner.Name}}:{{end}}{{.Repository.DefaultBranch | PathEscapeSegments}}{{end}}">{{ctx.Locale.Tr "action.compare_commits_general"}}</a> {{end}} {{end}} </div> @@ -40,25 +40,25 @@ {{if not .Repository.IsArchived}} <!-- Action Button --> {{if .IsShowClosed}} - <button class="ui primary basic button issue-action" data-action="open" data-url="{{$.RepoLink}}/issues/status">{{.locale.Tr "repo.issues.action_open"}}</button> + <button class="ui primary basic button issue-action" data-action="open" data-url="{{$.RepoLink}}/issues/status">{{ctx.Locale.Tr "repo.issues.action_open"}}</button> {{else}} - <button class="ui red basic button issue-action" data-action="close" data-url="{{$.RepoLink}}/issues/status">{{.locale.Tr "repo.issues.action_close"}}</button> + <button class="ui red basic button issue-action" data-action="close" data-url="{{$.RepoLink}}/issues/status">{{ctx.Locale.Tr "repo.issues.action_close"}}</button> {{end}} {{if $.IsRepoAdmin}} <button class="ui red button issue-action" data-action="delete" data-url="{{$.RepoLink}}/issues/delete" - data-action-delete-confirm="{{.locale.Tr "confirm_delete_selected"}}" - >{{.locale.Tr "repo.issues.delete"}}</button> + data-action-delete-confirm="{{ctx.Locale.Tr "confirm_delete_selected"}}" + >{{ctx.Locale.Tr "repo.issues.delete"}}</button> {{end}} <!-- Labels --> <div class="ui {{if not .Labels}}disabled{{end}} dropdown jump item"> <span class="text"> - {{.locale.Tr "repo.issues.action_label"}} + {{ctx.Locale.Tr "repo.issues.action_label"}} </span> {{svg "octicon-triangle-down" 14 "dropdown icon"}} <div class="menu"> <div class="item issue-action" data-action="clear" data-url="{{$.RepoLink}}/issues/labels"> - {{.locale.Tr "repo.issues.new.clear_labels"}} + {{ctx.Locale.Tr "repo.issues.new.clear_labels"}} </div> {{$previousExclusiveScope := "_no_scope"}} {{range .Labels}} @@ -77,16 +77,16 @@ <!-- Milestone --> <div class="ui {{if not (or .OpenMilestones .ClosedMilestones)}}disabled{{end}} dropdown jump item"> <span class="text"> - {{.locale.Tr "repo.issues.action_milestone"}} + {{ctx.Locale.Tr "repo.issues.action_milestone"}} </span> {{svg "octicon-triangle-down" 14 "dropdown icon"}} <div class="menu"> <div class="item issue-action" data-element-id="0" data-url="{{$.Link}}/milestone"> - {{.locale.Tr "repo.issues.action_milestone_no_select"}} + {{ctx.Locale.Tr "repo.issues.action_milestone_no_select"}} </div> {{if .OpenMilestones}} <div class="divider"></div> - <div class="header">{{.locale.Tr "repo.issues.filter_milestone_open"}}</div> + <div class="header">{{ctx.Locale.Tr "repo.issues.filter_milestone_open"}}</div> {{range .OpenMilestones}} <div class="item issue-action" data-element-id="{{.ID}}" data-url="{{$.RepoLink}}/issues/milestone"> {{.Name}} @@ -95,7 +95,7 @@ {{end}} {{if .ClosedMilestones}} <div class="divider"></div> - <div class="header">{{.locale.Tr "repo.issues.filter_milestone_open"}}</div> + <div class="header">{{ctx.Locale.Tr "repo.issues.filter_milestone_open"}}</div> {{range .ClosedMilestones}} <div class="item issue-action" data-element-id="{{.ID}}" data-url="{{$.RepoLink}}/issues/milestone"> {{.Name}} @@ -108,17 +108,17 @@ <!-- Projects --> <div class="ui{{if not (or .OpenProjects .ClosedProjects)}} disabled{{end}} dropdown jump item"> <span class="text"> - {{.locale.Tr "repo.project_board"}} + {{ctx.Locale.Tr "repo.project_board"}} </span> {{svg "octicon-triangle-down" 14 "dropdown icon"}} <div class="menu"> <div class="item issue-action" data-element-id="0" data-url="{{$.Link}}/projects"> - {{.locale.Tr "repo.issues.new.clear_projects"}} + {{ctx.Locale.Tr "repo.issues.new.clear_projects"}} </div> {{if .OpenProjects}} <div class="divider"></div> <div class="header"> - {{.locale.Tr "repo.issues.new.open_projects"}} + {{ctx.Locale.Tr "repo.issues.new.open_projects"}} </div> {{range .OpenProjects}} <div class="item issue-action" data-element-id="{{.ID}}" data-url="{{$.RepoLink}}/issues/projects"> @@ -129,7 +129,7 @@ {{if .ClosedProjects}} <div class="divider"></div> <div class="header"> - {{.locale.Tr "repo.issues.new.closed_projects"}} + {{ctx.Locale.Tr "repo.issues.new.closed_projects"}} </div> {{range .ClosedProjects}} <div class="item issue-action" data-element-id="{{.ID}}" data-url="{{$.RepoLink}}/issues/projects"> @@ -143,15 +143,15 @@ <!-- Assignees --> <div class="ui {{if not .Assignees}}disabled{{end}} dropdown jump item"> <span class="text"> - {{.locale.Tr "repo.issues.action_assignee"}} + {{ctx.Locale.Tr "repo.issues.action_assignee"}} </span> {{svg "octicon-triangle-down" 14 "dropdown icon"}} <div class="menu"> <div class="item issue-action" data-action="clear" data-url="{{$.Link}}/assignee"> - {{.locale.Tr "repo.issues.new.clear_assignees"}} + {{ctx.Locale.Tr "repo.issues.new.clear_assignees"}} </div> <div class="item issue-action" data-element-id="0" data-url="{{$.Link}}/assignee"> - {{.locale.Tr "repo.issues.action_assignee_no_select"}} + {{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"> diff --git a/templates/repo/issue/milestone/select_menu.tmpl b/templates/repo/issue/milestone/select_menu.tmpl index df9b324465..6f8c6c85c2 100644 --- a/templates/repo/issue/milestone/select_menu.tmpl +++ b/templates/repo/issue/milestone/select_menu.tmpl @@ -1,20 +1,20 @@ {{if or .OpenMilestones .ClosedMilestones}} <div class="ui icon search input"> <i class="icon">{{svg "octicon-search" 16}}</i> - <input type="text" placeholder="{{.locale.Tr "repo.issues.filter_milestones"}}"> + <input type="text" placeholder="{{ctx.Locale.Tr "repo.issues.filter_milestones"}}"> </div> <div class="divider"></div> {{end}} -<div class="no-select item">{{.locale.Tr "repo.issues.new.clear_milestone"}}</div> +<div class="no-select item">{{ctx.Locale.Tr "repo.issues.new.clear_milestone"}}</div> {{if and (not .OpenMilestones) (not .ClosedMilestones)}} <div class="disabled item"> - {{.locale.Tr "repo.issues.new.no_items"}} + {{ctx.Locale.Tr "repo.issues.new.no_items"}} </div> {{else}} {{if .OpenMilestones}} <div class="divider"></div> <div class="header"> - {{.locale.Tr "repo.issues.new.open_milestone"}} + {{ctx.Locale.Tr "repo.issues.new.open_milestone"}} </div> {{range .OpenMilestones}} <a class="item" data-id="{{.ID}}" data-href="{{$.RepoLink}}/issues?milestone={{.ID}}"> @@ -26,7 +26,7 @@ {{if .ClosedMilestones}} <div class="divider"></div> <div class="header"> - {{.locale.Tr "repo.issues.new.closed_milestone"}} + {{ctx.Locale.Tr "repo.issues.new.closed_milestone"}} </div> {{range .ClosedMilestones}} <a class="item" data-id="{{.ID}}" data-href="{{$.RepoLink}}/issues?milestone={{.ID}}"> diff --git a/templates/repo/issue/milestone_issues.tmpl b/templates/repo/issue/milestone_issues.tmpl index aa3d9b94cd..4ac8977e66 100644 --- a/templates/repo/issue/milestone_issues.tmpl +++ b/templates/repo/issue/milestone_issues.tmpl @@ -8,15 +8,15 @@ <div class="text right gt-f1"> {{if or .CanWriteIssues .CanWritePulls}} {{if .Milestone.IsClosed}} - <a class="ui primary basic button link-action" href data-url="{{$.RepoLink}}/milestones/{{.MilestoneID}}/open">{{$.locale.Tr "repo.milestones.open"}} + <a class="ui primary basic button link-action" href data-url="{{$.RepoLink}}/milestones/{{.MilestoneID}}/open">{{ctx.Locale.Tr "repo.milestones.open"}} </a> {{else}} - <a class="ui red basic button link-action" href data-url="{{$.RepoLink}}/milestones/{{.MilestoneID}}/close">{{$.locale.Tr "repo.milestones.close"}} + <a class="ui red basic button link-action" href data-url="{{$.RepoLink}}/milestones/{{.MilestoneID}}/close">{{ctx.Locale.Tr "repo.milestones.close"}} </a> {{end}} - <a class="ui button" href="{{.RepoLink}}/milestones/{{.MilestoneID}}/edit">{{.locale.Tr "repo.milestones.edit"}}</a> + <a class="ui button" href="{{.RepoLink}}/milestones/{{.MilestoneID}}/edit">{{ctx.Locale.Tr "repo.milestones.edit"}}</a> {{end}} - <a class="ui primary button" href="{{.RepoLink}}/issues/new{{if .NewIssueChooseTemplate}}/choose{{end}}?milestone={{.MilestoneID}}">{{.locale.Tr "repo.issues.new"}}</a> + <a class="ui primary button" href="{{.RepoLink}}/issues/new{{if .NewIssueChooseTemplate}}/choose{{end}}?milestone={{.MilestoneID}}">{{ctx.Locale.Tr "repo.issues.new"}}</a> </div> {{end}} </div> @@ -31,7 +31,7 @@ <div classs="gt-df gt-ac"> {{$closedDate:= TimeSinceUnix .Milestone.ClosedDateUnix $.locale}} {{if .IsClosed}} - {{svg "octicon-clock"}} {{$.locale.Tr "repo.milestones.closed" $closedDate | Safe}} + {{svg "octicon-clock"}} {{ctx.Locale.Tr "repo.milestones.closed" $closedDate | Safe}} {{else}} {{if .Milestone.DeadlineString}} @@ -41,11 +41,11 @@ </span> {{else}} {{svg "octicon-calendar"}} - {{$.locale.Tr "repo.milestones.no_due_date"}} + {{ctx.Locale.Tr "repo.milestones.no_due_date"}} {{end}} {{end}} </div> - <div class="gt-mr-3">{{.locale.Tr "repo.milestones.completeness" .Milestone.Completeness | Safe}}</div> + <div class="gt-mr-3">{{ctx.Locale.Tr "repo.milestones.completeness" .Milestone.Completeness | Safe}}</div> </div> </div> <div class="divider"></div> diff --git a/templates/repo/issue/milestone_new.tmpl b/templates/repo/issue/milestone_new.tmpl index 47a3d93d2b..3e79ee7ee9 100644 --- a/templates/repo/issue/milestone_new.tmpl +++ b/templates/repo/issue/milestone_new.tmpl @@ -6,50 +6,50 @@ {{template "repo/issue/navbar" .}} {{if and (or .CanWriteIssues .CanWritePulls) .PageIsEditMilestone}} <div class="ui right floated secondary menu"> - <a class="ui primary button" href="{{$.RepoLink}}/milestones/new">{{.locale.Tr "repo.milestones.new"}}</a> + <a class="ui primary button" href="{{$.RepoLink}}/milestones/new">{{ctx.Locale.Tr "repo.milestones.new"}}</a> </div> {{end}} </div> <div class="divider"></div> <h2 class="ui dividing header"> {{if .PageIsEditMilestone}} - {{.locale.Tr "repo.milestones.edit"}} - <div class="sub header">{{.locale.Tr "repo.milestones.edit_subheader"}}</div> + {{ctx.Locale.Tr "repo.milestones.edit"}} + <div class="sub header">{{ctx.Locale.Tr "repo.milestones.edit_subheader"}}</div> {{else}} - {{.locale.Tr "repo.milestones.new"}} - <div class="sub header">{{.locale.Tr "repo.milestones.new_subheader"}}</div> + {{ctx.Locale.Tr "repo.milestones.new"}} + <div class="sub header">{{ctx.Locale.Tr "repo.milestones.new_subheader"}}</div> {{end}} </h2> {{template "base/alert" .}} <form class="ui form" action="{{.Link}}" method="post"> {{.CsrfTokenHtml}} <div class="field {{if .Err_Title}}error{{end}}"> - <label>{{.locale.Tr "repo.milestones.title"}}</label> - <input name="title" placeholder="{{.locale.Tr "repo.milestones.title"}}" value="{{.title}}" autofocus required maxlength="50"> + <label>{{ctx.Locale.Tr "repo.milestones.title"}}</label> + <input name="title" placeholder="{{ctx.Locale.Tr "repo.milestones.title"}}" value="{{.title}}" autofocus required maxlength="50"> </div> <div class="field {{if .Err_Deadline}}error{{end}}"> <label> - {{.locale.Tr "repo.milestones.due_date"}} - <a id="clear-date">{{.locale.Tr "repo.milestones.clear"}}</a> + {{ctx.Locale.Tr "repo.milestones.due_date"}} + <a id="clear-date">{{ctx.Locale.Tr "repo.milestones.clear"}}</a> </label> - <input type="date" id="deadline" name="deadline" value="{{.deadline}}" placeholder="{{.locale.Tr "repo.issues.due_date_form"}}"> + <input type="date" id="deadline" name="deadline" value="{{.deadline}}" placeholder="{{ctx.Locale.Tr "repo.issues.due_date_form"}}"> </div> <div class="field"> - <label>{{.locale.Tr "repo.milestones.desc"}}</label> + <label>{{ctx.Locale.Tr "repo.milestones.desc"}}</label> <textarea name="content">{{.content}}</textarea> </div> <div class="divider"></div> <div class="gt-text-right"> {{if .PageIsEditMilestone}} <a class="ui primary basic button" href="{{.RepoLink}}/milestones"> - {{.locale.Tr "repo.milestones.cancel"}} + {{ctx.Locale.Tr "repo.milestones.cancel"}} </a> <button class="ui primary button"> - {{.locale.Tr "repo.milestones.modify"}} + {{ctx.Locale.Tr "repo.milestones.modify"}} </button> {{else}} <button class="ui primary button"> - {{.locale.Tr "repo.milestones.create"}} + {{ctx.Locale.Tr "repo.milestones.create"}} </button> {{end}} </div> diff --git a/templates/repo/issue/milestones.tmpl b/templates/repo/issue/milestones.tmpl index a6cb11dde6..3ed7577acd 100644 --- a/templates/repo/issue/milestones.tmpl +++ b/templates/repo/issue/milestones.tmpl @@ -5,7 +5,7 @@ <div class="navbar gt-mb-4"> {{template "repo/issue/navbar" .}} {{if and (or .CanWriteIssues .CanWritePulls) (not .Repository.IsArchived)}} - <a class="ui small primary button" href="{{$.Link}}/new">{{.locale.Tr "repo.milestones.new"}}</a> + <a class="ui small primary button" href="{{$.Link}}/new">{{ctx.Locale.Tr "repo.milestones.new"}}</a> {{end}} </div> {{template "base/alert" .}} @@ -14,11 +14,11 @@ <div class="small-menu-items ui compact tiny menu list-header-toggle"> <a class="item{{if not .IsShowClosed}} active{{end}}" href="{{.RepoLink}}/milestones?state=open&q={{$.Keyword}}"> {{svg "octicon-milestone" 16 "gt-mr-3"}} - {{.locale.PrettyNumber .OpenCount}} {{.locale.Tr "repo.issues.open_title"}} + {{.locale.PrettyNumber .OpenCount}} {{ctx.Locale.Tr "repo.issues.open_title"}} </a> <a class="item{{if .IsShowClosed}} active{{end}}" href="{{.RepoLink}}/milestones?state=closed&q={{$.Keyword}}"> {{svg "octicon-check" 16 "gt-mr-3"}} - {{.locale.PrettyNumber .ClosedCount}} {{.locale.Tr "repo.issues.closed_title"}} + {{.locale.PrettyNumber .ClosedCount}} {{ctx.Locale.Tr "repo.issues.closed_title"}} </a> </div> @@ -27,7 +27,7 @@ <div class="ui small search fluid action input"> <input type="hidden" name="state" value="{{$.State}}"> {{template "shared/searchinput" dict "Value" .Keyword}} - <button class="ui small icon button" type="submit" aria-label="{{.locale.Tr "explore.search"}}"> + <button class="ui small icon button" type="submit" aria-label="{{ctx.Locale.Tr "explore.search"}}"> {{svg "octicon-search"}} </button> </div> @@ -36,16 +36,16 @@ <!-- Sort --> <div class="list-header-sort ui small dropdown type jump item"> <span class="text"> - {{.locale.Tr "repo.issues.filter_sort"}} + {{ctx.Locale.Tr "repo.issues.filter_sort"}} </span> {{svg "octicon-triangle-down" 14 "dropdown icon"}} <div class="menu"> - <a class="{{if or (eq .SortType "closestduedate") (not .SortType)}}active {{end}}item" href="{{$.Link}}?sort=closestduedate&state={{$.State}}&q={{$.Keyword}}">{{.locale.Tr "repo.milestones.filter_sort.earliest_due_data"}}</a> - <a class="{{if eq .SortType "furthestduedate"}}active {{end}}item" href="{{$.Link}}?sort=furthestduedate&state={{$.State}}&q={{$.Keyword}}">{{.locale.Tr "repo.milestones.filter_sort.latest_due_date"}}</a> - <a class="{{if eq .SortType "leastcomplete"}}active {{end}}item" href="{{$.Link}}?sort=leastcomplete&state={{$.State}}&q={{$.Keyword}}">{{.locale.Tr "repo.milestones.filter_sort.least_complete"}}</a> - <a class="{{if eq .SortType "mostcomplete"}}active {{end}}item" href="{{$.Link}}?sort=mostcomplete&state={{$.State}}&q={{$.Keyword}}">{{.locale.Tr "repo.milestones.filter_sort.most_complete"}}</a> - <a class="{{if eq .SortType "mostissues"}}active {{end}}item" href="{{$.Link}}?sort=mostissues&state={{$.State}}&q={{$.Keyword}}">{{.locale.Tr "repo.milestones.filter_sort.most_issues"}}</a> - <a class="{{if eq .SortType "leastissues"}}active {{end}}item" href="{{$.Link}}?sort=leastissues&state={{$.State}}&q={{$.Keyword}}">{{.locale.Tr "repo.milestones.filter_sort.least_issues"}}</a> + <a class="{{if or (eq .SortType "closestduedate") (not .SortType)}}active {{end}}item" href="{{$.Link}}?sort=closestduedate&state={{$.State}}&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.milestones.filter_sort.earliest_due_data"}}</a> + <a class="{{if eq .SortType "furthestduedate"}}active {{end}}item" href="{{$.Link}}?sort=furthestduedate&state={{$.State}}&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.milestones.filter_sort.latest_due_date"}}</a> + <a class="{{if eq .SortType "leastcomplete"}}active {{end}}item" href="{{$.Link}}?sort=leastcomplete&state={{$.State}}&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.milestones.filter_sort.least_complete"}}</a> + <a class="{{if eq .SortType "mostcomplete"}}active {{end}}item" href="{{$.Link}}?sort=mostcomplete&state={{$.State}}&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.milestones.filter_sort.most_complete"}}</a> + <a class="{{if eq .SortType "mostissues"}}active {{end}}item" href="{{$.Link}}?sort=mostissues&state={{$.State}}&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.milestones.filter_sort.most_issues"}}</a> + <a class="{{if eq .SortType "leastissues"}}active {{end}}item" href="{{$.Link}}?sort=leastissues&state={{$.State}}&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.milestones.filter_sort.least_issues"}}</a> </div> </div> </div> @@ -68,11 +68,11 @@ <div class="group"> <div class="flex-text-block"> {{svg "octicon-issue-opened" 14}} - {{$.locale.PrettyNumber .NumOpenIssues}} {{$.locale.Tr "repo.issues.open_title"}} + {{$.locale.PrettyNumber .NumOpenIssues}} {{ctx.Locale.Tr "repo.issues.open_title"}} </div> <div class="flex-text-block"> {{svg "octicon-check" 14}} - {{$.locale.PrettyNumber .NumClosedIssues}} {{$.locale.Tr "repo.issues.closed_title"}} + {{$.locale.PrettyNumber .NumClosedIssues}} {{ctx.Locale.Tr "repo.issues.closed_title"}} </div> {{if .TotalTrackedTime}} <div class="flex-text-block"> @@ -83,14 +83,14 @@ {{if .UpdatedUnix}} <div class="flex-text-block"> {{svg "octicon-clock"}} - {{$.locale.Tr "repo.milestones.update_ago" (TimeSinceUnix .UpdatedUnix $.locale) | Safe}} + {{ctx.Locale.Tr "repo.milestones.update_ago" (TimeSinceUnix .UpdatedUnix $.locale) | Safe}} </div> {{end}} <div class="flex-text-block"> {{if .IsClosed}} {{$closedDate:= TimeSinceUnix .ClosedDateUnix $.locale}} {{svg "octicon-clock" 14}} - {{$.locale.Tr "repo.milestones.closed" $closedDate | Safe}} + {{ctx.Locale.Tr "repo.milestones.closed" $closedDate | Safe}} {{else}} {{if .DeadlineString}} <span class="flex-text-inline {{if .IsOverdue}}text red{{end}}"> @@ -99,20 +99,20 @@ </span> {{else}} {{svg "octicon-calendar" 14}} - {{$.locale.Tr "repo.milestones.no_due_date"}} + {{ctx.Locale.Tr "repo.milestones.no_due_date"}} {{end}} {{end}} </div> </div> {{if and (or $.CanWriteIssues $.CanWritePulls) (not $.Repository.IsArchived)}} <div class="group"> - <a class="flex-text-inline" href="{{$.Link}}/{{.ID}}/edit">{{svg "octicon-pencil" 14}}{{$.locale.Tr "repo.issues.label_edit"}}</a> + <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}}{{$.locale.Tr "repo.milestones.open"}}</a> + <a class="link-action flex-text-inline" href data-url="{{$.Link}}/{{.ID}}/open">{{svg "octicon-check" 14}}{{ctx.Locale.Tr "repo.milestones.open"}}</a> {{else}} - <a class="link-action flex-text-inline" href data-url="{{$.Link}}/{{.ID}}/close">{{svg "octicon-x" 14}}{{$.locale.Tr "repo.milestones.close"}}</a> + <a class="link-action flex-text-inline" href data-url="{{$.Link}}/{{.ID}}/close">{{svg "octicon-x" 14}}{{ctx.Locale.Tr "repo.milestones.close"}}</a> {{end}} - <a class="delete-button flex-text-inline" href="#" data-url="{{$.RepoLink}}/milestones/delete" data-id="{{.ID}}">{{svg "octicon-trash" 14}}{{$.locale.Tr "repo.issues.label_delete"}}</a> + <a class="delete-button flex-text-inline" href="#" data-url="{{$.RepoLink}}/milestones/delete" data-id="{{.ID}}">{{svg "octicon-trash" 14}}{{ctx.Locale.Tr "repo.issues.label_delete"}}</a> </div> {{end}} </div> @@ -133,10 +133,10 @@ <div class="ui g-modal-confirm delete modal"> <div class="header"> {{svg "octicon-trash"}} - {{.locale.Tr "repo.milestones.deletion"}} + {{ctx.Locale.Tr "repo.milestones.deletion"}} </div> <div class="content"> - <p>{{.locale.Tr "repo.milestones.deletion_desc"}}</p> + <p>{{ctx.Locale.Tr "repo.milestones.deletion_desc"}}</p> </div> {{template "base/modal_actions_confirm" .}} </div> diff --git a/templates/repo/issue/navbar.tmpl b/templates/repo/issue/navbar.tmpl index 2f1ea7a659..16110597ed 100644 --- a/templates/repo/issue/navbar.tmpl +++ b/templates/repo/issue/navbar.tmpl @@ -1,4 +1,4 @@ <h2 class="ui compact small menu header small-menu-items issue-list-navbar"> - <a class="{{if .PageIsLabels}}active {{end}}item" href="{{.RepoLink}}/labels">{{.locale.Tr "repo.labels"}}</a> - <a class="{{if .PageIsMilestones}}active {{end}}item" href="{{.RepoLink}}/milestones">{{.locale.Tr "repo.milestones"}}</a> + <a class="{{if .PageIsLabels}}active {{end}}item" href="{{.RepoLink}}/labels">{{ctx.Locale.Tr "repo.labels"}}</a> + <a class="{{if .PageIsMilestones}}active {{end}}item" href="{{.RepoLink}}/milestones">{{ctx.Locale.Tr "repo.milestones"}}</a> </h2> diff --git a/templates/repo/issue/new_form.tmpl b/templates/repo/issue/new_form.tmpl index 9d0b666375..917169528b 100644 --- a/templates/repo/issue/new_form.tmpl +++ b/templates/repo/issue/new_form.tmpl @@ -11,9 +11,9 @@ {{ctx.AvatarUtils.Avatar .SignedUser 40}} <div class="ui segment content gt-my-0"> <div class="field"> - <input name="title" id="issue_title" placeholder="{{.locale.Tr "repo.milestones.title"}}" value="{{if .TitleQuery}}{{.TitleQuery}}{{else if .IssueTemplateTitle}}{{.IssueTemplateTitle}}{{else}}{{.title}}{{end}}" autofocus required maxlength="255" autocomplete="off"> + <input name="title" id="issue_title" placeholder="{{ctx.Locale.Tr "repo.milestones.title"}}" value="{{if .TitleQuery}}{{.TitleQuery}}{{else if .IssueTemplateTitle}}{{.IssueTemplateTitle}}{{else}}{{.title}}{{end}}" autofocus required maxlength="255" autocomplete="off"> {{if .PageIsComparePull}} - <div class="title_wip_desc" data-wip-prefixes="{{JsonUtils.EncodeToString .PullRequestWorkInProgressPrefixes}}">{{.locale.Tr "repo.pulls.title_wip_desc" (index .PullRequestWorkInProgressPrefixes 0| Escape) | Safe}}</div> + <div class="title_wip_desc" data-wip-prefixes="{{JsonUtils.EncodeToString .PullRequestWorkInProgressPrefixes}}">{{ctx.Locale.Tr "repo.pulls.title_wip_desc" (index .PullRequestWorkInProgressPrefixes 0| Escape) | Safe}}</div> {{end}} </div> {{if .Fields}} @@ -37,9 +37,9 @@ <div class="text right"> <button class="ui primary button"> {{if .PageIsComparePull}} - {{.locale.Tr "repo.pulls.create"}} + {{ctx.Locale.Tr "repo.pulls.create"}} {{else}} - {{.locale.Tr "repo.issues.create"}} + {{ctx.Locale.Tr "repo.issues.create"}} {{end}} </button> </div> @@ -60,7 +60,7 @@ <input id="milestone_id" name="milestone_id" type="hidden" value="{{.milestone_id}}"> <div class="ui {{if not .HasIssuesOrPullsWritePermission}}disabled{{end}} floating jump select-milestone dropdown"> <span class="text flex-text-block"> - <strong>{{.locale.Tr "repo.issues.new.milestone"}}</strong> + <strong>{{ctx.Locale.Tr "repo.issues.new.milestone"}}</strong> {{if .HasIssuesOrPullsWritePermission}} {{svg "octicon-gear" 16 "gt-ml-2"}} {{end}} @@ -70,7 +70,7 @@ </div> </div> <div class="ui select-milestone list"> - <span class="no-select item {{if .Milestone}}gt-hidden{{end}}">{{.locale.Tr "repo.issues.new.no_milestone"}}</span> + <span class="no-select item {{if .Milestone}}gt-hidden{{end}}">{{ctx.Locale.Tr "repo.issues.new.no_milestone"}}</span> <div class="selected"> {{if .Milestone}} <a class="item muted sidebar-item-link" href="{{.RepoLink}}/issues?milestone={{.Milestone.ID}}"> @@ -87,7 +87,7 @@ <input id="project_id" name="project_id" type="hidden" value="{{.project_id}}"> <div class="ui {{if not .HasIssuesOrPullsWritePermission}}disabled{{end}} floating jump select-project dropdown"> <span class="text flex-text-block"> - <strong>{{.locale.Tr "repo.issues.new.projects"}}</strong> + <strong>{{ctx.Locale.Tr "repo.issues.new.projects"}}</strong> {{if .HasIssuesOrPullsWritePermission}} {{svg "octicon-gear" 16 "gt-ml-2"}} {{end}} @@ -96,19 +96,19 @@ {{if or .OpenProjects .ClosedProjects}} <div class="ui icon search input"> <i class="icon">{{svg "octicon-search" 16}}</i> - <input type="text" placeholder="{{.locale.Tr "repo.issues.filter_projects"}}"> + <input type="text" placeholder="{{ctx.Locale.Tr "repo.issues.filter_projects"}}"> </div> {{end}} - <div class="no-select item">{{.locale.Tr "repo.issues.new.clear_projects"}}</div> + <div class="no-select item">{{ctx.Locale.Tr "repo.issues.new.clear_projects"}}</div> {{if and (not .OpenProjects) (not .ClosedProjects)}} <div class="disabled item"> - {{.locale.Tr "repo.issues.new.no_items"}} + {{ctx.Locale.Tr "repo.issues.new.no_items"}} </div> {{else}} {{if .OpenProjects}} <div class="divider"></div> <div class="header"> - {{.locale.Tr "repo.issues.new.open_projects"}} + {{ctx.Locale.Tr "repo.issues.new.open_projects"}} </div> {{range .OpenProjects}} <a class="item muted sidebar-item-link" data-id="{{.ID}}" data-href="{{.Link}}"> @@ -119,7 +119,7 @@ {{if .ClosedProjects}} <div class="divider"></div> <div class="header"> - {{.locale.Tr "repo.issues.new.closed_projects"}} + {{ctx.Locale.Tr "repo.issues.new.closed_projects"}} </div> {{range .ClosedProjects}} <a class="item muted sidebar-item-link" data-id="{{.ID}}" data-href="{{.Link}}"> @@ -131,7 +131,7 @@ </div> </div> <div class="ui select-project list"> - <span class="no-select item {{if .Project}}gt-hidden{{end}}">{{.locale.Tr "repo.issues.new.no_projects"}}</span> + <span class="no-select item {{if .Project}}gt-hidden{{end}}">{{ctx.Locale.Tr "repo.issues.new.no_projects"}}</span> <div class="selected"> {{if .Project}} <a class="item muted sidebar-item-link" href="{{.Project.Link}}"> @@ -145,7 +145,7 @@ <input id="assignee_ids" name="assignee_ids" type="hidden" value="{{.assignee_ids}}"> <div class="ui {{if not .HasIssuesOrPullsWritePermission}}disabled{{end}} floating jump select-assignees dropdown"> <span class="text flex-text-block"> - <strong>{{.locale.Tr "repo.issues.new.assignees"}}</strong> + <strong>{{ctx.Locale.Tr "repo.issues.new.assignees"}}</strong> {{if .HasIssuesOrPullsWritePermission}} {{svg "octicon-gear" 16 "gt-ml-2"}} {{end}} @@ -153,9 +153,9 @@ <div class="filter menu" data-id="#assignee_ids"> <div class="ui icon search input"> <i class="icon">{{svg "octicon-search" 16}}</i> - <input type="text" placeholder="{{.locale.Tr "repo.issues.filter_assignees"}}"> + <input type="text" placeholder="{{ctx.Locale.Tr "repo.issues.filter_assignees"}}"> </div> - <div class="no-select item">{{.locale.Tr "repo.issues.new.clear_assignees"}}</div> + <div class="no-select item">{{ctx.Locale.Tr "repo.issues.new.clear_assignees"}}</div> {{range .Assignees}} <a class="item muted" href="#" data-id="{{.ID}}" data-id-selector="#assignee_{{.ID}}"> <span class="octicon-check gt-invisible">{{svg "octicon-check"}}</span> @@ -168,7 +168,7 @@ </div> <div class="ui assignees list"> <span class="no-select item {{if .HasSelectedLabel}}gt-hidden{{end}}"> - {{.locale.Tr "repo.issues.new.no_assignees"}} + {{ctx.Locale.Tr "repo.issues.new.no_assignees"}} </span> <div class="selected"> {{range .Assignees}} @@ -182,7 +182,7 @@ <div class="divider"></div> <div class="inline field"> <div class="ui checkbox"> - <label data-tooltip-content="{{.locale.Tr "repo.pulls.allow_edits_from_maintainers_desc"}}"><strong>{{.locale.Tr "repo.pulls.allow_edits_from_maintainers"}}</strong></label> + <label data-tooltip-content="{{ctx.Locale.Tr "repo.pulls.allow_edits_from_maintainers_desc"}}"><strong>{{.locale.Tr "repo.pulls.allow_edits_from_maintainers"}}</strong></label> <input name="allow_maintainer_edit" type="checkbox" {{if .AllowMaintainerEdit}}checked{{end}}> </div> </div> diff --git a/templates/repo/issue/openclose.tmpl b/templates/repo/issue/openclose.tmpl index a5916ed793..018f474841 100644 --- a/templates/repo/issue/openclose.tmpl +++ b/templates/repo/issue/openclose.tmpl @@ -5,10 +5,10 @@ {{else}} {{svg "octicon-issue-opened" 16 "gt-mr-3"}} {{end}} - {{.locale.PrettyNumber .IssueStats.OpenCount}} {{.locale.Tr "repo.issues.open_title"}} + {{.locale.PrettyNumber .IssueStats.OpenCount}} {{ctx.Locale.Tr "repo.issues.open_title"}} </a> <a class="{{if .IsShowClosed}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{.ViewType}}&sort={{$.SortType}}&state=closed&labels={{.SelectLabels}}&milestone={{.MilestoneID}}&project={{.ProjectID}}&assignee={{.AssigneeID}}&poster={{.PosterID}}"> {{svg "octicon-check" 16 "gt-mr-3"}} - {{.locale.PrettyNumber .IssueStats.ClosedCount}} {{.locale.Tr "repo.issues.closed_title"}} + {{.locale.PrettyNumber .IssueStats.ClosedCount}} {{ctx.Locale.Tr "repo.issues.closed_title"}} </a> </div> diff --git a/templates/repo/issue/search.tmpl b/templates/repo/issue/search.tmpl index fc9797c781..822700c652 100644 --- a/templates/repo/issue/search.tmpl +++ b/templates/repo/issue/search.tmpl @@ -9,8 +9,8 @@ <input type="hidden" name="poster" value="{{$.PosterID}}"> {{template "shared/searchinput" dict "Value" .Keyword}} {{if .PageIsIssueList}} - <button id="issue-list-quick-goto" class="ui small icon button gt-hidden" data-tooltip-content="{{.locale.Tr "explore.go_to"}}" data-repo-link="{{.RepoLink}}">{{svg "octicon-hash"}}</button> + <button id="issue-list-quick-goto" class="ui small icon button gt-hidden" data-tooltip-content="{{ctx.Locale.Tr "explore.go_to"}}" data-repo-link="{{.RepoLink}}">{{svg "octicon-hash"}}</button> {{end}} - <button class="ui small icon button" aria-label="{{.locale.Tr "explore.search"}}">{{svg "octicon-search"}}</button> + <button class="ui small icon button" aria-label="{{ctx.Locale.Tr "explore.search"}}">{{svg "octicon-search"}}</button> </div> </form> diff --git a/templates/repo/issue/view_content.tmpl b/templates/repo/issue/view_content.tmpl index 5450df0a7a..8dd6dfc7d3 100644 --- a/templates/repo/issue/view_content.tmpl +++ b/templates/repo/issue/view_content.tmpl @@ -28,10 +28,10 @@ {{.Issue.OriginalAuthor}} </span> <span class="text grey muted-links"> - {{.locale.Tr "repo.issues.commented_at" (.Issue.HashTag|Escape) $createdStr | Safe}} + {{ctx.Locale.Tr "repo.issues.commented_at" (.Issue.HashTag|Escape) $createdStr | Safe}} </span> <span class="text migrate"> - {{if .Repository.OriginalURL}} ({{$.locale.Tr "repo.migrated_from" (.Repository.OriginalURL|Escape) (.Repository.GetOriginalURLHostname|Escape) | Safe}}){{end}} + {{if .Repository.OriginalURL}} ({{ctx.Locale.Tr "repo.migrated_from" (.Repository.OriginalURL|Escape) (.Repository.GetOriginalURLHostname|Escape) | Safe}}){{end}} </span> {{else}} <a class="inline-timeline-avatar" href="{{.Issue.Poster.HomeLink}}"> @@ -39,7 +39,7 @@ </a> <span class="text grey muted-links"> {{template "shared/user/authorlink" .Issue.Poster}} - {{.locale.Tr "repo.issues.commented_at" (.Issue.HashTag|Escape) $createdStr | Safe}} + {{ctx.Locale.Tr "repo.issues.commented_at" (.Issue.HashTag|Escape) $createdStr | Safe}} </span> {{end}} </div> @@ -56,7 +56,7 @@ {{if .Issue.RenderedContent}} {{.Issue.RenderedContent|Str2html}} {{else}} - <span class="no-content">{{.locale.Tr "repo.issues.no_content"}}</span> + <span class="no-content">{{ctx.Locale.Tr "repo.issues.no_content"}}</span> {{end}} </div> <div id="issue-{{.Issue.ID}}-raw" class="raw-content gt-hidden">{{.Issue.Content}}</div> @@ -92,21 +92,21 @@ <div class="text right"> {{if and (or .HasIssuesOrPullsWritePermission .IsIssuePoster) (not .DisableStatusChange)}} {{if .Issue.IsClosed}} - <button id="status-button" class="ui primary basic button" tabindex="6" data-status="{{.locale.Tr "repo.issues.reopen_issue"}}" data-status-and-comment="{{.locale.Tr "repo.issues.reopen_comment_issue"}}" name="status" value="reopen"> - {{.locale.Tr "repo.issues.reopen_issue"}} + <button id="status-button" class="ui primary basic button" tabindex="6" data-status="{{ctx.Locale.Tr "repo.issues.reopen_issue"}}" data-status-and-comment="{{.locale.Tr "repo.issues.reopen_comment_issue"}}" name="status" value="reopen"> + {{ctx.Locale.Tr "repo.issues.reopen_issue"}} </button> {{else}} {{$closeTranslationKey := "repo.issues.close"}} {{if .Issue.IsPull}} {{$closeTranslationKey = "repo.pulls.close"}} {{end}} - <button id="status-button" class="ui red basic button" tabindex="6" data-status="{{.locale.Tr $closeTranslationKey}}" data-status-and-comment="{{.locale.Tr "repo.issues.close_comment_issue"}}" name="status" value="close"> - {{.locale.Tr $closeTranslationKey}} + <button id="status-button" class="ui red basic button" tabindex="6" data-status="{{ctx.Locale.Tr $closeTranslationKey}}" data-status-and-comment="{{.locale.Tr "repo.issues.close_comment_issue"}}" name="status" value="close"> + {{ctx.Locale.Tr $closeTranslationKey}} </button> {{end}} {{end}} <button class="ui primary button" tabindex="5"> - {{.locale.Tr "repo.issues.create_comment"}} + {{ctx.Locale.Tr "repo.issues.create_comment"}} </button> </div> </div> @@ -116,9 +116,9 @@ {{else if .Repository.IsArchived}} <div class="ui warning message gt-text-center"> {{if .Issue.IsPull}} - {{.locale.Tr "repo.archive.pull.nocomment"}} + {{ctx.Locale.Tr "repo.archive.pull.nocomment"}} {{else}} - {{.locale.Tr "repo.archive.issue.nocomment"}} + {{ctx.Locale.Tr "repo.archive.issue.nocomment"}} {{end}} </div> {{end}} @@ -126,14 +126,14 @@ {{if .Repository.IsArchived}} <div class="ui warning message gt-text-center"> {{if .Issue.IsPull}} - {{.locale.Tr "repo.archive.pull.nocomment"}} + {{ctx.Locale.Tr "repo.archive.pull.nocomment"}} {{else}} - {{.locale.Tr "repo.archive.issue.nocomment"}} + {{ctx.Locale.Tr "repo.archive.issue.nocomment"}} {{end}} </div> {{else}} <div class="ui warning message"> - {{.locale.Tr "repo.issues.sign_in_require_desc" (.SignInLink|Escape) | Safe}} + {{ctx.Locale.Tr "repo.issues.sign_in_require_desc" (.SignInLink|Escape) | Safe}} </div> {{end}} {{end}}{{/* end if: .IsSigned */}} @@ -162,8 +162,8 @@ <div class="field"> <div class="text right edit"> - <button class="ui basic cancel button" tabindex="3">{{.locale.Tr "repo.issues.cancel"}}</button> - <button class="ui primary save button" tabindex="2">{{.locale.Tr "repo.issues.save"}}</button> + <button class="ui basic cancel button" tabindex="3">{{ctx.Locale.Tr "repo.issues.cancel"}}</button> + <button class="ui primary save button" tabindex="2">{{ctx.Locale.Tr "repo.issues.save"}}</button> </div> </div> </div> @@ -172,16 +172,16 @@ {{template "repo/issue/view_content/reference_issue_dialog" .}} <div class="gt-hidden" id="no-content"> - <span class="no-content">{{.locale.Tr "repo.issues.no_content"}}</span> + <span class="no-content">{{ctx.Locale.Tr "repo.issues.no_content"}}</span> </div> <div class="ui g-modal-confirm delete modal"> <div class="header"> {{svg "octicon-trash"}} - {{.locale.Tr "repo.branch.delete" .HeadTarget}} + {{ctx.Locale.Tr "repo.branch.delete" .HeadTarget}} </div> <div class="content"> - <p>{{.locale.Tr "repo.branch.delete_desc" | Str2html}}</p> + <p>{{ctx.Locale.Tr "repo.branch.delete_desc" | Str2html}}</p> </div> {{template "base/modal_actions_confirm" .}} </div> diff --git a/templates/repo/issue/view_content/attachments.tmpl b/templates/repo/issue/view_content/attachments.tmpl index b74b6ce918..1fb6f2f2c2 100644 --- a/templates/repo/issue/view_content/attachments.tmpl +++ b/templates/repo/issue/view_content/attachments.tmpl @@ -6,7 +6,7 @@ {{- range .Attachments -}} <div class="gt-df"> <div class="gt-f1 gt-p-3"> - <a target="_blank" rel="noopener noreferrer" href="{{.DownloadURL}}" title="{{$.ctxData.locale.Tr "repo.issues.attachment.open_tab" .Name}}"> + <a target="_blank" rel="noopener noreferrer" href="{{.DownloadURL}}" title="{{ctx.Locale.Tr "repo.issues.attachment.open_tab" .Name}}"> {{if FilenameIsImage .Name}} {{if not (StringUtils.Contains $.Content .UUID)}} {{$hasThumbnails = true}} @@ -31,7 +31,7 @@ {{if FilenameIsImage .Name}} {{if not (StringUtils.Contains $.Content .UUID)}} <a target="_blank" rel="noopener noreferrer" href="{{.DownloadURL}}"> - <img alt="{{.Name}}" src="{{.DownloadURL}}" title="{{$.ctxData.locale.Tr "repo.issues.attachment.open_tab" .Name}}"> + <img alt="{{.Name}}" src="{{.DownloadURL}}" title="{{ctx.Locale.Tr "repo.issues.attachment.open_tab" .Name}}"> </a> {{end}} {{end}} diff --git a/templates/repo/issue/view_content/comments.tmpl b/templates/repo/issue/view_content/comments.tmpl index 6b75f9f9e3..bb55fcadae 100644 --- a/templates/repo/issue/view_content/comments.tmpl +++ b/templates/repo/issue/view_content/comments.tmpl @@ -32,10 +32,10 @@ {{.OriginalAuthor}} </span> <span class="text grey muted-links"> - {{$.locale.Tr "repo.issues.commented_at" (.HashTag|Escape) $createdStr | Safe}} {{if $.Repository.OriginalURL}} + {{ctx.Locale.Tr "repo.issues.commented_at" (.HashTag|Escape) $createdStr | Safe}} {{if $.Repository.OriginalURL}} </span> <span class="text migrate"> - ({{$.locale.Tr "repo.migrated_from" ($.Repository.OriginalURL|Escape) ($.Repository.GetOriginalURLHostname|Escape) | Safe}}){{end}} + ({{ctx.Locale.Tr "repo.migrated_from" ($.Repository.OriginalURL|Escape) ($.Repository.GetOriginalURLHostname|Escape) | Safe}}){{end}} </span> {{else}} {{if gt .Poster.ID 0}} @@ -45,7 +45,7 @@ {{end}} <span class="text grey muted-links"> {{template "shared/user/authorlink" .Poster}} - {{$.locale.Tr "repo.issues.commented_at" (.HashTag|Escape) $createdStr | Safe}} + {{ctx.Locale.Tr "repo.issues.commented_at" (.HashTag|Escape) $createdStr | Safe}} </span> {{end}} </div> @@ -62,7 +62,7 @@ {{if .RenderedContent}} {{.RenderedContent|Str2html}} {{else}} - <span class="no-content">{{$.locale.Tr "repo.issues.no_content"}}</span> + <span class="no-content">{{ctx.Locale.Tr "repo.issues.no_content"}}</span> {{end}} </div> <div id="issuecomment-{{.ID}}-raw" class="raw-content gt-hidden">{{.Content}}</div> @@ -84,9 +84,9 @@ <span class="text grey muted-links"> {{template "shared/user/authorlink" .Poster}} {{if .Issue.IsPull}} - {{$.locale.Tr "repo.pulls.reopened_at" .EventTag $createdStr | Safe}} + {{ctx.Locale.Tr "repo.pulls.reopened_at" .EventTag $createdStr | Safe}} {{else}} - {{$.locale.Tr "repo.issues.reopened_at" .EventTag $createdStr | Safe}} + {{ctx.Locale.Tr "repo.issues.reopened_at" .EventTag $createdStr | Safe}} {{end}} </span> </div> @@ -97,9 +97,9 @@ <span class="text grey muted-links"> {{template "shared/user/authorlink" .Poster}} {{if .Issue.IsPull}} - {{$.locale.Tr "repo.pulls.closed_at" .EventTag $createdStr | Safe}} + {{ctx.Locale.Tr "repo.pulls.closed_at" .EventTag $createdStr | Safe}} {{else}} - {{$.locale.Tr "repo.issues.closed_at" .EventTag $createdStr | Safe}} + {{ctx.Locale.Tr "repo.issues.closed_at" .EventTag $createdStr | Safe}} {{end}} </span> </div> @@ -111,16 +111,16 @@ {{template "shared/user/authorlink" .Poster}} {{$link := printf "%s/commit/%s" $.Repository.Link ($.Issue.PullRequest.MergedCommitID|PathEscape)}} {{if eq $.Issue.PullRequest.Status 3}} - {{$.locale.Tr "repo.issues.comment_manually_pull_merged_at" (printf `<a class="ui sha" href="%[1]s"><b>%[2]s</b></a>` ($link|Escape) (ShortSha $.Issue.PullRequest.MergedCommitID)) (printf "<b>%[1]s</b>" ($.BaseTarget|Escape)) $createdStr | Safe}} + {{ctx.Locale.Tr "repo.issues.comment_manually_pull_merged_at" (printf `<a class="ui sha" href="%[1]s"><b>%[2]s</b></a>` ($link|Escape) (ShortSha $.Issue.PullRequest.MergedCommitID)) (printf "<b>%[1]s</b>" ($.BaseTarget|Escape)) $createdStr | Safe}} {{else}} - {{$.locale.Tr "repo.issues.comment_pull_merged_at" (printf `<a class="ui sha" href="%[1]s"><b>%[2]s</b></a>` ($link|Escape) (ShortSha $.Issue.PullRequest.MergedCommitID)) (printf "<b>%[1]s</b>" ($.BaseTarget|Escape)) $createdStr | Safe}} + {{ctx.Locale.Tr "repo.issues.comment_pull_merged_at" (printf `<a class="ui sha" href="%[1]s"><b>%[2]s</b></a>` ($link|Escape) (ShortSha $.Issue.PullRequest.MergedCommitID)) (printf "<b>%[1]s</b>" ($.BaseTarget|Escape)) $createdStr | Safe}} {{end}} </span> </div> {{else if eq .Type 3 5 6}} {{$refFrom:= ""}} {{if ne .RefRepoID .Issue.RepoID}} - {{$refFrom = $.locale.Tr "repo.issues.ref_from" (.RefRepo.FullName|Escape)}} + {{$refFrom = ctx.Locale.Tr "repo.issues.ref_from" (.RefRepo.FullName|Escape)}} {{end}} {{$refTr := "repo.issues.ref_issue_from"}} {{if .Issue.IsPull}} @@ -137,7 +137,7 @@ {{if eq .RefAction 3}}<del>{{end}} <span class="text grey muted-links"> {{template "shared/user/authorlink" .Poster}} - {{$.locale.Tr $refTr (.EventTag|Escape) $createdStr (.RefCommentLink|Escape) $refFrom | Safe}} + {{ctx.Locale.Tr $refTr (.EventTag|Escape) $createdStr (.RefCommentLink|Escape) $refFrom | Safe}} </span> {{if eq .RefAction 3}}</del>{{end}} @@ -151,7 +151,7 @@ {{template "shared/user/avatarlink" dict "user" .Poster}} <span class="text grey muted-links"> {{template "shared/user/authorlink" .Poster}} - {{$.locale.Tr "repo.issues.commit_ref_at" .EventTag $createdStr | Safe}} + {{ctx.Locale.Tr "repo.issues.commit_ref_at" .EventTag $createdStr | Safe}} </span> <div class="detail"> {{svg "octicon-git-commit"}} @@ -166,11 +166,11 @@ <span class="text grey muted-links"> {{template "shared/user/authorlink" .Poster}} {{if and .AddedLabels (not .RemovedLabels)}} - {{$.locale.TrN (len .AddedLabels) "repo.issues.add_label" "repo.issues.add_labels" (RenderLabels $.Context .AddedLabels $.RepoLink) $createdStr | Safe}} + {{ctx.Locale.TrN (len .AddedLabels) "repo.issues.add_label" "repo.issues.add_labels" (RenderLabels $.Context .AddedLabels $.RepoLink) $createdStr | Safe}} {{else if and (not .AddedLabels) .RemovedLabels}} - {{$.locale.TrN (len .RemovedLabels) "repo.issues.remove_label" "repo.issues.remove_labels" (RenderLabels $.Context .RemovedLabels $.RepoLink) $createdStr | Safe}} + {{ctx.Locale.TrN (len .RemovedLabels) "repo.issues.remove_label" "repo.issues.remove_labels" (RenderLabels $.Context .RemovedLabels $.RepoLink) $createdStr | Safe}} {{else}} - {{$.locale.Tr "repo.issues.add_remove_labels" (RenderLabels $.Context .AddedLabels $.RepoLink) (RenderLabels $.Context .RemovedLabels $.RepoLink) $createdStr | Safe}} + {{ctx.Locale.Tr "repo.issues.add_remove_labels" (RenderLabels $.Context .AddedLabels $.RepoLink) (RenderLabels $.Context .RemovedLabels $.RepoLink) $createdStr | Safe}} {{end}} </span> </div> @@ -181,7 +181,7 @@ {{template "shared/user/avatarlink" dict "user" .Poster}} <span class="text grey muted-links"> {{template "shared/user/authorlink" .Poster}} - {{if gt .OldMilestoneID 0}}{{if gt .MilestoneID 0}}{{$.locale.Tr "repo.issues.change_milestone_at" (.OldMilestone.Name|Escape) (.Milestone.Name|Escape) $createdStr | Safe}}{{else}}{{$.locale.Tr "repo.issues.remove_milestone_at" (.OldMilestone.Name|Escape) $createdStr | Safe}}{{end}}{{else if gt .MilestoneID 0}}{{$.locale.Tr "repo.issues.add_milestone_at" (.Milestone.Name|Escape) $createdStr | Safe}}{{end}} + {{if gt .OldMilestoneID 0}}{{if gt .MilestoneID 0}}{{ctx.Locale.Tr "repo.issues.change_milestone_at" (.OldMilestone.Name|Escape) (.Milestone.Name|Escape) $createdStr | Safe}}{{else}}{{ctx.Locale.Tr "repo.issues.remove_milestone_at" (.OldMilestone.Name|Escape) $createdStr | Safe}}{{end}}{{else if gt .MilestoneID 0}}{{$.locale.Tr "repo.issues.add_milestone_at" (.Milestone.Name|Escape) $createdStr | Safe}}{{end}} </span> </div> {{else if eq .Type 9}} @@ -193,9 +193,9 @@ <span class="text grey muted-links"> {{template "shared/user/authorlink" .Assignee}} {{if eq .Poster.ID .Assignee.ID}} - {{$.locale.Tr "repo.issues.remove_self_assignment" $createdStr | Safe}} + {{ctx.Locale.Tr "repo.issues.remove_self_assignment" $createdStr | Safe}} {{else}} - {{$.locale.Tr "repo.issues.remove_assignee_at" (.Poster.GetDisplayName|Escape) $createdStr | Safe}} + {{ctx.Locale.Tr "repo.issues.remove_assignee_at" (.Poster.GetDisplayName|Escape) $createdStr | Safe}} {{end}} </span> {{else}} @@ -203,9 +203,9 @@ <span class="text grey muted-links"> {{template "shared/user/authorlink" .Assignee}} {{if eq .Poster.ID .AssigneeID}} - {{$.locale.Tr "repo.issues.self_assign_at" $createdStr | Safe}} + {{ctx.Locale.Tr "repo.issues.self_assign_at" $createdStr | Safe}} {{else}} - {{$.locale.Tr "repo.issues.add_assignee_at" (.Poster.GetDisplayName|Escape) $createdStr | Safe}} + {{ctx.Locale.Tr "repo.issues.add_assignee_at" (.Poster.GetDisplayName|Escape) $createdStr | Safe}} {{end}} </span> {{end}} @@ -217,7 +217,7 @@ {{template "shared/user/avatarlink" dict "user" .Poster}} <span class="text grey muted-links"> {{template "shared/user/authorlink" .Poster}} - {{$.locale.Tr "repo.issues.change_title_at" (.OldTitle|RenderEmoji $.Context) (.NewTitle|RenderEmoji $.Context) $createdStr | Safe}} + {{ctx.Locale.Tr "repo.issues.change_title_at" (.OldTitle|RenderEmoji $.Context) (.NewTitle|RenderEmoji $.Context) $createdStr | Safe}} </span> </div> {{else if eq .Type 11}} @@ -226,7 +226,7 @@ {{template "shared/user/avatarlink" dict "user" .Poster}} <span class="text grey muted-links"> {{template "shared/user/authorlink" .Poster}} - {{$.locale.Tr "repo.issues.delete_branch_at" (.OldRef|Escape) $createdStr | Safe}} + {{ctx.Locale.Tr "repo.issues.delete_branch_at" (.OldRef|Escape) $createdStr | Safe}} </span> </div> {{else if eq .Type 12}} @@ -235,7 +235,7 @@ {{template "shared/user/avatarlink" dict "user" .Poster}} <span class="text grey muted-links"> {{template "shared/user/authorlink" .Poster}} - {{$.locale.Tr "repo.issues.start_tracking_history" $createdStr | Safe}} + {{ctx.Locale.Tr "repo.issues.start_tracking_history" $createdStr | Safe}} </span> </div> {{else if eq .Type 13}} @@ -244,7 +244,7 @@ {{template "shared/user/avatarlink" dict "user" .Poster}} <span class="text grey muted-links"> {{template "shared/user/authorlink" .Poster}} - {{$.locale.Tr "repo.issues.stop_tracking_history" $createdStr | Safe}} + {{ctx.Locale.Tr "repo.issues.stop_tracking_history" $createdStr | Safe}} </span> {{template "repo/issue/view_content/comments_delete_time" dict "ctxData" $ "comment" .}} <div class="detail"> @@ -263,7 +263,7 @@ {{template "shared/user/avatarlink" dict "user" .Poster}} <span class="text grey muted-links"> {{template "shared/user/authorlink" .Poster}} - {{$.locale.Tr "repo.issues.add_time_history" $createdStr | Safe}} + {{ctx.Locale.Tr "repo.issues.add_time_history" $createdStr | Safe}} </span> {{template "repo/issue/view_content/comments_delete_time" dict "ctxData" $ "comment" .}} <div class="detail"> @@ -282,7 +282,7 @@ {{template "shared/user/avatarlink" dict "user" .Poster}} <span class="text grey muted-links"> {{template "shared/user/authorlink" .Poster}} - {{$.locale.Tr "repo.issues.cancel_tracking_history" $createdStr | Safe}} + {{ctx.Locale.Tr "repo.issues.cancel_tracking_history" $createdStr | Safe}} </span> </div> {{else if eq .Type 16}} @@ -291,7 +291,7 @@ {{template "shared/user/avatarlink" dict "user" .Poster}} <span class="text grey muted-links"> {{template "shared/user/authorlink" .Poster}} - {{$.locale.Tr "repo.issues.due_date_added" (DateTime "long" .Content) $createdStr | Safe}} + {{ctx.Locale.Tr "repo.issues.due_date_added" (DateTime "long" .Content) $createdStr | Safe}} </span> </div> {{else if eq .Type 17}} @@ -304,7 +304,7 @@ {{if eq (len $parsedDeadline) 2}} {{$from := DateTime "long" (index $parsedDeadline 1)}} {{$to := DateTime "long" (index $parsedDeadline 0)}} - {{$.locale.Tr "repo.issues.due_date_modified" $to $from $createdStr | Safe}} + {{ctx.Locale.Tr "repo.issues.due_date_modified" $to $from $createdStr | Safe}} {{end}} </span> </div> @@ -314,7 +314,7 @@ {{template "shared/user/avatarlink" dict "user" .Poster}} <span class="text grey muted-links"> {{template "shared/user/authorlink" .Poster}} - {{$.locale.Tr "repo.issues.due_date_remove" (DateTime "long" .Content) $createdStr | Safe}} + {{ctx.Locale.Tr "repo.issues.due_date_remove" (DateTime "long" .Content) $createdStr | Safe}} </span> </div> {{else if eq .Type 19}} @@ -323,7 +323,7 @@ {{template "shared/user/avatarlink" dict "user" .Poster}} <span class="text grey muted-links"> {{template "shared/user/authorlink" .Poster}} - {{$.locale.Tr "repo.issues.dependency.added_dependency" $createdStr | Safe}} + {{ctx.Locale.Tr "repo.issues.dependency.added_dependency" $createdStr | Safe}} </span> {{if .DependentIssue}} <div class="detail"> @@ -346,7 +346,7 @@ {{template "shared/user/avatarlink" dict "user" .Poster}} <span class="text grey muted-links"> {{template "shared/user/authorlink" .Poster}} - {{$.locale.Tr "repo.issues.dependency.removed_dependency" $createdStr | Safe}} + {{ctx.Locale.Tr "repo.issues.dependency.removed_dependency" $createdStr | Safe}} </span> {{if .DependentIssue}} <div class="detail"> @@ -383,22 +383,22 @@ {{.OriginalAuthor}} </span> <span class="text grey muted-links"> {{if $.Repository.OriginalURL}}</span> - <span class="text migrate">({{$.locale.Tr "repo.migrated_from" ($.Repository.OriginalURL|Escape) ($.Repository.GetOriginalURLHostname|Escape) | Safe}}){{end}}</span> + <span class="text migrate">({{ctx.Locale.Tr "repo.migrated_from" ($.Repository.OriginalURL|Escape) ($.Repository.GetOriginalURLHostname|Escape) | Safe}}){{end}}</span> {{else}} {{template "shared/user/authorlink" .Poster}} {{end}} {{if eq .Review.Type 1}} - {{$.locale.Tr "repo.issues.review.approve" $createdStr | Safe}} + {{ctx.Locale.Tr "repo.issues.review.approve" $createdStr | Safe}} {{else if eq .Review.Type 2}} - {{$.locale.Tr "repo.issues.review.comment" $createdStr | Safe}} + {{ctx.Locale.Tr "repo.issues.review.comment" $createdStr | Safe}} {{else if eq .Review.Type 3}} - {{$.locale.Tr "repo.issues.review.reject" $createdStr | Safe}} + {{ctx.Locale.Tr "repo.issues.review.reject" $createdStr | Safe}} {{else}} - {{$.locale.Tr "repo.issues.review.comment" $createdStr | Safe}} + {{ctx.Locale.Tr "repo.issues.review.comment" $createdStr | Safe}} {{end}} {{if .Review.Dismissed}} - <div class="ui small label">{{$.locale.Tr "repo.issues.review.dismissed_label"}}</div> + <div class="ui small label">{{ctx.Locale.Tr "repo.issues.review.dismissed_label"}}</div> {{end}} </span> </div> @@ -419,12 +419,12 @@ {{.OriginalAuthor}} </span> <span class="text grey muted-links"> {{if $.Repository.OriginalURL}}</span> - <span class="text migrate">({{$.locale.Tr "repo.migrated_from" ($.Repository.OriginalURL|Escape) ($.Repository.GetOriginalURLHostname|Escape) | Safe}}){{end}}</span> + <span class="text migrate">({{ctx.Locale.Tr "repo.migrated_from" ($.Repository.OriginalURL|Escape) ($.Repository.GetOriginalURLHostname|Escape) | Safe}}){{end}}</span> {{else}} {{template "shared/user/authorlink" .Poster}} {{end}} - {{$.locale.Tr "repo.issues.review.left_comment" | Safe}} + {{ctx.Locale.Tr "repo.issues.review.left_comment" | Safe}} </span> </div> <div class="comment-header-right actions gt-df gt-ac"> @@ -440,7 +440,7 @@ {{if .RenderedContent}} {{.RenderedContent|Str2html}} {{else}} - <span class="no-content">{{$.locale.Tr "repo.issues.no_content"}}</span> + <span class="no-content">{{ctx.Locale.Tr "repo.issues.no_content"}}</span> {{end}} </div> <div id="issuecomment-{{.ID}}-raw" class="raw-content gt-hidden">{{.Content}}</div> @@ -470,8 +470,8 @@ <div class="gt-df gt-ac"> <a href="{{(index $comms 0).CodeCommentLink}}" class="file-comment gt-ml-3 gt-word-break">{{$filename}}</a> {{if $invalid}} - <span class="ui label basic small gt-ml-3" data-tooltip-content="{{$.locale.Tr "repo.issues.review.outdated_description"}}"> - {{$.locale.Tr "repo.issues.review.outdated"}} + <span class="ui label basic small gt-ml-3" data-tooltip-content="{{ctx.Locale.Tr "repo.issues.review.outdated_description"}}"> + {{ctx.Locale.Tr "repo.issues.review.outdated"}} </span> {{end}} </div> @@ -480,17 +480,17 @@ <button id="show-outdated-{{(index $comms 0).ID}}" data-comment="{{(index $comms 0).ID}}" class="{{if not $resolved}}gt-hidden {{end}}ui compact labeled button show-outdated gt-df gt-ac"> {{svg "octicon-unfold" 16 "gt-mr-3"}} {{if $resolved}} - {{$.locale.Tr "repo.issues.review.show_resolved"}} + {{ctx.Locale.Tr "repo.issues.review.show_resolved"}} {{else}} - {{$.locale.Tr "repo.issues.review.show_outdated"}} + {{ctx.Locale.Tr "repo.issues.review.show_outdated"}} {{end}} </button> <button id="hide-outdated-{{(index $comms 0).ID}}" data-comment="{{(index $comms 0).ID}}" class="{{if $resolved}}gt-hidden {{end}}ui compact labeled button hide-outdated gt-df gt-ac"> {{svg "octicon-fold" 16 "gt-mr-3"}} {{if $resolved}} - {{$.locale.Tr "repo.issues.review.hide_resolved"}} + {{ctx.Locale.Tr "repo.issues.review.hide_resolved"}} {{else}} - {{$.locale.Tr "repo.issues.review.hide_outdated"}} + {{ctx.Locale.Tr "repo.issues.review.hide_outdated"}} {{end}} </button> {{end}} @@ -531,11 +531,11 @@ {{.OriginalAuthor}} </span> <span class="text grey muted-links"> {{if $.Repository.OriginalURL}}</span> - <span class="text migrate">({{$.locale.Tr "repo.migrated_from" ($.Repository.OriginalURL|Escape) ($.Repository.GetOriginalURLHostname|Escape) | Safe}}){{end}}</span> + <span class="text migrate">({{ctx.Locale.Tr "repo.migrated_from" ($.Repository.OriginalURL|Escape) ($.Repository.GetOriginalURLHostname|Escape) | Safe}}){{end}}</span> {{else}} {{template "shared/user/authorlink" .Poster}} {{end}} - {{$.locale.Tr "repo.issues.commented_at" (.HashTag|Escape) $createdSubStr | Safe}} + {{ctx.Locale.Tr "repo.issues.commented_at" (.HashTag|Escape) $createdSubStr | Safe}} </span> </div> <div class="comment-header-right actions gt-df gt-ac"> @@ -551,7 +551,7 @@ {{if .RenderedContent}} {{.RenderedContent|Str2html}} {{else}} - <span class="no-content">{{$.locale.Tr "repo.issues.no_content"}}</span> + <span class="no-content">{{ctx.Locale.Tr "repo.issues.no_content"}}</span> {{end}} </div> <div id="issuecomment-{{.ID}}-raw" class="raw-content gt-hidden">{{.Content}}</div> @@ -570,7 +570,7 @@ {{if $resolved}} <div class="ui grey text"> {{svg "octicon-check" 16 "gt-mr-2"}} - <b>{{$resolveDoer.Name}}</b> {{$.locale.Tr "repo.issues.review.resolved_by"}} + <b>{{$resolveDoer.Name}}</b> {{ctx.Locale.Tr "repo.issues.review.resolved_by"}} </div> {{end}} </div> @@ -578,15 +578,15 @@ {{if and $.CanMarkConversation $isNotPending}} <button class="ui tiny basic button resolve-conversation" data-origin="timeline" data-action="{{if not $resolved}}Resolve{{else}}UnResolve{{end}}" data-comment-id="{{(index $comms 0).ID}}" data-update-url="{{$.RepoLink}}/issues/resolve_conversation"> {{if $resolved}} - {{$.locale.Tr "repo.issues.review.un_resolve_conversation"}} + {{ctx.Locale.Tr "repo.issues.review.un_resolve_conversation"}} {{else}} - {{$.locale.Tr "repo.issues.review.resolve_conversation"}} + {{ctx.Locale.Tr "repo.issues.review.resolve_conversation"}} {{end}} </button> {{end}} {{if and $.SignedUserID (not $.Repository.IsArchived)}} <button class="comment-form-reply ui primary tiny labeled icon button gt-ml-2 gt-mr-0"> - {{svg "octicon-reply" 16 "reply icon gt-mr-2"}}{{$.locale.Tr "repo.diff.comment.reply"}} + {{svg "octicon-reply" 16 "reply icon gt-mr-2"}}{{ctx.Locale.Tr "repo.diff.comment.reply"}} </button> {{end}} </div> @@ -606,12 +606,12 @@ {{if .Content}} <span class="text grey muted-links"> {{template "shared/user/authorlink" .Poster}} - {{$.locale.Tr "repo.issues.lock_with_reason" .Content $createdStr | Safe}} + {{ctx.Locale.Tr "repo.issues.lock_with_reason" .Content $createdStr | Safe}} </span> {{else}} <span class="text grey muted-links"> {{template "shared/user/authorlink" .Poster}} - {{$.locale.Tr "repo.issues.lock_no_reason" $createdStr | Safe}} + {{ctx.Locale.Tr "repo.issues.lock_no_reason" $createdStr | Safe}} </span> {{end}} </div> @@ -621,7 +621,7 @@ {{template "shared/user/avatarlink" dict "user" .Poster}} <span class="text grey muted-links"> {{template "shared/user/authorlink" .Poster}} - {{$.locale.Tr "repo.issues.unlock_comment" $createdStr | Safe}} + {{ctx.Locale.Tr "repo.issues.unlock_comment" $createdStr | Safe}} </span> </div> {{else if eq .Type 25}} @@ -630,7 +630,7 @@ {{template "shared/user/avatarlink" dict "user" .Poster}} <span class="text grey muted-links"> <a{{if gt .Poster.ID 0}} href="{{.Poster.HomeLink}}"{{end}}>{{.Poster.Name}}</a> - {{$.locale.Tr "repo.pulls.change_target_branch_at" (.OldRef|Escape) (.NewRef|Escape) $createdStr | Safe}} + {{ctx.Locale.Tr "repo.pulls.change_target_branch_at" (.OldRef|Escape) (.NewRef|Escape) $createdStr | Safe}} </span> </div> {{else if eq .Type 26}} @@ -640,7 +640,7 @@ <span class="text grey muted-links"> {{template "shared/user/authorlink" .Poster}} - {{$.locale.Tr "repo.issues.del_time_history" $createdStr | Safe}} + {{ctx.Locale.Tr "repo.issues.del_time_history" $createdStr | Safe}} </span> <div class="detail"> {{svg "octicon-clock"}} @@ -661,12 +661,12 @@ {{if (gt .AssigneeID 0)}} {{if .RemovedAssignee}} {{if eq .PosterID .AssigneeID}} - {{$.locale.Tr "repo.issues.review.remove_review_request_self" $createdStr | Safe}} + {{ctx.Locale.Tr "repo.issues.review.remove_review_request_self" $createdStr | Safe}} {{else}} - {{$.locale.Tr "repo.issues.review.remove_review_request" (.Assignee.GetDisplayName|Escape) $createdStr | Safe}} + {{ctx.Locale.Tr "repo.issues.review.remove_review_request" (.Assignee.GetDisplayName|Escape) $createdStr | Safe}} {{end}} {{else}} - {{$.locale.Tr "repo.issues.review.add_review_request" (.Assignee.GetDisplayName|Escape) $createdStr | Safe}} + {{ctx.Locale.Tr "repo.issues.review.add_review_request" (.Assignee.GetDisplayName|Escape) $createdStr | Safe}} {{end}} {{else}} <!-- If the assigned team is deleted, just displaying "Ghost Team" in the comment --> @@ -675,9 +675,9 @@ {{$teamName = .AssigneeTeam.Name}} {{end}} {{if .RemovedAssignee}} - {{$.locale.Tr "repo.issues.review.remove_review_request" ($teamName|Escape) $createdStr | Safe}} + {{ctx.Locale.Tr "repo.issues.review.remove_review_request" ($teamName|Escape) $createdStr | Safe}} {{else}} - {{$.locale.Tr "repo.issues.review.add_review_request" ($teamName|Escape) $createdStr | Safe}} + {{ctx.Locale.Tr "repo.issues.review.add_review_request" ($teamName|Escape) $createdStr | Safe}} {{end}} {{end}} </span> @@ -692,14 +692,14 @@ <span class="text grey muted-links"> {{template "shared/user/authorlink" .Poster}} {{if .IsForcePush}} - {{$.locale.Tr "repo.issues.force_push_codes" ($.Issue.PullRequest.HeadBranch|Escape) (ShortSha .OldCommit) (($.Issue.Repo.CommitLink .OldCommit)|Escape) (ShortSha .NewCommit) (($.Issue.Repo.CommitLink .NewCommit)|Escape) $createdStr | Safe}} + {{ctx.Locale.Tr "repo.issues.force_push_codes" ($.Issue.PullRequest.HeadBranch|Escape) (ShortSha .OldCommit) (($.Issue.Repo.CommitLink .OldCommit)|Escape) (ShortSha .NewCommit) (($.Issue.Repo.CommitLink .NewCommit)|Escape) $createdStr | Safe}} {{else}} - {{$.locale.TrN (len .Commits) "repo.issues.push_commit_1" "repo.issues.push_commits_n" (len .Commits) $createdStr | Safe}} + {{ctx.Locale.TrN (len .Commits) "repo.issues.push_commit_1" "repo.issues.push_commits_n" (len .Commits) $createdStr | Safe}} {{end}} </span> {{if and .IsForcePush $.Issue.PullRequest.BaseRepo.Name}} <span class="gt-float-right comparebox"> - <a href="{{$.Issue.PullRequest.BaseRepo.Link}}/compare/{{PathEscape .OldCommit}}..{{PathEscape .NewCommit}}" rel="nofollow" class="ui compare label">{{$.locale.Tr "repo.issues.force_push_compare"}}</a> + <a href="{{$.Issue.PullRequest.BaseRepo.Link}}/compare/{{PathEscape .OldCommit}}..{{PathEscape .NewCommit}}" rel="nofollow" class="ui compare label">{{ctx.Locale.Tr "repo.issues.force_push_compare"}}</a> </span> {{end}} </div> @@ -716,19 +716,19 @@ {{$oldProjectDisplayHtml := "Unknown Project"}} {{if .OldProject}} {{$trKey := printf "projects.type-%d.display_name" .OldProject.Type}} - {{$oldProjectDisplayHtml = printf `<span data-tooltip-content="%s">%s</span>` ($.locale.Tr $trKey | Escape) (.OldProject.Title | Escape)}} + {{$oldProjectDisplayHtml = printf `<span data-tooltip-content="%s">%s</span>` (ctx.Locale.Tr $trKey | Escape) (.OldProject.Title | Escape)}} {{end}} {{$newProjectDisplayHtml := "Unknown Project"}} {{if .Project}} {{$trKey := printf "projects.type-%d.display_name" .Project.Type}} - {{$newProjectDisplayHtml = printf `<span data-tooltip-content="%s">%s</span>` ($.locale.Tr $trKey | Escape) (.Project.Title | Escape)}} + {{$newProjectDisplayHtml = printf `<span data-tooltip-content="%s">%s</span>` (ctx.Locale.Tr $trKey | Escape) (.Project.Title | Escape)}} {{end}} {{if and (gt .OldProjectID 0) (gt .ProjectID 0)}} - {{$.locale.Tr "repo.issues.change_project_at" $oldProjectDisplayHtml $newProjectDisplayHtml $createdStr | Safe}} + {{ctx.Locale.Tr "repo.issues.change_project_at" $oldProjectDisplayHtml $newProjectDisplayHtml $createdStr | Safe}} {{else if gt .OldProjectID 0}} - {{$.locale.Tr "repo.issues.remove_project_at" $oldProjectDisplayHtml $createdStr | Safe}} + {{ctx.Locale.Tr "repo.issues.remove_project_at" $oldProjectDisplayHtml $createdStr | Safe}} {{else if gt .ProjectID 0}} - {{$.locale.Tr "repo.issues.add_project_at" $newProjectDisplayHtml $createdStr | Safe}} + {{ctx.Locale.Tr "repo.issues.add_project_at" $newProjectDisplayHtml $createdStr | Safe}} {{end}} </span> </div> @@ -748,7 +748,7 @@ {{else}} {{$reviewerName = .Review.OriginalAuthor}} {{end}} - {{$.locale.Tr "repo.issues.review.dismissed" $reviewerName $createdStr | Safe}} + {{ctx.Locale.Tr "repo.issues.review.dismissed" $reviewerName $createdStr | Safe}} </span> </div> {{if .Content}} @@ -761,7 +761,7 @@ </a> {{end}} <span class="text grey muted-links"> - {{$.locale.Tr "action.review_dismissed_reason"}} + {{ctx.Locale.Tr "action.review_dismissed_reason"}} </span> </div> <div class="ui attached segment"> @@ -769,7 +769,7 @@ {{if .RenderedContent}} {{.RenderedContent|Str2html}} {{else}} - <span class="no-content">{{$.locale.Tr "repo.issues.no_content"}}</span> + <span class="no-content">{{ctx.Locale.Tr "repo.issues.no_content"}}</span> {{end}} </div> </div> @@ -784,11 +784,11 @@ <span class="text grey muted-links"> {{template "shared/user/authorlink" .Poster}} {{if and .OldRef .NewRef}} - {{$.locale.Tr "repo.issues.change_ref_at" (.OldRef|Escape) (.NewRef|Escape) $createdStr | Safe}} + {{ctx.Locale.Tr "repo.issues.change_ref_at" (.OldRef|Escape) (.NewRef|Escape) $createdStr | Safe}} {{else if .OldRef}} - {{$.locale.Tr "repo.issues.remove_ref_at" (.OldRef|Escape) $createdStr | Safe}} + {{ctx.Locale.Tr "repo.issues.remove_ref_at" (.OldRef|Escape) $createdStr | Safe}} {{else}} - {{$.locale.Tr "repo.issues.add_ref_at" (.NewRef|Escape) $createdStr | Safe}} + {{ctx.Locale.Tr "repo.issues.add_ref_at" (.NewRef|Escape) $createdStr | Safe}} {{end}} </span> </div> @@ -797,8 +797,8 @@ <span class="badge">{{svg "octicon-git-merge" 16}}</span> <span class="text grey muted-links"> {{template "shared/user/authorlink" .Poster}} - {{if eq .Type 34}}{{$.locale.Tr "repo.pulls.auto_merge_newly_scheduled_comment" $createdStr | Safe}} - {{else}}{{$.locale.Tr "repo.pulls.auto_merge_canceled_schedule_comment" $createdStr | Safe}}{{end}} + {{if eq .Type 34}}{{ctx.Locale.Tr "repo.pulls.auto_merge_newly_scheduled_comment" $createdStr | Safe}} + {{else}}{{ctx.Locale.Tr "repo.pulls.auto_merge_canceled_schedule_comment" $createdStr | Safe}}{{end}} </span> </div> {{else if or (eq .Type 36) (eq .Type 37)}} @@ -807,8 +807,8 @@ {{template "shared/user/avatarlink" dict "user" .Poster}} <span class="text grey muted-links"> {{template "shared/user/authorlink" .Poster}} - {{if eq .Type 36}}{{$.locale.Tr "repo.issues.pin_comment" $createdStr | Safe}} - {{else}}{{$.locale.Tr "repo.issues.unpin_comment" $createdStr | Safe}}{{end}} + {{if eq .Type 36}}{{ctx.Locale.Tr "repo.issues.pin_comment" $createdStr | Safe}} + {{else}}{{ctx.Locale.Tr "repo.issues.unpin_comment" $createdStr | Safe}}{{end}} </span> </div> {{end}} diff --git a/templates/repo/issue/view_content/comments_delete_time.tmpl b/templates/repo/issue/view_content/comments_delete_time.tmpl index 7fed4eb37a..7c01bb4228 100644 --- a/templates/repo/issue/view_content/comments_delete_time.tmpl +++ b/templates/repo/issue/view_content/comments_delete_time.tmpl @@ -6,10 +6,10 @@ <form method="post" class="delete-time-form" action="{{.ctxData.RepoLink}}/issues/{{.ctxData.Issue.Index}}/times/{{.comment.TimeID}}/delete"> {{.ctxData.CsrfTokenHtml}} </form> - <div class="header">{{.ctxData.locale.Tr "repo.issues.del_time"}}</div> + <div class="header">{{ctx.Locale.Tr "repo.issues.del_time"}}</div> {{template "base/modal_actions_confirm"}} </div> - <button class="ui icon button compact mini issue-delete-time" data-id="{{.comment.Time.ID}}" data-tooltip-content="{{.ctxData.locale.Tr "repo.issues.del_time"}}"> + <button class="ui icon button compact mini issue-delete-time" data-id="{{.comment.Time.ID}}" data-tooltip-content="{{ctx.Locale.Tr "repo.issues.del_time"}}"> {{svg "octicon-trash"}} </button> </span> diff --git a/templates/repo/issue/view_content/context_menu.tmpl b/templates/repo/issue/view_content/context_menu.tmpl index ff94e2554e..4afd73c371 100644 --- a/templates/repo/issue/view_content/context_menu.tmpl +++ b/templates/repo/issue/view_content/context_menu.tmpl @@ -9,17 +9,17 @@ {{else}} {{$referenceUrl = printf "%s/files#%s" .ctxData.Issue.Link .item.HashTag}} {{end}} - <div class="item context js-aria-clickable" data-clipboard-text-type="url" data-clipboard-text="{{$referenceUrl}}">{{.ctxData.locale.Tr "repo.issues.context.copy_link"}}</div> + <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> {{if and .ctxData.IsSigned (not .ctxData.Repository.IsArchived)}} - <div class="item context js-aria-clickable quote-reply {{if .diff}}quote-reply-diff{{end}}" data-target="{{.item.HashTag}}-raw">{{.ctxData.locale.Tr "repo.issues.context.quote_reply"}}</div> + <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 .ctxData.UnitIssuesGlobalDisabled}} - <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}}">{{.ctxData.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="{{$referenceUrl}}">{{ctx.Locale.Tr "repo.issues.context.reference_issue"}}</div> {{end}} {{if or .ctxData.Permission.IsAdmin .IsCommentPoster .ctxData.HasIssuesOrPullsWritePermission}} <div class="divider"></div> - <div class="item context js-aria-clickable edit-content">{{.ctxData.locale.Tr "repo.issues.context.edit"}}</div> + <div class="item context js-aria-clickable edit-content">{{ctx.Locale.Tr "repo.issues.context.edit"}}</div> {{if .delete}} - <div class="item context js-aria-clickable delete-comment" data-comment-id={{.item.HashTag}} data-url="{{.ctxData.RepoLink}}/comments/{{.item.ID}}/delete" data-locale="{{.ctxData.locale.Tr "repo.issues.delete_comment_confirm"}}">{{.ctxData.locale.Tr "repo.issues.context.delete"}}</div> + <div class="item context js-aria-clickable delete-comment" data-comment-id={{.item.HashTag}} data-url="{{.ctxData.RepoLink}}/comments/{{.item.ID}}/delete" data-locale="{{ctx.Locale.Tr "repo.issues.delete_comment_confirm"}}">{{ctx.Locale.Tr "repo.issues.context.delete"}}</div> {{end}} {{end}} {{end}} diff --git a/templates/repo/issue/view_content/pull.tmpl b/templates/repo/issue/view_content/pull.tmpl index a256660b13..1474b23195 100644 --- a/templates/repo/issue/view_content/pull.tmpl +++ b/templates/repo/issue/view_content/pull.tmpl @@ -28,39 +28,39 @@ <div class="item item-section text gt-f1"> <div class="item-section-left"> <h3 class="gt-mb-3"> - {{$.locale.Tr "repo.pulls.merged_success"}} + {{ctx.Locale.Tr "repo.pulls.merged_success"}} </h3> <div class="merge-section-info"> - {{$.locale.Tr "repo.pulls.merged_info_text" (printf "<code>%s</code>" (.HeadTarget | Escape)) | Str2html}} + {{ctx.Locale.Tr "repo.pulls.merged_info_text" (printf "<code>%s</code>" (.HeadTarget | Escape)) | Str2html}} </div> </div> <div class="item-section-right"> - <button class="delete-button ui button" data-url="{{.DeleteBranchLink}}">{{$.locale.Tr "repo.branch.delete_html"}}</button> + <button class="delete-button ui button" data-url="{{.DeleteBranchLink}}">{{ctx.Locale.Tr "repo.branch.delete_html"}}</button> </div> </div> {{end}} {{else if .Issue.IsClosed}} <div class="item item-section text gt-f1"> <div class="item-section-left"> - <h3 class="gt-mb-3">{{$.locale.Tr "repo.pulls.closed"}}</h3> + <h3 class="gt-mb-3">{{ctx.Locale.Tr "repo.pulls.closed"}}</h3> <div class="merge-section-info"> {{if .IsPullRequestBroken}} - {{$.locale.Tr "repo.pulls.cant_reopen_deleted_branch"}} + {{ctx.Locale.Tr "repo.pulls.cant_reopen_deleted_branch"}} {{else}} - {{$.locale.Tr "repo.pulls.reopen_to_merge"}} + {{ctx.Locale.Tr "repo.pulls.reopen_to_merge"}} {{end}} </div> </div> {{if and .IsPullBranchDeletable (not .IsPullRequestBroken)}} <div class="item-section-right"> - <button class="delete-button ui button" data-url="{{.DeleteBranchLink}}">{{$.locale.Tr "repo.branch.delete_html"}}</button> + <button class="delete-button ui button" data-url="{{.DeleteBranchLink}}">{{ctx.Locale.Tr "repo.branch.delete_html"}}</button> </div> {{end}} </div> {{else if .IsPullFilesConflicted}} <div class="item"> {{svg "octicon-x"}} - {{$.locale.Tr "repo.pulls.files_conflicted"}} + {{ctx.Locale.Tr "repo.pulls.files_conflicted"}} </div> <ul> {{range .ConflictedFiles}} @@ -70,17 +70,17 @@ {{else if .IsPullRequestBroken}} <div class="item"> {{svg "octicon-x"}} - {{$.locale.Tr "repo.pulls.data_broken"}} + {{ctx.Locale.Tr "repo.pulls.data_broken"}} </div> {{else if .IsPullWorkInProgress}} <div class="item toggle-wip" data-title="{{.Issue.Title}}" data-wip-prefix="{{(.WorkInProgressPrefix|Escape)}}" data-update-url="{{.Issue.Link}}/title"> <div class="item-section-left flex-text-inline gt-f1"> {{svg "octicon-x"}} - {{$.locale.Tr "repo.pulls.cannot_merge_work_in_progress"}} + {{ctx.Locale.Tr "repo.pulls.cannot_merge_work_in_progress"}} </div> {{if or .HasIssuesOrPullsWritePermission .IsIssuePoster}} <button class="ui compact button"> - {{$.locale.Tr "repo.pulls.remove_prefix" (.WorkInProgressPrefix|Escape) | Safe}} + {{ctx.Locale.Tr "repo.pulls.remove_prefix" (.WorkInProgressPrefix|Escape) | Safe}} </button> {{end}} </div> @@ -88,38 +88,38 @@ {{else if .Issue.PullRequest.IsChecking}} <div class="item"> {{svg "octicon-sync"}} - {{$.locale.Tr "repo.pulls.is_checking"}} + {{ctx.Locale.Tr "repo.pulls.is_checking"}} </div> {{else if .Issue.PullRequest.IsAncestor}} <div class="item"> {{svg "octicon-alert"}} - {{$.locale.Tr "repo.pulls.is_ancestor"}} + {{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"}} - {{$.locale.Tr "repo.pulls.blocked_by_approvals" .GrantedApprovals .ProtectedBranch.RequiredApprovals}} + {{ctx.Locale.Tr "repo.pulls.blocked_by_approvals" .GrantedApprovals .ProtectedBranch.RequiredApprovals}} </div> {{else if .IsBlockedByRejection}} <div class="item"> {{svg "octicon-x"}} - {{$.locale.Tr "repo.pulls.blocked_by_rejection"}} + {{ctx.Locale.Tr "repo.pulls.blocked_by_rejection"}} </div> {{else if .IsBlockedByOfficialReviewRequests}} <div class="item"> {{svg "octicon-x"}} - {{$.locale.Tr "repo.pulls.blocked_by_official_review_requests"}} + {{ctx.Locale.Tr "repo.pulls.blocked_by_official_review_requests"}} </div> {{else if .IsBlockedByOutdatedBranch}} <div class="item"> {{svg "octicon-x"}} - {{$.locale.Tr "repo.pulls.blocked_by_outdated_branch"}} + {{ctx.Locale.Tr "repo.pulls.blocked_by_outdated_branch"}} </div> {{else if .IsBlockedByChangedProtectedFiles}} <div class="item"> {{svg "octicon-x"}} - {{$.locale.TrN $.ChangedProtectedFilesNum "repo.pulls.blocked_by_changed_protected_files_1" "repo.pulls.blocked_by_changed_protected_files_n" | Safe}} + {{ctx.Locale.TrN $.ChangedProtectedFilesNum "repo.pulls.blocked_by_changed_protected_files_1" "repo.pulls.blocked_by_changed_protected_files_n" | Safe}} </div> <ul> {{range .ChangedProtectedFiles}} @@ -129,21 +129,21 @@ {{else if and .EnableStatusCheck (or .RequiredStatusCheckState.IsError .RequiredStatusCheckState.IsFailure)}} <div class="item"> {{svg "octicon-x"}} - {{$.locale.Tr "repo.pulls.required_status_check_failed"}} + {{ctx.Locale.Tr "repo.pulls.required_status_check_failed"}} </div> {{else if and .EnableStatusCheck (not .RequiredStatusCheckState.IsSuccess)}} <div class="item"> {{svg "octicon-x"}} - {{$.locale.Tr "repo.pulls.required_status_check_missing"}} + {{ctx.Locale.Tr "repo.pulls.required_status_check_missing"}} </div> {{else if and .AllowMerge .RequireSigned (not .WillSign)}} <div class="item"> {{svg "octicon-x"}} - {{$.locale.Tr "repo.pulls.require_signed_wont_sign"}} + {{ctx.Locale.Tr "repo.pulls.require_signed_wont_sign"}} </div> <div class="item"> {{svg "octicon-unlock"}} - {{$.locale.Tr (printf "repo.signing.wont_sign.%s" .WontSignReason)}} + {{ctx.Locale.Tr (printf "repo.signing.wont_sign.%s" .WontSignReason)}} </div> {{end}} @@ -157,23 +157,23 @@ {{if $notAllOverridableChecksOk}} <div class="item"> {{svg "octicon-dot-fill"}} - {{$.locale.Tr "repo.pulls.required_status_check_administrator"}} + {{ctx.Locale.Tr "repo.pulls.required_status_check_administrator"}} </div> {{else}} <div class="item"> {{svg "octicon-check"}} - {{$.locale.Tr "repo.pulls.can_auto_merge_desc"}} + {{ctx.Locale.Tr "repo.pulls.can_auto_merge_desc"}} </div> {{end}} {{if .WillSign}} <div class="item"> {{svg "octicon-lock" 16 "text green"}} - {{$.locale.Tr "repo.signing.will_sign" .SigningKey}} + {{ctx.Locale.Tr "repo.signing.will_sign" .SigningKey}} </div> {{else if .IsSigned}} <div class="item"> {{svg "octicon-unlock"}} - {{$.locale.Tr (printf "repo.signing.wont_sign.%s" .WontSignReason)}} + {{ctx.Locale.Tr (printf "repo.signing.wont_sign.%s" .WontSignReason)}} </div> {{end}} {{end}} @@ -183,7 +183,7 @@ <div class="item"> {{svg "octicon-alert"}} - {{$.locale.Tr "repo.pulls.is_empty"}} + {{ctx.Locale.Tr "repo.pulls.is_empty"}} </div> {{end}} @@ -194,7 +194,7 @@ {{$hasPendingPullRequestMergeTip := ""}} {{if .HasPendingPullRequestMerge}} {{$createdPRMergeStr := TimeSinceUnix .PendingPullRequestMerge.CreatedUnix $.locale}} - {{$hasPendingPullRequestMergeTip = $.locale.Tr "repo.pulls.auto_merge_has_pending_schedule" .PendingPullRequestMerge.Doer.Name $createdPRMergeStr}} + {{$hasPendingPullRequestMergeTip = ctx.Locale.Tr "repo.pulls.auto_merge_has_pending_schedule" .PendingPullRequestMerge.Doer.Name $createdPRMergeStr}} {{end}} <div class="divider"></div> <script type="module"> @@ -205,14 +205,14 @@ const defaultSquashMergeMessage = {{if .DefaultSquashMergeBody}}{{.DefaultSquashMergeBody}}{{else}}`Reviewed-on: ${issueUrl}\n` + {{$approvers}}{{end}}; const mergeForm = { 'baseLink': {{.Link}}, - 'textCancel': {{$.locale.Tr "cancel"}}, - 'textDeleteBranch': {{$.locale.Tr "repo.branch.delete" .HeadTarget}}, - 'textAutoMergeButtonWhenSucceed': {{$.locale.Tr "repo.pulls.auto_merge_button_when_succeed"}}, - 'textAutoMergeWhenSucceed': {{$.locale.Tr "repo.pulls.auto_merge_when_succeed"}}, - 'textAutoMergeCancelSchedule': {{$.locale.Tr "repo.pulls.auto_merge_cancel_schedule"}}, - 'textClearMergeMessage': {{$.locale.Tr "repo.pulls.clear_merge_message"}}, - 'textClearMergeMessageHint': {{$.locale.Tr "repo.pulls.clear_merge_message_hint"}}, - 'textMergeCommitId': {{$.locale.Tr "repo.pulls.merge_commit_id"}}, + '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}}, @@ -221,7 +221,7 @@ 'isPullBranchDeletable': {{.IsPullBranchDeletable}}, 'defaultMergeStyle': {{.MergeStyle}}, 'defaultDeleteBranchAfterMerge': {{$prUnit.PullRequestsConfig.DefaultDeleteBranchAfterMerge}}, - 'mergeMessageFieldPlaceHolder': {{$.locale.Tr "repo.editor.commit_message_desc"}}, + 'mergeMessageFieldPlaceHolder': {{ctx.Locale.Tr "repo.editor.commit_message_desc"}}, 'defaultMergeMessage': defaultMergeMessage, 'hasPendingPullRequestMerge': {{.HasPendingPullRequestMerge}}, @@ -233,7 +233,7 @@ { 'name': 'merge', 'allowed': {{$prUnit.PullRequestsConfig.AllowMerge}}, - 'textDoMerge': {{$.locale.Tr "repo.pulls.merge_pull_request"}}, + 'textDoMerge': {{ctx.Locale.Tr "repo.pulls.merge_pull_request"}}, 'mergeTitleFieldText': defaultMergeTitle, 'mergeMessageFieldText': defaultMergeMessage, 'hideAutoMerge': generalHideAutoMerge, @@ -241,14 +241,14 @@ { 'name': 'rebase', 'allowed': {{$prUnit.PullRequestsConfig.AllowRebase}}, - 'textDoMerge': {{$.locale.Tr "repo.pulls.rebase_merge_pull_request"}}, + 'textDoMerge': {{ctx.Locale.Tr "repo.pulls.rebase_merge_pull_request"}}, 'hideMergeMessageTexts': true, 'hideAutoMerge': generalHideAutoMerge, }, { 'name': 'rebase-merge', 'allowed': {{$prUnit.PullRequestsConfig.AllowRebaseMerge}}, - 'textDoMerge': {{$.locale.Tr "repo.pulls.rebase_merge_commit_pull_request"}}, + 'textDoMerge': {{ctx.Locale.Tr "repo.pulls.rebase_merge_commit_pull_request"}}, 'mergeTitleFieldText': defaultMergeTitle, 'mergeMessageFieldText': defaultMergeMessage, 'hideAutoMerge': generalHideAutoMerge, @@ -256,7 +256,7 @@ { 'name': 'squash', 'allowed': {{$prUnit.PullRequestsConfig.AllowSquash}}, - 'textDoMerge': {{$.locale.Tr "repo.pulls.squash_merge_pull_request"}}, + 'textDoMerge': {{ctx.Locale.Tr "repo.pulls.squash_merge_pull_request"}}, 'mergeTitleFieldText': defaultSquashMergeTitle, 'mergeMessageFieldText': {{.GetCommitMessages}} + defaultSquashMergeMessage, 'hideAutoMerge': generalHideAutoMerge, @@ -264,7 +264,7 @@ { 'name': 'manually-merged', 'allowed': {{and $prUnit.PullRequestsConfig.AllowManualMerge $.IsRepoAdmin}}, - 'textDoMerge': {{$.locale.Tr "repo.pulls.merge_manually"}}, + 'textDoMerge': {{ctx.Locale.Tr "repo.pulls.merge_manually"}}, 'hideMergeMessageTexts': true, 'hideAutoMerge': true, } @@ -279,11 +279,11 @@ <div class="divider"></div> <div class="item text red"> {{svg "octicon-x"}} - {{$.locale.Tr "repo.pulls.no_merge_desc"}} + {{ctx.Locale.Tr "repo.pulls.no_merge_desc"}} </div> <div class="item"> {{svg "octicon-info"}} - {{$.locale.Tr "repo.pulls.no_merge_helper"}} + {{ctx.Locale.Tr "repo.pulls.no_merge_helper"}} </div> {{end}} {{/* end if the repo was set to use any merge style */}} {{else}} @@ -291,7 +291,7 @@ <div class="divider"></div> <div class="item"> {{svg "octicon-info"}} - {{$.locale.Tr "repo.pulls.no_merge_access"}} + {{ctx.Locale.Tr "repo.pulls.no_merge_access"}} </div> {{end}} {{/* end if user is allowed to merge or not */}} {{else}} @@ -299,27 +299,27 @@ {{if .IsBlockedByApprovals}} <div class="item text red"> {{svg "octicon-x"}} - {{$.locale.Tr "repo.pulls.blocked_by_approvals" .GrantedApprovals .ProtectedBranch.RequiredApprovals}} + {{ctx.Locale.Tr "repo.pulls.blocked_by_approvals" .GrantedApprovals .ProtectedBranch.RequiredApprovals}} </div> {{else if .IsBlockedByRejection}} <div class="item text red"> {{svg "octicon-x"}} - {{$.locale.Tr "repo.pulls.blocked_by_rejection"}} + {{ctx.Locale.Tr "repo.pulls.blocked_by_rejection"}} </div> {{else if .IsBlockedByOfficialReviewRequests}} <div class="item text red"> {{svg "octicon-x"}} - {{$.locale.Tr "repo.pulls.blocked_by_official_review_requests"}} + {{ctx.Locale.Tr "repo.pulls.blocked_by_official_review_requests"}} </div> {{else if .IsBlockedByOutdatedBranch}} <div class="item text red"> {{svg "octicon-x"}} - {{$.locale.Tr "repo.pulls.blocked_by_outdated_branch"}} + {{ctx.Locale.Tr "repo.pulls.blocked_by_outdated_branch"}} </div> {{else if .IsBlockedByChangedProtectedFiles}} <div class="item text red"> {{svg "octicon-x"}} - {{$.locale.TrN $.ChangedProtectedFilesNum "repo.pulls.blocked_by_changed_protected_files_1" "repo.pulls.blocked_by_changed_protected_files_n" | Safe}} + {{ctx.Locale.TrN $.ChangedProtectedFilesNum "repo.pulls.blocked_by_changed_protected_files_1" "repo.pulls.blocked_by_changed_protected_files_n" | Safe}} </div> <ul> {{range .ChangedProtectedFiles}} @@ -329,21 +329,21 @@ {{else if and .EnableStatusCheck (not .RequiredStatusCheckState.IsSuccess)}} <div class="item text red"> {{svg "octicon-x"}} - {{$.locale.Tr "repo.pulls.required_status_check_failed"}} + {{ctx.Locale.Tr "repo.pulls.required_status_check_failed"}} </div> {{else if and .RequireSigned (not .WillSign)}} <div class="item text red"> {{svg "octicon-x"}} - {{$.locale.Tr "repo.pulls.require_signed_wont_sign"}} + {{ctx.Locale.Tr "repo.pulls.require_signed_wont_sign"}} </div> {{else}} <div class="item text red"> {{svg "octicon-x"}} - {{$.locale.Tr "repo.pulls.cannot_auto_merge_desc"}} + {{ctx.Locale.Tr "repo.pulls.cannot_auto_merge_desc"}} </div> <div class="item"> {{svg "octicon-info"}} - {{$.locale.Tr "repo.pulls.cannot_auto_merge_helper"}} + {{ctx.Locale.Tr "repo.pulls.cannot_auto_merge_helper"}} </div> {{end}} {{end}}{{/* end if: pull request status */}} @@ -363,10 +363,10 @@ <form action="{{.Link}}/merge" method="post"> {{.CsrfTokenHtml}} <div class="field"> - <input type="text" name="merge_commit_id" placeholder="{{$.locale.Tr "repo.pulls.merge_commit_id"}}"> + <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"> - {{$.locale.Tr "repo.pulls.merge_manually"}} + {{ctx.Locale.Tr "repo.pulls.merge_manually"}} </button> </form> </div> diff --git a/templates/repo/issue/view_content/reactions.tmpl b/templates/repo/issue/view_content/reactions.tmpl index 02202783da..b7ca943e01 100644 --- a/templates/repo/issue/view_content/reactions.tmpl +++ b/templates/repo/issue/view_content/reactions.tmpl @@ -2,7 +2,7 @@ {{range $key, $value := .Reactions}} {{$hasReacted := $value.HasUser $.ctxData.SignedUserID}} <a role="button" class="ui label basic{{if $hasReacted}} primary{{end}}{{if not $.ctxData.IsSigned}} disabled{{end}} comment-reaction-button" - data-tooltip-content="{{$value.GetFirstUsers}}{{if gt ($value.GetMoreUserCount) 0}} {{$.ctxData.locale.Tr "repo.reactions_more" $value.GetMoreUserCount}}{{end}}" + data-tooltip-content="{{$value.GetFirstUsers}}{{if gt ($value.GetMoreUserCount) 0}} {{ctx.Locale.Tr "repo.reactions_more" $value.GetMoreUserCount}}{{end}}" data-tooltip-placement="bottom-start" data-reaction-content="{{$key}}" data-has-reacted="{{$hasReacted}}"> <span class="reaction">{{ReactionToEmoji $key}}</span> diff --git a/templates/repo/issue/view_content/reference_issue_dialog.tmpl b/templates/repo/issue/view_content/reference_issue_dialog.tmpl index 3df85e7b81..b771e08909 100644 --- a/templates/repo/issue/view_content/reference_issue_dialog.tmpl +++ b/templates/repo/issue/view_content/reference_issue_dialog.tmpl @@ -1,28 +1,28 @@ <div class="ui small modal" id="reference-issue-modal"> <div class="header"> - {{.locale.Tr "repo.issues.context.reference_issue"}} + {{ctx.Locale.Tr "repo.issues.context.reference_issue"}} </div> <div class="content" style="text-align:left"> <form class="ui form form-fetch-action" action="{{printf "%s/issues/new" .Repository.Link}}" method="post"> {{.CsrfTokenHtml}} <div class="ui segment content"> <div class="field"> - <span class="text"><strong>{{.locale.Tr "repository"}}</strong></span> + <span class="text"><strong>{{ctx.Locale.Tr "repository"}}</strong></span> <div class="ui search normal selection dropdown issue_reference_repository_search"> <div class="default text">{{.Repository.FullName}}</div> <div class="menu"></div> </div> </div> <div class="field"> - <span class="text"><strong>{{.locale.Tr "repo.milestones.title"}}</strong></span> + <span class="text"><strong>{{ctx.Locale.Tr "repo.milestones.title"}}</strong></span> <input name="title" value="" autofocus required maxlength="255" autocomplete="off"> </div> <div class="field"> - <span class="text"><strong>{{.locale.Tr "repo.issues.reference_issue.body"}}</strong></span> + <span class="text"><strong>{{ctx.Locale.Tr "repo.issues.reference_issue.body"}}</strong></span> <textarea name="content" class="form-control"></textarea> </div> <div class="text right"> - <button class="ui primary button">{{.locale.Tr "repo.issues.create"}}</button> + <button class="ui primary button">{{ctx.Locale.Tr "repo.issues.create"}}</button> </div> </div> </form> diff --git a/templates/repo/issue/view_content/sidebar.tmpl b/templates/repo/issue/view_content/sidebar.tmpl index 6405a6e180..78560539e9 100644 --- a/templates/repo/issue/view_content/sidebar.tmpl +++ b/templates/repo/issue/view_content/sidebar.tmpl @@ -4,7 +4,7 @@ <input id="reviewer_id" name="reviewer_id" type="hidden" value="{{.reviewer_id}}"> <div class="ui {{if or (not .Reviewers) (not .CanChooseReviewer) .Repository.IsArchived}}disabled{{end}} floating jump select-reviewers-modify dropdown"> <a class="text gt-df gt-ac muted"> - <strong>{{.locale.Tr "repo.issues.review.reviewers"}}</strong> + <strong>{{ctx.Locale.Tr "repo.issues.review.reviewers"}}</strong> {{if and .CanChooseReviewer (not .Repository.IsArchived)}} {{svg "octicon-gear" 16 "gt-ml-2"}} {{end}} @@ -13,13 +13,13 @@ {{if .Reviewers}} <div class="ui icon search input"> <i class="icon">{{svg "octicon-search" 16}}</i> - <input type="text" placeholder="{{.locale.Tr "repo.issues.filter_reviewers"}}"> + <input type="text" placeholder="{{ctx.Locale.Tr "repo.issues.filter_reviewers"}}"> </div> {{end}} {{if .Reviewers}} {{range .Reviewers}} {{if .User}} - <a class="{{if not .CanChange}}ui{{end}} item {{if .Checked}}checked{{end}} {{if not .CanChange}}ban-change{{end}}" href="#" data-id="{{.ItemID}}" data-id-selector="#review_request_{{.ItemID}}" {{if not .CanChange}} data-tooltip-content="{{$.locale.Tr "repo.issues.remove_request_review_block"}}"{{end}}> + <a class="{{if not .CanChange}}ui{{end}} item {{if .Checked}}checked{{end}} {{if not .CanChange}}ban-change{{end}}" href="#" data-id="{{.ItemID}}" data-id-selector="#review_request_{{.ItemID}}" {{if not .CanChange}} data-tooltip-content="{{ctx.Locale.Tr "repo.issues.remove_request_review_block"}}"{{end}}> <span class="octicon-check {{if not .Checked}}gt-invisible{{end}}">{{svg "octicon-check"}}</span> <span class="text"> {{ctx.AvatarUtils.Avatar .User 28 "gt-mr-3"}}{{template "repo/search_name" .User}} @@ -32,7 +32,7 @@ <div class="divider"></div> {{range .TeamReviewers}} {{if .Team}} - <a class="{{if not .CanChange}}ui{{end}} item {{if .Checked}}checked{{end}} {{if not .CanChange}}ban-change{{end}}" href="#" data-id="{{.ItemID}}" data-id-selector="#review_request_team_{{.Team.ID}}" {{if not .CanChange}} data-tooltip-content="{{$.locale.Tr "repo.issues.remove_request_review_block"}}"{{end}}> + <a class="{{if not .CanChange}}ui{{end}} item {{if .Checked}}checked{{end}} {{if not .CanChange}}ban-change{{end}}" href="#" data-id="{{.ItemID}}" data-id-selector="#review_request_team_{{.Team.ID}}" {{if not .CanChange}} data-tooltip-content="{{ctx.Locale.Tr "repo.issues.remove_request_review_block"}}"{{end}}> <span class="octicon-check {{if not .Checked}}gt-invisible{{end}}">{{svg "octicon-check" 16}}</span> <span class="text"> {{svg "octicon-people" 16 "gt-ml-4 gt-mr-2"}}{{$.Issue.Repo.OwnerName}}/{{.Team.Name}} @@ -45,7 +45,7 @@ </div> <div class="ui assignees list"> - <span class="no-select item {{if or .OriginalReviews .PullReviewers}}gt-hidden{{end}}">{{.locale.Tr "repo.issues.new.no_reviewers"}}</span> + <span class="no-select item {{if or .OriginalReviews .PullReviewers}}gt-hidden{{end}}">{{ctx.Locale.Tr "repo.issues.new.no_reviewers"}}</span> <div class="selected"> {{range .PullReviewers}} <div class="item gt-df gt-ac gt-py-3"> @@ -58,39 +58,39 @@ </div> <div class="gt-df gt-ac gt-gap-3"> {{if (and $.Permission.IsAdmin (or (eq .Review.Type 1) (eq .Review.Type 3)) (not $.Issue.IsClosed))}} - <a href="#" class="ui muted icon gt-df gt-ac show-modal" data-tooltip-content="{{$.locale.Tr "repo.issues.dismiss_review"}}" data-modal="#dismiss-review-modal-{{.Review.ID}}"> + <a href="#" class="ui muted icon gt-df gt-ac show-modal" data-tooltip-content="{{ctx.Locale.Tr "repo.issues.dismiss_review"}}" data-modal="#dismiss-review-modal-{{.Review.ID}}"> {{svg "octicon-x" 20}} </a> <div class="ui small modal" id="dismiss-review-modal-{{.Review.ID}}"> <div class="header"> - {{$.locale.Tr "repo.issues.dismiss_review"}} + {{ctx.Locale.Tr "repo.issues.dismiss_review"}} </div> <div class="content"> <div class="ui warning message"> - {{$.locale.Tr "repo.issues.dismiss_review_warning"}} + {{ctx.Locale.Tr "repo.issues.dismiss_review_warning"}} </div> <form class="ui form dismiss-review-form" id="dismiss-review-{{.Review.ID}}" action="{{$.RepoLink}}/issues/dismiss_review" method="post"> {{$.CsrfTokenHtml}} <input type="hidden" name="review_id" value="{{.Review.ID}}"> <div class="field"> - <label for="message">{{$.locale.Tr "action.review_dismissed_reason"}}</label> + <label for="message">{{ctx.Locale.Tr "action.review_dismissed_reason"}}</label> <input id="message" name="message"> </div> <div class="text right actions"> - <button class="ui cancel button">{{$.locale.Tr "settings.cancel"}}</button> - <button class="ui red button" type="submit">{{$.locale.Tr "ok"}}</button> + <button class="ui cancel button">{{ctx.Locale.Tr "settings.cancel"}}</button> + <button class="ui red button" type="submit">{{ctx.Locale.Tr "ok"}}</button> </div> </form> </div> </div> {{end}} {{if .Review.Stale}} - <span data-tooltip-content="{{$.locale.Tr "repo.issues.is_stale"}}"> + <span data-tooltip-content="{{ctx.Locale.Tr "repo.issues.is_stale"}}"> {{svg "octicon-hourglass" 16}} </span> {{end}} {{if .CanChange}} - <a href="#" class="ui muted icon re-request-review{{if .Checked}} checked{{end}}" data-tooltip-content="{{if .Checked}}{{$.locale.Tr "repo.issues.remove_request_review"}}{{else}}{{$.locale.Tr "repo.issues.re_request_review"}}{{end}}" data-issue-id="{{$.Issue.ID}}" data-id="{{.ItemID}}" data-update-url="{{$.RepoLink}}/issues/request_review">{{if .Checked}}{{svg "octicon-trash"}}{{else}}{{svg "octicon-sync"}}{{end}}</a> + <a href="#" class="ui muted icon re-request-review{{if .Checked}} checked{{end}}" data-tooltip-content="{{if .Checked}}{{ctx.Locale.Tr "repo.issues.remove_request_review"}}{{else}}{{ctx.Locale.Tr "repo.issues.re_request_review"}}{{end}}" data-issue-id="{{$.Issue.ID}}" data-id="{{.ItemID}}" data-update-url="{{$.RepoLink}}/issues/request_review">{{if .Checked}}{{svg "octicon-trash"}}{{else}}{{svg "octicon-sync"}}{{end}}</a> {{end}} {{svg (printf "octicon-%s" .Review.Type.Icon) 16 (printf "text %s" (.Review.HTMLTypeColorName))}} </div> @@ -99,7 +99,7 @@ {{range .OriginalReviews}} <div class="item gt-df gt-ac gt-py-3"> <div class="gt-df gt-ac gt-f1"> - <a class="muted" href="{{$.Repository.OriginalURL}}" data-tooltip-content="{{$.locale.Tr "repo.migrated_from_fake" ($.Repository.GetOriginalURLHostname|Escape) | Safe}}"> + <a class="muted" href="{{$.Repository.OriginalURL}}" data-tooltip-content="{{ctx.Locale.Tr "repo.migrated_from_fake" ($.Repository.GetOriginalURLHostname|Escape) | Safe}}"> {{svg (MigrationIcon $.Repository.GetOriginalURLHostname) 20 "gt-mr-3"}} {{.OriginalAuthor}} </a> @@ -114,7 +114,7 @@ {{if and (or .HasIssuesOrPullsWritePermission .IsIssuePoster) (not .HasMerged) (not .Issue.IsClosed) (not .IsPullWorkInProgress)}} <div class="toggle-wip" data-title="{{.Issue.Title}}" data-wip-prefix="{{(index .PullRequestWorkInProgressPrefixes 0| Escape)}}" data-update-url="{{.Issue.Link}}/title"> <a class="muted"> - {{.locale.Tr "repo.pulls.still_in_progress"}} {{.locale.Tr "repo.pulls.add_prefix" (index .PullRequestWorkInProgressPrefixes 0| Escape) | Safe}} + {{ctx.Locale.Tr "repo.pulls.still_in_progress"}} {{.locale.Tr "repo.pulls.add_prefix" (index .PullRequestWorkInProgressPrefixes 0| Escape) | Safe}} </a> </div> {{end}} @@ -128,7 +128,7 @@ <div class="ui {{if or (not .HasIssuesOrPullsWritePermission) .Repository.IsArchived}}disabled{{end}} floating jump select-milestone dropdown"> <a class="text muted flex-text-block"> - <strong>{{.locale.Tr "repo.issues.new.milestone"}}</strong> + <strong>{{ctx.Locale.Tr "repo.issues.new.milestone"}}</strong> {{if and .HasIssuesOrPullsWritePermission (not .Repository.IsArchived)}} {{svg "octicon-gear" 16 "gt-ml-2"}} {{end}} @@ -138,7 +138,7 @@ </div> </div> <div class="ui select-milestone list"> - <span class="no-select item {{if .Issue.Milestone}}gt-hidden{{end}}">{{.locale.Tr "repo.issues.new.no_milestone"}}</span> + <span class="no-select item {{if .Issue.Milestone}}gt-hidden{{end}}">{{ctx.Locale.Tr "repo.issues.new.no_milestone"}}</span> <div class="selected"> {{if .Issue.Milestone}} <a class="item muted sidebar-item-link" href="{{.RepoLink}}/milestone/{{.Issue.Milestone.ID}}"> @@ -154,7 +154,7 @@ <div class="ui {{if or (not .HasIssuesOrPullsWritePermission) .Repository.IsArchived}}disabled{{end}} floating jump select-project dropdown"> <a class="text muted flex-text-block"> - <strong>{{.locale.Tr "repo.issues.new.projects"}}</strong> + <strong>{{ctx.Locale.Tr "repo.issues.new.projects"}}</strong> {{if and .HasIssuesOrPullsWritePermission (not .Repository.IsArchived)}} {{svg "octicon-gear" 16 "gt-ml-2"}} {{end}} @@ -163,14 +163,14 @@ {{if or .OpenProjects .ClosedProjects}} <div class="ui icon search input"> <i class="icon">{{svg "octicon-search" 16}}</i> - <input type="text" placeholder="{{.locale.Tr "repo.issues.filter_projects"}}"> + <input type="text" placeholder="{{ctx.Locale.Tr "repo.issues.filter_projects"}}"> </div> {{end}} - <div class="no-select item">{{.locale.Tr "repo.issues.new.clear_projects"}}</div> + <div class="no-select item">{{ctx.Locale.Tr "repo.issues.new.clear_projects"}}</div> {{if .OpenProjects}} <div class="divider"></div> <div class="header"> - {{.locale.Tr "repo.issues.new.open_projects"}} + {{ctx.Locale.Tr "repo.issues.new.open_projects"}} </div> {{range .OpenProjects}} <a class="item muted sidebar-item-link" data-id="{{.ID}}" data-href="{{.Link}}"> @@ -181,7 +181,7 @@ {{if .ClosedProjects}} <div class="divider"></div> <div class="header"> - {{.locale.Tr "repo.issues.new.closed_projects"}} + {{ctx.Locale.Tr "repo.issues.new.closed_projects"}} </div> {{range .ClosedProjects}} <a class="item muted sidebar-item-link" data-id="{{.ID}}" data-href="{{.Link}}"> @@ -192,7 +192,7 @@ </div> </div> <div class="ui select-project list"> - <span class="no-select item {{if .Issue.Project}}gt-hidden{{end}}">{{.locale.Tr "repo.issues.new.no_projects"}}</span> + <span class="no-select item {{if .Issue.Project}}gt-hidden{{end}}">{{ctx.Locale.Tr "repo.issues.new.no_projects"}}</span> <div class="selected"> {{if .Issue.Project}} <a class="item muted sidebar-item-link" href="{{.Issue.Project.Link}}"> @@ -208,7 +208,7 @@ <input id="assignee_id" name="assignee_id" type="hidden" value="{{.assignee_id}}"> <div class="ui {{if or (not .HasIssuesOrPullsWritePermission) .Repository.IsArchived}}disabled{{end}} floating jump select-assignees-modify dropdown"> <a class="text muted flex-text-block"> - <strong>{{.locale.Tr "repo.issues.new.assignees"}}</strong> + <strong>{{ctx.Locale.Tr "repo.issues.new.assignees"}}</strong> {{if and .HasIssuesOrPullsWritePermission (not .Repository.IsArchived)}} {{svg "octicon-gear" 16 "gt-ml-2"}} {{end}} @@ -216,9 +216,9 @@ <div class="filter menu" data-action="update" data-issue-id="{{$.Issue.ID}}" data-update-url="{{$.RepoLink}}/issues/assignee"> <div class="ui icon search input"> <i class="icon">{{svg "octicon-search" 16}}</i> - <input type="text" placeholder="{{.locale.Tr "repo.issues.filter_assignees"}}"> + <input type="text" placeholder="{{ctx.Locale.Tr "repo.issues.filter_assignees"}}"> </div> - <div class="no-select item">{{.locale.Tr "repo.issues.new.clear_assignees"}}</div> + <div class="no-select item">{{ctx.Locale.Tr "repo.issues.new.clear_assignees"}}</div> {{range .Assignees}} {{$AssigneeID := .ID}} @@ -238,7 +238,7 @@ </div> </div> <div class="ui assignees list"> - <span class="no-select item {{if .Issue.Assignees}}gt-hidden{{end}}">{{.locale.Tr "repo.issues.new.no_assignees"}}</span> + <span class="no-select item {{if .Issue.Assignees}}gt-hidden{{end}}">{{ctx.Locale.Tr "repo.issues.new.no_assignees"}}</span> <div class="selected"> {{range .Issue.Assignees}} <div class="item"> @@ -254,7 +254,7 @@ <div class="divider"></div> {{if .Participants}} - <span class="text"><strong>{{.locale.Tr "repo.issues.num_participants" .NumParticipants}}</strong></span> + <span class="text"><strong>{{ctx.Locale.Tr "repo.issues.num_participants" .NumParticipants}}</strong></span> <div class="ui list gt-df gt-fw"> {{range .Participants}} <a {{if gt .ID 0}}href="{{.HomeLink}}"{{end}} data-tooltip-content="{{.GetDisplayName}}"> @@ -268,7 +268,7 @@ <div class="divider"></div> <div class="ui watching"> - <span class="text"><strong>{{.locale.Tr "notification.notifications"}}</strong></span> + <span class="text"><strong>{{ctx.Locale.Tr "notification.notifications"}}</strong></span> <div class="gt-mt-3"> <form method="post" action="{{.Issue.Link}}/watch"> <input type="hidden" name="watch" value="{{if $.IssueWatch.IsWatching}}0{{else}}1{{end}}"> @@ -276,10 +276,10 @@ <button class="fluid ui button"> {{if $.IssueWatch.IsWatching}} {{svg "octicon-mute" 16 "gt-mr-3"}} - {{.locale.Tr "repo.issues.unsubscribe"}} + {{ctx.Locale.Tr "repo.issues.unsubscribe"}} {{else}} {{svg "octicon-unmute" 16 "gt-mr-3"}} - {{.locale.Tr "repo.issues.subscribe"}} + {{ctx.Locale.Tr "repo.issues.subscribe"}} {{end}} </button> </form> @@ -290,7 +290,7 @@ {{if and .CanUseTimetracker (not .Repository.IsArchived)}} <div class="divider"></div> <div class="ui timetrack"> - <span class="text"><strong>{{.locale.Tr "repo.issues.tracker"}}</strong></span> + <span class="text"><strong>{{ctx.Locale.Tr "repo.issues.tracker"}}</strong></span> <div class="gt-mt-3"> <form method="post" action="{{.Issue.Link}}/times/stopwatch/toggle" id="toggle_stopwatch_form"> {{$.CsrfTokenHtml}} @@ -301,39 +301,39 @@ {{if $.IsStopwatchRunning}} <button class="ui fluid button issue-stop-time"> {{svg "octicon-stopwatch" 16 "gt-mr-3"}} - {{.locale.Tr "repo.issues.stop_tracking"}} + {{ctx.Locale.Tr "repo.issues.stop_tracking"}} </button> <button class="ui fluid button issue-cancel-time gt-mt-3"> {{svg "octicon-trash" 16 "gt-mr-3"}} - {{.locale.Tr "repo.issues.cancel_tracking"}} + {{ctx.Locale.Tr "repo.issues.cancel_tracking"}} </button> {{else}} {{if .HasUserStopwatch}} <div class="ui warning message"> - {{.locale.Tr "repo.issues.tracking_already_started" (.OtherStopwatchURL|Escape) | Safe}} + {{ctx.Locale.Tr "repo.issues.tracking_already_started" (.OtherStopwatchURL|Escape) | Safe}} </div> {{end}} - <button class="ui fluid button issue-start-time" data-tooltip-content='{{.locale.Tr "repo.issues.start_tracking"}}'> + <button class="ui fluid button issue-start-time" data-tooltip-content='{{ctx.Locale.Tr "repo.issues.start_tracking"}}'> {{svg "octicon-stopwatch" 16 "gt-mr-3"}} - {{.locale.Tr "repo.issues.start_tracking_short"}} + {{ctx.Locale.Tr "repo.issues.start_tracking_short"}} </button> <div class="ui mini modal issue-start-time-modal"> - <div class="header">{{.locale.Tr "repo.issues.add_time"}}</div> + <div class="header">{{ctx.Locale.Tr "repo.issues.add_time"}}</div> <div class="content"> <form method="post" id="add_time_manual_form" action="{{.Issue.Link}}/times/add" class="ui input fluid gt-gap-3"> {{$.CsrfTokenHtml}} - <input placeholder='{{.locale.Tr "repo.issues.add_time_hours"}}' type="number" name="hours"> - <input placeholder='{{.locale.Tr "repo.issues.add_time_minutes"}}' type="number" name="minutes" class="ui compact"> + <input placeholder='{{ctx.Locale.Tr "repo.issues.add_time_hours"}}' type="number" name="hours"> + <input placeholder='{{ctx.Locale.Tr "repo.issues.add_time_minutes"}}' type="number" name="minutes" class="ui compact"> </form> </div> <div class="actions"> - <button class="ui primary approve button">{{.locale.Tr "repo.issues.add_time_short"}}</button> - <button class="ui cancel button">{{.locale.Tr "repo.issues.add_time_cancel"}}</button> + <button class="ui primary approve button">{{ctx.Locale.Tr "repo.issues.add_time_short"}}</button> + <button class="ui cancel button">{{ctx.Locale.Tr "repo.issues.add_time_cancel"}}</button> </div> </div> - <button class="ui fluid button issue-add-time gt-mt-3" data-tooltip-content='{{.locale.Tr "repo.issues.add_time"}}'> + <button class="ui fluid button issue-add-time gt-mt-3" data-tooltip-content='{{ctx.Locale.Tr "repo.issues.add_time"}}'> {{svg "octicon-plus" 16 "gt-mr-3"}} - {{.locale.Tr "repo.issues.add_time_short"}} + {{ctx.Locale.Tr "repo.issues.add_time_short"}} </button> {{end}} </div> @@ -342,7 +342,7 @@ {{if gt (len .WorkingUsers) 0}} <div class="divider"></div> <div class="ui comments"> - <span class="text"><strong>{{.locale.Tr "repo.issues.time_spent_from_all_authors" ($.Issue.TotalTrackedTime | Sec2Time) | Safe}}</strong></span> + <span class="text"><strong>{{ctx.Locale.Tr "repo.issues.time_spent_from_all_authors" ($.Issue.TotalTrackedTime | Sec2Time) | Safe}}</strong></span> <div> {{range $user, $trackedtime := .WorkingUsers}} <div class="comment gt-mt-3"> @@ -363,36 +363,36 @@ {{end}} <div class="divider"></div> - <span class="text"><strong>{{.locale.Tr "repo.issues.due_date"}}</strong></span> + <span class="text"><strong>{{ctx.Locale.Tr "repo.issues.due_date"}}</strong></span> <div class="ui form" id="deadline-loader"> <div class="ui negative message gt-hidden" id="deadline-err-invalid-date"> {{svg "octicon-x" 16 "close icon"}} - {{.locale.Tr "repo.issues.due_date_invalid"}} + {{ctx.Locale.Tr "repo.issues.due_date_invalid"}} </div> {{if ne .Issue.DeadlineUnix 0}} <p> <div class="gt-df gt-sb gt-ac"> - <div class="due-date {{if .Issue.IsOverdue}}text red{{end}}" {{if .Issue.IsOverdue}}data-tooltip-content="{{.locale.Tr "repo.issues.due_date_overdue"}}"{{end}}> + <div class="due-date {{if .Issue.IsOverdue}}text red{{end}}" {{if .Issue.IsOverdue}}data-tooltip-content="{{ctx.Locale.Tr "repo.issues.due_date_overdue"}}"{{end}}> {{svg "octicon-calendar" 16 "gt-mr-3"}} {{DateTime "long" .Issue.DeadlineUnix.FormatDate}} </div> <div> {{if and .HasIssuesOrPullsWritePermission (not .Repository.IsArchived)}} - <a class="issue-due-edit muted" data-tooltip-content="{{$.locale.Tr "repo.issues.due_date_form_edit"}}">{{svg "octicon-pencil" 16 "gt-mr-2"}}</a> - <a class="issue-due-remove muted" data-tooltip-content="{{$.locale.Tr "repo.issues.due_date_form_remove"}}">{{svg "octicon-trash"}}</a> + <a class="issue-due-edit muted" data-tooltip-content="{{ctx.Locale.Tr "repo.issues.due_date_form_edit"}}">{{svg "octicon-pencil" 16 "gt-mr-2"}}</a> + <a class="issue-due-remove muted" data-tooltip-content="{{ctx.Locale.Tr "repo.issues.due_date_form_remove"}}">{{svg "octicon-trash"}}</a> {{end}} </div> </div> </p> {{else}} - <p>{{.locale.Tr "repo.issues.due_date_not_set"}}</p> + <p>{{ctx.Locale.Tr "repo.issues.due_date_not_set"}}</p> {{end}} {{if and .HasIssuesOrPullsWritePermission (not .Repository.IsArchived)}} <div {{if ne .Issue.DeadlineUnix 0}} class="gt-hidden"{{end}} id="deadlineForm"> <form class="ui fluid action input issue-due-form" action="{{AppSubUrl}}/{{PathEscape .Repository.Owner.Name}}/{{PathEscape .Repository.Name}}/issues/{{.Issue.Index}}/deadline" method="post" id="update-issue-deadline-form"> {{$.CsrfTokenHtml}} - <input required placeholder="{{.locale.Tr "repo.issues.due_date_form"}}" {{if gt .Issue.DeadlineUnix 0}}value="{{.Issue.DeadlineUnix.Format "2006-01-02"}}"{{end}} type="date" name="deadlineDate" id="deadlineDate"> + <input required placeholder="{{ctx.Locale.Tr "repo.issues.due_date_form"}}" {{if gt .Issue.DeadlineUnix 0}}value="{{.Issue.DeadlineUnix.Format "2006-01-02"}}"{{end}} type="date" name="deadlineDate" id="deadlineDate"> <button class="ui icon button"> {{if ne .Issue.DeadlineUnix 0}} {{svg "octicon-pencil"}} @@ -410,20 +410,20 @@ <div class="ui depending"> {{if (and (not .BlockedByDependencies) (not .BlockedByDependenciesNotPermitted) (not .BlockingDependencies) (not .BlockingDependenciesNotPermitted))}} - <span class="text"><strong>{{.locale.Tr "repo.issues.dependency.title"}}</strong></span> + <span class="text"><strong>{{ctx.Locale.Tr "repo.issues.dependency.title"}}</strong></span> <br> <p> {{if .Issue.IsPull}} - {{.locale.Tr "repo.issues.dependency.pr_no_dependencies"}} + {{ctx.Locale.Tr "repo.issues.dependency.pr_no_dependencies"}} {{else}} - {{.locale.Tr "repo.issues.dependency.issue_no_dependencies"}} + {{ctx.Locale.Tr "repo.issues.dependency.issue_no_dependencies"}} {{end}} </p> {{end}} {{if or .BlockingDependencies .BlockingDependenciesNotPermitted}} - <span class="text" data-tooltip-content="{{if .Issue.IsPull}}{{.locale.Tr "repo.issues.dependency.pr_close_blocks"}}{{else}}{{.locale.Tr "repo.issues.dependency.issue_close_blocks"}}{{end}}"> - <strong>{{.locale.Tr "repo.issues.dependency.blocks_short"}}</strong> + <span class="text" data-tooltip-content="{{if .Issue.IsPull}}{{ctx.Locale.Tr "repo.issues.dependency.pr_close_blocks"}}{{else}}{{.locale.Tr "repo.issues.dependency.issue_close_blocks"}}{{end}}"> + <strong>{{ctx.Locale.Tr "repo.issues.dependency.blocks_short"}}</strong> </span> <div class="ui relaxed divided list"> {{range .BlockingDependencies}} @@ -438,7 +438,7 @@ </div> <div class="item-right gt-df gt-ac"> {{if and $.CanCreateIssueDependencies (not $.Repository.IsArchived)}} - <a class="delete-dependency-button ci muted" data-id="{{.Issue.ID}}" data-type="blocking" data-tooltip-content="{{$.locale.Tr "repo.issues.dependency.remove_info"}}"> + <a class="delete-dependency-button ci muted" data-id="{{.Issue.ID}}" data-type="blocking" data-tooltip-content="{{ctx.Locale.Tr "repo.issues.dependency.remove_info"}}"> {{svg "octicon-trash" 16}} </a> {{end}} @@ -447,15 +447,15 @@ {{end}} {{if .BlockingDependenciesNotPermitted}} <div class="item gt-df gt-ac gt-sb"> - <span>{{$.locale.TrN (len .BlockingDependenciesNotPermitted) "repo.issues.dependency.no_permission_1" "repo.issues.dependency.no_permission_n" (len .BlockingDependenciesNotPermitted)}}</span> + <span>{{ctx.Locale.TrN (len .BlockingDependenciesNotPermitted) "repo.issues.dependency.no_permission_1" "repo.issues.dependency.no_permission_n" (len .BlockingDependenciesNotPermitted)}}</span> </div> {{end}} </div> {{end}} {{if or .BlockedByDependencies .BlockedByDependenciesNotPermitted}} - <span class="text" data-tooltip-content="{{if .Issue.IsPull}}{{.locale.Tr "repo.issues.dependency.pr_closing_blockedby"}}{{else}}{{.locale.Tr "repo.issues.dependency.issue_closing_blockedby"}}{{end}}"> - <strong>{{.locale.Tr "repo.issues.dependency.blocked_by_short"}}</strong> + <span class="text" data-tooltip-content="{{if .Issue.IsPull}}{{ctx.Locale.Tr "repo.issues.dependency.pr_closing_blockedby"}}{{else}}{{.locale.Tr "repo.issues.dependency.issue_closing_blockedby"}}{{end}}"> + <strong>{{ctx.Locale.Tr "repo.issues.dependency.blocked_by_short"}}</strong> </span> <div class="ui relaxed divided list"> {{range .BlockedByDependencies}} @@ -470,7 +470,7 @@ </div> <div class="item-right gt-df gt-ac"> {{if and $.CanCreateIssueDependencies (not $.Repository.IsArchived)}} - <a class="delete-dependency-button ci muted" data-id="{{.Issue.ID}}" data-type="blockedBy" data-tooltip-content="{{$.locale.Tr "repo.issues.dependency.remove_info"}}"> + <a class="delete-dependency-button ci muted" data-id="{{.Issue.ID}}" data-type="blockedBy" data-tooltip-content="{{ctx.Locale.Tr "repo.issues.dependency.remove_info"}}"> {{svg "octicon-trash" 16}} </a> {{end}} @@ -482,7 +482,7 @@ <div class="item dependency{{if .Issue.IsClosed}} is-closed{{end}} gt-df gt-ac gt-sb"> <div class="item-left gt-df gt-jc gt-fc gt-f1"> <div> - <span data-tooltip-content="{{$.locale.Tr "repo.issues.dependency.no_permission.can_remove"}}">{{svg "octicon-lock" 16}}</span> + <span data-tooltip-content="{{ctx.Locale.Tr "repo.issues.dependency.no_permission.can_remove"}}">{{svg "octicon-lock" 16}}</span> <span class="title" data-tooltip-content="#{{.Issue.Index}} {{.Issue.Title | RenderEmoji $.Context}}"> #{{.Issue.Index}} {{.Issue.Title | RenderEmoji $.Context}} </span> @@ -493,7 +493,7 @@ </div> <div class="item-right gt-df gt-ac"> {{if and $.CanCreateIssueDependencies (not $.Repository.IsArchived)}} - <a class="delete-dependency-button ci muted" data-id="{{.Issue.ID}}" data-type="blocking" data-tooltip-content="{{$.locale.Tr "repo.issues.dependency.remove_info"}}"> + <a class="delete-dependency-button ci muted" data-id="{{.Issue.ID}}" data-type="blocking" data-tooltip-content="{{ctx.Locale.Tr "repo.issues.dependency.remove_info"}}"> {{svg "octicon-trash" 16}} </a> {{end}} @@ -502,7 +502,7 @@ {{end}} {{else if .BlockedByDependenciesNotPermitted}} <div class="item gt-df gt-ac gt-sb"> - <span>{{$.locale.TrN (len .BlockedByDependenciesNotPermitted) "repo.issues.dependency.no_permission_1" "repo.issues.dependency.no_permission_n" (len .BlockedByDependenciesNotPermitted)}}</span> + <span>{{ctx.Locale.TrN (len .BlockedByDependenciesNotPermitted) "repo.issues.dependency.no_permission_1" "repo.issues.dependency.no_permission_n" (len .BlockedByDependenciesNotPermitted)}}</span> </div> {{end}} </div> @@ -517,7 +517,7 @@ <input name="newDependency" type="hidden"> {{svg "octicon-triangle-down" 14 "dropdown icon"}} <input type="text" class="search"> - <div class="default text">{{.locale.Tr "repo.issues.dependency.add"}}</div> + <div class="default text">{{ctx.Locale.Tr "repo.issues.dependency.add"}}</div> </div> <button class="ui icon button"> {{svg "octicon-plus"}} @@ -534,7 +534,7 @@ <div class="ui g-modal-confirm modal remove-dependency"> <div class="header"> {{svg "octicon-trash"}} - {{.locale.Tr "repo.issues.dependency.remove_header"}} + {{ctx.Locale.Tr "repo.issues.dependency.remove_header"}} </div> <div class="content"> <form method="post" action="{{.Issue.Link}}/dependency/delete" id="removeDependencyForm"> @@ -543,13 +543,13 @@ <input type="hidden" value="" name="dependencyType" id="dependencyType"> </form> <p>{{if .Issue.IsPull}} - {{.locale.Tr "repo.issues.dependency.pr_remove_text"}} + {{ctx.Locale.Tr "repo.issues.dependency.pr_remove_text"}} {{else}} - {{.locale.Tr "repo.issues.dependency.issue_remove_text"}} + {{ctx.Locale.Tr "repo.issues.dependency.issue_remove_text"}} {{end}}</p> </div> - {{$ModalButtonCancelText := .locale.Tr "repo.issues.dependency.cancel"}} - {{$ModalButtonOkText := .locale.Tr "repo.issues.dependency.remove"}} + {{$ModalButtonCancelText := ctx.Locale.Tr "repo.issues.dependency.cancel"}} + {{$ModalButtonOkText := ctx.Locale.Tr "repo.issues.dependency.remove"}} {{template "base/modal_actions_confirm" (dict "." . "ModalButtonCancelText" $ModalButtonCancelText "ModalButtonOkText" $ModalButtonOkText)}} </div> {{end}} @@ -559,7 +559,7 @@ <div class="ui equal width compact grid"> {{$issueReferenceLink := printf "%s#%d" .Issue.Repo.FullName .Issue.Index}} <div class="row gt-ac" data-tooltip-content="{{$issueReferenceLink}}"> - <span class="text column truncate">{{.locale.Tr "repo.issues.reference_link" $issueReferenceLink}}</span> + <span class="text column truncate">{{ctx.Locale.Tr "repo.issues.reference_link" $issueReferenceLink}}</span> <button class="ui two wide button column gt-p-3" data-clipboard-text="{{$issueReferenceLink}}">{{svg "octicon-copy" 14}}</button> </div> </div> @@ -568,15 +568,15 @@ <div class="divider"></div> {{if or .PinEnabled .Issue.IsPinned}} - <form class="gt-mt-2 form-fetch-action single-button-form" method="post" {{if $.NewPinAllowed}}action="{{.Issue.Link}}/pin"{{else}}data-tooltip-content="{{.locale.Tr "repo.issues.max_pinned"}}"{{end}}> + <form class="gt-mt-2 form-fetch-action single-button-form" method="post" {{if $.NewPinAllowed}}action="{{.Issue.Link}}/pin"{{else}}data-tooltip-content="{{ctx.Locale.Tr "repo.issues.max_pinned"}}"{{end}}> {{$.CsrfTokenHtml}} <button class="fluid ui button {{if not $.NewPinAllowed}}disabled{{end}}"> {{if not .Issue.IsPinned}} {{svg "octicon-pin" 16 "gt-mr-3"}} - {{.locale.Tr "pin"}} + {{ctx.Locale.Tr "pin"}} {{else}} {{svg "octicon-pin-slash" 16 "gt-mr-3"}} - {{.locale.Tr "unpin"}} + {{ctx.Locale.Tr "unpin"}} {{end}} </button> </form> @@ -585,29 +585,29 @@ <button class="gt-mt-2 fluid ui show-modal button {{if .Issue.IsLocked}} negative {{end}}" data-modal="#lock"> {{if .Issue.IsLocked}} {{svg "octicon-key"}} - {{.locale.Tr "repo.issues.unlock"}} + {{ctx.Locale.Tr "repo.issues.unlock"}} {{else}} {{svg "octicon-lock"}} - {{.locale.Tr "repo.issues.lock"}} + {{ctx.Locale.Tr "repo.issues.lock"}} {{end}} </button> <div class="ui tiny modal" id="lock"> <div class="header"> {{if .Issue.IsLocked}} - {{.locale.Tr "repo.issues.unlock.title"}} + {{ctx.Locale.Tr "repo.issues.unlock.title"}} {{else}} - {{.locale.Tr "repo.issues.lock.title"}} + {{ctx.Locale.Tr "repo.issues.lock.title"}} {{end}} </div> <div class="content"> <div class="ui warning message"> {{if .Issue.IsLocked}} - {{.locale.Tr "repo.issues.unlock.notice_1"}}<br> - {{.locale.Tr "repo.issues.unlock.notice_2"}}<br> + {{ctx.Locale.Tr "repo.issues.unlock.notice_1"}}<br> + {{ctx.Locale.Tr "repo.issues.unlock.notice_2"}}<br> {{else}} - {{.locale.Tr "repo.issues.lock.notice_1"}}<br> - {{.locale.Tr "repo.issues.lock.notice_2"}}<br> - {{.locale.Tr "repo.issues.lock.notice_3"}}<br> + {{ctx.Locale.Tr "repo.issues.lock.notice_1"}}<br> + {{ctx.Locale.Tr "repo.issues.lock.notice_2"}}<br> + {{ctx.Locale.Tr "repo.issues.lock.notice_3"}}<br> {{end}} </div> @@ -617,7 +617,7 @@ {{if not .Issue.IsLocked}} <div class="field"> - <strong> {{.locale.Tr "repo.issues.lock.reason"}} </strong> + <strong> {{ctx.Locale.Tr "repo.issues.lock.reason"}} </strong> </div> <div class="field"> @@ -643,12 +643,12 @@ {{end}} <div class="text right actions"> - <button class="ui cancel button">{{.locale.Tr "settings.cancel"}}</button> + <button class="ui cancel button">{{ctx.Locale.Tr "settings.cancel"}}</button> <button class="ui red button"> {{if .Issue.IsLocked}} - {{.locale.Tr "repo.issues.unlock_confirm"}} + {{ctx.Locale.Tr "repo.issues.unlock_confirm"}} {{else}} - {{.locale.Tr "repo.issues.lock_confirm"}} + {{ctx.Locale.Tr "repo.issues.lock_confirm"}} {{end}} </button> </div> @@ -657,22 +657,22 @@ </div> <button class="gt-mt-2 fluid ui show-modal button" data-modal="#sidebar-delete-issue"> {{svg "octicon-trash"}} - {{.locale.Tr "repo.issues.delete"}} + {{ctx.Locale.Tr "repo.issues.delete"}} </button> <div class="ui g-modal-confirm modal" id="sidebar-delete-issue"> <div class="header"> {{if .Issue.IsPull}} - {{.locale.Tr "repo.pulls.delete.title"}} + {{ctx.Locale.Tr "repo.pulls.delete.title"}} {{else}} - {{.locale.Tr "repo.issues.delete.title"}} + {{ctx.Locale.Tr "repo.issues.delete.title"}} {{end}} </div> <div class="content"> <p> {{if .Issue.IsPull}} - {{.locale.Tr "repo.pulls.delete.text"}} + {{ctx.Locale.Tr "repo.pulls.delete.text"}} {{else}} - {{.locale.Tr "repo.issues.delete.text"}} + {{ctx.Locale.Tr "repo.issues.delete.text"}} {{end}} </p> </div> @@ -689,10 +689,10 @@ <div class="inline field"> <div class="ui checkbox" id="allow-edits-from-maintainers" data-url="{{.Issue.Link}}" - data-tooltip-content="{{.locale.Tr "repo.pulls.allow_edits_from_maintainers_desc"}}" - data-prompt-error="{{.locale.Tr "repo.pulls.allow_edits_from_maintainers_err"}}" + data-tooltip-content="{{ctx.Locale.Tr "repo.pulls.allow_edits_from_maintainers_desc"}}" + data-prompt-error="{{ctx.Locale.Tr "repo.pulls.allow_edits_from_maintainers_err"}}" > - <label><strong>{{.locale.Tr "repo.pulls.allow_edits_from_maintainers"}}</strong></label> + <label><strong>{{ctx.Locale.Tr "repo.pulls.allow_edits_from_maintainers"}}</strong></label> <input type="checkbox" {{if .Issue.PullRequest.AllowMaintainerEdit}}checked{{end}}> </div> </div> diff --git a/templates/repo/issue/view_content/update_branch_by_merge.tmpl b/templates/repo/issue/view_content/update_branch_by_merge.tmpl index 7e4a0f18e2..4dbefefe00 100644 --- a/templates/repo/issue/view_content/update_branch_by_merge.tmpl +++ b/templates/repo/issue/view_content/update_branch_by_merge.tmpl @@ -3,7 +3,7 @@ <div class="item item-section"> <div class="item-section-left flex-text-inline"> {{svg "octicon-alert"}} - {{$.locale.Tr "repo.pulls.outdated_with_base_branch"}} + {{ctx.Locale.Tr "repo.pulls.outdated_with_base_branch"}} </div> <div class="item-section-right"> {{if and $.UpdateAllowed $.UpdateByRebaseAllowed}} @@ -11,14 +11,14 @@ <div class="ui buttons update-button"> <button class="ui button" data-do="{{$.Link}}/update" data-redirect="{{$.Link}}"> <span class="button-text"> - {{$.locale.Tr "repo.pulls.update_branch"}} + {{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="{{$.Link}}/update">{{$.locale.Tr "repo.pulls.update_branch"}}</a> - <a class="item" data-do="{{$.Link}}/update?style=rebase">{{$.locale.Tr "repo.pulls.update_branch_rebase"}}</a> + <a class="item active selected" data-do="{{$.Link}}/update">{{ctx.Locale.Tr "repo.pulls.update_branch"}}</a> + <a class="item" data-do="{{$.Link}}/update?style=rebase">{{ctx.Locale.Tr "repo.pulls.update_branch_rebase"}}</a> </div> </div> </div> @@ -28,7 +28,7 @@ <form action="{{$.Link}}/update" method="post" class="ui update-branch-form"> {{$.CsrfTokenHtml}} <button class="ui compact button"> - <span class="ui text">{{$.locale.Tr "repo.pulls.update_branch"}}</span> + <span class="ui text">{{ctx.Locale.Tr "repo.pulls.update_branch"}}</span> </button> </form> {{end}} diff --git a/templates/repo/issue/view_title.tmpl b/templates/repo/issue/view_title.tmpl index 0ad408b8d9..a1359c070f 100644 --- a/templates/repo/issue/view_title.tmpl +++ b/templates/repo/issue/view_title.tmpl @@ -14,32 +14,32 @@ </h1> <div class="issue-title-buttons"> {{if and (or .HasIssuesOrPullsWritePermission .IsIssuePoster) (not .Repository.IsArchived)}} - <button id="edit-title" class="ui small basic button edit-button not-in-edit{{if .Issue.IsPull}} gt-mr-0{{end}}">{{.locale.Tr "repo.issues.edit"}}</button> + <button id="edit-title" class="ui small basic button edit-button not-in-edit{{if .Issue.IsPull}} gt-mr-0{{end}}">{{ctx.Locale.Tr "repo.issues.edit"}}</button> {{end}} {{if not .Issue.IsPull}} - <a role="button" class="ui small primary button new-issue-button gt-mr-0" href="{{.RepoLink}}/issues/new{{if .NewIssueChooseTemplate}}/choose{{end}}">{{.locale.Tr "repo.issues.new"}}</a> + <a role="button" class="ui small primary button new-issue-button gt-mr-0" href="{{.RepoLink}}/issues/new{{if .NewIssueChooseTemplate}}/choose{{end}}">{{ctx.Locale.Tr "repo.issues.new"}}</a> {{end}} </div> {{if and (or .HasIssuesOrPullsWritePermission .IsIssuePoster) (not .Repository.IsArchived)}} <div class="edit-buttons"> - <button id="cancel-edit-title" class="ui small basic button in-edit gt-hidden">{{.locale.Tr "repo.issues.cancel"}}</button> - <button id="save-edit-title" class="ui small primary button in-edit gt-hidden gt-mr-0" data-update-url="{{$.RepoLink}}/issues/{{.Issue.Index}}/title" {{if .Issue.IsPull}}data-target-update-url="{{$.RepoLink}}/pull/{{.Issue.Index}}/target_branch"{{end}}>{{.locale.Tr "repo.issues.save"}}</button> + <button id="cancel-edit-title" class="ui small basic button in-edit gt-hidden">{{ctx.Locale.Tr "repo.issues.cancel"}}</button> + <button id="save-edit-title" class="ui small primary button in-edit gt-hidden gt-mr-0" data-update-url="{{$.RepoLink}}/issues/{{.Issue.Index}}/title" {{if .Issue.IsPull}}data-target-update-url="{{$.RepoLink}}/pull/{{.Issue.Index}}/target_branch"{{end}}>{{ctx.Locale.Tr "repo.issues.save"}}</button> </div> {{end}} </div> <div class="issue-title-meta"> {{if .HasMerged}} - <div class="ui purple label issue-state-label">{{svg "octicon-git-merge" 16 "gt-mr-2"}} {{if eq .Issue.PullRequest.Status 3}}{{.locale.Tr "repo.pulls.manually_merged"}}{{else}}{{.locale.Tr "repo.pulls.merged"}}{{end}}</div> + <div class="ui purple label issue-state-label">{{svg "octicon-git-merge" 16 "gt-mr-2"}} {{if eq .Issue.PullRequest.Status 3}}{{ctx.Locale.Tr "repo.pulls.manually_merged"}}{{else}}{{.locale.Tr "repo.pulls.merged"}}{{end}}</div> {{else if .Issue.IsClosed}} - <div class="ui red label issue-state-label">{{if .Issue.IsPull}}{{svg "octicon-git-pull-request"}}{{else}}{{svg "octicon-issue-closed"}}{{end}} {{.locale.Tr "repo.issues.closed_title"}}</div> + <div class="ui red label issue-state-label">{{if .Issue.IsPull}}{{svg "octicon-git-pull-request"}}{{else}}{{svg "octicon-issue-closed"}}{{end}} {{ctx.Locale.Tr "repo.issues.closed_title"}}</div> {{else if .Issue.IsPull}} {{if .IsPullWorkInProgress}} - <div class="ui grey label issue-state-label">{{svg "octicon-git-pull-request-draft"}} {{.locale.Tr "repo.issues.draft_title"}}</div> + <div class="ui grey label issue-state-label">{{svg "octicon-git-pull-request-draft"}} {{ctx.Locale.Tr "repo.issues.draft_title"}}</div> {{else}} - <div class="ui green label issue-state-label">{{svg "octicon-git-pull-request"}} {{.locale.Tr "repo.issues.open_title"}}</div> + <div class="ui green label issue-state-label">{{svg "octicon-git-pull-request"}} {{ctx.Locale.Tr "repo.issues.open_title"}}</div> {{end}} {{else}} - <div class="ui green label issue-state-label">{{svg "octicon-issue-opened"}} {{.locale.Tr "repo.issues.open_title"}}</div> + <div class="ui green label issue-state-label">{{svg "octicon-issue-opened"}} {{ctx.Locale.Tr "repo.issues.open_title"}}</div> {{end}} <div class="gt-ml-3"> {{if .Issue.IsPull}} @@ -47,7 +47,7 @@ {{if .HeadBranchLink}} {{$headHref = printf `<a href="%s">%s</a>` (.HeadBranchLink | Escape) $headHref}} {{end}} - {{$headHref = printf `%s <button class="btn interact-fg" data-tooltip-content="%s" data-clipboard-text="%s">%s</button>` $headHref (.locale.Tr "copy_branch") (.HeadTarget | Escape) (svg "octicon-copy" 14)}} + {{$headHref = printf `%s <button class="btn interact-fg" data-tooltip-content="%s" data-clipboard-text="%s">%s</button>` $headHref (ctx.Locale.Tr "copy_branch") (.HeadTarget | Escape) (svg "octicon-copy" 14)}} {{$baseHref := .BaseTarget|Escape}} {{if .BaseBranchLink}} {{$baseHref = printf `<a href="%s">%s</a>` (.BaseBranchLink | Escape) $baseHref}} @@ -56,36 +56,36 @@ {{$mergedStr:= TimeSinceUnix .Issue.PullRequest.MergedUnix $.locale}} {{if .Issue.OriginalAuthor}} {{.Issue.OriginalAuthor}} - <span class="pull-desc">{{$.locale.Tr "repo.pulls.merged_title_desc" .NumCommits $headHref $baseHref $mergedStr | Safe}}</span> + <span class="pull-desc">{{ctx.Locale.Tr "repo.pulls.merged_title_desc" .NumCommits $headHref $baseHref $mergedStr | Safe}}</span> {{else}} <a {{if gt .Issue.PullRequest.Merger.ID 0}}href="{{.Issue.PullRequest.Merger.HomeLink}}"{{end}}>{{.Issue.PullRequest.Merger.GetDisplayName}}</a> - <span class="pull-desc">{{$.locale.Tr "repo.pulls.merged_title_desc" .NumCommits $headHref $baseHref $mergedStr | Safe}}</span> + <span class="pull-desc">{{ctx.Locale.Tr "repo.pulls.merged_title_desc" .NumCommits $headHref $baseHref $mergedStr | Safe}}</span> {{end}} {{else}} {{if .Issue.OriginalAuthor}} - <span id="pull-desc" class="pull-desc">{{.Issue.OriginalAuthor}} {{$.locale.Tr "repo.pulls.title_desc" .NumCommits $headHref $baseHref | Safe}}</span> + <span id="pull-desc" class="pull-desc">{{.Issue.OriginalAuthor}} {{ctx.Locale.Tr "repo.pulls.title_desc" .NumCommits $headHref $baseHref | Safe}}</span> {{else}} <span id="pull-desc" class="pull-desc"> <a {{if gt .Issue.Poster.ID 0}}href="{{.Issue.Poster.HomeLink}}"{{end}}>{{.Issue.Poster.GetDisplayName}}</a> - {{$.locale.Tr "repo.pulls.title_desc" .NumCommits $headHref $baseHref | Safe}} + {{ctx.Locale.Tr "repo.pulls.title_desc" .NumCommits $headHref $baseHref | Safe}} </span> {{end}} <span id="pull-desc-edit" class="gt-hidden flex-text-block"> <div class="ui floating filter dropdown"> <div class="ui basic small button gt-mr-0"> - <span class="text">{{.locale.Tr "repo.pulls.compare_compare"}}: {{$.HeadTarget}}</span> + <span class="text">{{ctx.Locale.Tr "repo.pulls.compare_compare"}}: {{$.HeadTarget}}</span> </div> </div> {{svg "octicon-arrow-right"}} - <div class="ui floating filter dropdown" data-no-results="{{.locale.Tr "repo.pulls.no_results"}}"> + <div class="ui floating filter dropdown" data-no-results="{{ctx.Locale.Tr "repo.pulls.no_results"}}"> <div class="ui basic small button"> - <span class="text" id="pull-target-branch" data-basename="{{$.BaseName}}" data-branch="{{$.BaseBranch}}">{{.locale.Tr "repo.pulls.compare_base"}}: {{$.BaseName}}:{{$.BaseBranch}}</span> + <span class="text" id="pull-target-branch" data-basename="{{$.BaseName}}" data-branch="{{$.BaseBranch}}">{{ctx.Locale.Tr "repo.pulls.compare_base"}}: {{$.BaseName}}:{{$.BaseBranch}}</span> {{svg "octicon-triangle-down" 14 "dropdown icon"}} </div> <div class="menu"> <div class="ui icon search input"> <i class="icon">{{svg "octicon-filter" 16}}</i> - <input name="search" placeholder="{{.locale.Tr "repo.pulls.filter_branch"}}..."> + <input name="search" placeholder="{{ctx.Locale.Tr "repo.pulls.filter_branch"}}..."> </div> <div class="scrolling menu" id="branch-select"> {{range .Branches}} @@ -104,14 +104,14 @@ {{$createdStr:= TimeSinceUnix .Issue.CreatedUnix $.locale}} <span class="time-desc"> {{if .Issue.OriginalAuthor}} - {{$.locale.Tr "repo.issues.opened_by_fake" $createdStr (.Issue.OriginalAuthor|Escape) | Safe}} + {{ctx.Locale.Tr "repo.issues.opened_by_fake" $createdStr (.Issue.OriginalAuthor|Escape) | Safe}} {{else if gt .Issue.Poster.ID 0}} - {{$.locale.Tr "repo.issues.opened_by" $createdStr (.Issue.Poster.HomeLink|Escape) (.Issue.Poster.GetDisplayName|Escape) | Safe}} + {{ctx.Locale.Tr "repo.issues.opened_by" $createdStr (.Issue.Poster.HomeLink|Escape) (.Issue.Poster.GetDisplayName|Escape) | Safe}} {{else}} - {{$.locale.Tr "repo.issues.opened_by_fake" $createdStr (.Issue.Poster.GetDisplayName|Escape) | Safe}} + {{ctx.Locale.Tr "repo.issues.opened_by_fake" $createdStr (.Issue.Poster.GetDisplayName|Escape) | Safe}} {{end}} · - {{$.locale.TrN .Issue.NumComments "repo.issues.num_comments_1" "repo.issues.num_comments" .Issue.NumComments}} + {{ctx.Locale.TrN .Issue.NumComments "repo.issues.num_comments_1" "repo.issues.num_comments" .Issue.NumComments}} </span> {{end}} </div> diff --git a/templates/repo/migrate/codebase.tmpl b/templates/repo/migrate/codebase.tmpl index 394e7c2ecf..62dfbd5c85 100644 --- a/templates/repo/migrate/codebase.tmpl +++ b/templates/repo/migrate/codebase.tmpl @@ -6,25 +6,25 @@ {{template "base/disable_form_autofill"}} {{.CsrfTokenHtml}} <h3 class="ui top attached header"> - {{.locale.Tr "repo.migrate.migrate" .service.Title}} + {{ctx.Locale.Tr "repo.migrate.migrate" .service.Title}} <input id="service_type" type="hidden" name="service" value="{{.service}}"> </h3> <div class="ui attached segment"> {{template "base/alert" .}} <div class="inline required field {{if .Err_CloneAddr}}error{{end}}"> - <label for="clone_addr">{{.locale.Tr "repo.migrate.clone_address"}}</label> + <label for="clone_addr">{{ctx.Locale.Tr "repo.migrate.clone_address"}}</label> <input id="clone_addr" name="clone_addr" value="{{.clone_addr}}" autofocus required> <span class="help"> - {{.locale.Tr "repo.migrate.clone_address_desc"}}{{if .ContextUser.CanImportLocal}} {{.locale.Tr "repo.migrate.clone_local_path"}}{{end}} + {{ctx.Locale.Tr "repo.migrate.clone_address_desc"}}{{if .ContextUser.CanImportLocal}} {{.locale.Tr "repo.migrate.clone_local_path"}}{{end}} </span> </div> <div class="inline field {{if .Err_Auth}}error{{end}}"> - <label for="auth_username">{{.locale.Tr "username"}}</label> + <label for="auth_username">{{ctx.Locale.Tr "username"}}</label> <input id="auth_username" name="auth_username" value="{{.auth_username}}" {{if not .auth_username}}data-need-clear="true"{{end}}> </div> <div class="inline field {{if .Err_Auth}}error{{end}}"> - <label for="auth_password">{{.locale.Tr "password"}}</label> + <label for="auth_password">{{ctx.Locale.Tr "password"}}</label> <input id="auth_password" name="auth_password" type="password" value="{{.auth_password}}"> </div> @@ -32,25 +32,25 @@ <div id="migrate_items"> <div class="inline field"> - <label>{{.locale.Tr "repo.migrate_items"}}</label> + <label>{{ctx.Locale.Tr "repo.migrate_items"}}</label> <div class="ui checkbox"> <input name="milestones" type="checkbox" {{if .milestones}}checked{{end}}> - <label>{{.locale.Tr "repo.migrate_items_milestones" | Safe}}</label> + <label>{{ctx.Locale.Tr "repo.migrate_items_milestones" | Safe}}</label> </div> <div class="ui checkbox"> <input name="labels" type="checkbox" {{if .labels}}checked{{end}}> - <label>{{.locale.Tr "repo.migrate_items_labels" | Safe}}</label> + <label>{{ctx.Locale.Tr "repo.migrate_items_labels" | Safe}}</label> </div> </div> <div class="inline field"> <label></label> <div class="ui checkbox"> <input name="issues" type="checkbox" {{if .issues}}checked{{end}}> - <label>{{.locale.Tr "repo.migrate_items_issues" | Safe}}</label> + <label>{{ctx.Locale.Tr "repo.migrate_items_issues" | Safe}}</label> </div> <div class="ui checkbox"> <input name="pull_requests" type="checkbox" {{if .pull_requests}}checked{{end}}> - <label>{{.locale.Tr "repo.migrate_items_merge_requests" | Safe}}</label> + <label>{{ctx.Locale.Tr "repo.migrate_items_merge_requests" | Safe}}</label> </div> </div> </div> @@ -58,7 +58,7 @@ <div class="divider"></div> <div class="inline required field {{if .Err_Owner}}error{{end}}"> - <label>{{.locale.Tr "repo.owner"}}</label> + <label>{{ctx.Locale.Tr "repo.owner"}}</label> <div class="ui selection owner dropdown"> <input type="hidden" id="uid" name="uid" value="{{.ContextUser.ID}}" required> <span class="text truncated-item-container" title="{{.ContextUser.Name}}"> @@ -82,30 +82,30 @@ </div> <div class="inline required field {{if .Err_RepoName}}error{{end}}"> - <label for="repo_name">{{.locale.Tr "repo.repo_name"}}</label> + <label for="repo_name">{{ctx.Locale.Tr "repo.repo_name"}}</label> <input id="repo_name" name="repo_name" value="{{.repo_name}}" required maxlength="100"> </div> <div class="inline field"> - <label>{{.locale.Tr "repo.visibility"}}</label> + <label>{{ctx.Locale.Tr "repo.visibility"}}</label> <div class="ui checkbox"> {{if .IsForcedPrivate}} <input name="private" type="checkbox" checked readonly> - <label>{{.locale.Tr "repo.visibility_helper_forced" | Safe}}</label> + <label>{{ctx.Locale.Tr "repo.visibility_helper_forced" | Safe}}</label> {{else}} <input name="private" type="checkbox" {{if .private}}checked{{end}}> - <label>{{.locale.Tr "repo.visibility_helper" | Safe}}</label> + <label>{{ctx.Locale.Tr "repo.visibility_helper" | Safe}}</label> {{end}} </div> </div> <div class="inline field {{if .Err_Description}}error{{end}}"> - <label for="description">{{.locale.Tr "repo.repo_desc"}}</label> + <label for="description">{{ctx.Locale.Tr "repo.repo_desc"}}</label> <textarea id="description" name="description" maxlength="2048">{{.description}}</textarea> </div> <div class="inline field"> <label></label> <button class="ui primary button"> - {{.locale.Tr "repo.migrate_repo"}} + {{ctx.Locale.Tr "repo.migrate_repo"}} </button> </div> </div> diff --git a/templates/repo/migrate/git.tmpl b/templates/repo/migrate/git.tmpl index 1e449ae30e..352362854f 100644 --- a/templates/repo/migrate/git.tmpl +++ b/templates/repo/migrate/git.tmpl @@ -6,24 +6,24 @@ {{template "base/disable_form_autofill"}} {{.CsrfTokenHtml}} <h3 class="ui top attached header"> - {{.locale.Tr "repo.migrate.migrate" .service.Title}} + {{ctx.Locale.Tr "repo.migrate.migrate" .service.Title}} <input id="service_type" type="hidden" name="service" value="{{.service}}"> </h3> <div class="ui attached segment"> {{template "base/alert" .}} <div class="inline required field {{if .Err_CloneAddr}}error{{end}}"> - <label for="clone_addr">{{.locale.Tr "repo.migrate.clone_address"}}</label> + <label for="clone_addr">{{ctx.Locale.Tr "repo.migrate.clone_address"}}</label> <input id="clone_addr" name="clone_addr" value="{{.clone_addr}}" autofocus required> <span class="help"> - {{.locale.Tr "repo.migrate.clone_address_desc"}}{{if .ContextUser.CanImportLocal}} {{.locale.Tr "repo.migrate.clone_local_path"}}{{end}} + {{ctx.Locale.Tr "repo.migrate.clone_address_desc"}}{{if .ContextUser.CanImportLocal}} {{.locale.Tr "repo.migrate.clone_local_path"}}{{end}} </span> </div> <div class="inline field {{if .Err_Auth}}error{{end}}"> - <label for="auth_username">{{.locale.Tr "username"}}</label> + <label for="auth_username">{{ctx.Locale.Tr "username"}}</label> <input id="auth_username" name="auth_username" value="{{.auth_username}}" {{if not .auth_username}}data-need-clear="true"{{end}}> </div> <div class="inline field {{if .Err_Auth}}error{{end}}"> - <label for="auth_password">{{.locale.Tr "password"}}</label> + <label for="auth_password">{{ctx.Locale.Tr "password"}}</label> <input id="auth_password" name="auth_password" type="password" value="{{.auth_password}}"> </div> @@ -32,7 +32,7 @@ <div class="divider"></div> <div class="inline required field {{if .Err_Owner}}error{{end}}"> - <label>{{.locale.Tr "repo.owner"}}</label> + <label>{{ctx.Locale.Tr "repo.owner"}}</label> <div class="ui selection owner dropdown"> <input type="hidden" id="uid" name="uid" value="{{.ContextUser.ID}}" required> <span class="text truncated-item-container" title="{{.ContextUser.Name}}"> @@ -56,30 +56,30 @@ </div> <div class="inline required field {{if .Err_RepoName}}error{{end}}"> - <label for="repo_name">{{.locale.Tr "repo.repo_name"}}</label> + <label for="repo_name">{{ctx.Locale.Tr "repo.repo_name"}}</label> <input id="repo_name" name="repo_name" value="{{.repo_name}}" required maxlength="100"> </div> <div class="inline field"> - <label>{{.locale.Tr "repo.visibility"}}</label> + <label>{{ctx.Locale.Tr "repo.visibility"}}</label> <div class="ui checkbox"> {{if .IsForcedPrivate}} <input name="private" type="checkbox" checked readonly> - <label>{{.locale.Tr "repo.visibility_helper_forced" | Safe}}</label> + <label>{{ctx.Locale.Tr "repo.visibility_helper_forced" | Safe}}</label> {{else}} <input name="private" type="checkbox" {{if .private}}checked{{end}}> - <label>{{.locale.Tr "repo.visibility_helper" | Safe}}</label> + <label>{{ctx.Locale.Tr "repo.visibility_helper" | Safe}}</label> {{end}} </div> </div> <div class="inline field {{if .Err_Description}}error{{end}}"> - <label for="description">{{.locale.Tr "repo.repo_desc"}}</label> + <label for="description">{{ctx.Locale.Tr "repo.repo_desc"}}</label> <textarea id="description" name="description" maxlength="2048">{{.description}}</textarea> </div> <div class="inline field"> <label></label> <button class="ui primary button"> - {{.locale.Tr "repo.migrate_repo"}} + {{ctx.Locale.Tr "repo.migrate_repo"}} </button> </div> </div> diff --git a/templates/repo/migrate/gitbucket.tmpl b/templates/repo/migrate/gitbucket.tmpl index aa269e561c..c631ee788f 100644 --- a/templates/repo/migrate/gitbucket.tmpl +++ b/templates/repo/migrate/gitbucket.tmpl @@ -6,67 +6,67 @@ {{template "base/disable_form_autofill"}} {{.CsrfTokenHtml}} <h3 class="ui top attached header"> - {{.locale.Tr "repo.migrate.migrate" .service.Title}} + {{ctx.Locale.Tr "repo.migrate.migrate" .service.Title}} <input id="service_type" type="hidden" name="service" value="{{.service}}"> </h3> <div class="ui attached segment"> {{template "base/alert" .}} <div class="inline required field {{if .Err_CloneAddr}}error{{end}}"> - <label for="clone_addr">{{.locale.Tr "repo.migrate.clone_address"}}</label> + <label for="clone_addr">{{ctx.Locale.Tr "repo.migrate.clone_address"}}</label> <input id="clone_addr" name="clone_addr" value="{{.clone_addr}}" autofocus required> <span class="help"> - {{.locale.Tr "repo.migrate.clone_address_desc"}}{{if .ContextUser.CanImportLocal}} {{.locale.Tr "repo.migrate.clone_local_path"}}{{end}} + {{ctx.Locale.Tr "repo.migrate.clone_address_desc"}}{{if .ContextUser.CanImportLocal}} {{.locale.Tr "repo.migrate.clone_local_path"}}{{end}} </span> </div> <div class="inline field {{if .Err_Auth}}error{{end}}"> - <label for="auth_username">{{.locale.Tr "username"}}</label> + <label for="auth_username">{{ctx.Locale.Tr "username"}}</label> <input id="auth_username" name="auth_username" value="{{.auth_username}}" {{if not .auth_username}}data-need-clear="true"{{end}}> </div> <div class="inline field {{if .Err_Auth}}error{{end}}"> - <label for="auth_password">{{.locale.Tr "password"}}</label> + <label for="auth_password">{{ctx.Locale.Tr "password"}}</label> <input id="auth_password" name="auth_password" type="password" value="{{.auth_password}}"> </div> {{template "repo/migrate/options" .}} <div class="inline field"> - <label>{{.locale.Tr "repo.migrate_items"}}</label> + <label>{{ctx.Locale.Tr "repo.migrate_items"}}</label> <div class="ui checkbox"> <input name="wiki" type="checkbox" {{if .wiki}}checked{{end}}> - <label>{{.locale.Tr "repo.migrate_items_wiki" | Safe}}</label> + <label>{{ctx.Locale.Tr "repo.migrate_items_wiki" | Safe}}</label> </div> </div> <div id="migrate_items"> - <span class="help">{{.locale.Tr "repo.migrate.migrate_items_options"}}</span> + <span class="help">{{ctx.Locale.Tr "repo.migrate.migrate_items_options"}}</span> <div class="inline field"> <label></label> <div class="ui checkbox"> <input name="labels" type="checkbox" {{if .labels}}checked{{end}}> - <label>{{.locale.Tr "repo.migrate_items_labels" | Safe}}</label> + <label>{{ctx.Locale.Tr "repo.migrate_items_labels" | Safe}}</label> </div> <div class="ui checkbox"> <input name="issues" type="checkbox" {{if .issues}}checked{{end}}> - <label>{{.locale.Tr "repo.migrate_items_issues" | Safe}}</label> + <label>{{ctx.Locale.Tr "repo.migrate_items_issues" | Safe}}</label> </div> </div> <div class="inline field"> <label></label> <div class="ui checkbox"> <input name="pull_requests" type="checkbox" {{if .pull_requests}}checked{{end}}> - <label>{{.locale.Tr "repo.migrate_items_pullrequests" | Safe}}</label> + <label>{{ctx.Locale.Tr "repo.migrate_items_pullrequests" | Safe}}</label> </div> <div class="ui checkbox"> <input name="releases" type="checkbox" {{if .releases}}checked{{end}}> - <label>{{.locale.Tr "repo.migrate_items_releases" | Safe}}</label> + <label>{{ctx.Locale.Tr "repo.migrate_items_releases" | Safe}}</label> </div> </div> <div class="inline field"> <label></label> <div class="ui checkbox"> <input name="milestones" type="checkbox" {{if .milestones}}checked{{end}}> - <label>{{.locale.Tr "repo.migrate_items_milestones" | Safe}}</label> + <label>{{ctx.Locale.Tr "repo.migrate_items_milestones" | Safe}}</label> </div> </div> </div> @@ -74,7 +74,7 @@ <div class="divider"></div> <div class="inline required field {{if .Err_Owner}}error{{end}}"> - <label>{{.locale.Tr "repo.owner"}}</label> + <label>{{ctx.Locale.Tr "repo.owner"}}</label> <div class="ui selection owner dropdown"> <input type="hidden" id="uid" name="uid" value="{{.ContextUser.ID}}" required> <span class="text truncated-item-container" title="{{.ContextUser.Name}}"> @@ -98,30 +98,30 @@ </div> <div class="inline required field {{if .Err_RepoName}}error{{end}}"> - <label for="repo_name">{{.locale.Tr "repo.repo_name"}}</label> + <label for="repo_name">{{ctx.Locale.Tr "repo.repo_name"}}</label> <input id="repo_name" name="repo_name" value="{{.repo_name}}" required maxlength="100"> </div> <div class="inline field"> - <label>{{.locale.Tr "repo.visibility"}}</label> + <label>{{ctx.Locale.Tr "repo.visibility"}}</label> <div class="ui checkbox"> {{if .IsForcedPrivate}} <input name="private" type="checkbox" checked readonly> - <label>{{.locale.Tr "repo.visibility_helper_forced" | Safe}}</label> + <label>{{ctx.Locale.Tr "repo.visibility_helper_forced" | Safe}}</label> {{else}} <input name="private" type="checkbox" {{if .private}}checked{{end}}> - <label>{{.locale.Tr "repo.visibility_helper" | Safe}}</label> + <label>{{ctx.Locale.Tr "repo.visibility_helper" | Safe}}</label> {{end}} </div> </div> <div class="inline field {{if .Err_Description}}error{{end}}"> - <label for="description">{{.locale.Tr "repo.repo_desc"}}</label> + <label for="description">{{ctx.Locale.Tr "repo.repo_desc"}}</label> <textarea id="description" name="description" maxlength="2048">{{.description}}</textarea> </div> <div class="inline field"> <label></label> <button class="ui primary button"> - {{.locale.Tr "repo.migrate_repo"}} + {{ctx.Locale.Tr "repo.migrate_repo"}} </button> </div> </div> diff --git a/templates/repo/migrate/gitea.tmpl b/templates/repo/migrate/gitea.tmpl index e4d8c62734..f71287de66 100644 --- a/templates/repo/migrate/gitea.tmpl +++ b/templates/repo/migrate/gitea.tmpl @@ -5,21 +5,21 @@ <form class="ui form" action="{{.Link}}" method="post"> {{.CsrfTokenHtml}} <h3 class="ui top attached header"> - {{.locale.Tr "repo.migrate.migrate" .service.Title}} + {{ctx.Locale.Tr "repo.migrate.migrate" .service.Title}} <input id="service_type" type="hidden" name="service" value="{{.service}}"> </h3> <div class="ui attached segment"> {{template "base/alert" .}} <div class="inline required field {{if .Err_CloneAddr}}error{{end}}"> - <label for="clone_addr">{{.locale.Tr "repo.migrate.clone_address"}}</label> + <label for="clone_addr">{{ctx.Locale.Tr "repo.migrate.clone_address"}}</label> <input id="clone_addr" name="clone_addr" value="{{.clone_addr}}" autofocus required> <span class="help"> - {{.locale.Tr "repo.migrate.clone_address_desc"}}{{if .ContextUser.CanImportLocal}} {{.locale.Tr "repo.migrate.clone_local_path"}}{{end}} + {{ctx.Locale.Tr "repo.migrate.clone_address_desc"}}{{if .ContextUser.CanImportLocal}} {{.locale.Tr "repo.migrate.clone_local_path"}}{{end}} </span> </div> <div class="inline field {{if .Err_Auth}}error{{end}}"> - <label for="auth_token">{{.locale.Tr "access_token"}}</label> + <label for="auth_token">{{ctx.Locale.Tr "access_token"}}</label> <input id="auth_token" name="auth_token" type="password" autocomplete="new-password" value="{{.auth_token}}" {{if not .auth_token}} data-need-clear="true" {{end}}> <a target="_blank" href="https://docs.gitea.com/development/api-usage">{{svg "octicon-question"}}</a> </div> @@ -27,42 +27,42 @@ {{template "repo/migrate/options" .}} <div class="inline field"> - <label>{{.locale.Tr "repo.migrate_items"}}</label> + <label>{{ctx.Locale.Tr "repo.migrate_items"}}</label> <div class="ui checkbox"> <input name="wiki" type="checkbox" {{if .wiki}} checked{{end}}> - <label>{{.locale.Tr "repo.migrate_items_wiki" | Safe}}</label> + <label>{{ctx.Locale.Tr "repo.migrate_items_wiki" | Safe}}</label> </div> </div> <div id="migrate_items"> - <span class="help">{{.locale.Tr "repo.migrate.migrate_items_options"}}</span> + <span class="help">{{ctx.Locale.Tr "repo.migrate.migrate_items_options"}}</span> <div class="inline field"> <label></label> <div class="ui checkbox"> <input name="labels" type="checkbox" {{if .labels}} checked{{end}}> - <label>{{.locale.Tr "repo.migrate_items_labels" | Safe}}</label> + <label>{{ctx.Locale.Tr "repo.migrate_items_labels" | Safe}}</label> </div> <div class="ui checkbox"> <input name="issues" type="checkbox" {{if .issues}} checked{{end}}> - <label>{{.locale.Tr "repo.migrate_items_issues" | Safe}}</label> + <label>{{ctx.Locale.Tr "repo.migrate_items_issues" | Safe}}</label> </div> </div> <div class="inline field"> <label></label> <div class="ui checkbox"> <input name="pull_requests" type="checkbox" {{if .pull_requests}} checked{{end}}> - <label>{{.locale.Tr "repo.migrate_items_pullrequests" | Safe}}</label> + <label>{{ctx.Locale.Tr "repo.migrate_items_pullrequests" | Safe}}</label> </div> <div class="ui checkbox"> <input name="releases" type="checkbox" {{if .releases}} checked{{end}}> - <label>{{.locale.Tr "repo.migrate_items_releases" | Safe}}</label> + <label>{{ctx.Locale.Tr "repo.migrate_items_releases" | Safe}}</label> </div> </div> <div class="inline field"> <label></label> <div class="ui checkbox"> <input name="milestones" type="checkbox" {{if .milestones}} checked{{end}}> - <label>{{.locale.Tr "repo.migrate_items_milestones" | Safe}}</label> + <label>{{ctx.Locale.Tr "repo.migrate_items_milestones" | Safe}}</label> </div> </div> </div> @@ -70,7 +70,7 @@ <div class="divider"></div> <div class="inline required field {{if .Err_Owner}}error{{end}}"> - <label>{{.locale.Tr "repo.owner"}}</label> + <label>{{ctx.Locale.Tr "repo.owner"}}</label> <div class="ui selection owner dropdown"> <input type="hidden" id="uid" name="uid" value="{{.ContextUser.ID}}" required> <span class="text truncated-item-container" title="{{.ContextUser.Name}}"> @@ -94,30 +94,30 @@ </div> <div class="inline required field {{if .Err_RepoName}}error{{end}}"> - <label for="repo_name">{{.locale.Tr "repo.repo_name"}}</label> + <label for="repo_name">{{ctx.Locale.Tr "repo.repo_name"}}</label> <input id="repo_name" name="repo_name" value="{{.repo_name}}" required maxlength="100"> </div> <div class="inline field"> - <label>{{.locale.Tr "repo.visibility"}}</label> + <label>{{ctx.Locale.Tr "repo.visibility"}}</label> <div class="ui checkbox"> {{if .IsForcedPrivate}} <input name="private" type="checkbox" checked readonly> - <label>{{.locale.Tr "repo.visibility_helper_forced" | Safe}}</label> + <label>{{ctx.Locale.Tr "repo.visibility_helper_forced" | Safe}}</label> {{else}} <input name="private" type="checkbox" {{if .private}} checked{{end}}> - <label>{{.locale.Tr "repo.visibility_helper" | Safe}}</label> + <label>{{ctx.Locale.Tr "repo.visibility_helper" | Safe}}</label> {{end}} </div> </div> <div class="inline field {{if .Err_Description}}error{{end}}"> - <label for="description">{{.locale.Tr "repo.repo_desc"}}</label> + <label for="description">{{ctx.Locale.Tr "repo.repo_desc"}}</label> <textarea id="description" name="description" maxlength="2048">{{.description}}</textarea> </div> <div class="inline field"> <label></label> <button class="ui primary button"> - {{.locale.Tr "repo.migrate_repo"}} + {{ctx.Locale.Tr "repo.migrate_repo"}} </button> </div> </div> diff --git a/templates/repo/migrate/github.tmpl b/templates/repo/migrate/github.tmpl index d3f0e0b8bd..07f8216fcb 100644 --- a/templates/repo/migrate/github.tmpl +++ b/templates/repo/migrate/github.tmpl @@ -5,66 +5,66 @@ <form class="ui form" action="{{.Link}}" method="post"> {{.CsrfTokenHtml}} <h3 class="ui top attached header"> - {{.locale.Tr "repo.migrate.migrate" .service.Title}} + {{ctx.Locale.Tr "repo.migrate.migrate" .service.Title}} <input id="service_type" type="hidden" name="service" value="{{.service}}"> </h3> <div class="ui attached segment"> {{template "base/alert" .}} <div class="inline required field {{if .Err_CloneAddr}}error{{end}}"> - <label for="clone_addr">{{.locale.Tr "repo.migrate.clone_address"}}</label> + <label for="clone_addr">{{ctx.Locale.Tr "repo.migrate.clone_address"}}</label> <input id="clone_addr" name="clone_addr" value="{{.clone_addr}}" autofocus required> <span class="help"> - {{.locale.Tr "repo.migrate.clone_address_desc"}} + {{ctx.Locale.Tr "repo.migrate.clone_address_desc"}} </span> </div> <div class="inline field {{if .Err_Auth}}error{{end}}"> - <label for="auth_token">{{.locale.Tr "access_token"}}</label> + <label for="auth_token">{{ctx.Locale.Tr "access_token"}}</label> <input id="auth_token" name="auth_token" type="password" autocomplete="new-password" value="{{.auth_token}}" {{if not .auth_token}}data-need-clear="true"{{end}}> <a target="_blank" href="https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token">{{svg "octicon-question"}}</a> <span class="help"> - {{.locale.Tr "repo.migrate.github_token_desc"}} + {{ctx.Locale.Tr "repo.migrate.github_token_desc"}} </span> </div> {{template "repo/migrate/options" .}} <div class="inline field"> - <label>{{.locale.Tr "repo.migrate_items"}}</label> + <label>{{ctx.Locale.Tr "repo.migrate_items"}}</label> <div class="ui checkbox"> <input name="wiki" type="checkbox" {{if .wiki}}checked{{end}}> - <label>{{.locale.Tr "repo.migrate_items_wiki" | Safe}}</label> + <label>{{ctx.Locale.Tr "repo.migrate_items_wiki" | Safe}}</label> </div> </div> <div id="migrate_items"> - <span class="help">{{.locale.Tr "repo.migrate.migrate_items_options"}}</span> + <span class="help">{{ctx.Locale.Tr "repo.migrate.migrate_items_options"}}</span> <div class="inline field"> <label></label> <div class="ui checkbox"> <input name="labels" type="checkbox" {{if .labels}}checked{{end}}> - <label>{{.locale.Tr "repo.migrate_items_labels" | Safe}}</label> + <label>{{ctx.Locale.Tr "repo.migrate_items_labels" | Safe}}</label> </div> <div class="ui checkbox"> <input name="issues" type="checkbox" {{if .issues}}checked{{end}}> - <label>{{.locale.Tr "repo.migrate_items_issues" | Safe}}</label> + <label>{{ctx.Locale.Tr "repo.migrate_items_issues" | Safe}}</label> </div> </div> <div class="inline field"> <label></label> <div class="ui checkbox"> <input name="pull_requests" type="checkbox" {{if .pull_requests}}checked{{end}}> - <label>{{.locale.Tr "repo.migrate_items_pullrequests" | Safe}}</label> + <label>{{ctx.Locale.Tr "repo.migrate_items_pullrequests" | Safe}}</label> </div> <div class="ui checkbox"> <input name="releases" type="checkbox" {{if .releases}}checked{{end}}> - <label>{{.locale.Tr "repo.migrate_items_releases" | Safe}}</label> + <label>{{ctx.Locale.Tr "repo.migrate_items_releases" | Safe}}</label> </div> </div> <div class="inline field"> <label></label> <div class="ui checkbox"> <input name="milestones" type="checkbox" {{if .milestones}}checked{{end}}> - <label>{{.locale.Tr "repo.migrate_items_milestones" | Safe}}</label> + <label>{{ctx.Locale.Tr "repo.migrate_items_milestones" | Safe}}</label> </div> </div> </div> @@ -72,7 +72,7 @@ <div class="divider"></div> <div class="inline required field {{if .Err_Owner}}error{{end}}"> - <label>{{.locale.Tr "repo.owner"}}</label> + <label>{{ctx.Locale.Tr "repo.owner"}}</label> <div class="ui selection owner dropdown"> <input type="hidden" id="uid" name="uid" value="{{.ContextUser.ID}}" required> <span class="text truncated-item-container" title="{{.ContextUser.Name}}"> @@ -96,30 +96,30 @@ </div> <div class="inline required field {{if .Err_RepoName}}error{{end}}"> - <label for="repo_name">{{.locale.Tr "repo.repo_name"}}</label> + <label for="repo_name">{{ctx.Locale.Tr "repo.repo_name"}}</label> <input id="repo_name" name="repo_name" value="{{.repo_name}}" required maxlength="100"> </div> <div class="inline field"> - <label>{{.locale.Tr "repo.visibility"}}</label> + <label>{{ctx.Locale.Tr "repo.visibility"}}</label> <div class="ui checkbox"> {{if .IsForcedPrivate}} <input name="private" type="checkbox" checked readonly> - <label>{{.locale.Tr "repo.visibility_helper_forced" | Safe}}</label> + <label>{{ctx.Locale.Tr "repo.visibility_helper_forced" | Safe}}</label> {{else}} <input name="private" type="checkbox" {{if .private}}checked{{end}}> - <label>{{.locale.Tr "repo.visibility_helper" | Safe}}</label> + <label>{{ctx.Locale.Tr "repo.visibility_helper" | Safe}}</label> {{end}} </div> </div> <div class="inline field {{if .Err_Description}}error{{end}}"> - <label for="description">{{.locale.Tr "repo.repo_desc"}}</label> + <label for="description">{{ctx.Locale.Tr "repo.repo_desc"}}</label> <textarea id="description" name="description" maxlength="2048">{{.description}}</textarea> </div> <div class="inline field"> <label></label> <button class="ui primary button"> - {{.locale.Tr "repo.migrate_repo"}} + {{ctx.Locale.Tr "repo.migrate_repo"}} </button> </div> </div> diff --git a/templates/repo/migrate/gitlab.tmpl b/templates/repo/migrate/gitlab.tmpl index e055cce19e..911fd1a17b 100644 --- a/templates/repo/migrate/gitlab.tmpl +++ b/templates/repo/migrate/gitlab.tmpl @@ -5,21 +5,21 @@ <form class="ui form" action="{{.Link}}" method="post"> {{.CsrfTokenHtml}} <h3 class="ui top attached header"> - {{.locale.Tr "repo.migrate.migrate" .service.Title}} + {{ctx.Locale.Tr "repo.migrate.migrate" .service.Title}} <input id="service_type" type="hidden" name="service" value="{{.service}}"> </h3> <div class="ui attached segment"> {{template "base/alert" .}} <div class="inline required field {{if .Err_CloneAddr}}error{{end}}"> - <label for="clone_addr">{{.locale.Tr "repo.migrate.clone_address"}}</label> + <label for="clone_addr">{{ctx.Locale.Tr "repo.migrate.clone_address"}}</label> <input id="clone_addr" name="clone_addr" value="{{.clone_addr}}" autofocus required> <span class="help"> - {{.locale.Tr "repo.migrate.clone_address_desc"}}{{if .ContextUser.CanImportLocal}} {{.locale.Tr "repo.migrate.clone_local_path"}}{{end}} + {{ctx.Locale.Tr "repo.migrate.clone_address_desc"}}{{if .ContextUser.CanImportLocal}} {{.locale.Tr "repo.migrate.clone_local_path"}}{{end}} </span> </div> <div class="inline field {{if .Err_Auth}}error{{end}}"> - <label for="auth_token">{{.locale.Tr "access_token"}}</label> + <label for="auth_token">{{ctx.Locale.Tr "access_token"}}</label> <input id="auth_token" name="auth_token" type="password" autocomplete="new-password" value="{{.auth_token}}" {{if not .auth_token}}data-need-clear="true"{{end}}> <a target="_blank" href="https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html">{{svg "octicon-question"}}</a> </div> @@ -27,41 +27,41 @@ {{template "repo/migrate/options" .}} <div class="inline field"> - <label>{{.locale.Tr "repo.migrate_items"}}</label> + <label>{{ctx.Locale.Tr "repo.migrate_items"}}</label> <div class="ui checkbox"> <input name="wiki" type="checkbox" {{if .wiki}}checked{{end}}> - <label>{{.locale.Tr "repo.migrate_items_wiki" | Safe}}</label> + <label>{{ctx.Locale.Tr "repo.migrate_items_wiki" | Safe}}</label> </div> </div> <div id="migrate_items"> - <span class="help">{{.locale.Tr "repo.migrate.migrate_items_options"}}</span> + <span class="help">{{ctx.Locale.Tr "repo.migrate.migrate_items_options"}}</span> <div class="inline field"> <label></label> <div class="ui checkbox"> <input name="labels" type="checkbox" {{if .labels}}checked{{end}}> - <label>{{.locale.Tr "repo.migrate_items_labels" | Safe}}</label> + <label>{{ctx.Locale.Tr "repo.migrate_items_labels" | Safe}}</label> </div> <div class="ui checkbox"> <input name="issues" type="checkbox" {{if .issues}}checked{{end}}> - <label>{{.locale.Tr "repo.migrate_items_issues" | Safe}}</label> + <label>{{ctx.Locale.Tr "repo.migrate_items_issues" | Safe}}</label> </div> </div> <div class="inline field"> <label></label> <div class="ui checkbox"> <input name="pull_requests" type="checkbox" {{if .pull_requests}}checked{{end}}> - <label>{{.locale.Tr "repo.migrate_items_merge_requests" | Safe}}</label> + <label>{{ctx.Locale.Tr "repo.migrate_items_merge_requests" | Safe}}</label> </div> <div class="ui checkbox"> <input name="releases" type="checkbox" {{if .releases}}checked{{end}}> - <label>{{.locale.Tr "repo.migrate_items_releases" | Safe}}</label> + <label>{{ctx.Locale.Tr "repo.migrate_items_releases" | Safe}}</label> </div> </div> <div class="inline field"> <label></label> <div class="ui checkbox"> <input name="milestones" type="checkbox" {{if .milestones}}checked{{end}}> - <label>{{.locale.Tr "repo.migrate_items_milestones" | Safe}}</label> + <label>{{ctx.Locale.Tr "repo.migrate_items_milestones" | Safe}}</label> </div> </div> </div> @@ -69,7 +69,7 @@ <div class="divider"></div> <div class="inline required field {{if .Err_Owner}}error{{end}}"> - <label>{{.locale.Tr "repo.owner"}}</label> + <label>{{ctx.Locale.Tr "repo.owner"}}</label> <div class="ui selection owner dropdown"> <input type="hidden" id="uid" name="uid" value="{{.ContextUser.ID}}" required> <span class="text truncated-item-container" title="{{.ContextUser.Name}}"> @@ -93,30 +93,30 @@ </div> <div class="inline required field {{if .Err_RepoName}}error{{end}}"> - <label for="repo_name">{{.locale.Tr "repo.repo_name"}}</label> + <label for="repo_name">{{ctx.Locale.Tr "repo.repo_name"}}</label> <input id="repo_name" name="repo_name" value="{{.repo_name}}" required maxlength="100"> </div> <div class="inline field"> - <label>{{.locale.Tr "repo.visibility"}}</label> + <label>{{ctx.Locale.Tr "repo.visibility"}}</label> <div class="ui checkbox"> {{if .IsForcedPrivate}} <input name="private" type="checkbox" checked readonly> - <label>{{.locale.Tr "repo.visibility_helper_forced" | Safe}}</label> + <label>{{ctx.Locale.Tr "repo.visibility_helper_forced" | Safe}}</label> {{else}} <input name="private" type="checkbox" {{if .private}}checked{{end}}> - <label>{{.locale.Tr "repo.visibility_helper" | Safe}}</label> + <label>{{ctx.Locale.Tr "repo.visibility_helper" | Safe}}</label> {{end}} </div> </div> <div class="inline field {{if .Err_Description}}error{{end}}"> - <label for="description">{{.locale.Tr "repo.repo_desc"}}</label> + <label for="description">{{ctx.Locale.Tr "repo.repo_desc"}}</label> <textarea id="description" name="description" maxlength="2048">{{.description}}</textarea> </div> <div class="inline field"> <label></label> <button class="ui primary button"> - {{.locale.Tr "repo.migrate_repo"}} + {{ctx.Locale.Tr "repo.migrate_repo"}} </button> </div> </div> diff --git a/templates/repo/migrate/gogs.tmpl b/templates/repo/migrate/gogs.tmpl index 2d66800608..529f257585 100644 --- a/templates/repo/migrate/gogs.tmpl +++ b/templates/repo/migrate/gogs.tmpl @@ -5,21 +5,21 @@ <form class="ui form" action="{{.Link}}" method="post"> {{.CsrfTokenHtml}} <h3 class="ui top attached header"> - {{.locale.Tr "repo.migrate.migrate" .service.Title}} + {{ctx.Locale.Tr "repo.migrate.migrate" .service.Title}} <input id="service_type" type="hidden" name="service" value="{{.service}}"> </h3> <div class="ui attached segment"> {{template "base/alert" .}} <div class="inline required field {{if .Err_CloneAddr}}error{{end}}"> - <label for="clone_addr">{{.locale.Tr "repo.migrate.clone_address"}}</label> + <label for="clone_addr">{{ctx.Locale.Tr "repo.migrate.clone_address"}}</label> <input id="clone_addr" name="clone_addr" value="{{.clone_addr}}" autofocus required> <span class="help"> - {{.locale.Tr "repo.migrate.clone_address_desc"}}{{if .ContextUser.CanImportLocal}} {{.locale.Tr "repo.migrate.clone_local_path"}}{{end}} + {{ctx.Locale.Tr "repo.migrate.clone_address_desc"}}{{if .ContextUser.CanImportLocal}} {{.locale.Tr "repo.migrate.clone_local_path"}}{{end}} </span> </div> <div class="inline field {{if .Err_Auth}}error{{end}}"> - <label for="auth_token">{{.locale.Tr "access_token"}}</label> + <label for="auth_token">{{ctx.Locale.Tr "access_token"}}</label> <input id="auth_token" name="auth_token" type="password" autocomplete="new-password" value="{{.auth_token}}" {{if not .auth_token}} data-need-clear="true" {{end}}> <!-- <a target="_blank" href="https://docs.gitea.com/development/api-usage">{{svg "octicon-question"}}</a> --> </div> @@ -27,31 +27,31 @@ {{template "repo/migrate/options" .}} <div class="inline field"> - <label>{{.locale.Tr "repo.migrate_items"}}</label> + <label>{{ctx.Locale.Tr "repo.migrate_items"}}</label> <div class="ui checkbox"> <input name="wiki" type="checkbox" {{if .wiki}} checked{{end}}> - <label>{{.locale.Tr "repo.migrate_items_wiki" | Safe}}</label> + <label>{{ctx.Locale.Tr "repo.migrate_items_wiki" | Safe}}</label> </div> </div> <div id="migrate_items"> - <span class="help">{{.locale.Tr "repo.migrate.migrate_items_options"}}</span> + <span class="help">{{ctx.Locale.Tr "repo.migrate.migrate_items_options"}}</span> <div class="inline field"> <label></label> <div class="ui checkbox"> <input name="labels" type="checkbox" {{if .labels}} checked{{end}}> - <label>{{.locale.Tr "repo.migrate_items_labels" | Safe}}</label> + <label>{{ctx.Locale.Tr "repo.migrate_items_labels" | Safe}}</label> </div> <div class="ui checkbox"> <input name="issues" type="checkbox" {{if .issues}} checked{{end}}> - <label>{{.locale.Tr "repo.migrate_items_issues" | Safe}}</label> + <label>{{ctx.Locale.Tr "repo.migrate_items_issues" | Safe}}</label> </div> </div> <div class="inline field"> <label></label> <div class="ui checkbox"> <input name="milestones" type="checkbox" {{if .milestones}} checked{{end}}> - <label>{{.locale.Tr "repo.migrate_items_milestones" | Safe}}</label> + <label>{{ctx.Locale.Tr "repo.migrate_items_milestones" | Safe}}</label> </div> </div> <!-- Gogs do not support it @@ -59,11 +59,11 @@ <label></label> <div class="ui checkbox"> <input name="pull_requests" type="checkbox" {{if .pull_requests}} checked{{end}}> - <label>{{.locale.Tr "repo.migrate_items_merge_requests" | Safe}}</label> + <label>{{ctx.Locale.Tr "repo.migrate_items_merge_requests" | Safe}}</label> </div> <div class="ui checkbox"> <input name="releases" type="checkbox" {{if .releases}} checked{{end}}> - <label>{{.locale.Tr "repo.migrate_items_releases" | Safe}}</label> + <label>{{ctx.Locale.Tr "repo.migrate_items_releases" | Safe}}</label> </div> </div> --> @@ -72,7 +72,7 @@ <div class="divider"></div> <div class="inline required field {{if .Err_Owner}}error{{end}}"> - <label>{{.locale.Tr "repo.owner"}}</label> + <label>{{ctx.Locale.Tr "repo.owner"}}</label> <div class="ui selection owner dropdown"> <input type="hidden" id="uid" name="uid" value="{{.ContextUser.ID}}" required> <span class="text truncated-item-container" title="{{.ContextUser.Name}}"> @@ -96,30 +96,30 @@ </div> <div class="inline required field {{if .Err_RepoName}}error{{end}}"> - <label for="repo_name">{{.locale.Tr "repo.repo_name"}}</label> + <label for="repo_name">{{ctx.Locale.Tr "repo.repo_name"}}</label> <input id="repo_name" name="repo_name" value="{{.repo_name}}" required maxlength="100"> </div> <div class="inline field"> - <label>{{.locale.Tr "repo.visibility"}}</label> + <label>{{ctx.Locale.Tr "repo.visibility"}}</label> <div class="ui checkbox"> {{if .IsForcedPrivate}} <input name="private" type="checkbox" checked readonly> - <label>{{.locale.Tr "repo.visibility_helper_forced" | Safe}}</label> + <label>{{ctx.Locale.Tr "repo.visibility_helper_forced" | Safe}}</label> {{else}} <input name="private" type="checkbox" {{if .private}} checked{{end}}> - <label>{{.locale.Tr "repo.visibility_helper" | Safe}}</label> + <label>{{ctx.Locale.Tr "repo.visibility_helper" | Safe}}</label> {{end}} </div> </div> <div class="inline field {{if .Err_Description}}error{{end}}"> - <label for="description">{{.locale.Tr "repo.repo_desc"}}</label> + <label for="description">{{ctx.Locale.Tr "repo.repo_desc"}}</label> <textarea id="description" name="description" maxlength="2048">{{.description}}</textarea> </div> <div class="inline field"> <label></label> <button class="ui primary button"> - {{.locale.Tr "repo.migrate_repo"}} + {{ctx.Locale.Tr "repo.migrate_repo"}} </button> </div> </div> diff --git a/templates/repo/migrate/migrate.tmpl b/templates/repo/migrate/migrate.tmpl index eb17794647..c686f0b832 100644 --- a/templates/repo/migrate/migrate.tmpl +++ b/templates/repo/migrate/migrate.tmpl @@ -20,7 +20,7 @@ {{.Title}} </div> <div class="description gt-text-center"> - {{(printf "repo.migrate.%s.description" .Name) | $.locale.Tr}} + {{(printf "repo.migrate.%s.description" .Name) | ctx.Locale.Tr}} </div> </div> </a> diff --git a/templates/repo/migrate/migrating.tmpl b/templates/repo/migrate/migrating.tmpl index 6effa05f97..649d14ad99 100644 --- a/templates/repo/migrate/migrating.tmpl +++ b/templates/repo/migrate/migrating.tmpl @@ -21,14 +21,14 @@ <div class="ui stackable middle very relaxed page grid"> <div class="sixteen wide center aligned centered column"> <div id="repo_migrating_progress"> - <p>{{.locale.Tr "repo.migrate.migrating" .CloneAddr | Safe}}</p> + <p>{{ctx.Locale.Tr "repo.migrate.migrating" .CloneAddr | Safe}}</p> <p id="repo_migrating_progress_message"></p> </div> <div id="repo_migrating_failed" class="gt-hidden"> {{if .CloneAddr}} - <p>{{.locale.Tr "repo.migrate.migrating_failed" .CloneAddr | Safe}}</p> + <p>{{ctx.Locale.Tr "repo.migrate.migrating_failed" .CloneAddr | Safe}}</p> {{else}} - <p>{{.locale.Tr "repo.migrate.migrating_failed_no_addr" | Safe}}</p> + <p>{{ctx.Locale.Tr "repo.migrate.migrating_failed_no_addr" | Safe}}</p> {{end}} <p id="repo_migrating_failed_error"></p> </div> @@ -36,11 +36,11 @@ <div class="divider"></div> <div class="item"> {{if .Failed}} - <button class="ui basic red show-modal button" data-modal="#delete-repo-modal">{{.locale.Tr "repo.settings.delete"}}</button> + <button class="ui basic red show-modal button" data-modal="#delete-repo-modal">{{ctx.Locale.Tr "repo.settings.delete"}}</button> {{else}} - <button class="ui basic show-modal button" data-modal="#cancel-repo-modal">{{.locale.Tr "cancel"}}</button> + <button class="ui basic show-modal button" data-modal="#cancel-repo-modal">{{ctx.Locale.Tr "cancel"}}</button> {{end}} - <button id="repo_migrating_retry" data-migrating-task-retry-url="{{.Link}}/settings/migrate/retry" class="ui basic button gt-hidden">{{.locale.Tr "retry"}}</button> + <button id="repo_migrating_retry" data-migrating-task-retry-url="{{.Link}}/settings/migrate/retry" class="ui basic button gt-hidden">{{ctx.Locale.Tr "retry"}}</button> </div> {{end}} </div> @@ -53,14 +53,14 @@ <div class="ui small modal" id="delete-repo-modal"> <div class="header"> - {{.locale.Tr "repo.settings.delete"}} + {{ctx.Locale.Tr "repo.settings.delete"}} </div> <div class="content"> <div class="ui warning message"> - {{.locale.Tr "repo.settings.delete_notices_1" | Safe}}<br> - {{.locale.Tr "repo.settings.delete_notices_2" .Repository.FullName | Safe}} + {{ctx.Locale.Tr "repo.settings.delete_notices_1" | Safe}}<br> + {{ctx.Locale.Tr "repo.settings.delete_notices_2" .Repository.FullName | Safe}} {{if .Repository.NumForks}}<br> - {{.locale.Tr "repo.settings.delete_notices_fork_1"}} + {{ctx.Locale.Tr "repo.settings.delete_notices_fork_1"}} {{end}} </div> <form class="ui form" action="{{.Link}}/settings" method="post"> @@ -68,18 +68,18 @@ <input type="hidden" name="action" value="delete"> <div class="field"> <label> - {{.locale.Tr "repo.settings.transfer_form_title"}} + {{ctx.Locale.Tr "repo.settings.transfer_form_title"}} <span class="text red">{{.Repository.Name}}</span> </label> </div> <div class="required field"> - <label for="repo_name">{{.locale.Tr "repo.repo_name"}}</label> + <label for="repo_name">{{ctx.Locale.Tr "repo.repo_name"}}</label> <input id="repo_name" name="repo_name" required> </div> <div class="text right actions"> - <button class="ui cancel button">{{.locale.Tr "settings.cancel"}}</button> - <button class="ui red button">{{.locale.Tr "repo.settings.confirm_delete"}}</button> + <button class="ui cancel button">{{ctx.Locale.Tr "settings.cancel"}}</button> + <button class="ui red button">{{ctx.Locale.Tr "repo.settings.confirm_delete"}}</button> </div> </form> </div> @@ -87,12 +87,12 @@ <div class="ui g-modal-confirm modal" id="cancel-repo-modal"> <div class="header"> - {{.locale.Tr "repo.migrate.cancel_migrating_title"}} + {{ctx.Locale.Tr "repo.migrate.cancel_migrating_title"}} </div> <form action="{{.Link}}/settings/migrate/cancel" method="post"> {{.CsrfTokenHtml}} <div class="content"> - {{.locale.Tr "repo.migrate.cancel_migrating_confirm"}} + {{ctx.Locale.Tr "repo.migrate.cancel_migrating_confirm"}} </div> {{template "base/modal_actions_confirm" .}} </form> diff --git a/templates/repo/migrate/onedev.tmpl b/templates/repo/migrate/onedev.tmpl index 818b23fddc..90aee0f48c 100644 --- a/templates/repo/migrate/onedev.tmpl +++ b/templates/repo/migrate/onedev.tmpl @@ -6,25 +6,25 @@ {{template "base/disable_form_autofill"}} {{.CsrfTokenHtml}} <h3 class="ui top attached header"> - {{.locale.Tr "repo.migrate.migrate" .service.Title}} + {{ctx.Locale.Tr "repo.migrate.migrate" .service.Title}} <input id="service_type" type="hidden" name="service" value="{{.service}}"> </h3> <div class="ui attached segment"> {{template "base/alert" .}} <div class="inline required field {{if .Err_CloneAddr}}error{{end}}"> - <label for="clone_addr">{{.locale.Tr "repo.migrate.clone_address"}}</label> + <label for="clone_addr">{{ctx.Locale.Tr "repo.migrate.clone_address"}}</label> <input id="clone_addr" name="clone_addr" value="{{.clone_addr}}" autofocus required> <span class="help"> - {{.locale.Tr "repo.migrate.clone_address_desc"}}{{if .ContextUser.CanImportLocal}} {{.locale.Tr "repo.migrate.clone_local_path"}}{{end}} + {{ctx.Locale.Tr "repo.migrate.clone_address_desc"}}{{if .ContextUser.CanImportLocal}} {{.locale.Tr "repo.migrate.clone_local_path"}}{{end}} </span> </div> <div class="inline field {{if .Err_Auth}}error{{end}}"> - <label for="auth_username">{{.locale.Tr "username"}}</label> + <label for="auth_username">{{ctx.Locale.Tr "username"}}</label> <input id="auth_username" name="auth_username" value="{{.auth_username}}" {{if not .auth_username}}data-need-clear="true"{{end}}> </div> <div class="inline field {{if .Err_Auth}}error{{end}}"> - <label for="auth_password">{{.locale.Tr "password"}}</label> + <label for="auth_password">{{ctx.Locale.Tr "password"}}</label> <input id="auth_password" name="auth_password" type="password" value="{{.auth_password}}"> </div> @@ -32,25 +32,25 @@ <div id="migrate_items"> <div class="inline field"> - <label>{{.locale.Tr "repo.migrate_items"}}</label> + <label>{{ctx.Locale.Tr "repo.migrate_items"}}</label> <div class="ui checkbox"> <input name="milestones" type="checkbox" {{if .milestones}}checked{{end}}> - <label>{{.locale.Tr "repo.migrate_items_milestones" | Safe}}</label> + <label>{{ctx.Locale.Tr "repo.migrate_items_milestones" | Safe}}</label> </div> <div class="ui checkbox"> <input name="labels" type="checkbox" {{if .labels}}checked{{end}}> - <label>{{.locale.Tr "repo.migrate_items_labels" | Safe}}</label> + <label>{{ctx.Locale.Tr "repo.migrate_items_labels" | Safe}}</label> </div> </div> <div class="inline field"> <label></label> <div class="ui checkbox"> <input name="issues" type="checkbox" {{if .issues}}checked{{end}}> - <label>{{.locale.Tr "repo.migrate_items_issues" | Safe}}</label> + <label>{{ctx.Locale.Tr "repo.migrate_items_issues" | Safe}}</label> </div> <div class="ui checkbox"> <input name="pull_requests" type="checkbox" {{if .pull_requests}}checked{{end}}> - <label>{{.locale.Tr "repo.migrate_items_pullrequests" | Safe}}</label> + <label>{{ctx.Locale.Tr "repo.migrate_items_pullrequests" | Safe}}</label> </div> </div> </div> @@ -58,7 +58,7 @@ <div class="divider"></div> <div class="inline required field {{if .Err_Owner}}error{{end}}"> - <label>{{.locale.Tr "repo.owner"}}</label> + <label>{{ctx.Locale.Tr "repo.owner"}}</label> <div class="ui selection owner dropdown"> <input type="hidden" id="uid" name="uid" value="{{.ContextUser.ID}}" required> <span class="text truncated-item-container" title="{{.ContextUser.Name}}"> @@ -82,30 +82,30 @@ </div> <div class="inline required field {{if .Err_RepoName}}error{{end}}"> - <label for="repo_name">{{.locale.Tr "repo.repo_name"}}</label> + <label for="repo_name">{{ctx.Locale.Tr "repo.repo_name"}}</label> <input id="repo_name" name="repo_name" value="{{.repo_name}}" required maxlength="100"> </div> <div class="inline field"> - <label>{{.locale.Tr "repo.visibility"}}</label> + <label>{{ctx.Locale.Tr "repo.visibility"}}</label> <div class="ui checkbox"> {{if .IsForcedPrivate}} <input name="private" type="checkbox" checked readonly> - <label>{{.locale.Tr "repo.visibility_helper_forced" | Safe}}</label> + <label>{{ctx.Locale.Tr "repo.visibility_helper_forced" | Safe}}</label> {{else}} <input name="private" type="checkbox" {{if .private}}checked{{end}}> - <label>{{.locale.Tr "repo.visibility_helper" | Safe}}</label> + <label>{{ctx.Locale.Tr "repo.visibility_helper" | Safe}}</label> {{end}} </div> </div> <div class="inline field {{if .Err_Description}}error{{end}}"> - <label for="description">{{.locale.Tr "repo.repo_desc"}}</label> + <label for="description">{{ctx.Locale.Tr "repo.repo_desc"}}</label> <textarea id="description" name="description" maxlength="2048">{{.description}}</textarea> </div> <div class="inline field"> <label></label> <button class="ui primary button"> - {{.locale.Tr "repo.migrate_repo"}} + {{ctx.Locale.Tr "repo.migrate_repo"}} </button> </div> </div> diff --git a/templates/repo/migrate/options.tmpl b/templates/repo/migrate/options.tmpl index d39caf01b4..2e97bdf1ad 100644 --- a/templates/repo/migrate/options.tmpl +++ b/templates/repo/migrate/options.tmpl @@ -1,9 +1,9 @@ {{if not .DisableNewPullMirrors}} <div class="inline field"> - <label>{{.locale.Tr "repo.migrate_options"}}</label> + <label>{{ctx.Locale.Tr "repo.migrate_options"}}</label> <div class="ui checkbox"> <input id="mirror" name="mirror" type="checkbox" {{if .mirror}} checked{{end}}> - <label>{{.locale.Tr "repo.migrate_options_mirror_helper"}}</label> + <label>{{ctx.Locale.Tr "repo.migrate_options_mirror_helper"}}</label> </div> </div> {{end}} @@ -12,15 +12,15 @@ <label></label> <div class="ui checkbox"> <input id="lfs" name="lfs" type="checkbox" {{if .lfs}} checked{{end}}> - <label>{{.locale.Tr "repo.migrate_options_lfs"}}</label> + <label>{{ctx.Locale.Tr "repo.migrate_options_lfs"}}</label> </div> - <span id="lfs_settings" class="gt-hidden">(<a id="lfs_settings_show" href="#">{{.locale.Tr "repo.settings.advanced_settings"}}</a>)</span> + <span id="lfs_settings" class="gt-hidden">(<a id="lfs_settings_show" href="#">{{ctx.Locale.Tr "repo.settings.advanced_settings"}}</a>)</span> </div> <div id="lfs_endpoint" class="gt-hidden"> - <span class="help">{{.locale.Tr "repo.migrate_options_lfs_endpoint.description" "https://github.com/git-lfs/git-lfs/blob/main/docs/api/server-discovery.md#server-discovery" | Str2html}}{{if .ContextUser.CanImportLocal}} {{.locale.Tr "repo.migrate_options_lfs_endpoint.description.local"}}{{end}}</span> + <span class="help">{{ctx.Locale.Tr "repo.migrate_options_lfs_endpoint.description" "https://github.com/git-lfs/git-lfs/blob/main/docs/api/server-discovery.md#server-discovery" | Str2html}}{{if .ContextUser.CanImportLocal}} {{.locale.Tr "repo.migrate_options_lfs_endpoint.description.local"}}{{end}}</span> <div class="inline field {{if .Err_LFSEndpoint}}error{{end}}"> - <label>{{.locale.Tr "repo.migrate_options_lfs_endpoint.label"}}</label> - <input name="lfs_endpoint" value="{{.lfs_endpoint}}" placeholder="{{.locale.Tr "repo.migrate_options_lfs_endpoint.placeholder"}}"> + <label>{{ctx.Locale.Tr "repo.migrate_options_lfs_endpoint.label"}}</label> + <input name="lfs_endpoint" value="{{.lfs_endpoint}}" placeholder="{{ctx.Locale.Tr "repo.migrate_options_lfs_endpoint.placeholder"}}"> </div> </div> {{end}} diff --git a/templates/repo/pulls/fork.tmpl b/templates/repo/pulls/fork.tmpl index 66b1c3a276..57d2269807 100644 --- a/templates/repo/pulls/fork.tmpl +++ b/templates/repo/pulls/fork.tmpl @@ -5,12 +5,12 @@ <form class="ui form" action="{{.Link}}" method="post"> {{.CsrfTokenHtml}} <h3 class="ui top attached header"> - {{.locale.Tr "new_fork"}} + {{ctx.Locale.Tr "new_fork"}} </h3> <div class="ui attached segment"> {{template "base/alert" .}} <div class="inline required field {{if .Err_Owner}}error{{end}}"> - <label>{{.locale.Tr "repo.owner"}}</label> + <label>{{ctx.Locale.Tr "repo.owner"}}</label> <div class="ui selection owner dropdown"> <input type="hidden" id="uid" name="uid" value="{{.ContextUser.ID}}" required> <span class="text truncated-item-container" title="{{.ContextUser.Name}}"> @@ -36,30 +36,30 @@ </div> <div class="inline field"> - <label>{{.locale.Tr "repo.fork_from"}}</label> + <label>{{ctx.Locale.Tr "repo.fork_from"}}</label> <a href="{{.ForkRepo.Link}}" class="gt-dib">{{.ForkRepo.FullName}}</a> </div> <div class="inline required field {{if .Err_RepoName}}error{{end}}"> - <label for="repo_name">{{.locale.Tr "repo.repo_name"}}</label> + <label for="repo_name">{{ctx.Locale.Tr "repo.repo_name"}}</label> <input id="repo_name" name="repo_name" value="{{.repo_name}}" required> </div> <div class="inline field"> - <label>{{.locale.Tr "repo.visibility"}}</label> + <label>{{ctx.Locale.Tr "repo.visibility"}}</label> <div class="ui disabled checkbox"> <input type="checkbox" disabled {{if .IsPrivate}}checked{{end}}> - <label>{{.locale.Tr "repo.visibility_helper" | Safe}}</label> + <label>{{ctx.Locale.Tr "repo.visibility_helper" | Safe}}</label> </div> - <span class="help">{{.locale.Tr "repo.fork_visibility_helper"}}</span> + <span class="help">{{ctx.Locale.Tr "repo.fork_visibility_helper"}}</span> </div> <div class="inline field {{if .Err_Description}}error{{end}}"> - <label for="description">{{.locale.Tr "repo.repo_desc"}}</label> + <label for="description">{{ctx.Locale.Tr "repo.repo_desc"}}</label> <textarea id="description" name="description">{{.description}}</textarea> </div> <div class="inline field"> <label></label> <button class="ui primary button{{if not .CanForkRepo}} disabled{{end}}"> - {{.locale.Tr "repo.fork_repo"}} + {{ctx.Locale.Tr "repo.fork_repo"}} </button> </div> </div> diff --git a/templates/repo/pulls/status.tmpl b/templates/repo/pulls/status.tmpl index 25d8954658..476b89a425 100644 --- a/templates/repo/pulls/status.tmpl +++ b/templates/repo/pulls/status.tmpl @@ -2,17 +2,17 @@ {{if not $.Issue.PullRequest.HasMerged}} <div class="ui top attached header"> {{if eq .LatestCommitStatus.State "pending"}} - {{$.locale.Tr "repo.pulls.status_checking"}} + {{ctx.Locale.Tr "repo.pulls.status_checking"}} {{else if eq .LatestCommitStatus.State "success"}} - {{$.locale.Tr "repo.pulls.status_checks_success"}} + {{ctx.Locale.Tr "repo.pulls.status_checks_success"}} {{else if eq .LatestCommitStatus.State "warning"}} - {{$.locale.Tr "repo.pulls.status_checks_warning"}} + {{ctx.Locale.Tr "repo.pulls.status_checks_warning"}} {{else if eq .LatestCommitStatus.State "failure"}} - {{$.locale.Tr "repo.pulls.status_checks_failure"}} + {{ctx.Locale.Tr "repo.pulls.status_checks_failure"}} {{else if eq .LatestCommitStatus.State "error"}} - {{$.locale.Tr "repo.pulls.status_checks_error"}} + {{ctx.Locale.Tr "repo.pulls.status_checks_error"}} {{else}} - {{$.locale.Tr "repo.pulls.status_checking"}} + {{ctx.Locale.Tr "repo.pulls.status_checking"}} {{end}} </div> {{end}} @@ -24,9 +24,9 @@ <span>{{.Context}} <span class="text grey">{{.Description}}</span></span> <div class="ui status-details"> {{if $.is_context_required}} - {{if (call $.is_context_required .Context)}}<div class="ui label">{{$.locale.Tr "repo.pulls.status_checks_requested"}}</div>{{end}} + {{if (call $.is_context_required .Context)}}<div class="ui label">{{ctx.Locale.Tr "repo.pulls.status_checks_requested"}}</div>{{end}} {{end}} - <span>{{if .TargetURL}}<a href="{{.TargetURL}}">{{$.locale.Tr "repo.pulls.status_checks_details"}}</a>{{end}}</span> + <span>{{if .TargetURL}}<a href="{{.TargetURL}}">{{ctx.Locale.Tr "repo.pulls.status_checks_details"}}</a>{{end}}</span> </div> </div> </div> diff --git a/templates/repo/pulls/tab_menu.tmpl b/templates/repo/pulls/tab_menu.tmpl index fe1d4e4de0..10bdfdb3de 100644 --- a/templates/repo/pulls/tab_menu.tmpl +++ b/templates/repo/pulls/tab_menu.tmpl @@ -2,17 +2,17 @@ <div class="ui top attached pull tabular menu"> <a class="item {{if .PageIsPullConversation}}active{{end}}" href="{{.Issue.Link}}"> {{svg "octicon-comment-discussion"}} - {{$.locale.Tr "repo.pulls.tab_conversation"}} + {{ctx.Locale.Tr "repo.pulls.tab_conversation"}} <span class="ui small label">{{.Issue.NumComments}}</span> </a> <a class="item {{if .PageIsPullCommits}}active{{end}}" {{if .NumCommits}}href="{{.Issue.Link}}/commits"{{end}}> {{svg "octicon-git-commit"}} - {{$.locale.Tr "repo.pulls.tab_commits"}} + {{ctx.Locale.Tr "repo.pulls.tab_commits"}} <span class="ui small label">{{if .NumCommits}}{{.NumCommits}}{{else}}-{{end}}</span> </a> <a class="item {{if .PageIsPullFiles}}active{{end}}" href="{{.Issue.Link}}/files"> {{svg "octicon-diff"}} - {{$.locale.Tr "repo.pulls.tab_files"}} + {{ctx.Locale.Tr "repo.pulls.tab_files"}} <span class="ui small label">{{if .NumFiles}}{{.NumFiles}}{{else}}-{{end}}</span> </a> <span class="item gt-ml-auto gt-pr-0 gt-font-bold gt-df gt-ac gt-gap-3"> diff --git a/templates/repo/release/list.tmpl b/templates/repo/release/list.tmpl index a717fba651..72739671b8 100644 --- a/templates/repo/release/list.tmpl +++ b/templates/repo/release/list.tmpl @@ -19,16 +19,16 @@ <h4 class="release-list-title"> <a href="{{$.RepoLink}}/releases/tag/{{.TagName | PathEscapeSegments}}">{{.Title}}</a> {{if .IsDraft}} - <span class="ui yellow label">{{$.locale.Tr "repo.release.draft"}}</span> + <span class="ui yellow label">{{ctx.Locale.Tr "repo.release.draft"}}</span> {{else if .IsPrerelease}} - <span class="ui orange label">{{$.locale.Tr "repo.release.prerelease"}}</span> + <span class="ui orange label">{{ctx.Locale.Tr "repo.release.prerelease"}}</span> {{else if not .IsTag}} - <span class="ui green label">{{$.locale.Tr "repo.release.stable"}}</span> + <span class="ui green label">{{ctx.Locale.Tr "repo.release.stable"}}</span> {{end}} </h4> <div> {{if and $.CanCreateRelease (not .IsTag)}} - <a class="muted" data-tooltip-content="{{$.locale.Tr "repo.release.edit"}}" href="{{$.RepoLink}}/releases/edit/{{.TagName | PathEscapeSegments}}" rel="nofollow"> + <a class="muted" data-tooltip-content="{{ctx.Locale.Tr "repo.release.edit"}}" href="{{$.RepoLink}}/releases/edit/{{.TagName | PathEscapeSegments}}" rel="nofollow"> {{svg "octicon-pencil"}} </a> {{end}} @@ -42,14 +42,14 @@ <a href="{{.Publisher.HomeLink}}">{{.Publisher.Name}}</a> </span> <span class="released"> - {{$.locale.Tr "repo.tagged_this"}} + {{ctx.Locale.Tr "repo.tagged_this"}} </span> {{if .CreatedUnix}} <span class="time">{{TimeSinceUnix .CreatedUnix $.locale}}</span> {{end}} | {{end}} - <span class="ahead"><a href="{{$.RepoLink}}/compare/{{.TagName | PathEscapeSegments}}...{{.TargetBehind | PathEscapeSegments}}">{{$.locale.Tr "repo.release.ahead.commits" .NumCommitsBehind | Str2html}}</a> {{$.locale.Tr "repo.tag.ahead.target" .TargetBehind}}</span> + <span class="ahead"><a href="{{$.RepoLink}}/compare/{{.TagName | PathEscapeSegments}}...{{.TargetBehind | PathEscapeSegments}}">{{ctx.Locale.Tr "repo.release.ahead.commits" .NumCommitsBehind | Str2html}}</a> {{ctx.Locale.Tr "repo.tag.ahead.target" .TargetBehind}}</span> </p> {{else}} <p class="text grey"> @@ -64,13 +64,13 @@ {{end}} </span> <span class="released"> - {{$.locale.Tr "repo.released_this"}} + {{ctx.Locale.Tr "repo.released_this"}} </span> {{if .CreatedUnix}} <span class="time">{{TimeSinceUnix .CreatedUnix $.locale}}</span> {{end}} {{if not .IsDraft}} - | <span class="ahead"><a href="{{$.RepoLink}}/compare/{{.TagName | PathEscapeSegments}}...{{.TargetBehind | PathEscapeSegments}}">{{$.locale.Tr "repo.release.ahead.commits" .NumCommitsBehind | Str2html}}</a> {{$.locale.Tr "repo.release.ahead.target" .TargetBehind}}</span> + | <span class="ahead"><a href="{{$.RepoLink}}/compare/{{.TagName | PathEscapeSegments}}...{{.TargetBehind | PathEscapeSegments}}">{{ctx.Locale.Tr "repo.release.ahead.commits" .NumCommitsBehind | Str2html}}</a> {{ctx.Locale.Tr "repo.release.ahead.target" .TargetBehind}}</span> {{end}} </p> {{end}} @@ -80,15 +80,15 @@ <div class="divider"></div> <details class="download" {{if eq $idx 0}}open{{end}}> <summary class="gt-my-4"> - {{$.locale.Tr "repo.release.downloads"}} + {{ctx.Locale.Tr "repo.release.downloads"}} </summary> <ul class="list"> {{if and (not $.DisableDownloadSourceArchives) (not .IsDraft) ($.Permission.CanRead $.UnitTypeCode)}} <li> - <a class="archive-link" href="{{$.RepoLink}}/archive/{{.TagName | PathEscapeSegments}}.zip" rel="nofollow"><strong>{{svg "octicon-file-zip" 16 "gt-mr-2"}}{{$.locale.Tr "repo.release.source_code"}} (ZIP)</strong></a> + <a class="archive-link" href="{{$.RepoLink}}/archive/{{.TagName | PathEscapeSegments}}.zip" rel="nofollow"><strong>{{svg "octicon-file-zip" 16 "gt-mr-2"}}{{ctx.Locale.Tr "repo.release.source_code"}} (ZIP)</strong></a> </li> <li> - <a class="archive-link" href="{{$.RepoLink}}/archive/{{.TagName | PathEscapeSegments}}.tar.gz" rel="nofollow"><strong>{{svg "octicon-file-zip" 16 "gt-mr-2"}}{{$.locale.Tr "repo.release.source_code"}} (TAR.GZ)</strong></a> + <a class="archive-link" href="{{$.RepoLink}}/archive/{{.TagName | PathEscapeSegments}}.tar.gz" rel="nofollow"><strong>{{svg "octicon-file-zip" 16 "gt-mr-2"}}{{ctx.Locale.Tr "repo.release.source_code"}} (TAR.GZ)</strong></a> </li> {{end}} {{if .Attachments}} @@ -99,7 +99,7 @@ </a> <div> <span class="text grey">{{.Size | FileSize}}</span> - <span data-tooltip-content="{{$.locale.Tr "repo.release.download_count" ($.locale.PrettyNumber .DownloadCount)}}"> + <span data-tooltip-content="{{ctx.Locale.Tr "repo.release.download_count" ($.locale.PrettyNumber .DownloadCount)}}"> {{svg "octicon-info"}} </span> </div> @@ -122,10 +122,10 @@ <div class="ui g-modal-confirm delete modal"> <div class="header"> {{svg "octicon-trash"}} - {{.locale.Tr "repo.release.delete_tag"}} + {{ctx.Locale.Tr "repo.release.delete_tag"}} </div> <div class="content"> - <p>{{.locale.Tr "repo.release.deletion_tag_desc"}}</p> + <p>{{ctx.Locale.Tr "repo.release.deletion_tag_desc"}}</p> </div> {{template "base/modal_actions_confirm" .}} </div> diff --git a/templates/repo/release/new.tmpl b/templates/repo/release/new.tmpl index 217196f6cf..4a34b32bf9 100644 --- a/templates/repo/release/new.tmpl +++ b/templates/repo/release/new.tmpl @@ -4,11 +4,11 @@ <div class="ui container"> <h2 class="ui dividing header"> {{if .PageIsEditRelease}} - {{.locale.Tr "repo.release.edit_release"}} - <div class="sub header">{{.locale.Tr "repo.release.edit_subheader"}}</div> + {{ctx.Locale.Tr "repo.release.edit_release"}} + <div class="sub header">{{ctx.Locale.Tr "repo.release.edit_subheader"}}</div> {{else}} - {{.locale.Tr "repo.release.new_release"}} - <div class="sub header">{{.locale.Tr "repo.release.new_subheader"}}</div> + {{ctx.Locale.Tr "repo.release.new_release"}} + <div class="sub header">{{ctx.Locale.Tr "repo.release.new_subheader"}}</div> {{end}} </h2> {{template "base/alert" .}} @@ -19,15 +19,15 @@ {{if .PageIsEditRelease}} <b>{{.tag_name}}</b><span class="at">@</span><strong>{{.tag_target}}</strong> {{else}} - <input id="tag-name" name="tag_name" value="{{.tag_name}}" aria-label="{{.locale.Tr "repo.release.tag_name"}}" placeholder="{{.locale.Tr "repo.release.tag_name"}}" autofocus required maxlength="255"> - <input id="tag-name-editor" type="hidden" data-existing-tags="{{JsonUtils.EncodeToString .Tags}}" data-tag-helper="{{.locale.Tr "repo.release.tag_helper"}}" data-tag-helper-new="{{.locale.Tr "repo.release.tag_helper_new"}}" data-tag-helper-existing="{{.locale.Tr "repo.release.tag_helper_existing"}}"> + <input id="tag-name" name="tag_name" value="{{.tag_name}}" aria-label="{{ctx.Locale.Tr "repo.release.tag_name"}}" placeholder="{{.locale.Tr "repo.release.tag_name"}}" autofocus required maxlength="255"> + <input id="tag-name-editor" type="hidden" data-existing-tags="{{JsonUtils.EncodeToString .Tags}}" data-tag-helper="{{ctx.Locale.Tr "repo.release.tag_helper"}}" data-tag-helper-new="{{.locale.Tr "repo.release.tag_helper_new"}}" data-tag-helper-existing="{{.locale.Tr "repo.release.tag_helper_existing"}}"> <div id="tag-target-selector" class="gt-dib"> <span class="at">@</span> <div class="ui selection dropdown"> <input type="hidden" name="tag_target" value="{{.tag_target}}"> {{svg "octicon-git-branch"}} <div class="text"> - {{.locale.Tr "repo.release.target"}} : + {{ctx.Locale.Tr "repo.release.target"}} : <strong id="repo-branch-current">{{.Repository.DefaultBranch}}</strong> </div> {{svg "octicon-triangle-down" 14 "dropdown icon"}} @@ -39,14 +39,14 @@ </div> </div> <div> - <span id="tag-helper" class="help gt-mt-3 gt-pb-0">{{.locale.Tr "repo.release.tag_helper"}}</span> + <span id="tag-helper" class="help gt-mt-3 gt-pb-0">{{ctx.Locale.Tr "repo.release.tag_helper"}}</span> </div> {{end}} </div> </div> <div class="eleven wide gt-pt-0"> <div class="field {{if .Err_Title}}error{{end}}"> - <input name="title" aria-label="{{.locale.Tr "repo.release.title"}}" placeholder="{{.locale.Tr "repo.release.title"}}" value="{{.title}}" autofocus maxlength="255"> + <input name="title" aria-label="{{ctx.Locale.Tr "repo.release.title"}}" placeholder="{{.locale.Tr "repo.release.title"}}" value="{{.title}}" autofocus maxlength="255"> </div> <div class="field"> {{template "shared/combomarkdowneditor" (dict @@ -54,8 +54,8 @@ "MarkdownPreviewContext" .RepoLink "TextareaName" "content" "TextareaContent" .content - "TextareaPlaceholder" (.locale.Tr "repo.release.message") - "TextareaAriaLabel" (.locale.Tr "repo.release.message") + "TextareaPlaceholder" (ctx.Locale.Tr "repo.release.message") + "TextareaAriaLabel" (ctx.Locale.Tr "repo.release.message") "DropzoneParentContainer" "form" )}} </div> @@ -65,12 +65,12 @@ <input name="attachment-edit-{{.UUID}}" class="attachment_edit" required value="{{.Name}}"> <input name="attachment-del-{{.UUID}}" type="hidden" value="false"> <span class="ui text grey gt-whitespace-nowrap">{{.Size | FileSize}}</span> - <span data-tooltip-content="{{$.locale.Tr "repo.release.download_count" ($.locale.PrettyNumber .DownloadCount)}}"> + <span data-tooltip-content="{{ctx.Locale.Tr "repo.release.download_count" ($.locale.PrettyNumber .DownloadCount)}}"> {{svg "octicon-info"}} </span> </div> <a class="ui mini compact red button remove-rel-attach" data-id="{{.ID}}" data-uuid="{{.UUID}}"> - {{$.locale.Tr "remove"}} + {{ctx.Locale.Tr "remove"}} </a> </div> {{end}} @@ -87,7 +87,7 @@ <div class="tag-message field"> <div class="ui checkbox"> <input type="checkbox" name="add_tag_msg"> - <label><strong>{{.locale.Tr "repo.release.add_tag_msg"}}</strong></label> + <label><strong>{{ctx.Locale.Tr "repo.release.add_tag_msg"}}</strong></label> </div> </div> {{else}} @@ -96,32 +96,32 @@ <div class="prerelease field"> <div class="ui checkbox"> <input type="checkbox" name="prerelease" {{if .prerelease}}checked{{end}}> - <label><strong>{{.locale.Tr "repo.release.prerelease_desc"}}</strong></label> + <label><strong>{{ctx.Locale.Tr "repo.release.prerelease_desc"}}</strong></label> </div> </div> - <span class="help">{{.locale.Tr "repo.release.prerelease_helper"}}</span> + <span class="help">{{ctx.Locale.Tr "repo.release.prerelease_helper"}}</span> <div class="divider gt-mt-0"></div> <div class="gt-df gt-je"> {{if .PageIsEditRelease}} <a class="ui small button" href="{{.RepoLink}}/releases"> - {{.locale.Tr "repo.release.cancel"}} + {{ctx.Locale.Tr "repo.release.cancel"}} </a> <a class="ui small red button delete-button" data-url="{{$.RepoLink}}/releases/delete" data-id="{{.ID}}"> - {{$.locale.Tr "repo.release.delete_release"}} + {{ctx.Locale.Tr "repo.release.delete_release"}} </a> {{if .IsDraft}} - <button class="ui small button" type="submit" name="draft" value="{{.locale.Tr "repo.release.save_draft"}}">{{.locale.Tr "repo.release.save_draft"}}</button> + <button class="ui small button" type="submit" name="draft" value="{{ctx.Locale.Tr "repo.release.save_draft"}}">{{.locale.Tr "repo.release.save_draft"}}</button> <button class="ui small primary button"> - {{.locale.Tr "repo.release.publish"}} + {{ctx.Locale.Tr "repo.release.publish"}} </button> {{else}} <button class="ui small primary button"> - {{.locale.Tr "repo.release.edit_release"}} + {{ctx.Locale.Tr "repo.release.edit_release"}} </button> {{end}} {{else}} <button class="ui small primary button"> - {{.locale.Tr "repo.release.publish"}} + {{ctx.Locale.Tr "repo.release.publish"}} </button> {{end}} </div> @@ -135,10 +135,10 @@ <div class="ui g-modal-confirm delete modal"> <div class="header"> {{svg "octicon-trash"}} - {{.locale.Tr "repo.release.deletion"}} + {{ctx.Locale.Tr "repo.release.deletion"}} </div> <div class="content"> - <p>{{.locale.Tr "repo.release.deletion_desc"}}</p> + <p>{{ctx.Locale.Tr "repo.release.deletion_desc"}}</p> </div> {{template "base/modal_actions_confirm" .}} </div> diff --git a/templates/repo/release_tag_header.tmpl b/templates/repo/release_tag_header.tmpl index 89358e9dd4..b8f47bd2aa 100644 --- a/templates/repo/release_tag_header.tmpl +++ b/templates/repo/release_tag_header.tmpl @@ -5,18 +5,18 @@ <div class="gt-df"> <div class="gt-f1 gt-df gt-ac"> <h2 class="ui compact small menu header small-menu-items"> - <a class="{{if .PageIsReleaseList}}active {{end}}item" href="{{.RepoLink}}/releases">{{.locale.PrettyNumber .NumReleases}} {{.locale.TrN .NumReleases "repo.release" "repo.releases"}}</a> + <a class="{{if .PageIsReleaseList}}active {{end}}item" href="{{.RepoLink}}/releases">{{.locale.PrettyNumber .NumReleases}} {{ctx.Locale.TrN .NumReleases "repo.release" "repo.releases"}}</a> {{if $canReadCode}} - <a class="{{if .PageIsTagList}}active {{end}}item" href="{{.RepoLink}}/tags">{{.locale.PrettyNumber .NumTags}} {{.locale.TrN .NumTags "repo.tag" "repo.tags"}}</a> + <a class="{{if .PageIsTagList}}active {{end}}item" href="{{.RepoLink}}/tags">{{.locale.PrettyNumber .NumTags}} {{ctx.Locale.TrN .NumTags "repo.tag" "repo.tags"}}</a> {{end}} </h2> {{if .EnableFeed}} - <a class="rss-icon gt-mx-3" href="{{.RepoLink}}/{{if .PageIsTagList}}tags{{else}}releases{{end}}.rss" data-tooltip-content="{{.locale.Tr "rss_feed"}}">{{svg "octicon-rss" 18}}</a> + <a class="rss-icon gt-mx-3" href="{{.RepoLink}}/{{if .PageIsTagList}}tags{{else}}releases{{end}}.rss" data-tooltip-content="{{ctx.Locale.Tr "rss_feed"}}">{{svg "octicon-rss" 18}}</a> {{end}} </div> {{if and (not .PageIsTagList) .CanCreateRelease}} <a class="ui small primary button" href="{{$.RepoLink}}/releases/new"> - {{.locale.Tr "repo.release.new_release"}} + {{ctx.Locale.Tr "repo.release.new_release"}} </a> {{end}} </div> diff --git a/templates/repo/search.tmpl b/templates/repo/search.tmpl index cf088442b3..4ad7e857ef 100644 --- a/templates/repo/search.tmpl +++ b/templates/repo/search.tmpl @@ -5,13 +5,13 @@ <div class="ui repo-search"> <form class="ui form ignore-dirty" method="get"> <div class="ui fluid action input"> - <input name="q" value="{{.Keyword}}"{{if .CodeIndexerUnavailable}} disabled{{end}} placeholder="{{.locale.Tr "repo.search.search_repo"}}"> - <div class="ui dropdown selection {{if .CodeIndexerUnavailable}} disabled{{end}}" data-tooltip-content="{{.locale.Tr "repo.search.type.tooltip"}}"> + <input name="q" value="{{.Keyword}}"{{if .CodeIndexerUnavailable}} disabled{{end}} placeholder="{{ctx.Locale.Tr "repo.search.search_repo"}}"> + <div class="ui dropdown selection {{if .CodeIndexerUnavailable}} disabled{{end}}" data-tooltip-content="{{ctx.Locale.Tr "repo.search.type.tooltip"}}"> <input name="t" type="hidden"{{if .CodeIndexerUnavailable}} disabled{{end}} value="{{.queryType}}">{{svg "octicon-triangle-down" 14 "dropdown icon"}} - <div class="text">{{.locale.Tr (printf "repo.search.%s" (or .queryType "fuzzy"))}}</div> + <div class="text">{{ctx.Locale.Tr (printf "repo.search.%s" (or .queryType "fuzzy"))}}</div> <div class="menu"> - <div class="item" data-value="" data-tooltip-content="{{.locale.Tr "repo.search.fuzzy.tooltip"}}">{{.locale.Tr "repo.search.fuzzy"}}</div> - <div class="item" data-value="match" data-tooltip-content="{{.locale.Tr "repo.search.match.tooltip"}}">{{.locale.Tr "repo.search.match"}}</div> + <div class="item" data-value="" data-tooltip-content="{{ctx.Locale.Tr "repo.search.fuzzy.tooltip"}}">{{.locale.Tr "repo.search.fuzzy"}}</div> + <div class="item" data-value="match" data-tooltip-content="{{ctx.Locale.Tr "repo.search.match.tooltip"}}">{{.locale.Tr "repo.search.match"}}</div> </div> </div> <button class="ui icon button"{{if .CodeIndexerUnavailable}} disabled{{end}} type="submit">{{svg "octicon-search" 16}}</button> @@ -20,11 +20,11 @@ </div> {{if .CodeIndexerUnavailable}} <div class="ui error message"> - <p>{{$.locale.Tr "repo.search.code_search_unavailable"}}</p> + <p>{{ctx.Locale.Tr "repo.search.code_search_unavailable"}}</p> </div> {{else if .Keyword}} <h3> - {{.locale.Tr "repo.search.results" (.Keyword|Escape) (.RepoLink|Escape) (.RepoName|Escape) | Str2html}} + {{ctx.Locale.Tr "repo.search.results" (.Keyword|Escape) (.RepoLink|Escape) (.RepoName|Escape) | Str2html}} </h3> {{if .SearchResults}} <div class="flex-text-block gt-fw"> @@ -41,7 +41,7 @@ <div class="diff-file-box diff-box file-content non-diff-file-content repo-search-result"> <h4 class="ui top attached normal header gt-df gt-fw"> <span class="file gt-f1">{{.Filename}}</span> - <a role="button" class="ui basic tiny button" rel="nofollow" href="{{$.SourcePath}}/src/commit/{{PathEscape $result.CommitID}}/{{PathEscapeSegments .Filename}}">{{$.locale.Tr "repo.diff.view_file"}}</a> + <a role="button" class="ui basic tiny button" rel="nofollow" href="{{$.SourcePath}}/src/commit/{{PathEscape $result.CommitID}}/{{PathEscapeSegments .Filename}}">{{ctx.Locale.Tr "repo.diff.view_file"}}</a> </h4> <div class="ui attached table segment"> <div class="file-body file-code code-view"> @@ -65,7 +65,7 @@ </div> {{template "base/paginate" .}} {{else}} - <div>{{$.locale.Tr "repo.search.code_no_results"}}</div> + <div>{{ctx.Locale.Tr "repo.search.code_no_results"}}</div> {{end}} {{end}} </div> diff --git a/templates/repo/settings/branches.tmpl b/templates/repo/settings/branches.tmpl index 43203a7ad3..fbdc12defb 100644 --- a/templates/repo/settings/branches.tmpl +++ b/templates/repo/settings/branches.tmpl @@ -2,15 +2,15 @@ <div class="repo-setting-content"> {{if .Repository.IsArchived}} <div class="ui warning message gt-text-center"> - {{.locale.Tr "repo.settings.archive.branchsettings_unavailable"}} + {{ctx.Locale.Tr "repo.settings.archive.branchsettings_unavailable"}} </div> {{else}} <h4 class="ui top attached header"> - {{.locale.Tr "repo.default_branch"}} + {{ctx.Locale.Tr "repo.default_branch"}} </h4> <div class="ui attached segment"> <p> - {{.locale.Tr "repo.settings.default_branch_desc"}} + {{ctx.Locale.Tr "repo.settings.default_branch_desc"}} </p> <form class="gt-df" action="{{.Link}}" method="post"> {{.CsrfTokenHtml}} @@ -26,15 +26,15 @@ {{end}} </div> </div> - <button class="ui primary button">{{$.locale.Tr "repo.settings.branches.update_default_branch"}}</button> + <button class="ui primary button">{{ctx.Locale.Tr "repo.settings.branches.update_default_branch"}}</button> {{end}} </form> </div> <h4 class="ui top attached header"> - {{.locale.Tr "repo.settings.protected_branch"}} + {{ctx.Locale.Tr "repo.settings.protected_branch"}} <div class="ui right"> - <a class="ui primary tiny button" href="{{$.Repository.Link}}/settings/branches/edit">{{$.locale.Tr "repo.settings.branches.add_new_rule"}}</a> + <a class="ui primary tiny button" href="{{$.Repository.Link}}/settings/branches/edit">{{ctx.Locale.Tr "repo.settings.branches.add_new_rule"}}</a> </div> </h4> @@ -48,15 +48,15 @@ </div> </div> <div class="flex-item-trailing"> - <a class="rm ui tiny button" href="{{$.Repository.Link}}/settings/branches/edit?rule_name={{.RuleName}}">{{$.locale.Tr "repo.settings.edit_protected_branch"}}</a> + <a class="rm 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 delete-button" data-url="{{$.Repository.Link}}/settings/branches/{{.ID}}/delete" data-id="{{.ID}}"> - {{$.locale.Tr "repo.settings.protected_branch.delete_rule"}} + {{ctx.Locale.Tr "repo.settings.protected_branch.delete_rule"}} </button> </div> </div> {{else}} <div class="flex-item center aligned"> - {{.locale.Tr "repo.settings.no_protected_branch"}} + {{ctx.Locale.Tr "repo.settings.no_protected_branch"}} </div> {{end}} </div> @@ -67,10 +67,10 @@ <div class="ui g-modal-confirm delete modal"> <div class="header"> {{svg "octicon-trash"}} - {{.locale.Tr "repo.settings.protected_branch_deletion"}} + {{ctx.Locale.Tr "repo.settings.protected_branch_deletion"}} </div> <div class="content"> - <p>{{.locale.Tr "repo.settings.protected_branch_deletion_desc"}}</p> + <p>{{ctx.Locale.Tr "repo.settings.protected_branch_deletion_desc"}}</p> </div> {{template "base/modal_actions_confirm" .}} </div> diff --git a/templates/repo/settings/collaboration.tmpl b/templates/repo/settings/collaboration.tmpl index 290a1ae093..0844ebeaa4 100644 --- a/templates/repo/settings/collaboration.tmpl +++ b/templates/repo/settings/collaboration.tmpl @@ -1,7 +1,7 @@ {{template "repo/settings/layout_head" (dict "ctxData" . "pageClass" "repository settings collaboration")}} <div class="repo-setting-content"> <h4 class="ui top attached header"> - {{.locale.Tr "repo.settings.collaboration"}} + {{ctx.Locale.Tr "repo.settings.collaboration"}} </h4> {{if .Collaborators}} <div class="ui attached segment"> @@ -20,17 +20,17 @@ <div class="flex-text-block"> {{svg "octicon-shield-lock"}} <div class="ui inline dropdown access-mode" data-url="{{$.Link}}/access_mode" data-uid="{{.ID}}" data-last-value="{{printf "%d" .Collaboration.Mode}}"> - <div class="text">{{if eq .Collaboration.Mode 1}}{{$.locale.Tr "repo.settings.collaboration.read"}}{{else if eq .Collaboration.Mode 2}}{{$.locale.Tr "repo.settings.collaboration.write"}}{{else if eq .Collaboration.Mode 3}}{{$.locale.Tr "repo.settings.collaboration.admin"}}{{else}}{{$.locale.Tr "repo.settings.collaboration.undefined"}}{{end}}</div> + <div class="text">{{if eq .Collaboration.Mode 1}}{{ctx.Locale.Tr "repo.settings.collaboration.read"}}{{else if eq .Collaboration.Mode 2}}{{ctx.Locale.Tr "repo.settings.collaboration.write"}}{{else if eq .Collaboration.Mode 3}}{{$.locale.Tr "repo.settings.collaboration.admin"}}{{else}}{{$.locale.Tr "repo.settings.collaboration.undefined"}}{{end}}</div> {{svg "octicon-triangle-down" 14 "dropdown icon"}} <div class="menu"> - <div class="item" data-text="{{$.locale.Tr "repo.settings.collaboration.admin"}}" data-value="3">{{$.locale.Tr "repo.settings.collaboration.admin"}}</div> - <div class="item" data-text="{{$.locale.Tr "repo.settings.collaboration.write"}}" data-value="2">{{$.locale.Tr "repo.settings.collaboration.write"}}</div> - <div class="item" data-text="{{$.locale.Tr "repo.settings.collaboration.read"}}" data-value="1">{{$.locale.Tr "repo.settings.collaboration.read"}}</div> + <div class="item" data-text="{{ctx.Locale.Tr "repo.settings.collaboration.admin"}}" data-value="3">{{ctx.Locale.Tr "repo.settings.collaboration.admin"}}</div> + <div class="item" data-text="{{ctx.Locale.Tr "repo.settings.collaboration.write"}}" data-value="2">{{ctx.Locale.Tr "repo.settings.collaboration.write"}}</div> + <div class="item" data-text="{{ctx.Locale.Tr "repo.settings.collaboration.read"}}" data-value="1">{{ctx.Locale.Tr "repo.settings.collaboration.read"}}</div> </div> </div> </div> <button class="ui red tiny button inline text-thin delete-button" data-url="{{$.Link}}/delete" data-id="{{.ID}}"> - {{$.locale.Tr "repo.settings.delete_collaborator"}} + {{ctx.Locale.Tr "repo.settings.delete_collaborator"}} </button> </div> </div> @@ -42,15 +42,15 @@ <form class="ui form" id="repo-collab-form" action="{{.Link}}" method="post"> {{.CsrfTokenHtml}} <div id="search-user-box" class="ui search input gt-vm"> - <input class="prompt" name="collaborator" placeholder="{{.locale.Tr "repo.settings.search_user_placeholder"}}" autocomplete="off" autofocus required> + <input class="prompt" name="collaborator" placeholder="{{ctx.Locale.Tr "repo.settings.search_user_placeholder"}}" autocomplete="off" autofocus required> </div> - <button class="ui primary button">{{.locale.Tr "repo.settings.add_collaborator"}}</button> + <button class="ui primary button">{{ctx.Locale.Tr "repo.settings.add_collaborator"}}</button> </form> </div> {{if .RepoOwnerIsOrganization}} <h4 class="ui top attached header"> - {{$.locale.Tr "repo.settings.teams"}} + {{ctx.Locale.Tr "repo.settings.teams"}} </h4> {{$allowedToChangeTeams := (or (.Org.RepoAdminChangeTeamAccess) (.Permission.IsOwner))}} {{if .Teams}} @@ -64,19 +64,19 @@ </a> <div class="flex-item-body flex-text-block"> {{svg "octicon-shield-lock"}} - {{if eq .AccessMode 1}}{{$.locale.Tr "repo.settings.collaboration.read"}}{{else if eq .AccessMode 2}}{{$.locale.Tr "repo.settings.collaboration.write"}}{{else if eq .AccessMode 3}}{{$.locale.Tr "repo.settings.collaboration.admin"}}{{else if eq .AccessMode 4}}{{$.locale.Tr "repo.settings.collaboration.owner"}}{{else}}{{$.locale.Tr "repo.settings.collaboration.undefined"}}{{end}} + {{if eq .AccessMode 1}}{{ctx.Locale.Tr "repo.settings.collaboration.read"}}{{else if eq .AccessMode 2}}{{ctx.Locale.Tr "repo.settings.collaboration.write"}}{{else if eq .AccessMode 3}}{{$.locale.Tr "repo.settings.collaboration.admin"}}{{else if eq .AccessMode 4}}{{$.locale.Tr "repo.settings.collaboration.owner"}}{{else}}{{$.locale.Tr "repo.settings.collaboration.undefined"}}{{end}} </div> {{if or (eq .AccessMode 1) (eq .AccessMode 2)}} {{$first := true}} - <div class="flex-item-body" data-tooltip-content="{{$.locale.Tr "repo.settings.change_team_permission_tip"}}"> - Sections: {{range $u, $unit := $.Units}}{{if and ($.Repo.UnitEnabled $.Context $unit.Type) ($team.UnitEnabled $.Context $unit.Type)}}{{if $first}}{{$first = false}}{{else}}, {{end}}{{$.locale.Tr $unit.NameKey}}{{end}}{{end}} {{if $first}}None{{end}} + <div class="flex-item-body" data-tooltip-content="{{ctx.Locale.Tr "repo.settings.change_team_permission_tip"}}"> + Sections: {{range $u, $unit := $.Units}}{{if and ($.Repo.UnitEnabled $.Context $unit.Type) ($team.UnitEnabled $.Context $unit.Type)}}{{if $first}}{{$first = false}}{{else}}, {{end}}{{ctx.Locale.Tr $unit.NameKey}}{{end}}{{end}} {{if $first}}None{{end}} </div> {{end}} </div> {{if $allowedToChangeTeams}} - <div class="flex-item-trailing" {{if .IncludesAllRepositories}} data-tooltip-content="{{$.locale.Tr "repo.settings.delete_team_tip"}}"{{end}}> + <div class="flex-item-trailing" {{if .IncludesAllRepositories}} data-tooltip-content="{{ctx.Locale.Tr "repo.settings.delete_team_tip"}}"{{end}}> <button class="ui red tiny button inline text-thin delete-button {{if .IncludesAllRepositories}}disabled{{end}}" data-url="{{$.Link}}/team/delete" data-id="{{.ID}}"> - {{$.locale.Tr "repo.settings.delete_collaborator"}} + {{ctx.Locale.Tr "repo.settings.delete_collaborator"}} </button> </div> {{end}} @@ -90,13 +90,13 @@ <form class="ui form" id="repo-collab-team-form" action="{{.Link}}/team" method="post"> {{.CsrfTokenHtml}} <div id="search-team-box" class="ui search input gt-vm" data-org-name="{{.OrgName}}"> - <input class="prompt" name="team" placeholder="{{$.locale.Tr "repo.settings.search_team"}}" autocomplete="off" autofocus required> + <input class="prompt" name="team" placeholder="{{ctx.Locale.Tr "repo.settings.search_team"}}" autocomplete="off" autofocus required> </div> - <button class="ui primary button">{{$.locale.Tr "repo.settings.add_team"}}</button> + <button class="ui primary button">{{ctx.Locale.Tr "repo.settings.add_team"}}</button> </form> {{else}} <div class="item"> - {{$.locale.Tr "repo.settings.change_team_access_not_allowed"}} + {{ctx.Locale.Tr "repo.settings.change_team_access_not_allowed"}} </div> {{end}} </div> @@ -106,10 +106,10 @@ <div class="ui g-modal-confirm delete modal"> <div class="header"> {{svg "octicon-trash"}} - {{.locale.Tr "repo.settings.collaborator_deletion"}} + {{ctx.Locale.Tr "repo.settings.collaborator_deletion"}} </div> <div class="content"> - <p>{{.locale.Tr "repo.settings.collaborator_deletion_desc"}}</p> + <p>{{ctx.Locale.Tr "repo.settings.collaborator_deletion_desc"}}</p> </div> {{template "base/modal_actions_confirm" .}} </div> diff --git a/templates/repo/settings/deploy_keys.tmpl b/templates/repo/settings/deploy_keys.tmpl index a7b7dd6511..7f60c567b1 100644 --- a/templates/repo/settings/deploy_keys.tmpl +++ b/templates/repo/settings/deploy_keys.tmpl @@ -1,12 +1,12 @@ {{template "repo/settings/layout_head" (dict "ctxData" . "pageClass" "repository settings")}} <div class="repo-setting-content"> <h4 class="ui top attached header"> - {{.locale.Tr "repo.settings.deploy_keys"}} + {{ctx.Locale.Tr "repo.settings.deploy_keys"}} <div class="ui right"> {{if not .DisableSSH}} - <button class="ui primary tiny show-panel toggle button" data-panel="#add-deploy-key-panel">{{.locale.Tr "repo.settings.add_deploy_key"}}</button> + <button class="ui primary tiny show-panel toggle button" data-panel="#add-deploy-key-panel">{{ctx.Locale.Tr "repo.settings.add_deploy_key"}}</button> {{else}} - <button class="ui primary tiny button disabled">{{.locale.Tr "settings.ssh_disabled"}}</button> + <button class="ui primary tiny button disabled">{{ctx.Locale.Tr "settings.ssh_disabled"}}</button> {{end}} </div> </h4> @@ -15,30 +15,30 @@ <form class="ui form" action="{{.Link}}" method="post"> {{.CsrfTokenHtml}} <div class="field"> - {{.locale.Tr "repo.settings.deploy_key_desc"}} + {{ctx.Locale.Tr "repo.settings.deploy_key_desc"}} </div> <div class="field {{if .Err_Title}}error{{end}}"> - <label for="title">{{.locale.Tr "repo.settings.title"}}</label> + <label for="title">{{ctx.Locale.Tr "repo.settings.title"}}</label> <input id="ssh-key-title" name="title" value="{{.title}}" autofocus required> </div> <div class="field {{if .Err_Content}}error{{end}}"> - <label for="content">{{.locale.Tr "repo.settings.deploy_key_content"}}</label> - <textarea id="ssh-key-content" name="content" placeholder="{{.locale.Tr "settings.key_content_ssh_placeholder"}}" required>{{.content}}</textarea> + <label for="content">{{ctx.Locale.Tr "repo.settings.deploy_key_content"}}</label> + <textarea id="ssh-key-content" name="content" placeholder="{{ctx.Locale.Tr "settings.key_content_ssh_placeholder"}}" required>{{.content}}</textarea> </div> <div class="field"> <div class="ui checkbox {{if .Err_IsWritable}}error{{end}}"> <input id="ssh-key-is-writable" name="is_writable" type="checkbox" value="1"> <label for="is_writable"> - {{.locale.Tr "repo.settings.is_writable"}} + {{ctx.Locale.Tr "repo.settings.is_writable"}} </label> - <small style="padding-left: 26px;">{{$.locale.Tr "repo.settings.is_writable_info" | Str2html}}</small> + <small style="padding-left: 26px;">{{ctx.Locale.Tr "repo.settings.is_writable_info" | Str2html}}</small> </div> </div> <button class="ui primary button"> - {{.locale.Tr "repo.settings.add_deploy_key"}} + {{ctx.Locale.Tr "repo.settings.add_deploy_key"}} </button> <button class="ui hide-panel button" data-panel="#add-deploy-key-panel"> - {{.locale.Tr "cancel"}} + {{ctx.Locale.Tr "cancel"}} </button> </form> </div> @@ -47,7 +47,7 @@ {{range .Deploykeys}} <div class="flex-item"> <div class="flex-item-leading"> - <span class="text {{if .HasRecentActivity}}green{{end}}" {{if .HasRecentActivity}}data-tooltip-content="{{$.locale.Tr "settings.key_state_desc"}}"{{end}}>{{svg "octicon-key" 32}}</span> + <span class="text {{if .HasRecentActivity}}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> @@ -55,19 +55,19 @@ {{.Fingerprint}} </div> <div class="flex-item-body"> - <i>{{$.locale.Tr "settings.added_on" (DateTime "short" .CreatedUnix) | Safe}} — {{svg "octicon-info"}} {{if .HasUsed}}{{$.locale.Tr "settings.last_used"}} <span {{if .HasRecentActivity}}class="text green"{{end}}>{{DateTime "short" .UpdatedUnix}}</span>{{else}}{{$.locale.Tr "settings.no_activity"}}{{end}} - <span>{{$.locale.Tr "settings.can_read_info"}}{{if not .IsReadOnly}} / {{$.locale.Tr "settings.can_write_info"}} {{end}}</span></i> + <i>{{ctx.Locale.Tr "settings.added_on" (DateTime "short" .CreatedUnix) | Safe}} — {{svg "octicon-info"}} {{if .HasUsed}}{{ctx.Locale.Tr "settings.last_used"}} <span {{if .HasRecentActivity}}class="text green"{{end}}>{{DateTime "short" .UpdatedUnix}}</span>{{else}}{{$.locale.Tr "settings.no_activity"}}{{end}} - <span>{{$.locale.Tr "settings.can_read_info"}}{{if not .IsReadOnly}} / {{$.locale.Tr "settings.can_write_info"}} {{end}}</span></i> </div> </div> <div class="flex-item-trailing"> <button class="ui red tiny button delete-button" data-url="{{$.Link}}/delete" data-id="{{.ID}}"> - {{$.locale.Tr "settings.delete_key"}} + {{ctx.Locale.Tr "settings.delete_key"}} </button> </div> </div> {{end}} </div> {{else}} - {{.locale.Tr "repo.settings.no_deploy_keys"}} + {{ctx.Locale.Tr "repo.settings.no_deploy_keys"}} {{end}} </div> </div> @@ -75,10 +75,10 @@ <div class="ui g-modal-confirm delete modal"> <div class="header"> {{svg "octicon-trash"}} - {{.locale.Tr "repo.settings.deploy_key_deletion"}} + {{ctx.Locale.Tr "repo.settings.deploy_key_deletion"}} </div> <div class="content"> - <p>{{.locale.Tr "repo.settings.deploy_key_deletion_desc"}}</p> + <p>{{ctx.Locale.Tr "repo.settings.deploy_key_deletion_desc"}}</p> </div> {{template "base/modal_actions_confirm" .}} </div> diff --git a/templates/repo/settings/githook_edit.tmpl b/templates/repo/settings/githook_edit.tmpl index c2fabd02ed..db8982a282 100644 --- a/templates/repo/settings/githook_edit.tmpl +++ b/templates/repo/settings/githook_edit.tmpl @@ -1,24 +1,24 @@ {{template "repo/settings/layout_head" (dict "ctxData" . "pageClass" "repository settings edit githook")}} <div class="repo-setting-content"> <h4 class="ui top attached header"> - {{.locale.Tr "repo.settings.githooks"}} + {{ctx.Locale.Tr "repo.settings.githooks"}} </h4> <div class="ui attached segment"> - <p>{{.locale.Tr "repo.settings.githook_edit_desc"}}</p> + <p>{{ctx.Locale.Tr "repo.settings.githook_edit_desc"}}</p> <form class="ui form" action="{{.Link}}" method="post"> {{.CsrfTokenHtml}} {{with .Hook}} <div class="inline field"> - <label>{{$.locale.Tr "repo.settings.githook_name"}}</label> + <label>{{ctx.Locale.Tr "repo.settings.githook_name"}}</label> <span class="hook-filename">{{.Name}}</span> </div> <div class="field"> - <label for="content">{{$.locale.Tr "repo.settings.githook_content"}}</label> + <label for="content">{{ctx.Locale.Tr "repo.settings.githook_content"}}</label> <textarea id="content" name="content" class="gt-hidden">{{if .IsActive}}{{.Content}}{{else}}{{.Sample}}{{end}}</textarea> <div class="editor-loading is-loading"></div> </div> <div class="inline field"> - <button class="ui primary button">{{$.locale.Tr "repo.settings.update_githook"}}</button> + <button class="ui primary button">{{ctx.Locale.Tr "repo.settings.update_githook"}}</button> </div> {{end}} </form> diff --git a/templates/repo/settings/githooks.tmpl b/templates/repo/settings/githooks.tmpl index 75729108fa..389d381f30 100644 --- a/templates/repo/settings/githooks.tmpl +++ b/templates/repo/settings/githooks.tmpl @@ -1,12 +1,12 @@ {{template "repo/settings/layout_head" (dict "ctxData" . "pageClass" "repository settings githooks")}} <div class="repo-setting-content"> <h4 class="ui top attached header"> - {{.locale.Tr "repo.settings.githooks"}} + {{ctx.Locale.Tr "repo.settings.githooks"}} </h4> <div class="ui attached segment"> <div class="ui list"> <div class="item"> - {{.locale.Tr "repo.settings.githooks_desc" | Str2html}} + {{ctx.Locale.Tr "repo.settings.githooks_desc" | Str2html}} </div> {{range .Hooks}} <div class="item truncated-item-container"> diff --git a/templates/repo/settings/lfs.tmpl b/templates/repo/settings/lfs.tmpl index 06ccb92c30..f30e480e26 100644 --- a/templates/repo/settings/lfs.tmpl +++ b/templates/repo/settings/lfs.tmpl @@ -1,10 +1,10 @@ {{template "repo/settings/layout_head" (dict "ctxData" . "pageClass" "repository settings lfs")}} <div class="repo-setting-content"> <h4 class="ui top attached header"> - {{.locale.Tr "repo.settings.lfs_filelist"}} ({{.locale.Tr "admin.total" .Total}}) + {{ctx.Locale.Tr "repo.settings.lfs_filelist"}} ({{.locale.Tr "admin.total" .Total}}) <div class="ui right"> - <a class="ui tiny button" href="{{.Link}}/locks">{{.locale.Tr "repo.settings.lfs_locks"}}</a> - <a class="ui primary tiny button" href="{{.Link}}/pointers"> {{.locale.Tr "repo.settings.lfs_findpointerfiles"}}</a> + <a class="ui tiny button" href="{{.Link}}/locks">{{ctx.Locale.Tr "repo.settings.lfs_locks"}}</a> + <a class="ui primary tiny button" href="{{.Link}}/pointers"> {{ctx.Locale.Tr "repo.settings.lfs_findpointerfiles"}}</a> </div> </h4> <table id="lfs-files-table" class="ui attached segment single line table"> @@ -19,15 +19,15 @@ <td>{{FileSize .Size}}</td> <td>{{TimeSince .CreatedUnix.AsTime $.locale}}</td> <td class="right aligned"> - <a class="ui primary button" href="{{$.Link}}/find?oid={{.Oid}}&size={{.Size}}">{{$.locale.Tr "repo.settings.lfs_findcommits"}}</a> + <a class="ui primary button" href="{{$.Link}}/find?oid={{.Oid}}&size={{.Size}}">{{ctx.Locale.Tr "repo.settings.lfs_findcommits"}}</a> <button class="ui basic show-modal icon button red" data-modal="#delete-{{.Oid}}"> - <span class="btn-octicon btn-octicon-danger" data-tooltip-content="{{$.locale.Tr "repo.editor.delete_this_file"}}">{{svg "octicon-trash"}}</span> + <span class="btn-octicon btn-octicon-danger" data-tooltip-content="{{ctx.Locale.Tr "repo.editor.delete_this_file"}}">{{svg "octicon-trash"}}</span> </button> </td> </tr> {{else}} <tr> - <td colspan="4">{{.locale.Tr "repo.settings.lfs_no_lfs_files"}}</td> + <td colspan="4">{{ctx.Locale.Tr "repo.settings.lfs_no_lfs_files"}}</td> </tr> {{end}} </tbody> @@ -36,11 +36,11 @@ {{range .LFSFiles}} <div class="ui g-modal-confirm modal" id="delete-{{.Oid}}"> <div class="header"> - {{$.locale.Tr "repo.settings.lfs_delete" .Oid}} + {{ctx.Locale.Tr "repo.settings.lfs_delete" .Oid}} </div> <div class="content"> <p> - {{$.locale.Tr "repo.settings.lfs_delete_warning"}} + {{ctx.Locale.Tr "repo.settings.lfs_delete_warning"}} </p> <form class="ui form" action="{{$.Link}}/delete/{{.Oid}}" method="post"> {{$.CsrfTokenHtml}} diff --git a/templates/repo/settings/lfs_file.tmpl b/templates/repo/settings/lfs_file.tmpl index de6f0100f8..a718eed0f1 100644 --- a/templates/repo/settings/lfs_file.tmpl +++ b/templates/repo/settings/lfs_file.tmpl @@ -2,13 +2,13 @@ <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"> - <a href="{{.LFSFilesLink}}">{{.locale.Tr "repo.settings.lfs"}}</a> / <span class="truncate sha">{{.LFSFile.Oid}}</span> + <a href="{{.LFSFilesLink}}">{{ctx.Locale.Tr "repo.settings.lfs"}}</a> / <span class="truncate sha">{{.LFSFile.Oid}}</span> <div class="ui right"> {{if .EscapeStatus.Escaped}} - <a class="ui mini basic button unescape-button gt-hidden">{{.locale.Tr "repo.unescape_control_characters"}}</a> - <a class="ui mini basic button escape-button">{{.locale.Tr "repo.escape_control_characters"}}</a> + <a class="ui mini basic button unescape-button gt-hidden">{{ctx.Locale.Tr "repo.unescape_control_characters"}}</a> + <a class="ui mini basic button escape-button">{{ctx.Locale.Tr "repo.escape_control_characters"}}</a> {{end}} - <a class="ui primary button" href="{{.LFSFilesLink}}/find?oid={{.LFSFile.Oid}}&size={{.LFSFile.Size}}">{{$.locale.Tr "repo.settings.lfs_findcommits"}}</a> + <a class="ui primary button" href="{{.LFSFilesLink}}/find?oid={{.LFSFile.Oid}}&size={{.LFSFile.Size}}">{{ctx.Locale.Tr "repo.settings.lfs_findcommits"}}</a> </div> </h4> <div class="ui attached table unstackable segment"> @@ -24,16 +24,16 @@ <img src="{{$.RawFileLink}}"> {{else if .IsVideoFile}} <video controls src="{{$.RawFileLink}}"> - <strong>{{.locale.Tr "repo.video_not_supported_in_browser"}}</strong> + <strong>{{ctx.Locale.Tr "repo.video_not_supported_in_browser"}}</strong> </video> {{else if .IsAudioFile}} <audio controls src="{{$.RawFileLink}}"> - <strong>{{.locale.Tr "repo.audio_not_supported_in_browser"}}</strong> + <strong>{{ctx.Locale.Tr "repo.audio_not_supported_in_browser"}}</strong> </audio> {{else if .IsPDFFile}} - <div class="pdf-content is-loading" data-src="{{$.RawFileLink}}" data-fallback-button-text="{{.locale.Tr "diff.view_file"}}"></div> + <div class="pdf-content is-loading" data-src="{{$.RawFileLink}}" data-fallback-button-text="{{ctx.Locale.Tr "diff.view_file"}}"></div> {{else}} - <a href="{{$.RawFileLink}}" rel="nofollow" class="btn btn-gray btn-radius">{{.locale.Tr "repo.file_view_raw"}}</a> + <a href="{{$.RawFileLink}}" rel="nofollow" class="btn btn-gray btn-radius">{{ctx.Locale.Tr "repo.file_view_raw"}}</a> {{end}} </div> {{else if .FileSize}} @@ -41,7 +41,7 @@ <tbody> <tr> {{if .IsFileTooLarge}} - <td><strong>{{.locale.Tr "repo.file_too_large"}}</strong></td> + <td><strong>{{ctx.Locale.Tr "repo.file_too_large"}}</strong></td> {{else}} <td class="lines-num">{{.LineNums}}</td> <td class="lines-code"><pre><code class="{{.HighlightClass}}"><ol>{{.FileContent}}</ol></code></pre></td> diff --git a/templates/repo/settings/lfs_file_find.tmpl b/templates/repo/settings/lfs_file_find.tmpl index b85f67fb43..0ffb637511 100644 --- a/templates/repo/settings/lfs_file_find.tmpl +++ b/templates/repo/settings/lfs_file_find.tmpl @@ -2,7 +2,7 @@ <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"> - <a href="{{.LFSFilesLink}}">{{.locale.Tr "repo.settings.lfs"}}</a> / <span class="truncate sha">{{.Oid}}</span> + <a href="{{.LFSFilesLink}}">{{ctx.Locale.Tr "repo.settings.lfs"}}</a> / <span class="truncate sha">{{.Oid}}</span> </h4> <table id="lfs-files-find-table" class="ui attached segment single line table"> <tbody> @@ -24,19 +24,19 @@ </td> <td> {{if .ParentHashes}} - {{$.locale.Tr "repo.diff.parent"}} + {{ctx.Locale.Tr "repo.diff.parent"}} {{range .ParentHashes}} <a class="ui primary sha label" href="{{$.RepoLink}}/commit/{{.String}}">{{ShortSha .String}}</a> {{end}} {{end}} - {{$.locale.Tr "repo.diff.commit"}} + {{ctx.Locale.Tr "repo.diff.commit"}} <a class="ui primary sha label" href="{{$.RepoLink}}/commit/{{.SHA}}">{{ShortSha .SHA}}</a> </td> <td>{{TimeSince .When $.locale}}</td> </tr> {{else}} <tr> - <td colspan="5">{{.locale.Tr "repo.settings.lfs_lfs_file_no_commits"}}</td> + <td colspan="5">{{ctx.Locale.Tr "repo.settings.lfs_lfs_file_no_commits"}}</td> </tr> {{end}} </tbody> diff --git a/templates/repo/settings/lfs_locks.tmpl b/templates/repo/settings/lfs_locks.tmpl index 4eadf9ca32..0e389ea6b8 100644 --- a/templates/repo/settings/lfs_locks.tmpl +++ b/templates/repo/settings/lfs_locks.tmpl @@ -2,14 +2,14 @@ <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"> - <a href="{{.LFSFilesLink}}">{{.locale.Tr "repo.settings.lfs"}}</a> / {{.locale.Tr "repo.settings.lfs_locks"}} ({{.locale.Tr "admin.total" .Total}}) + <a href="{{.LFSFilesLink}}">{{ctx.Locale.Tr "repo.settings.lfs"}}</a> / {{.locale.Tr "repo.settings.lfs_locks"}} ({{.locale.Tr "admin.total" .Total}}) </h4> <div class="ui attached segment"> <form class="ui form ignore-dirty" method="post"> {{$.CsrfTokenHtml}} <div class="ui fluid action input"> - <input name="path" value="" placeholder="{{.locale.Tr "repo.settings.lfs_lock_path"}}" autofocus> - <button class="ui primary button">{{.locale.Tr "repo.settings.lfs_lock"}}</button> + <input name="path" value="" placeholder="{{ctx.Locale.Tr "repo.settings.lfs_lock_path"}}" autofocus> + <button class="ui primary button">{{ctx.Locale.Tr "repo.settings.lfs_lock"}}</button> </div> </form> </div> @@ -23,10 +23,10 @@ <a href="{{$.RepoLink}}/src/branch/{{PathEscapeSegments $.Repository.DefaultBranch}}/{{PathEscapeSegments $lock.Path}}" title="{{$lock.Path}}">{{$lock.Path}}</a> {{else}} {{svg "octicon-diff"}} - <span data-tooltip-content="{{$.locale.Tr "repo.settings.lfs_lock_file_no_exist"}}">{{$lock.Path}}</span> + <span data-tooltip-content="{{ctx.Locale.Tr "repo.settings.lfs_lock_file_no_exist"}}">{{$lock.Path}}</span> {{end}} {{if not (index $.Lockables $index)}} - <span data-tooltip-content="{{$.locale.Tr "repo.settings.lfs_noattribute"}}">{{svg "octicon-alert"}}</span> + <span data-tooltip-content="{{ctx.Locale.Tr "repo.settings.lfs_noattribute"}}">{{svg "octicon-alert"}}</span> {{end}} </td> <td> @@ -39,13 +39,13 @@ <td class="right aligned"> <form action="{{$.LFSFilesLink}}/locks/{{$lock.ID}}/unlock" method="post"> {{$.CsrfTokenHtml}} - <button class="ui primary button"><span class="btn-octicon">{{svg "octicon-lock"}}</span>{{$.locale.Tr "repo.settings.lfs_force_unlock"}}</button> + <button class="ui primary button"><span class="btn-octicon">{{svg "octicon-lock"}}</span>{{ctx.Locale.Tr "repo.settings.lfs_force_unlock"}}</button> </form> </td> </tr> {{else}} <tr> - <td colspan="4">{{.locale.Tr "repo.settings.lfs_locks_no_locks"}}</td> + <td colspan="4">{{ctx.Locale.Tr "repo.settings.lfs_locks_no_locks"}}</td> </tr> {{end}} </tbody> diff --git a/templates/repo/settings/lfs_pointers.tmpl b/templates/repo/settings/lfs_pointers.tmpl index db3fdd2f85..1f710869bb 100644 --- a/templates/repo/settings/lfs_pointers.tmpl +++ b/templates/repo/settings/lfs_pointers.tmpl @@ -1,7 +1,7 @@ {{template "repo/settings/layout_head" (dict "ctxData" . "pageClass" "repository settings lfs")}} <div class="repo-setting-content"> <h4 class="ui top attached header"> - {{.locale.Tr "repo.settings.lfs_pointers.found" .NumPointers .NumAssociated .NumNotAssociated .NumNoExist}} + {{ctx.Locale.Tr "repo.settings.lfs_pointers.found" .NumPointers .NumAssociated .NumNotAssociated .NumNoExist}} {{if gt .NumAssociatable 0}} <div class="ui right"> <form class="ui form" method="post" action="{{$.Link}}/associate"> @@ -11,7 +11,7 @@ <input type="hidden" name="oid" value="{{.Oid}} {{.Size}}"> {{end}} {{end}} - <button class="ui primary button">{{$.locale.Tr "repo.settings.lfs_pointers.associateAccessible" $.NumAssociatable}}</button> + <button class="ui primary button">{{ctx.Locale.Tr "repo.settings.lfs_pointers.associateAccessible" $.NumAssociatable}}</button> </form> </div> {{end}} @@ -20,11 +20,11 @@ <table id="lfs-files-table" class="ui fixed single line table"> <thead> <tr> - <th class="three wide">{{.locale.Tr "repo.settings.lfs_pointers.sha"}}</th> - <th class="four wide">{{.locale.Tr "repo.settings.lfs_pointers.oid"}}</th> - <th class="two wide">{{.locale.Tr "repo.settings.lfs_pointers.inRepo"}}</th> - <th class="two wide">{{.locale.Tr "repo.settings.lfs_pointers.exists"}}</th> - <th class="two wide" data-tooltip-content="{{.locale.Tr "repo.settings.lfs_pointers.accessible"}}">{{.locale.Tr "repo.settings.lfs_pointers.accessible"}}</th> + <th class="three wide">{{ctx.Locale.Tr "repo.settings.lfs_pointers.sha"}}</th> + <th class="four wide">{{ctx.Locale.Tr "repo.settings.lfs_pointers.oid"}}</th> + <th class="two wide">{{ctx.Locale.Tr "repo.settings.lfs_pointers.inRepo"}}</th> + <th class="two wide">{{ctx.Locale.Tr "repo.settings.lfs_pointers.exists"}}</th> + <th class="two wide" data-tooltip-content="{{ctx.Locale.Tr "repo.settings.lfs_pointers.accessible"}}">{{.locale.Tr "repo.settings.lfs_pointers.accessible"}}</th> <th class="three wide"></th> </tr> </thead> @@ -45,7 +45,7 @@ <td>{{if .Exists}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</td> <td>{{if .Accessible}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</td> <td class="gt-text-right"> - <a class="ui primary button" href="{{$.LFSFilesLink}}/find?oid={{.Oid}}&size={{.Size}}&sha={{.SHA}}">{{$.locale.Tr "repo.settings.lfs_findcommits"}}</a> + <a class="ui primary button" href="{{$.LFSFilesLink}}/find?oid={{.Oid}}&size={{.Size}}&sha={{.SHA}}">{{ctx.Locale.Tr "repo.settings.lfs_findcommits"}}</a> </td> </tr> {{end}} diff --git a/templates/repo/settings/nav.tmpl b/templates/repo/settings/nav.tmpl index 4a88d69adf..93ecb3877b 100644 --- a/templates/repo/settings/nav.tmpl +++ b/templates/repo/settings/nav.tmpl @@ -1,19 +1,19 @@ <div id="setting-menu" class="grid-1-5 panel panel-radius left"> - <p class="panel-header"><strong>{{.locale.Tr "repo.settings"}}</strong></p> + <p class="panel-header"><strong>{{ctx.Locale.Tr "repo.settings"}}</strong></p> <div class="panel-body"> <ul class="menu menu-vertical switching-list grid-1-5 left"> - <li {{if .PageIsSettingsOptions}}class="current"{{end}}><a href="{{.RepoLink}}/settings">{{.locale.Tr "repo.settings.options"}}</a></li> - <li {{if .PageIsSettingsCollaboration}}class="current"{{end}}><a href="{{.RepoLink}}/settings/collaboration">{{.locale.Tr "repo.settings.collaboration"}}</a></li> - <li {{if .PageIsSettingsBranches}}class="current"{{end}}><a href="{{.RepoLink}}/settings/branches">{{.locale.Tr "repo.settings.branches"}}</a></li> - <li {{if .PageIsSettingsTags}}class="current"{{end}}><a href="{{.RepoLink}}/settings/tags">{{.locale.Tr "repo.settings.tags"}}</a></li> + <li {{if .PageIsSettingsOptions}}class="current"{{end}}><a href="{{.RepoLink}}/settings">{{ctx.Locale.Tr "repo.settings.options"}}</a></li> + <li {{if .PageIsSettingsCollaboration}}class="current"{{end}}><a href="{{.RepoLink}}/settings/collaboration">{{ctx.Locale.Tr "repo.settings.collaboration"}}</a></li> + <li {{if .PageIsSettingsBranches}}class="current"{{end}}><a href="{{.RepoLink}}/settings/branches">{{ctx.Locale.Tr "repo.settings.branches"}}</a></li> + <li {{if .PageIsSettingsTags}}class="current"{{end}}><a href="{{.RepoLink}}/settings/tags">{{ctx.Locale.Tr "repo.settings.tags"}}</a></li> {{if not DisableWebhooks}} - <li {{if .PageIsSettingsHooks}}class="current"{{end}}><a href="{{.RepoLink}}/settings/hooks">{{.locale.Tr "repo.settings.hooks"}}</a></li> + <li {{if .PageIsSettingsHooks}}class="current"{{end}}><a href="{{.RepoLink}}/settings/hooks">{{ctx.Locale.Tr "repo.settings.hooks"}}</a></li> {{end}} {{if or .SignedUser.AllowGitHook .SignedUser.IsAdmin}} - <li {{if .PageIsSettingsGitHooks}}class="current"{{end}}><a href="{{.RepoLink}}/settings/hooks/git">{{.locale.Tr "repo.settings.githooks"}}</a></li> + <li {{if .PageIsSettingsGitHooks}}class="current"{{end}}><a href="{{.RepoLink}}/settings/hooks/git">{{ctx.Locale.Tr "repo.settings.githooks"}}</a></li> {{end}} - <li {{if .PageIsSettingsKeys}}class="current"{{end}}><a href="{{.RepoLink}}/settings/keys">{{.locale.Tr "repo.settings.deploy_keys"}}</a></li> - <li {{if .PageIsSharedSettingsSecrets}}class="current"{{end}}><a href="{{.RepoLink}}/settings/secrets">{{.locale.Tr "secrets.secrets"}}</a></li> + <li {{if .PageIsSettingsKeys}}class="current"{{end}}><a href="{{.RepoLink}}/settings/keys">{{ctx.Locale.Tr "repo.settings.deploy_keys"}}</a></li> + <li {{if .PageIsSharedSettingsSecrets}}class="current"{{end}}><a href="{{.RepoLink}}/settings/secrets">{{ctx.Locale.Tr "secrets.secrets"}}</a></li> </ul> </div> </div> diff --git a/templates/repo/settings/navbar.tmpl b/templates/repo/settings/navbar.tmpl index 390cc5022d..74c4b86c68 100644 --- a/templates/repo/settings/navbar.tmpl +++ b/templates/repo/settings/navbar.tmpl @@ -1,50 +1,50 @@ <div class="four wide column"> <div class="ui fluid vertical menu"> - <div class="header item">{{.locale.Tr "repo.settings"}}</div> + <div class="header item">{{ctx.Locale.Tr "repo.settings"}}</div> <a class="{{if .PageIsSettingsOptions}}active {{end}}item" href="{{.RepoLink}}/settings"> - {{.locale.Tr "repo.settings.options"}} + {{ctx.Locale.Tr "repo.settings.options"}} </a> <a class="{{if .PageIsSettingsCollaboration}}active {{end}}item" href="{{.RepoLink}}/settings/collaboration"> - {{.locale.Tr "repo.settings.collaboration"}} + {{ctx.Locale.Tr "repo.settings.collaboration"}} </a> {{if not .Repository.IsEmpty}} <a class="{{if .PageIsSettingsBranches}}active {{end}}item" href="{{.RepoLink}}/settings/branches"> - {{.locale.Tr "repo.settings.branches"}} + {{ctx.Locale.Tr "repo.settings.branches"}} </a> {{end}} <a class="{{if .PageIsSettingsTags}}active {{end}}item" href="{{.RepoLink}}/settings/tags"> - {{.locale.Tr "repo.settings.tags"}} + {{ctx.Locale.Tr "repo.settings.tags"}} </a> {{if not DisableWebhooks}} <a class="{{if .PageIsSettingsHooks}}active {{end}}item" href="{{.RepoLink}}/settings/hooks"> - {{.locale.Tr "repo.settings.hooks"}} + {{ctx.Locale.Tr "repo.settings.hooks"}} </a> {{end}} {{if .SignedUser.CanEditGitHook}} <a class="{{if .PageIsSettingsGitHooks}}active {{end}}item" href="{{.RepoLink}}/settings/hooks/git"> - {{.locale.Tr "repo.settings.githooks"}} + {{ctx.Locale.Tr "repo.settings.githooks"}} </a> {{end}} <a class="{{if .PageIsSettingsKeys}}active {{end}}item" href="{{.RepoLink}}/settings/keys"> - {{.locale.Tr "repo.settings.deploy_keys"}} + {{ctx.Locale.Tr "repo.settings.deploy_keys"}} </a> {{if .LFSStartServer}} <a class="{{if .PageIsSettingsLFS}}active {{end}}item" href="{{.RepoLink}}/settings/lfs"> - {{.locale.Tr "repo.settings.lfs"}} + {{ctx.Locale.Tr "repo.settings.lfs"}} </a> {{end}} {{if and .EnableActions (not .UnitActionsGlobalDisabled) (.Permission.CanRead $.UnitTypeActions)}} <details class="item toggleable-item" {{if or .PageIsSharedSettingsRunners .PageIsSharedSettingsSecrets .PageIsSharedSettingsVariables}}open{{end}}> - <summary>{{.locale.Tr "actions.actions"}}</summary> + <summary>{{ctx.Locale.Tr "actions.actions"}}</summary> <div class="menu"> <a class="{{if .PageIsSharedSettingsRunners}}active {{end}}item" href="{{.RepoLink}}/settings/actions/runners"> - {{.locale.Tr "actions.runners"}} + {{ctx.Locale.Tr "actions.runners"}} </a> <a class="{{if .PageIsSharedSettingsSecrets}}active {{end}}item" href="{{.RepoLink}}/settings/actions/secrets"> - {{.locale.Tr "secrets.secrets"}} + {{ctx.Locale.Tr "secrets.secrets"}} </a> <a class="{{if .PageIsSharedSettingsVariables}}active {{end}}item" href="{{.RepoLink}}/settings/actions/variables"> - {{.locale.Tr "actions.variables"}} + {{ctx.Locale.Tr "actions.variables"}} </a> </div> </details> diff --git a/templates/repo/settings/options.tmpl b/templates/repo/settings/options.tmpl index 28841de4cd..82c7982b8b 100644 --- a/templates/repo/settings/options.tmpl +++ b/templates/repo/settings/options.tmpl @@ -1,7 +1,7 @@ {{template "repo/settings/layout_head" (dict "ctxData" . "pageClass" "repository settings options")}} <div class="user-main-content twelve wide column"> <h4 class="ui top attached header"> - {{.locale.Tr "repo.settings.basic_settings"}} + {{ctx.Locale.Tr "repo.settings.basic_settings"}} </h4> <div class="ui attached segment"> <form class="ui form" action="{{.Link}}" method="post"> @@ -9,43 +9,43 @@ {{.CsrfTokenHtml}} <input type="hidden" name="action" value="update"> <div class="required field {{if .Err_RepoName}}error{{end}}"> - <label for="repo_name">{{.locale.Tr "repo.repo_name"}}</label> + <label for="repo_name">{{ctx.Locale.Tr "repo.repo_name"}}</label> <input id="repo_name" name="repo_name" value="{{.Repository.Name}}" data-repo-name="{{.Repository.Name}}" autofocus required> </div> <div class="inline field"> - <label>{{.locale.Tr "repo.repo_size"}}</label> + <label>{{ctx.Locale.Tr "repo.repo_size"}}</label> <span {{if not (eq .Repository.Size 0)}} data-tooltip-content="{{.Repository.SizeDetailsString}}"{{end}}>{{FileSize .Repository.Size}}</span> </div> <div class="inline field"> - <label>{{.locale.Tr "repo.template"}}</label> + <label>{{ctx.Locale.Tr "repo.template"}}</label> <div class="ui checkbox"> <input name="template" type="checkbox" {{if .Repository.IsTemplate}}checked{{end}}> - <label>{{.locale.Tr "repo.template_helper"}}</label> + <label>{{ctx.Locale.Tr "repo.template_helper"}}</label> </div> </div> {{if not .Repository.IsFork}} <div class="inline field"> - <label>{{.locale.Tr "repo.visibility"}}</label> - <div class="ui checkbox" {{if and (not .Repository.IsPrivate) (gt .Repository.NumStars 0)}}data-tooltip-content="{{.locale.Tr "repo.stars_remove_warning"}}"{{end}}> + <label>{{ctx.Locale.Tr "repo.visibility"}}</label> + <div class="ui checkbox" {{if and (not .Repository.IsPrivate) (gt .Repository.NumStars 0)}}data-tooltip-content="{{ctx.Locale.Tr "repo.stars_remove_warning"}}"{{end}}> {{if .IsAdmin}} <input name="private" type="checkbox" {{if .Repository.IsPrivate}}checked{{end}}> {{else}} <input name="private" type="checkbox" {{if .Repository.IsPrivate}}checked{{end}}{{if and $.ForcePrivate .Repository.IsPrivate}} readonly{{end}}> {{end}} - <label>{{.locale.Tr "repo.visibility_helper" | Safe}} {{if .Repository.NumForks}}<span class="text red">{{.locale.Tr "repo.visibility_fork_helper"}}</span>{{end}}</label> + <label>{{ctx.Locale.Tr "repo.visibility_helper" | Safe}} {{if .Repository.NumForks}}<span class="text red">{{.locale.Tr "repo.visibility_fork_helper"}}</span>{{end}}</label> </div> </div> {{end}} <div class="field {{if .Err_Description}}error{{end}}"> - <label for="description">{{$.locale.Tr "repo.repo_desc"}}</label> + <label for="description">{{ctx.Locale.Tr "repo.repo_desc"}}</label> <textarea id="description" name="description" rows="2" maxlength="2048">{{.Repository.Description}}</textarea> </div> <div class="field {{if .Err_Website}}error{{end}}"> - <label for="website">{{.locale.Tr "repo.settings.site"}}</label> + <label for="website">{{ctx.Locale.Tr "repo.settings.site"}}</label> <input id="website" name="website" type="url" maxlength="1024" value="{{.Repository.Website}}"> </div> <div class="field"> - <button class="ui primary button">{{$.locale.Tr "repo.settings.update_settings"}}</button> + <button class="ui primary button">{{ctx.Locale.Tr "repo.settings.update_settings"}}</button> </div> </form> @@ -53,12 +53,12 @@ <form class="ui form" action="{{.Link}}/avatar" method="post" enctype="multipart/form-data"> {{.CsrfTokenHtml}} <div class="inline field"> - <label for="avatar">{{.locale.Tr "settings.choose_new_avatar"}}</label> + <label for="avatar">{{ctx.Locale.Tr "settings.choose_new_avatar"}}</label> <input name="avatar" type="file" accept="image/png,image/jpeg,image/gif,image/webp"> </div> <div class="field"> - <button class="ui primary button">{{$.locale.Tr "settings.update_avatar"}}</button> - <button class="ui red button link-action" data-url="{{.Link}}/avatar/delete">{{$.locale.Tr "settings.delete_current_avatar"}}</button> + <button class="ui primary button">{{ctx.Locale.Tr "settings.update_avatar"}}</button> + <button class="ui red button link-action" data-url="{{.Link}}/avatar/delete">{{ctx.Locale.Tr "settings.delete_current_avatar"}}</button> </div> </form> </div> @@ -76,37 +76,37 @@ {{if $showMirrorSettings}} <h4 class="ui top attached header"> - {{.locale.Tr "repo.settings.mirror_settings"}} + {{ctx.Locale.Tr "repo.settings.mirror_settings"}} </h4> <div class="ui attached segment"> {{if $newMirrorsEntirelyEnabled}} - {{$.locale.Tr "repo.settings.mirror_settings.docs"}} - <a target="_blank" rel="noopener noreferrer" href="https://docs.gitea.com/usage/repo-mirror#pushing-to-a-remote-repository">{{$.locale.Tr "repo.settings.mirror_settings.docs.doc_link_title"}}</a><br><br> - {{$.locale.Tr "repo.settings.mirror_settings.docs.pull_mirror_instructions"}} - <a target="_blank" rel="noopener noreferrer" href="https://docs.gitea.com/usage/repo-mirror#pulling-from-a-remote-repository">{{$.locale.Tr "repo.settings.mirror_settings.docs.doc_link_pull_section"}}</a><br> + {{ctx.Locale.Tr "repo.settings.mirror_settings.docs"}} + <a target="_blank" rel="noopener noreferrer" href="https://docs.gitea.com/usage/repo-mirror#pushing-to-a-remote-repository">{{ctx.Locale.Tr "repo.settings.mirror_settings.docs.doc_link_title"}}</a><br><br> + {{ctx.Locale.Tr "repo.settings.mirror_settings.docs.pull_mirror_instructions"}} + <a target="_blank" rel="noopener noreferrer" href="https://docs.gitea.com/usage/repo-mirror#pulling-from-a-remote-repository">{{ctx.Locale.Tr "repo.settings.mirror_settings.docs.doc_link_pull_section"}}</a><br> {{else if $onlyNewPushMirrorsEnabled}} - {{$.locale.Tr "repo.settings.mirror_settings.docs.disabled_pull_mirror.instructions"}} - {{$.locale.Tr "repo.settings.mirror_settings.docs.more_information_if_disabled"}} - <a target="_blank" rel="noopener noreferrer" href="https://docs.gitea.com/usage/repo-mirror#pulling-from-a-remote-repository">{{$.locale.Tr "repo.settings.mirror_settings.docs.doc_link_title"}}</a><br> + {{ctx.Locale.Tr "repo.settings.mirror_settings.docs.disabled_pull_mirror.instructions"}} + {{ctx.Locale.Tr "repo.settings.mirror_settings.docs.more_information_if_disabled"}} + <a target="_blank" rel="noopener noreferrer" href="https://docs.gitea.com/usage/repo-mirror#pulling-from-a-remote-repository">{{ctx.Locale.Tr "repo.settings.mirror_settings.docs.doc_link_title"}}</a><br> {{else if $onlyNewPullMirrorsEnabled}} - {{$.locale.Tr "repo.settings.mirror_settings.docs.disabled_push_mirror.instructions"}} - {{$.locale.Tr "repo.settings.mirror_settings.docs.disabled_push_mirror.pull_mirror_warning"}} - {{$.locale.Tr "repo.settings.mirror_settings.docs.more_information_if_disabled"}} - <a target="_blank" rel="noopener noreferrer" href="https://docs.gitea.com/usage/repo-mirror#pulling-from-a-remote-repository">{{$.locale.Tr "repo.settings.mirror_settings.docs.doc_link_title"}}</a><br><br> - {{$.locale.Tr "repo.settings.mirror_settings.docs.disabled_push_mirror.info"}} + {{ctx.Locale.Tr "repo.settings.mirror_settings.docs.disabled_push_mirror.instructions"}} + {{ctx.Locale.Tr "repo.settings.mirror_settings.docs.disabled_push_mirror.pull_mirror_warning"}} + {{ctx.Locale.Tr "repo.settings.mirror_settings.docs.more_information_if_disabled"}} + <a target="_blank" rel="noopener noreferrer" href="https://docs.gitea.com/usage/repo-mirror#pulling-from-a-remote-repository">{{ctx.Locale.Tr "repo.settings.mirror_settings.docs.doc_link_title"}}</a><br><br> + {{ctx.Locale.Tr "repo.settings.mirror_settings.docs.disabled_push_mirror.info"}} {{if $existingPushMirror}} - {{$.locale.Tr "repo.settings.mirror_settings.docs.can_still_use"}} + {{ctx.Locale.Tr "repo.settings.mirror_settings.docs.can_still_use"}} {{end}} {{else}} - {{$.locale.Tr "repo.settings.mirror_settings.docs.no_new_mirrors"}} {{$.locale.Tr "repo.settings.mirror_settings.docs.can_still_use"}}<br> + {{ctx.Locale.Tr "repo.settings.mirror_settings.docs.no_new_mirrors"}} {{ctx.Locale.Tr "repo.settings.mirror_settings.docs.can_still_use"}}<br> {{end}} <table class="ui table"> {{if $existingPushMirror}} <thead> <tr> - <th style="width:40%">{{$.locale.Tr "repo.settings.mirror_settings.mirrored_repository"}}</th> - <th>{{$.locale.Tr "repo.settings.mirror_settings.direction"}}</th> - <th>{{$.locale.Tr "repo.settings.mirror_settings.last_update"}}</th> + <th style="width:40%">{{ctx.Locale.Tr "repo.settings.mirror_settings.mirrored_repository"}}</th> + <th>{{ctx.Locale.Tr "repo.settings.mirror_settings.direction"}}</th> + <th>{{ctx.Locale.Tr "repo.settings.mirror_settings.last_update"}}</th> <th></th> </tr> </thead> @@ -116,7 +116,7 @@ <tbody> <tr> <td colspan="4"> - <div class="text red gt-py-4 gt-border-secondary-bottom">{{$.locale.Tr "repo.settings.mirror_settings.direction.pull"}}: {{$.locale.Tr "error.occurred"}}</div> + <div class="text red gt-py-4 gt-border-secondary-bottom">{{ctx.Locale.Tr "repo.settings.mirror_settings.direction.pull"}}: {{ctx.Locale.Tr "error.occurred"}}</div> </td> </tr> </tbody> @@ -124,13 +124,13 @@ <tbody> <tr> <td>{{.PullMirror.RemoteAddress}}</td> - <td>{{$.locale.Tr "repo.settings.mirror_settings.direction.pull"}}</td> + <td>{{ctx.Locale.Tr "repo.settings.mirror_settings.direction.pull"}}</td> <td>{{DateTime "full" .PullMirror.UpdatedUnix}}</td> <td class="right aligned"> <form method="post" class="gt-dib"> {{.CsrfTokenHtml}} <input type="hidden" name="action" value="mirror-sync"> - <button class="ui primary tiny button inline text-thin">{{$.locale.Tr "repo.settings.sync_mirror"}}</button> + <button class="ui primary tiny button inline text-thin">{{ctx.Locale.Tr "repo.settings.sync_mirror"}}</button> </form> </td> </tr> @@ -141,55 +141,55 @@ {{.CsrfTokenHtml}} <input type="hidden" name="action" value="mirror"> <div class="inline field {{if .Err_EnablePrune}}error{{end}}"> - <label>{{.locale.Tr "repo.mirror_prune"}}</label> + <label>{{ctx.Locale.Tr "repo.mirror_prune"}}</label> <div class="ui checkbox"> <input id="enable_prune" name="enable_prune" type="checkbox" {{if .PullMirror.EnablePrune}}checked{{end}}> - <label>{{.locale.Tr "repo.mirror_prune_desc"}}</label> + <label>{{ctx.Locale.Tr "repo.mirror_prune_desc"}}</label> </div> </div> <div class="inline field {{if .Err_Interval}}error{{end}}"> - <label for="interval">{{.locale.Tr "repo.mirror_interval" .MinimumMirrorInterval}}</label> + <label for="interval">{{ctx.Locale.Tr "repo.mirror_interval" .MinimumMirrorInterval}}</label> <input id="interval" name="interval" value="{{.PullMirror.Interval}}"> </div> {{$address := MirrorRemoteAddress $.Context .Repository .PullMirror.GetRemoteName false}} <div class="field {{if .Err_MirrorAddress}}error{{end}}"> - <label for="mirror_address">{{.locale.Tr "repo.mirror_address"}}</label> + <label for="mirror_address">{{ctx.Locale.Tr "repo.mirror_address"}}</label> <input id="mirror_address" name="mirror_address" value="{{$address.Address}}" required> - <p class="help">{{.locale.Tr "repo.mirror_address_desc"}}</p> + <p class="help">{{ctx.Locale.Tr "repo.mirror_address_desc"}}</p> </div> <details class="ui optional field" {{if or .Err_Auth $address.Username}}open{{end}}> <summary class="gt-p-2"> - {{.locale.Tr "repo.need_auth"}} + {{ctx.Locale.Tr "repo.need_auth"}} </summary> <div class="gt-p-2"> <div class="inline field {{if .Err_Auth}}error{{end}}"> - <label for="mirror_username">{{.locale.Tr "username"}}</label> + <label for="mirror_username">{{ctx.Locale.Tr "username"}}</label> <input id="mirror_username" name="mirror_username" value="{{$address.Username}}" {{if not .mirror_username}}data-need-clear="true"{{end}}> </div> <div class="inline field {{if .Err_Auth}}error{{end}}"> - <label for="mirror_password">{{.locale.Tr "password"}}</label> - <input id="mirror_password" name="mirror_password" type="password" placeholder="{{if $address.Password}}{{.locale.Tr "repo.mirror_password_placeholder"}}{{else}}{{.locale.Tr "repo.mirror_password_blank_placeholder"}}{{end}}" value="" {{if not .mirror_password}}data-need-clear="true"{{end}} autocomplete="off"> + <label for="mirror_password">{{ctx.Locale.Tr "password"}}</label> + <input id="mirror_password" name="mirror_password" type="password" placeholder="{{if $address.Password}}{{ctx.Locale.Tr "repo.mirror_password_placeholder"}}{{else}}{{.locale.Tr "repo.mirror_password_blank_placeholder"}}{{end}}" value="" {{if not .mirror_password}}data-need-clear="true"{{end}} autocomplete="off"> </div> - <p class="help">{{.locale.Tr "repo.mirror_password_help"}}</p> + <p class="help">{{ctx.Locale.Tr "repo.mirror_password_help"}}</p> </div> </details> {{if .LFSStartServer}} <div class="inline field"> - <label>{{.locale.Tr "repo.mirror_lfs"}}</label> + <label>{{ctx.Locale.Tr "repo.mirror_lfs"}}</label> <div class="ui checkbox"> <input id="mirror_lfs" name="mirror_lfs" type="checkbox" {{if .PullMirror.LFS}}checked{{end}}> - <label>{{.locale.Tr "repo.mirror_lfs_desc"}}</label> + <label>{{ctx.Locale.Tr "repo.mirror_lfs_desc"}}</label> </div> </div> <div class="field {{if .Err_LFSEndpoint}}error{{end}}"> - <label for="mirror_lfs_endpoint">{{.locale.Tr "repo.mirror_lfs_endpoint"}}</label> - <input id="mirror_lfs_endpoint" name="mirror_lfs_endpoint" value="{{.PullMirror.LFSEndpoint}}" placeholder="{{.locale.Tr "repo.migrate_options_lfs_endpoint.placeholder"}}"> - <p class="help">{{.locale.Tr "repo.mirror_lfs_endpoint_desc" "https://github.com/git-lfs/git-lfs/blob/main/docs/api/server-discovery.md#server-discovery" | Str2html}}</p> + <label for="mirror_lfs_endpoint">{{ctx.Locale.Tr "repo.mirror_lfs_endpoint"}}</label> + <input id="mirror_lfs_endpoint" name="mirror_lfs_endpoint" value="{{.PullMirror.LFSEndpoint}}" placeholder="{{ctx.Locale.Tr "repo.migrate_options_lfs_endpoint.placeholder"}}"> + <p class="help">{{ctx.Locale.Tr "repo.mirror_lfs_endpoint_desc" "https://github.com/git-lfs/git-lfs/blob/main/docs/api/server-discovery.md#server-discovery" | Str2html}}</p> </div> {{end}} <div class="field"> - <button class="ui primary button">{{$.locale.Tr "repo.settings.update_mirror_settings"}}</button> + <button class="ui primary button">{{ctx.Locale.Tr "repo.settings.update_mirror_settings"}}</button> </div> </form> </td> @@ -201,13 +201,13 @@ {{range .PushMirrors}} <tr> <td class="gt-word-break">{{.RemoteAddress}}</td> - <td>{{$.locale.Tr "repo.settings.mirror_settings.direction.push"}}</td> - <td>{{if .LastUpdateUnix}}{{DateTime "full" .LastUpdateUnix}}{{else}}{{$.locale.Tr "never"}}{{end}} {{if .LastError}}<div class="ui red label" data-tooltip-content="{{.LastError}}">{{$.locale.Tr "error"}}</div>{{end}}</td> + <td>{{ctx.Locale.Tr "repo.settings.mirror_settings.direction.push"}}</td> + <td>{{if .LastUpdateUnix}}{{DateTime "full" .LastUpdateUnix}}{{else}}{{ctx.Locale.Tr "never"}}{{end}} {{if .LastError}}<div class="ui red label" data-tooltip-content="{{.LastError}}">{{ctx.Locale.Tr "error"}}</div>{{end}}</td> <td class="right aligned"> <button class="ui tiny button show-modal" data-modal="#push-mirror-edit-modal" - data-tooltip-content="{{$.locale.Tr "repo.settings.mirror_settings.push_mirror.edit_sync_time"}}" + data-tooltip-content="{{ctx.Locale.Tr "repo.settings.mirror_settings.push_mirror.edit_sync_time"}}" data-modal-push-mirror-edit-id="{{.ID}}" data-modal-push-mirror-edit-interval="{{.Interval}}" data-modal-push-mirror-edit-address="{{.RemoteAddress}}" @@ -218,19 +218,19 @@ {{$.CsrfTokenHtml}} <input type="hidden" name="action" value="push-mirror-sync"> <input type="hidden" name="push_mirror_id" value="{{.ID}}"> - <button class="ui primary tiny button" data-tooltip-content="{{$.locale.Tr "repo.settings.sync_mirror"}}">{{svg "octicon-sync" 14}}</button> + <button class="ui primary tiny button" data-tooltip-content="{{ctx.Locale.Tr "repo.settings.sync_mirror"}}">{{svg "octicon-sync" 14}}</button> </form> <form method="post" class="gt-dib"> {{$.CsrfTokenHtml}} <input type="hidden" name="action" value="push-mirror-remove"> <input type="hidden" name="push_mirror_id" value="{{.ID}}"> - <button class="ui basic red tiny button" data-tooltip-content="{{$.locale.Tr "remove"}}">{{svg "octicon-trash" 14}}</button> + <button class="ui basic red tiny button" data-tooltip-content="{{ctx.Locale.Tr "remove"}}">{{svg "octicon-trash" 14}}</button> </form> </td> </tr> {{else}} <tr> - <td>{{$.locale.Tr "repo.settings.mirror_settings.push_mirror.none"}}</td> + <td>{{ctx.Locale.Tr "repo.settings.mirror_settings.push_mirror.none"}}</td> </tr> {{end}} {{if (not .DisableNewPushMirrors)}} @@ -241,21 +241,21 @@ {{.CsrfTokenHtml}} <input type="hidden" name="action" value="push-mirror-add"> <div class="field {{if .Err_PushMirrorAddress}}error{{end}}"> - <label for="push_mirror_address">{{.locale.Tr "repo.settings.mirror_settings.push_mirror.remote_url"}}</label> + <label for="push_mirror_address">{{ctx.Locale.Tr "repo.settings.mirror_settings.push_mirror.remote_url"}}</label> <input id="push_mirror_address" name="push_mirror_address" value="{{.push_mirror_address}}" required> - <p class="help">{{.locale.Tr "repo.mirror_address_desc"}}</p> + <p class="help">{{ctx.Locale.Tr "repo.mirror_address_desc"}}</p> </div> <details class="ui optional field" {{if or .Err_PushMirrorAuth .push_mirror_username}}open{{end}}> <summary class="gt-p-2"> - {{.locale.Tr "repo.need_auth"}} + {{ctx.Locale.Tr "repo.need_auth"}} </summary> <div class="gt-p-2"> <div class="inline field {{if .Err_PushMirrorAuth}}error{{end}}"> - <label for="push_mirror_username">{{.locale.Tr "username"}}</label> + <label for="push_mirror_username">{{ctx.Locale.Tr "username"}}</label> <input id="push_mirror_username" name="push_mirror_username" value="{{.push_mirror_username}}"> </div> <div class="inline field {{if .Err_PushMirrorAuth}}error{{end}}"> - <label for="push_mirror_password">{{.locale.Tr "password"}}</label> + <label for="push_mirror_password">{{ctx.Locale.Tr "password"}}</label> <input id="push_mirror_password" name="push_mirror_password" type="password" value="{{.push_mirror_password}}" autocomplete="off"> </div> </div> @@ -263,15 +263,15 @@ <div class="field"> <div class="ui checkbox"> <input id="push_mirror_sync_on_commit" name="push_mirror_sync_on_commit" type="checkbox" {{if .push_mirror_sync_on_commit}}checked{{end}}> - <label for="push_mirror_sync_on_commit">{{.locale.Tr "repo.mirror_sync_on_commit"}}</label> + <label for="push_mirror_sync_on_commit">{{ctx.Locale.Tr "repo.mirror_sync_on_commit"}}</label> </div> </div> <div class="inline field {{if .Err_PushMirrorInterval}}error{{end}}"> - <label for="push_mirror_interval">{{.locale.Tr "repo.mirror_interval" .MinimumMirrorInterval}}</label> + <label for="push_mirror_interval">{{ctx.Locale.Tr "repo.mirror_interval" .MinimumMirrorInterval}}</label> <input id="push_mirror_interval" name="push_mirror_interval" value="{{if .push_mirror_interval}}{{.push_mirror_interval}}{{else}}{{.DefaultMirrorInterval}}{{end}}"> </div> <div class="field"> - <button class="ui primary button">{{$.locale.Tr "repo.settings.mirror_settings.push_mirror.add"}}</button> + <button class="ui primary button">{{ctx.Locale.Tr "repo.settings.mirror_settings.push_mirror.add"}}</button> </div> </form> </td> @@ -283,7 +283,7 @@ {{end}} <h4 class="ui top attached header"> - {{.locale.Tr "repo.settings.advanced_settings"}} + {{ctx.Locale.Tr "repo.settings.advanced_settings"}} </h4> <div class="ui attached segment"> <form class="ui form" method="post"> @@ -293,10 +293,10 @@ {{$isCodeEnabled := .Repository.UnitEnabled $.Context $.UnitTypeCode}} {{$isCodeGlobalDisabled := .UnitTypeCode.UnitGlobalDisabled}} <div class="inline field"> - <label>{{.locale.Tr "repo.code"}}</label> - <div class="ui checkbox{{if $isCodeGlobalDisabled}} disabled{{end}}"{{if $isCodeGlobalDisabled}} data-tooltip-content="{{.locale.Tr "repo.unit_disabled"}}"{{end}}> + <label>{{ctx.Locale.Tr "repo.code"}}</label> + <div class="ui checkbox{{if $isCodeGlobalDisabled}} disabled{{end}}"{{if $isCodeGlobalDisabled}} data-tooltip-content="{{ctx.Locale.Tr "repo.unit_disabled"}}"{{end}}> <input class="enable-system" name="enable_code" type="checkbox"{{if $isCodeEnabled}} checked{{end}}> - <label>{{.locale.Tr "repo.code.desc"}}</label> + <label>{{ctx.Locale.Tr "repo.code.desc"}}</label> </div> </div> @@ -305,29 +305,29 @@ {{$isExternalWikiGlobalDisabled := .UnitTypeExternalWiki.UnitGlobalDisabled}} {{$isBothWikiGlobalDisabled := and $isWikiGlobalDisabled $isExternalWikiGlobalDisabled}} <div class="inline field"> - <label>{{.locale.Tr "repo.wiki"}}</label> - <div class="ui checkbox{{if $isBothWikiGlobalDisabled}} disabled{{end}}"{{if $isBothWikiGlobalDisabled}} data-tooltip-content="{{.locale.Tr "repo.unit_disabled"}}"{{end}}> + <label>{{ctx.Locale.Tr "repo.wiki"}}</label> + <div class="ui checkbox{{if $isBothWikiGlobalDisabled}} disabled{{end}}"{{if $isBothWikiGlobalDisabled}} data-tooltip-content="{{ctx.Locale.Tr "repo.unit_disabled"}}"{{end}}> <input class="enable-system" name="enable_wiki" type="checkbox" data-target="#wiki_box" {{if $isWikiEnabled}}checked{{end}}> - <label>{{.locale.Tr "repo.settings.wiki_desc"}}</label> + <label>{{ctx.Locale.Tr "repo.settings.wiki_desc"}}</label> </div> </div> <div class="field{{if not $isWikiEnabled}} disabled{{end}}" id="wiki_box"> <div class="field"> - <div class="ui radio checkbox{{if $isWikiGlobalDisabled}} disabled{{end}}"{{if $isWikiGlobalDisabled}} data-tooltip-content="{{.locale.Tr "repo.unit_disabled"}}"{{end}}> + <div class="ui radio checkbox{{if $isWikiGlobalDisabled}} disabled{{end}}"{{if $isWikiGlobalDisabled}} data-tooltip-content="{{ctx.Locale.Tr "repo.unit_disabled"}}"{{end}}> <input class="enable-system-radio" name="enable_external_wiki" type="radio" value="false" data-target="#external_wiki_box" {{if not (.Repository.UnitEnabled $.Context $.UnitTypeExternalWiki)}}checked{{end}}> - <label>{{.locale.Tr "repo.settings.use_internal_wiki"}}</label> + <label>{{ctx.Locale.Tr "repo.settings.use_internal_wiki"}}</label> </div> </div> <div class="field"> - <div class="ui radio checkbox{{if $isExternalWikiGlobalDisabled}} disabled{{end}}"{{if $isExternalWikiGlobalDisabled}} data-tooltip-content="{{.locale.Tr "repo.unit_disabled"}}"{{end}}> + <div class="ui radio checkbox{{if $isExternalWikiGlobalDisabled}} disabled{{end}}"{{if $isExternalWikiGlobalDisabled}} data-tooltip-content="{{ctx.Locale.Tr "repo.unit_disabled"}}"{{end}}> <input class="enable-system-radio" name="enable_external_wiki" type="radio" value="true" data-target="#external_wiki_box" {{if .Repository.UnitEnabled $.Context $.UnitTypeExternalWiki}}checked{{end}}> - <label>{{.locale.Tr "repo.settings.use_external_wiki"}}</label> + <label>{{ctx.Locale.Tr "repo.settings.use_external_wiki"}}</label> </div> </div> <div class="field gt-pl-4 {{if not (.Repository.UnitEnabled $.Context $.UnitTypeExternalWiki)}}disabled{{end}}" id="external_wiki_box"> - <label for="external_wiki_url">{{.locale.Tr "repo.settings.external_wiki_url"}}</label> + <label for="external_wiki_url">{{ctx.Locale.Tr "repo.settings.external_wiki_url"}}</label> <input id="external_wiki_url" name="external_wiki_url" type="url" value="{{(.Repository.MustGetUnit $.Context $.UnitTypeExternalWiki).ExternalWikiConfig.ExternalWikiURL}}"> - <p class="help">{{.locale.Tr "repo.settings.external_wiki_url_desc"}}</p> + <p class="help">{{ctx.Locale.Tr "repo.settings.external_wiki_url_desc"}}</p> </div> </div> @@ -338,17 +338,17 @@ {{$isExternalTrackerGlobalDisabled := .UnitTypeExternalTracker.UnitGlobalDisabled}} {{$isIssuesAndExternalGlobalDisabled := and $isIssuesGlobalDisabled $isExternalTrackerGlobalDisabled}} <div class="inline field"> - <label>{{.locale.Tr "repo.issues"}}</label> - <div class="ui checkbox{{if $isIssuesAndExternalGlobalDisabled}} disabled{{end}}"{{if $isIssuesAndExternalGlobalDisabled}} data-tooltip-content="{{.locale.Tr "repo.unit_disabled"}}"{{end}}> + <label>{{ctx.Locale.Tr "repo.issues"}}</label> + <div class="ui checkbox{{if $isIssuesAndExternalGlobalDisabled}} disabled{{end}}"{{if $isIssuesAndExternalGlobalDisabled}} data-tooltip-content="{{ctx.Locale.Tr "repo.unit_disabled"}}"{{end}}> <input class="enable-system" name="enable_issues" type="checkbox" data-target="#issue_box" {{if $isIssuesEnabled}}checked{{end}}> - <label>{{.locale.Tr "repo.settings.issues_desc"}}</label> + <label>{{ctx.Locale.Tr "repo.settings.issues_desc"}}</label> </div> </div> <div class="field {{if not $isIssuesEnabled}}disabled{{end}}" id="issue_box"> <div class="field"> - <div class="ui radio checkbox{{if $isIssuesGlobalDisabled}} disabled{{end}}"{{if $isIssuesGlobalDisabled}} data-tooltip-content="{{.locale.Tr "repo.unit_disabled"}}"{{end}}> + <div class="ui radio checkbox{{if $isIssuesGlobalDisabled}} disabled{{end}}"{{if $isIssuesGlobalDisabled}} data-tooltip-content="{{ctx.Locale.Tr "repo.unit_disabled"}}"{{end}}> <input class="enable-system-radio" name="enable_external_tracker" type="radio" value="false" data-context="#internal_issue_box" data-target="#external_issue_box" {{if not (.Repository.UnitEnabled $.Context $.UnitTypeExternalTracker)}}checked{{end}}> - <label>{{.locale.Tr "repo.settings.use_internal_issue_tracker"}}</label> + <label>{{ctx.Locale.Tr "repo.settings.use_internal_issue_tracker"}}</label> </div> </div> <div class="field gt-pl-4 {{if (.Repository.UnitEnabled $.Context $.UnitTypeExternalTracker)}}disabled{{end}}" id="internal_issue_box"> @@ -356,71 +356,71 @@ <div class="field"> <div class="ui checkbox"> <input name="enable_timetracker" class="enable-system" data-target="#only_contributors" type="checkbox" {{if .Repository.IsTimetrackerEnabled $.Context}}checked{{end}}> - <label>{{.locale.Tr "repo.settings.enable_timetracker"}}</label> + <label>{{ctx.Locale.Tr "repo.settings.enable_timetracker"}}</label> </div> </div> <div class="field {{if not (.Repository.IsTimetrackerEnabled $.Context)}}disabled{{end}}" id="only_contributors"> <div class="ui checkbox"> <input name="allow_only_contributors_to_track_time" type="checkbox" {{if .Repository.AllowOnlyContributorsToTrackTime $.Context}}checked{{end}}> - <label>{{.locale.Tr "repo.settings.allow_only_contributors_to_track_time"}}</label> + <label>{{ctx.Locale.Tr "repo.settings.allow_only_contributors_to_track_time"}}</label> </div> </div> {{end}} <div class="field"> <div class="ui checkbox"> <input name="enable_issue_dependencies" type="checkbox" {{if (.Repository.IsDependenciesEnabled $.Context)}}checked{{end}}> - <label>{{.locale.Tr "repo.issues.dependency.setting"}}</label> + <label>{{ctx.Locale.Tr "repo.issues.dependency.setting"}}</label> </div> </div> <div class="ui checkbox"> <input name="enable_close_issues_via_commit_in_any_branch" type="checkbox" {{if .Repository.CloseIssuesViaCommitInAnyBranch}}checked{{end}}> - <label>{{.locale.Tr "repo.settings.admin_enable_close_issues_via_commit_in_any_branch"}}</label> + <label>{{ctx.Locale.Tr "repo.settings.admin_enable_close_issues_via_commit_in_any_branch"}}</label> </div> </div> <div class="field"> - <div class="ui radio checkbox{{if $isExternalTrackerGlobalDisabled}} disabled{{end}}"{{if $isExternalTrackerGlobalDisabled}} data-tooltip-content="{{.locale.Tr "repo.unit_disabled"}}"{{end}}> + <div class="ui radio checkbox{{if $isExternalTrackerGlobalDisabled}} disabled{{end}}"{{if $isExternalTrackerGlobalDisabled}} data-tooltip-content="{{ctx.Locale.Tr "repo.unit_disabled"}}"{{end}}> <input class="enable-system-radio" name="enable_external_tracker" type="radio" value="true" data-context="#internal_issue_box" data-target="#external_issue_box" {{if .Repository.UnitEnabled $.Context $.UnitTypeExternalTracker}}checked{{end}}> - <label>{{.locale.Tr "repo.settings.use_external_issue_tracker"}}</label> + <label>{{ctx.Locale.Tr "repo.settings.use_external_issue_tracker"}}</label> </div> </div> <div class="field gt-pl-4 {{if not (.Repository.UnitEnabled $.Context $.UnitTypeExternalTracker)}}disabled{{end}}" id="external_issue_box"> <div class="field"> - <label for="external_tracker_url">{{.locale.Tr "repo.settings.external_tracker_url"}}</label> + <label for="external_tracker_url">{{ctx.Locale.Tr "repo.settings.external_tracker_url"}}</label> <input id="external_tracker_url" name="external_tracker_url" type="url" value="{{(.Repository.MustGetUnit $.Context $.UnitTypeExternalTracker).ExternalTrackerConfig.ExternalTrackerURL}}"> - <p class="help">{{.locale.Tr "repo.settings.external_tracker_url_desc"}}</p> + <p class="help">{{ctx.Locale.Tr "repo.settings.external_tracker_url_desc"}}</p> </div> <div class="field"> - <label for="tracker_url_format">{{.locale.Tr "repo.settings.tracker_url_format"}}</label> + <label for="tracker_url_format">{{ctx.Locale.Tr "repo.settings.tracker_url_format"}}</label> <input id="tracker_url_format" name="tracker_url_format" type="url" value="{{(.Repository.MustGetUnit $.Context $.UnitTypeExternalTracker).ExternalTrackerConfig.ExternalTrackerFormat}}" placeholder="https://github.com/{user}/{repo}/issues/{index}"> - <p class="help">{{.locale.Tr "repo.settings.tracker_url_format_desc" | Str2html}}</p> + <p class="help">{{ctx.Locale.Tr "repo.settings.tracker_url_format_desc" | Str2html}}</p> </div> <div class="inline fields"> - <label for="issue_style">{{.locale.Tr "repo.settings.tracker_issue_style"}}</label> + <label for="issue_style">{{ctx.Locale.Tr "repo.settings.tracker_issue_style"}}</label> <div class="field"> <div class="ui radio checkbox"> {{$externalTracker := (.Repository.MustGetUnit $.Context $.UnitTypeExternalTracker)}} {{$externalTrackerStyle := $externalTracker.ExternalTrackerConfig.ExternalTrackerStyle}} <input class="js-tracker-issue-style" name="tracker_issue_style" type="radio" value="numeric" {{if eq $externalTrackerStyle "numeric"}}checked{{end}}> - <label>{{.locale.Tr "repo.settings.tracker_issue_style.numeric"}} <span class="ui light grey text">#1234</span></label> + <label>{{ctx.Locale.Tr "repo.settings.tracker_issue_style.numeric"}} <span class="ui light grey text">#1234</span></label> </div> </div> <div class="field"> <div class="ui radio checkbox"> <input class="js-tracker-issue-style" name="tracker_issue_style" type="radio" value="alphanumeric" {{if eq $externalTrackerStyle "alphanumeric"}}checked{{end}}> - <label>{{.locale.Tr "repo.settings.tracker_issue_style.alphanumeric"}} <span class="ui light grey text">ABC-123 , DEFG-234</span></label> + <label>{{ctx.Locale.Tr "repo.settings.tracker_issue_style.alphanumeric"}} <span class="ui light grey text">ABC-123 , DEFG-234</span></label> </div> </div> <div class="field"> <div class="ui radio checkbox"> <input class="js-tracker-issue-style" name="tracker_issue_style" type="radio" value="regexp" {{if eq $externalTrackerStyle "regexp"}}checked{{end}}> - <label>{{.locale.Tr "repo.settings.tracker_issue_style.regexp"}} <span class="ui light grey text">(ISSUE-\d+) , ISSUE-(\d+)</span></label> + <label>{{ctx.Locale.Tr "repo.settings.tracker_issue_style.regexp"}} <span class="ui light grey text">(ISSUE-\d+) , ISSUE-(\d+)</span></label> </div> </div> </div> <div class="field {{if ne $externalTrackerStyle "regexp"}}disabled{{end}}" id="tracker-issue-style-regex-box"> - <label for="external_tracker_regexp_pattern">{{.locale.Tr "repo.settings.tracker_issue_style.regexp_pattern"}}</label> + <label for="external_tracker_regexp_pattern">{{ctx.Locale.Tr "repo.settings.tracker_issue_style.regexp_pattern"}}</label> <input id="external_tracker_regexp_pattern" name="external_tracker_regexp_pattern" value="{{(.Repository.MustGetUnit $.Context $.UnitTypeExternalTracker).ExternalTrackerConfig.ExternalTrackerRegexpPattern}}"> - <p class="help">{{.locale.Tr "repo.settings.tracker_issue_style.regexp_pattern_desc" | Str2html}}</p> + <p class="help">{{ctx.Locale.Tr "repo.settings.tracker_issue_style.regexp_pattern_desc" | Str2html}}</p> </div> </div> </div> @@ -430,30 +430,30 @@ {{$isProjectsEnabled := .Repository.UnitEnabled $.Context $.UnitTypeProjects}} {{$isProjectsGlobalDisabled := .UnitTypeProjects.UnitGlobalDisabled}} <div class="inline field"> - <label>{{.locale.Tr "repo.project_board"}}</label> - <div class="ui checkbox{{if $isProjectsGlobalDisabled}} disabled{{end}}"{{if $isProjectsGlobalDisabled}} data-tooltip-content="{{.locale.Tr "repo.unit_disabled"}}"{{end}}> + <label>{{ctx.Locale.Tr "repo.project_board"}}</label> + <div class="ui checkbox{{if $isProjectsGlobalDisabled}} disabled{{end}}"{{if $isProjectsGlobalDisabled}} data-tooltip-content="{{ctx.Locale.Tr "repo.unit_disabled"}}"{{end}}> <input class="enable-system" name="enable_projects" type="checkbox" {{if $isProjectsEnabled}}checked{{end}}> - <label>{{.locale.Tr "repo.settings.projects_desc"}}</label> + <label>{{ctx.Locale.Tr "repo.settings.projects_desc"}}</label> </div> </div> {{$isReleasesEnabled := .Repository.UnitEnabled $.Context $.UnitTypeReleases}} {{$isReleasesGlobalDisabled := .UnitTypeReleases.UnitGlobalDisabled}} <div class="inline field"> - <label>{{.locale.Tr "repo.releases"}}</label> - <div class="ui checkbox{{if $isReleasesGlobalDisabled}} disabled{{end}}"{{if $isReleasesGlobalDisabled}} data-tooltip-content="{{.locale.Tr "repo.unit_disabled"}}"{{end}}> + <label>{{ctx.Locale.Tr "repo.releases"}}</label> + <div class="ui checkbox{{if $isReleasesGlobalDisabled}} disabled{{end}}"{{if $isReleasesGlobalDisabled}} data-tooltip-content="{{ctx.Locale.Tr "repo.unit_disabled"}}"{{end}}> <input class="enable-system" name="enable_releases" type="checkbox" {{if $isReleasesEnabled}}checked{{end}}> - <label>{{.locale.Tr "repo.settings.releases_desc"}}</label> + <label>{{ctx.Locale.Tr "repo.settings.releases_desc"}}</label> </div> </div> {{$isPackagesEnabled := .Repository.UnitEnabled $.Context $.UnitTypePackages}} {{$isPackagesGlobalDisabled := .UnitTypePackages.UnitGlobalDisabled}} <div class="inline field"> - <label>{{.locale.Tr "repo.packages"}}</label> - <div class="ui checkbox{{if $isPackagesGlobalDisabled}} disabled{{end}}"{{if $isPackagesGlobalDisabled}} data-tooltip-content="{{.locale.Tr "repo.unit_disabled"}}"{{end}}> + <label>{{ctx.Locale.Tr "repo.packages"}}</label> + <div class="ui checkbox{{if $isPackagesGlobalDisabled}} disabled{{end}}"{{if $isPackagesGlobalDisabled}} data-tooltip-content="{{ctx.Locale.Tr "repo.unit_disabled"}}"{{end}}> <input class="enable-system" name="enable_packages" type="checkbox" {{if $isPackagesEnabled}}checked{{end}}> - <label>{{.locale.Tr "repo.settings.packages_desc"}}</label> + <label>{{ctx.Locale.Tr "repo.settings.packages_desc"}}</label> </div> </div> @@ -461,10 +461,10 @@ {{$isActionsEnabled := .Repository.UnitEnabled $.Context $.UnitTypeActions}} {{$isActionsGlobalDisabled := .UnitTypeActions.UnitGlobalDisabled}} <div class="inline field"> - <label>{{.locale.Tr "actions.actions"}}</label> - <div class="ui checkbox{{if $isActionsGlobalDisabled}} disabled{{end}}"{{if $isActionsGlobalDisabled}} data-tooltip-content="{{.locale.Tr "repo.unit_disabled"}}"{{end}}> + <label>{{ctx.Locale.Tr "actions.actions"}}</label> + <div class="ui checkbox{{if $isActionsGlobalDisabled}} disabled{{end}}"{{if $isActionsGlobalDisabled}} data-tooltip-content="{{ctx.Locale.Tr "repo.unit_disabled"}}"{{end}}> <input class="enable-system" name="enable_actions" type="checkbox" {{if $isActionsEnabled}}checked{{end}}> - <label>{{.locale.Tr "repo.settings.actions_desc"}}</label> + <label>{{ctx.Locale.Tr "repo.settings.actions_desc"}}</label> </div> </div> {{end}} @@ -475,110 +475,110 @@ {{$pullRequestGlobalDisabled := .UnitTypePullRequests.UnitGlobalDisabled}} {{$prUnit := .Repository.MustGetUnit $.Context $.UnitTypePullRequests}} <div class="inline field"> - <label>{{.locale.Tr "repo.pulls"}}</label> - <div class="ui checkbox{{if $pullRequestGlobalDisabled}} disabled{{end}}"{{if $pullRequestGlobalDisabled}} data-tooltip-content="{{.locale.Tr "repo.unit_disabled"}}"{{end}}> + <label>{{ctx.Locale.Tr "repo.pulls"}}</label> + <div class="ui checkbox{{if $pullRequestGlobalDisabled}} disabled{{end}}"{{if $pullRequestGlobalDisabled}} data-tooltip-content="{{ctx.Locale.Tr "repo.unit_disabled"}}"{{end}}> <input class="enable-system" name="enable_pulls" type="checkbox" data-target="#pull_box" {{if $pullRequestEnabled}}checked{{end}}> - <label>{{.locale.Tr "repo.settings.pulls_desc"}}</label> + <label>{{ctx.Locale.Tr "repo.settings.pulls_desc"}}</label> </div> </div> <div class="field{{if not $pullRequestEnabled}} disabled{{end}}" id="pull_box"> <div class="field"> <p> - {{.locale.Tr "repo.settings.merge_style_desc"}} + {{ctx.Locale.Tr "repo.settings.merge_style_desc"}} </p> </div> <div class="field"> <div class="ui checkbox"> <input name="pulls_allow_merge" type="checkbox" {{if or (not $pullRequestEnabled) ($prUnit.PullRequestsConfig.AllowMerge)}}checked{{end}}> - <label>{{.locale.Tr "repo.pulls.merge_pull_request"}}</label> + <label>{{ctx.Locale.Tr "repo.pulls.merge_pull_request"}}</label> </div> </div> <div class="field"> <div class="ui checkbox"> <input name="pulls_allow_rebase" type="checkbox" {{if or (not $pullRequestEnabled) ($prUnit.PullRequestsConfig.AllowRebase)}}checked{{end}}> - <label>{{.locale.Tr "repo.pulls.rebase_merge_pull_request"}}</label> + <label>{{ctx.Locale.Tr "repo.pulls.rebase_merge_pull_request"}}</label> </div> </div> <div class="field"> <div class="ui checkbox"> <input name="pulls_allow_rebase_merge" type="checkbox" {{if or (not $pullRequestEnabled) ($prUnit.PullRequestsConfig.AllowRebaseMerge)}}checked{{end}}> - <label>{{.locale.Tr "repo.pulls.rebase_merge_commit_pull_request"}}</label> + <label>{{ctx.Locale.Tr "repo.pulls.rebase_merge_commit_pull_request"}}</label> </div> </div> <div class="field"> <div class="ui checkbox"> <input name="pulls_allow_squash" type="checkbox" {{if or (not $pullRequestEnabled) ($prUnit.PullRequestsConfig.AllowSquash)}}checked{{end}}> - <label>{{.locale.Tr "repo.pulls.squash_merge_pull_request"}}</label> + <label>{{ctx.Locale.Tr "repo.pulls.squash_merge_pull_request"}}</label> </div> </div> <div class="field"> <div class="ui checkbox"> <input name="pulls_allow_manual_merge" type="checkbox" {{if or (not $pullRequestEnabled) ($prUnit.PullRequestsConfig.AllowManualMerge)}}checked{{end}}> - <label>{{.locale.Tr "repo.pulls.merge_manually"}}</label> + <label>{{ctx.Locale.Tr "repo.pulls.merge_manually"}}</label> </div> </div> <div class="field"> <p> - {{.locale.Tr "repo.settings.default_merge_style_desc"}} + {{ctx.Locale.Tr "repo.settings.default_merge_style_desc"}} </p> <div class="ui dropdown selection"> <select name="pulls_default_merge_style"> - <option value="merge" {{if or (not $pullRequestEnabled) (eq $prUnit.PullRequestsConfig.DefaultMergeStyle "merge")}}selected{{end}}>{{.locale.Tr "repo.pulls.merge_pull_request"}}</option> - <option value="rebase" {{if or (not $pullRequestEnabled) (eq $prUnit.PullRequestsConfig.DefaultMergeStyle "rebase")}}selected{{end}}>{{.locale.Tr "repo.pulls.rebase_merge_pull_request"}}</option> - <option value="rebase-merge" {{if or (not $pullRequestEnabled) (eq $prUnit.PullRequestsConfig.DefaultMergeStyle "rebase-merge")}}selected{{end}}>{{.locale.Tr "repo.pulls.rebase_merge_commit_pull_request"}}</option> - <option value="squash" {{if or (not $pullRequestEnabled) (eq $prUnit.PullRequestsConfig.DefaultMergeStyle "squash")}}selected{{end}}>{{.locale.Tr "repo.pulls.squash_merge_pull_request"}}</option> + <option value="merge" {{if or (not $pullRequestEnabled) (eq $prUnit.PullRequestsConfig.DefaultMergeStyle "merge")}}selected{{end}}>{{ctx.Locale.Tr "repo.pulls.merge_pull_request"}}</option> + <option value="rebase" {{if or (not $pullRequestEnabled) (eq $prUnit.PullRequestsConfig.DefaultMergeStyle "rebase")}}selected{{end}}>{{ctx.Locale.Tr "repo.pulls.rebase_merge_pull_request"}}</option> + <option value="rebase-merge" {{if or (not $pullRequestEnabled) (eq $prUnit.PullRequestsConfig.DefaultMergeStyle "rebase-merge")}}selected{{end}}>{{ctx.Locale.Tr "repo.pulls.rebase_merge_commit_pull_request"}}</option> + <option value="squash" {{if or (not $pullRequestEnabled) (eq $prUnit.PullRequestsConfig.DefaultMergeStyle "squash")}}selected{{end}}>{{ctx.Locale.Tr "repo.pulls.squash_merge_pull_request"}}</option> </select>{{svg "octicon-triangle-down" 14 "dropdown icon"}} <div class="default text"> {{if (eq $prUnit.PullRequestsConfig.DefaultMergeStyle "merge")}} - {{.locale.Tr "repo.pulls.merge_pull_request"}} + {{ctx.Locale.Tr "repo.pulls.merge_pull_request"}} {{end}} {{if (eq $prUnit.PullRequestsConfig.DefaultMergeStyle "rebase")}} - {{.locale.Tr "repo.pulls.rebase_merge_pull_request"}} + {{ctx.Locale.Tr "repo.pulls.rebase_merge_pull_request"}} {{end}} {{if (eq $prUnit.PullRequestsConfig.DefaultMergeStyle "rebase-merge")}} - {{.locale.Tr "repo.pulls.rebase_merge_commit_pull_request"}} + {{ctx.Locale.Tr "repo.pulls.rebase_merge_commit_pull_request"}} {{end}} {{if (eq $prUnit.PullRequestsConfig.DefaultMergeStyle "squash")}} - {{.locale.Tr "repo.pulls.squash_merge_pull_request"}} + {{ctx.Locale.Tr "repo.pulls.squash_merge_pull_request"}} {{end}} </div> <div class="menu"> - <div class="item" data-value="merge">{{.locale.Tr "repo.pulls.merge_pull_request"}}</div> - <div class="item" data-value="rebase">{{.locale.Tr "repo.pulls.rebase_merge_pull_request"}}</div> - <div class="item" data-value="rebase-merge">{{.locale.Tr "repo.pulls.rebase_merge_commit_pull_request"}}</div> - <div class="item" data-value="squash">{{.locale.Tr "repo.pulls.squash_merge_pull_request"}}</div> + <div class="item" data-value="merge">{{ctx.Locale.Tr "repo.pulls.merge_pull_request"}}</div> + <div class="item" data-value="rebase">{{ctx.Locale.Tr "repo.pulls.rebase_merge_pull_request"}}</div> + <div class="item" data-value="rebase-merge">{{ctx.Locale.Tr "repo.pulls.rebase_merge_commit_pull_request"}}</div> + <div class="item" data-value="squash">{{ctx.Locale.Tr "repo.pulls.squash_merge_pull_request"}}</div> </div> </div> </div> <div class="field"> <div class="ui checkbox"> <input name="default_allow_maintainer_edit" type="checkbox" {{if or (not $pullRequestEnabled) ($prUnit.PullRequestsConfig.DefaultAllowMaintainerEdit)}}checked{{end}}> - <label>{{.locale.Tr "repo.settings.pulls.default_allow_edits_from_maintainers"}}</label> + <label>{{ctx.Locale.Tr "repo.settings.pulls.default_allow_edits_from_maintainers"}}</label> </div> </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}}> - <label>{{.locale.Tr "repo.settings.pulls.allow_rebase_update"}}</label> + <label>{{ctx.Locale.Tr "repo.settings.pulls.allow_rebase_update"}}</label> </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}}> - <label>{{.locale.Tr "repo.settings.pulls.default_delete_branch_after_merge"}}</label> + <label>{{ctx.Locale.Tr "repo.settings.pulls.default_delete_branch_after_merge"}}</label> </div> </div> <div class="field"> <div class="ui checkbox"> <input name="enable_autodetect_manual_merge" type="checkbox" {{if or (not $pullRequestEnabled) ($prUnit.PullRequestsConfig.AutodetectManualMerge)}}checked{{end}}> - <label>{{.locale.Tr "repo.settings.pulls.enable_autodetect_manual_merge"}}</label> + <label>{{ctx.Locale.Tr "repo.settings.pulls.enable_autodetect_manual_merge"}}</label> </div> </div> <div class="field"> <div class="ui checkbox"> <input name="pulls_ignore_whitespace" type="checkbox" {{if and $pullRequestEnabled ($prUnit.PullRequestsConfig.IgnoreWhitespaceConflicts)}}checked{{end}}> - <label>{{.locale.Tr "repo.settings.pulls.ignore_whitespace"}}</label> + <label>{{ctx.Locale.Tr "repo.settings.pulls.ignore_whitespace"}}</label> </div> </div> </div> @@ -586,60 +586,60 @@ <div class="divider"></div> <div class="field"> - <button class="ui primary button">{{$.locale.Tr "repo.settings.update_settings"}}</button> + <button class="ui primary button">{{ctx.Locale.Tr "repo.settings.update_settings"}}</button> </div> </form> </div> <h4 class="ui top attached header"> - {{.locale.Tr "repo.settings.signing_settings"}} + {{ctx.Locale.Tr "repo.settings.signing_settings"}} </h4> <div class="ui attached segment"> <form class="ui form" method="post"> {{.CsrfTokenHtml}} <input type="hidden" name="action" value="signing"> <div class="field"> - <label>{{.locale.Tr "repo.settings.trust_model"}}</label><br> + <label>{{ctx.Locale.Tr "repo.settings.trust_model"}}</label><br> <div class="field"> <div class="ui radio checkbox"> <input type="radio" id="trust_model_default" name="trust_model" {{if eq .Repository.TrustModel.String "default"}}checked="checked"{{end}} value="default"> - <label for="trust_model_default">{{.locale.Tr "repo.settings.trust_model.default"}}</label> - <p class="help">{{.locale.Tr "repo.settings.trust_model.default.desc"}}</p> + <label for="trust_model_default">{{ctx.Locale.Tr "repo.settings.trust_model.default"}}</label> + <p class="help">{{ctx.Locale.Tr "repo.settings.trust_model.default.desc"}}</p> </div> </div> <div class="field"> <div class="ui radio checkbox"> <input type="radio" id="trust_model_collaborator" name="trust_model" {{if eq .Repository.TrustModel.String "collaborator"}}checked="checked"{{end}} value="collaborator"> - <label for="trust_model_collaborator">{{.locale.Tr "repo.settings.trust_model.collaborator.long"}}</label> - <p class="help">{{.locale.Tr "repo.settings.trust_model.collaborator.desc"}}</p> + <label for="trust_model_collaborator">{{ctx.Locale.Tr "repo.settings.trust_model.collaborator.long"}}</label> + <p class="help">{{ctx.Locale.Tr "repo.settings.trust_model.collaborator.desc"}}</p> </div> </div> <div class="field"> <div class="ui radio checkbox"> <input type="radio" name="trust_model" id="trust_model_committer" {{if eq .Repository.TrustModel.String "committer"}}checked="checked"{{end}} value="committer"> - <label for="trust_model_committer">{{.locale.Tr "repo.settings.trust_model.committer.long"}}</label> - <p class="help">{{.locale.Tr "repo.settings.trust_model.committer.desc"}}</p> + <label for="trust_model_committer">{{ctx.Locale.Tr "repo.settings.trust_model.committer.long"}}</label> + <p class="help">{{ctx.Locale.Tr "repo.settings.trust_model.committer.desc"}}</p> </div> </div> <div class="field"> <div class="ui radio checkbox"> <input type="radio" name="trust_model" id="trust_model_collaboratorcommitter" {{if eq .Repository.TrustModel.String "collaboratorcommitter"}}checked="checked"{{end}} value="collaboratorcommitter"> - <label for="trust_model_collaboratorcommitter">{{.locale.Tr "repo.settings.trust_model.collaboratorcommitter.long"}}</label> - <p class="help">{{.locale.Tr "repo.settings.trust_model.collaboratorcommitter.desc"}}</p> + <label for="trust_model_collaboratorcommitter">{{ctx.Locale.Tr "repo.settings.trust_model.collaboratorcommitter.long"}}</label> + <p class="help">{{ctx.Locale.Tr "repo.settings.trust_model.collaboratorcommitter.desc"}}</p> </div> </div> </div> <div class="divider"></div> <div class="field"> - <button class="ui primary button">{{$.locale.Tr "repo.settings.update_settings"}}</button> + <button class="ui primary button">{{ctx.Locale.Tr "repo.settings.update_settings"}}</button> </div> </form> </div> {{if .IsAdmin}} <h4 class="ui top attached header"> - {{.locale.Tr "repo.settings.admin_settings"}} + {{ctx.Locale.Tr "repo.settings.admin_settings"}} </h4> <div class="ui attached segment"> <form class="ui form" method="post"> @@ -648,12 +648,12 @@ <div class="field"> <div class="ui checkbox"> <input name="enable_health_check" type="checkbox" {{if .Repository.IsFsckEnabled}}checked{{end}}> - <label>{{.locale.Tr "repo.settings.admin_enable_health_check"}}</label> + <label>{{ctx.Locale.Tr "repo.settings.admin_enable_health_check"}}</label> </div> </div> <div class="field"> - <button class="ui primary button">{{$.locale.Tr "repo.settings.update_settings"}}</button> + <button class="ui primary button">{{ctx.Locale.Tr "repo.settings.update_settings"}}</button> </div> </form> @@ -662,27 +662,27 @@ {{.CsrfTokenHtml}} <input type="hidden" name="action" value="admin_index"> {{if .CodeIndexerEnabled}} - <h4 class="ui header">{{.locale.Tr "repo.settings.admin_code_indexer"}}</h4> + <h4 class="ui header">{{ctx.Locale.Tr "repo.settings.admin_code_indexer"}}</h4> <div class="inline fields"> - <label>{{.locale.Tr "repo.settings.admin_indexer_commit_sha"}}</label> + <label>{{ctx.Locale.Tr "repo.settings.admin_indexer_commit_sha"}}</label> <span class="field"> {{if .CodeIndexerStatus}} <a rel="nofollow" class="ui sha label" href="{{.RepoLink}}/commit/{{.CodeIndexerStatus.CommitSha}}"> <span class="shortsha">{{ShortSha .CodeIndexerStatus.CommitSha}}</span> </a> {{else}} - <span>{{.locale.Tr "repo.settings.admin_indexer_unindexed"}}</span> + <span>{{ctx.Locale.Tr "repo.settings.admin_indexer_unindexed"}}</span> {{end}} </span> <div class="field"> - <button class="ui primary button" name="request_reindex_type" value="code">{{$.locale.Tr "repo.settings.reindex_button"}}</button> + <button class="ui primary button" name="request_reindex_type" value="code">{{ctx.Locale.Tr "repo.settings.reindex_button"}}</button> </div> </div> {{end}} - <h4 class="ui header">{{.locale.Tr "repo.settings.admin_stats_indexer"}}</h4> + <h4 class="ui header">{{ctx.Locale.Tr "repo.settings.admin_stats_indexer"}}</h4> <div class="inline fields"> {{if and .StatsIndexerStatus .StatsIndexerStatus.CommitSha}} - <label>{{.locale.Tr "repo.settings.admin_indexer_commit_sha"}}</label> + <label>{{ctx.Locale.Tr "repo.settings.admin_indexer_commit_sha"}}</label> {{end}} <span class="field"> {{if and .StatsIndexerStatus .StatsIndexerStatus.CommitSha}} @@ -690,11 +690,11 @@ <span class="shortsha">{{ShortSha .StatsIndexerStatus.CommitSha}}</span> </a> {{else}} - <span>{{.locale.Tr "repo.settings.admin_indexer_unindexed"}}</span> + <span>{{ctx.Locale.Tr "repo.settings.admin_indexer_unindexed"}}</span> {{end}} </span> <div class="field"> - <button class="ui primary button" name="request_reindex_type" value="stats">{{$.locale.Tr "repo.settings.reindex_button"}}</button> + <button class="ui primary button" name="request_reindex_type" value="stats">{{ctx.Locale.Tr "repo.settings.reindex_button"}}</button> </div> </div> </form> @@ -703,40 +703,40 @@ {{if .Permission.IsOwner}} <h4 class="ui top attached error header"> - {{.locale.Tr "repo.settings.danger_zone"}} + {{ctx.Locale.Tr "repo.settings.danger_zone"}} </h4> <div class="ui attached error danger segment"> <div class="flex-list"> {{if .Repository.IsMirror}} <div class="flex-item"> <div class="flex-item-main"> - <div class="flex-item-title">{{.locale.Tr "repo.settings.convert"}}</div> - <div class="flex-item-body">{{.locale.Tr "repo.settings.convert_desc"}}</div> + <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> <div class="flex-item-trailing"> - <button class="ui basic red show-modal button" data-modal="#convert-mirror-repo-modal">{{.locale.Tr "repo.settings.convert"}}</button> + <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 and .Repository.IsFork .Repository.Owner.CanCreateRepo}} <div class="flex-item"> <div class="flex-item-main"> - <div class="flex-item-title">{{.locale.Tr "repo.settings.convert_fork"}}</div> - <div class="flex-item-body">{{.locale.Tr "repo.settings.convert_fork_desc"}}</div> + <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> <div class="flex-item-trailing"> - <button class="ui basic red show-modal button" data-modal="#convert-fork-repo-modal">{{.locale.Tr "repo.settings.convert_fork"}}</button> + <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">{{.locale.Tr "repo.settings.transfer"}}</div> + <div class="flex-item-title">{{ctx.Locale.Tr "repo.settings.transfer"}}</div> <div class="flex-item-body"> {{if .RepoTransfer}} - {{.locale.Tr "repo.settings.transfer_started" .RepoTransfer.Recipient.DisplayName}} + {{ctx.Locale.Tr "repo.settings.transfer_started" .RepoTransfer.Recipient.DisplayName}} {{else}} - {{.locale.Tr "repo.settings.transfer_desc"}} + {{ctx.Locale.Tr "repo.settings.transfer_desc"}} {{end}} </div> </div> @@ -745,50 +745,50 @@ <form class="ui form" action="{{.Link}}" method="post"> {{.CsrfTokenHtml}} <input type="hidden" name="action" value="cancel_transfer"> - <button class="ui red button">{{.locale.Tr "repo.settings.transfer_abort"}}</button> + <button class="ui red button">{{ctx.Locale.Tr "repo.settings.transfer_abort"}}</button> </form> {{else}} - <button class="ui basic red show-modal button" data-modal="#transfer-repo-modal">{{.locale.Tr "repo.settings.transfer"}}</button> + <button class="ui basic red show-modal button" data-modal="#transfer-repo-modal">{{ctx.Locale.Tr "repo.settings.transfer"}}</button> {{end}} </div> </div> {{if .Permission.CanRead $.UnitTypeWiki}} <div class="flex-item"> <div class="flex-item-main"> - <div class="flex-item-title">{{.locale.Tr "repo.settings.wiki_delete"}}</div> - <div class="flex-item-body">{{.locale.Tr "repo.settings.wiki_delete_desc"}}</div> + <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> <div class="flex-item-trailing"> - <button class="ui basic red show-modal button" data-modal="#delete-wiki-modal">{{.locale.Tr "repo.settings.wiki_delete"}}</button> + <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">{{.locale.Tr "repo.settings.delete"}}</div> - <div class="flex-item-body">{{.locale.Tr "repo.settings.delete_desc"}}</div> + <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> <div class="flex-item-trailing"> - <button class="ui basic red show-modal button" data-modal="#delete-repo-modal">{{.locale.Tr "repo.settings.delete"}}</button> + <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 gt-ac"> <div class="flex-item-main"> {{if .Repository.IsArchived}} - <div class="flex-item-title">{{.locale.Tr "repo.settings.unarchive.header"}}</div> - <div class="flex-item-body">{{.locale.Tr "repo.settings.unarchive.text"}}</div> + <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> {{else}} - <div class="flex-item-title">{{.locale.Tr "repo.settings.archive.header"}}</div> - <div class="flex-item-body">{{.locale.Tr "repo.settings.archive.text"}}</div> + <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> {{end}} </div> <div class="flex-item-trailing"> <button class="ui basic red show-modal button" data-modal="#archive-repo-modal"> {{if .Repository.IsArchived}} - {{.locale.Tr "repo.settings.unarchive.button"}} + {{ctx.Locale.Tr "repo.settings.unarchive.button"}} {{else}} - {{.locale.Tr "repo.settings.archive.button"}} + {{ctx.Locale.Tr "repo.settings.archive.button"}} {{end}} </button> </div> @@ -804,29 +804,29 @@ {{if .Repository.IsMirror}} <div class="ui small modal" id="convert-mirror-repo-modal"> <div class="header"> - {{.locale.Tr "repo.settings.convert"}} + {{ctx.Locale.Tr "repo.settings.convert"}} </div> <div class="content"> <div class="ui warning message"> - {{.locale.Tr "repo.settings.convert_notices_1"}} + {{ctx.Locale.Tr "repo.settings.convert_notices_1"}} </div> <form class="ui form" action="{{.Link}}" method="post"> {{.CsrfTokenHtml}} <input type="hidden" name="action" value="convert"> <div class="field"> <label> - {{.locale.Tr "repo.settings.transfer_form_title"}} + {{ctx.Locale.Tr "repo.settings.transfer_form_title"}} <span class="text red">{{.Repository.Name}}</span> </label> </div> <div class="required field"> - <label for="repo_name">{{.locale.Tr "repo.repo_name"}}</label> + <label for="repo_name">{{ctx.Locale.Tr "repo.repo_name"}}</label> <input id="repo_name" name="repo_name" required maxlength="100"> </div> <div class="text right actions"> - <button class="ui cancel button">{{.locale.Tr "settings.cancel"}}</button> - <button class="ui red button">{{.locale.Tr "repo.settings.convert_confirm"}}</button> + <button class="ui cancel button">{{ctx.Locale.Tr "settings.cancel"}}</button> + <button class="ui red button">{{ctx.Locale.Tr "repo.settings.convert_confirm"}}</button> </div> </form> </div> @@ -835,29 +835,29 @@ {{if and .Repository.IsFork .Repository.Owner.CanCreateRepo}} <div class="ui small modal" id="convert-fork-repo-modal"> <div class="header"> - {{.locale.Tr "repo.settings.convert_fork"}} + {{ctx.Locale.Tr "repo.settings.convert_fork"}} </div> <div class="content"> <div class="ui warning message"> - {{.locale.Tr "repo.settings.convert_fork_notices_1"}} + {{ctx.Locale.Tr "repo.settings.convert_fork_notices_1"}} </div> <form class="ui form" action="{{.Link}}" method="post"> {{.CsrfTokenHtml}} <input type="hidden" name="action" value="convert_fork"> <div class="field"> <label> - {{.locale.Tr "repo.settings.transfer_form_title"}} + {{ctx.Locale.Tr "repo.settings.transfer_form_title"}} <span class="text red">{{.Repository.Name}}</span> </label> </div> <div class="required field"> - <label for="repo_name">{{.locale.Tr "repo.repo_name"}}</label> + <label for="repo_name">{{ctx.Locale.Tr "repo.repo_name"}}</label> <input id="repo_name" name="repo_name" required> </div> <div class="text right actions"> - <button class="ui cancel button">{{.locale.Tr "settings.cancel"}}</button> - <button class="ui red button">{{.locale.Tr "repo.settings.convert_fork_confirm"}}</button> + <button class="ui cancel button">{{ctx.Locale.Tr "settings.cancel"}}</button> + <button class="ui red button">{{ctx.Locale.Tr "repo.settings.convert_fork_confirm"}}</button> </div> </form> </div> @@ -865,35 +865,35 @@ {{end}} <div class="ui small modal" id="transfer-repo-modal"> <div class="header"> - {{.locale.Tr "repo.settings.transfer"}} + {{ctx.Locale.Tr "repo.settings.transfer"}} </div> <div class="content"> <div class="ui warning message"> - {{.locale.Tr "repo.settings.transfer_notices_1"}} <br> - {{.locale.Tr "repo.settings.transfer_notices_2"}} <br> - {{.locale.Tr "repo.settings.transfer_notices_3"}} + {{ctx.Locale.Tr "repo.settings.transfer_notices_1"}} <br> + {{ctx.Locale.Tr "repo.settings.transfer_notices_2"}} <br> + {{ctx.Locale.Tr "repo.settings.transfer_notices_3"}} </div> <form class="ui form" action="{{.Link}}" method="post"> {{.CsrfTokenHtml}} <input type="hidden" name="action" value="transfer"> <div class="field"> <label> - {{.locale.Tr "repo.settings.transfer_form_title"}} + {{ctx.Locale.Tr "repo.settings.transfer_form_title"}} <span class="text red">{{.Repository.Name}}</span> </label> </div> <div class="required field"> - <label for="repo_name">{{.locale.Tr "repo.repo_name"}}</label> + <label for="repo_name">{{ctx.Locale.Tr "repo.repo_name"}}</label> <input id="repo_name" name="repo_name" required> </div> <div class="required field"> - <label for="new_owner_name">{{.locale.Tr "repo.settings.transfer_owner"}}</label> + <label for="new_owner_name">{{ctx.Locale.Tr "repo.settings.transfer_owner"}}</label> <input id="new_owner_name" name="new_owner_name" required> </div> <div class="text right actions"> - <button class="ui cancel button">{{.locale.Tr "settings.cancel"}}</button> - <button class="ui red button">{{.locale.Tr "repo.settings.transfer_perform"}}</button> + <button class="ui cancel button">{{ctx.Locale.Tr "settings.cancel"}}</button> + <button class="ui red button">{{ctx.Locale.Tr "repo.settings.transfer_perform"}}</button> </div> </form> </div> @@ -901,14 +901,14 @@ <div class="ui small modal" id="delete-repo-modal"> <div class="header"> - {{.locale.Tr "repo.settings.delete"}} + {{ctx.Locale.Tr "repo.settings.delete"}} </div> <div class="content"> <div class="ui warning message"> - {{.locale.Tr "repo.settings.delete_notices_1" | Safe}}<br> - {{.locale.Tr "repo.settings.delete_notices_2" .Repository.FullName | Safe}} + {{ctx.Locale.Tr "repo.settings.delete_notices_1" | Safe}}<br> + {{ctx.Locale.Tr "repo.settings.delete_notices_2" .Repository.FullName | Safe}} {{if .Repository.NumForks}}<br> - {{.locale.Tr "repo.settings.delete_notices_fork_1"}} + {{ctx.Locale.Tr "repo.settings.delete_notices_fork_1"}} {{end}} </div> <form class="ui form" action="{{.Link}}" method="post"> @@ -916,18 +916,18 @@ <input type="hidden" name="action" value="delete"> <div class="field"> <label> - {{.locale.Tr "repo.settings.transfer_form_title"}} + {{ctx.Locale.Tr "repo.settings.transfer_form_title"}} <span class="text red">{{.Repository.Name}}</span> </label> </div> <div class="required field"> - <label for="repo_name">{{.locale.Tr "repo.repo_name"}}</label> + <label for="repo_name">{{ctx.Locale.Tr "repo.repo_name"}}</label> <input id="repo_name" name="repo_name" required> </div> <div class="text right actions"> - <button class="ui cancel button">{{.locale.Tr "settings.cancel"}}</button> - <button class="ui red button">{{.locale.Tr "repo.settings.confirm_delete"}}</button> + <button class="ui cancel button">{{ctx.Locale.Tr "settings.cancel"}}</button> + <button class="ui red button">{{ctx.Locale.Tr "repo.settings.confirm_delete"}}</button> </div> </form> </div> @@ -936,30 +936,30 @@ {{if .Repository.UnitEnabled $.Context $.UnitTypeWiki}} <div class="ui small modal" id="delete-wiki-modal"> <div class="header"> - {{.locale.Tr "repo.settings.wiki_delete"}} + {{ctx.Locale.Tr "repo.settings.wiki_delete"}} </div> <div class="content"> <div class="ui warning message"> - {{.locale.Tr "repo.settings.delete_notices_1" | Safe}}<br> - {{.locale.Tr "repo.settings.wiki_delete_notices_1" .Repository.Name | Safe}} + {{ctx.Locale.Tr "repo.settings.delete_notices_1" | Safe}}<br> + {{ctx.Locale.Tr "repo.settings.wiki_delete_notices_1" .Repository.Name | Safe}} </div> <form class="ui form" action="{{.Link}}" method="post"> {{.CsrfTokenHtml}} <input type="hidden" name="action" value="delete-wiki"> <div class="field"> <label> - {{.locale.Tr "repo.settings.transfer_form_title"}} + {{ctx.Locale.Tr "repo.settings.transfer_form_title"}} <span class="text red">{{.Repository.Name}}</span> </label> </div> <div class="required field"> - <label for="repo_name">{{.locale.Tr "repo.repo_name"}}</label> + <label for="repo_name">{{ctx.Locale.Tr "repo.repo_name"}}</label> <input id="repo_name" name="repo_name" required> </div> <div class="text right actions"> - <button class="ui cancel button">{{.locale.Tr "settings.cancel"}}</button> - <button class="ui red button">{{.locale.Tr "repo.settings.confirm_wiki_delete"}}</button> + <button class="ui cancel button">{{ctx.Locale.Tr "settings.cancel"}}</button> + <button class="ui red button">{{ctx.Locale.Tr "repo.settings.confirm_wiki_delete"}}</button> </div> </form> </div> @@ -970,17 +970,17 @@ <div class="ui g-modal-confirm modal" id="archive-repo-modal"> <div class="header"> {{if .Repository.IsArchived}} - {{.locale.Tr "repo.settings.unarchive.header"}} + {{ctx.Locale.Tr "repo.settings.unarchive.header"}} {{else}} - {{.locale.Tr "repo.settings.archive.header"}} + {{ctx.Locale.Tr "repo.settings.archive.header"}} {{end}} </div> <div class="content"> <p> {{if .Repository.IsArchived}} - {{.locale.Tr "repo.settings.unarchive.text"}} + {{ctx.Locale.Tr "repo.settings.unarchive.text"}} {{else}} - {{.locale.Tr "repo.settings.archive.text"}} + {{ctx.Locale.Tr "repo.settings.archive.text"}} {{end}} </p> </div> diff --git a/templates/repo/settings/protected_branch.tmpl b/templates/repo/settings/protected_branch.tmpl index 74cb84aba3..6a8c8c1e35 100644 --- a/templates/repo/settings/protected_branch.tmpl +++ b/templates/repo/settings/protected_branch.tmpl @@ -2,56 +2,56 @@ <div class="repo-setting-content"> <form class="ui form" action="{{.Link}}" method="post"> <h4 class="ui top attached header"> - {{.locale.Tr "repo.settings.branch_protection" (.Rule.RuleName|Escape) | Str2html}} + {{ctx.Locale.Tr "repo.settings.branch_protection" (.Rule.RuleName|Escape) | Str2html}} </h4> <div class="ui attached segment branch-protection"> - <h5 class="ui dividing header">{{.locale.Tr "repo.settings.protect_patterns"}}</h5> + <h5 class="ui dividing header">{{ctx.Locale.Tr "repo.settings.protect_patterns"}}</h5> <div class="field"> - <label>{{.locale.Tr "repo.settings.protect_branch_name_pattern"}}</label> + <label>{{ctx.Locale.Tr "repo.settings.protect_branch_name_pattern"}}</label> <input name="rule_name" type="text" value="{{.Rule.RuleName}}"> <input name="rule_id" type="hidden" value="{{.Rule.ID}}"> </div> <div class="field"> - <label>{{.locale.Tr "repo.settings.protect_protected_file_patterns"}}</label> + <label>{{ctx.Locale.Tr "repo.settings.protect_protected_file_patterns"}}</label> <input name="protected_file_patterns" type="text" value="{{.Rule.ProtectedFilePatterns}}"> - <p class="help gt-ml-0">{{.locale.Tr "repo.settings.protect_protected_file_patterns_desc" | Safe}}</p> + <p class="help gt-ml-0">{{ctx.Locale.Tr "repo.settings.protect_protected_file_patterns_desc" | Safe}}</p> </div> <div class="field"> - <label>{{.locale.Tr "repo.settings.protect_unprotected_file_patterns"}}</label> + <label>{{ctx.Locale.Tr "repo.settings.protect_unprotected_file_patterns"}}</label> <input name="unprotected_file_patterns" type="text" value="{{.Rule.UnprotectedFilePatterns}}"> - <p class="help gt-ml-0">{{.locale.Tr "repo.settings.protect_unprotected_file_patterns_desc" | Safe}}</p> + <p class="help gt-ml-0">{{ctx.Locale.Tr "repo.settings.protect_unprotected_file_patterns_desc" | Safe}}</p> </div> {{.CsrfTokenHtml}} - <h5 class="ui dividing header">{{.locale.Tr "repo.settings.event_push"}}</h5> + <h5 class="ui dividing header">{{ctx.Locale.Tr "repo.settings.event_push"}}</h5> <div class="field"> <div class="ui radio checkbox"> <input name="enable_push" type="radio" value="none" class="toggle-target-disabled" data-target="#whitelist_box" {{if not .Rule.CanPush}}checked{{end}}> - <label>{{.locale.Tr "repo.settings.protect_disable_push"}}</label> - <p class="help">{{.locale.Tr "repo.settings.protect_disable_push_desc"}}</p> + <label>{{ctx.Locale.Tr "repo.settings.protect_disable_push"}}</label> + <p class="help">{{ctx.Locale.Tr "repo.settings.protect_disable_push_desc"}}</p> </div> </div> <div class="field"> <div class="ui radio checkbox"> <input name="enable_push" type="radio" value="all" class="toggle-target-disabled" data-target="#whitelist_box" {{if and (.Rule.CanPush) (not .Rule.EnableWhitelist)}}checked{{end}}> - <label>{{.locale.Tr "repo.settings.protect_enable_push"}}</label> - <p class="help">{{.locale.Tr "repo.settings.protect_enable_push_desc"}}</p> + <label>{{ctx.Locale.Tr "repo.settings.protect_enable_push"}}</label> + <p class="help">{{ctx.Locale.Tr "repo.settings.protect_enable_push_desc"}}</p> </div> </div> <div class="grouped fields"> <div class="field"> <div class="ui radio checkbox"> <input name="enable_push" type="radio" value="whitelist" class="toggle-target-enabled" data-target="#whitelist_box" {{if and (.Rule.CanPush) (.Rule.EnableWhitelist)}}checked{{end}}> - <label>{{.locale.Tr "repo.settings.protect_whitelist_committers"}}</label> - <p class="help">{{.locale.Tr "repo.settings.protect_whitelist_committers_desc"}}</p> + <label>{{ctx.Locale.Tr "repo.settings.protect_whitelist_committers"}}</label> + <p class="help">{{ctx.Locale.Tr "repo.settings.protect_whitelist_committers_desc"}}</p> </div> </div> <div id="whitelist_box" class="grouped fields {{if not .Rule.EnableWhitelist}}disabled{{end}}"> <div class="checkbox-sub-item field"> - <label>{{.locale.Tr "repo.settings.protect_whitelist_users"}}</label> + <label>{{ctx.Locale.Tr "repo.settings.protect_whitelist_users"}}</label> <div class="ui multiple search selection dropdown"> <input type="hidden" name="whitelist_users" value="{{.whitelist_users}}"> - <div class="default text">{{.locale.Tr "repo.settings.protect_whitelist_search_users"}}</div> + <div class="default text">{{ctx.Locale.Tr "repo.settings.protect_whitelist_search_users"}}</div> <div class="menu"> {{range .Users}} <div class="item" data-value="{{.ID}}"> @@ -63,10 +63,10 @@ </div> {{if .Owner.IsOrganization}} <div class="checkbox-sub-item field"> - <label>{{.locale.Tr "repo.settings.protect_whitelist_teams"}}</label> + <label>{{ctx.Locale.Tr "repo.settings.protect_whitelist_teams"}}</label> <div class="ui multiple search selection dropdown"> <input type="hidden" name="whitelist_teams" value="{{.whitelist_teams}}"> - <div class="default text">{{.locale.Tr "repo.settings.protect_whitelist_search_teams"}}</div> + <div class="default text">{{ctx.Locale.Tr "repo.settings.protect_whitelist_search_teams"}}</div> <div class="menu"> {{range .Teams}} <div class="item" data-value="{{.ID}}"> @@ -81,7 +81,7 @@ <div class="checkbox-sub-item field"> <div class="ui checkbox"> <input type="checkbox" name="whitelist_deploy_keys" {{if .Rule.WhitelistDeployKeys}}checked{{end}}> - <label>{{.locale.Tr "repo.settings.protect_whitelist_deploy_keys"}}</label> + <label>{{ctx.Locale.Tr "repo.settings.protect_whitelist_deploy_keys"}}</label> </div> </div> </div> @@ -89,30 +89,30 @@ <div class="field"> <div class="ui checkbox"> <input name="require_signed_commits" type="checkbox" {{if .Rule.RequireSignedCommits}}checked{{end}}> - <label>{{.locale.Tr "repo.settings.require_signed_commits"}}</label> - <p class="help">{{.locale.Tr "repo.settings.require_signed_commits_desc"}}</p> + <label>{{ctx.Locale.Tr "repo.settings.require_signed_commits"}}</label> + <p class="help">{{ctx.Locale.Tr "repo.settings.require_signed_commits_desc"}}</p> </div> </div> - <h5 class="ui dividing header">{{.locale.Tr "repo.settings.event_pull_request_approvals"}}</h5> + <h5 class="ui dividing header">{{ctx.Locale.Tr "repo.settings.event_pull_request_approvals"}}</h5> <div class="field"> - <label>{{.locale.Tr "repo.settings.protect_required_approvals"}}</label> + <label>{{ctx.Locale.Tr "repo.settings.protect_required_approvals"}}</label> <input name="required_approvals" type="number" value="{{.Rule.RequiredApprovals}}"> - <p class="help gt-ml-0">{{.locale.Tr "repo.settings.protect_required_approvals_desc"}}</p> + <p class="help gt-ml-0">{{ctx.Locale.Tr "repo.settings.protect_required_approvals_desc"}}</p> </div> <div class="grouped fields"> <div class="field"> <div class="ui checkbox"> <input name="enable_approvals_whitelist" type="checkbox" class="toggle-target-enabled" data-target="#approvals_whitelist_box" {{if .Rule.EnableApprovalsWhitelist}}checked{{end}}> - <label>{{.locale.Tr "repo.settings.protect_approvals_whitelist_enabled"}}</label> - <p class="help">{{.locale.Tr "repo.settings.protect_approvals_whitelist_enabled_desc"}}</p> + <label>{{ctx.Locale.Tr "repo.settings.protect_approvals_whitelist_enabled"}}</label> + <p class="help">{{ctx.Locale.Tr "repo.settings.protect_approvals_whitelist_enabled_desc"}}</p> </div> </div> <div id="approvals_whitelist_box" class="grouped fields {{if not .Rule.EnableApprovalsWhitelist}}disabled{{end}}"> <div class="checkbox-sub-item field"> - <label>{{.locale.Tr "repo.settings.protect_approvals_whitelist_users"}}</label> + <label>{{ctx.Locale.Tr "repo.settings.protect_approvals_whitelist_users"}}</label> <div class="ui multiple search selection dropdown"> <input type="hidden" name="approvals_whitelist_users" value="{{.approvals_whitelist_users}}"> - <div class="default text">{{.locale.Tr "repo.settings.protect_whitelist_search_users"}}</div> + <div class="default text">{{ctx.Locale.Tr "repo.settings.protect_whitelist_search_users"}}</div> <div class="menu"> {{range .Users}} <div class="item" data-value="{{.ID}}"> @@ -124,10 +124,10 @@ </div> {{if .Owner.IsOrganization}} <div class="checkbox-sub-item field"> - <label>{{.locale.Tr "repo.settings.protect_approvals_whitelist_teams"}}</label> + <label>{{ctx.Locale.Tr "repo.settings.protect_approvals_whitelist_teams"}}</label> <div class="ui multiple search selection dropdown"> <input type="hidden" name="approvals_whitelist_teams" value="{{.approvals_whitelist_teams}}"> - <div class="default text">{{.locale.Tr "repo.settings.protect_whitelist_search_teams"}}</div> + <div class="default text">{{ctx.Locale.Tr "repo.settings.protect_whitelist_search_teams"}}</div> <div class="menu"> {{range .Teams}} <div class="item" data-value="{{.ID}}"> @@ -144,26 +144,26 @@ <div class="field"> <div class="ui checkbox"> <input name="dismiss_stale_approvals" type="checkbox" {{if .Rule.DismissStaleApprovals}}checked{{end}}> - <label>{{.locale.Tr "repo.settings.dismiss_stale_approvals"}}</label> - <p class="help">{{.locale.Tr "repo.settings.dismiss_stale_approvals_desc"}}</p> + <label>{{ctx.Locale.Tr "repo.settings.dismiss_stale_approvals"}}</label> + <p class="help">{{ctx.Locale.Tr "repo.settings.dismiss_stale_approvals_desc"}}</p> </div> </div> <div class="grouped fields"> <div class="field"> <div class="ui checkbox"> <input name="enable_status_check" type="checkbox" class="toggle-target-enabled" data-target="#statuscheck_contexts_box" {{if .Rule.EnableStatusCheck}}checked{{end}}> - <label>{{.locale.Tr "repo.settings.protect_check_status_contexts"}}</label> - <p class="help">{{.locale.Tr "repo.settings.protect_check_status_contexts_desc"}}</p> + <label>{{ctx.Locale.Tr "repo.settings.protect_check_status_contexts"}}</label> + <p class="help">{{ctx.Locale.Tr "repo.settings.protect_check_status_contexts_desc"}}</p> </div> </div> <div id="statuscheck_contexts_box" class="checkbox-sub-item field {{if not .Rule.EnableStatusCheck}}disabled{{end}}"> - <label>{{.locale.Tr "repo.settings.protect_status_check_patterns"}}</label> + <label>{{ctx.Locale.Tr "repo.settings.protect_status_check_patterns"}}</label> <textarea id="status_check_contexts" name="status_check_contexts" rows="3">{{.status_check_contexts}}</textarea> - <p class="help">{{.locale.Tr "repo.settings.protect_status_check_patterns_desc"}}</p> + <p class="help">{{ctx.Locale.Tr "repo.settings.protect_status_check_patterns_desc"}}</p> <table class="ui celled table"> <thead> <tr> - <th>{{.locale.Tr "repo.settings.protect_check_status_contexts_list"}}</th> + <th>{{ctx.Locale.Tr "repo.settings.protect_check_status_contexts_list"}}</th> </tr> </thead> <tbody> @@ -171,7 +171,7 @@ <tr> <td> <span>{{.}}</span> - <span class="status-check-matched-mark gt-hidden" data-status-check="{{.}}">{{$.locale.Tr "repo.settings.protect_status_check_matched"}}</span> + <span class="status-check-matched-mark gt-hidden" data-status-check="{{.}}">{{ctx.Locale.Tr "repo.settings.protect_status_check_matched"}}</span> </td> </tr> {{else}} @@ -181,28 +181,28 @@ </table> </div> </div> - <h5 class="ui dividing header">{{.locale.Tr "repo.settings.event_pull_request_merge"}}</h5> + <h5 class="ui dividing header">{{ctx.Locale.Tr "repo.settings.event_pull_request_merge"}}</h5> <div class="grouped fields"> <div class="field"> <div class="ui radio checkbox"> <input name="enable_merge_whitelist" type="radio" value="false" class="toggle-target-disabled" data-target="#merge_whitelist_box" {{if not .Rule.EnableMergeWhitelist}}checked{{end}}> - <label>{{.locale.Tr "repo.settings.protect_enable_merge"}}</label> - <p class="help">{{.locale.Tr "repo.settings.protect_enable_merge_desc"}}</p> + <label>{{ctx.Locale.Tr "repo.settings.protect_enable_merge"}}</label> + <p class="help">{{ctx.Locale.Tr "repo.settings.protect_enable_merge_desc"}}</p> </div> </div> <div class="field"> <div class="ui radio checkbox"> <input name="enable_merge_whitelist" type="radio" value="true" class="toggle-target-enabled" data-target="#merge_whitelist_box" {{if .Rule.EnableMergeWhitelist}}checked{{end}}> - <label>{{.locale.Tr "repo.settings.protect_merge_whitelist_committers"}}</label> - <p class="help">{{.locale.Tr "repo.settings.protect_merge_whitelist_committers_desc"}}</p> + <label>{{ctx.Locale.Tr "repo.settings.protect_merge_whitelist_committers"}}</label> + <p class="help">{{ctx.Locale.Tr "repo.settings.protect_merge_whitelist_committers_desc"}}</p> </div> </div> <div id="merge_whitelist_box" class="grouped fields {{if not .Rule.EnableMergeWhitelist}}disabled{{end}}"> <div class="checkbox-sub-item field"> - <label>{{.locale.Tr "repo.settings.protect_merge_whitelist_users"}}</label> + <label>{{ctx.Locale.Tr "repo.settings.protect_merge_whitelist_users"}}</label> <div class="ui multiple search selection dropdown"> <input type="hidden" name="merge_whitelist_users" value="{{.merge_whitelist_users}}"> - <div class="default text">{{.locale.Tr "repo.settings.protect_whitelist_search_users"}}</div> + <div class="default text">{{ctx.Locale.Tr "repo.settings.protect_whitelist_search_users"}}</div> <div class="menu"> {{range .Users}} <div class="item" data-value="{{.ID}}"> @@ -214,10 +214,10 @@ </div> {{if .Owner.IsOrganization}} <div class="checkbox-sub-item field"> - <label>{{.locale.Tr "repo.settings.protect_merge_whitelist_teams"}}</label> + <label>{{ctx.Locale.Tr "repo.settings.protect_merge_whitelist_teams"}}</label> <div class="ui multiple search selection dropdown"> <input type="hidden" name="merge_whitelist_teams" value="{{.merge_whitelist_teams}}"> - <div class="default text">{{.locale.Tr "repo.settings.protect_whitelist_search_teams"}}</div> + <div class="default text">{{ctx.Locale.Tr "repo.settings.protect_whitelist_search_teams"}}</div> <div class="menu"> {{range .Teams}} <div class="item" data-value="{{.ID}}"> @@ -234,28 +234,28 @@ <div class="field"> <div class="ui checkbox"> <input name="block_on_rejected_reviews" type="checkbox" {{if .Rule.BlockOnRejectedReviews}}checked{{end}}> - <label>{{.locale.Tr "repo.settings.block_rejected_reviews"}}</label> - <p class="help">{{.locale.Tr "repo.settings.block_rejected_reviews_desc"}}</p> + <label>{{ctx.Locale.Tr "repo.settings.block_rejected_reviews"}}</label> + <p class="help">{{ctx.Locale.Tr "repo.settings.block_rejected_reviews_desc"}}</p> </div> </div> <div class="field"> <div class="ui checkbox"> <input name="block_on_official_review_requests" type="checkbox" {{if .Rule.BlockOnOfficialReviewRequests}}checked{{end}}> - <label>{{.locale.Tr "repo.settings.block_on_official_review_requests"}}</label> - <p class="help">{{.locale.Tr "repo.settings.block_on_official_review_requests_desc"}}</p> + <label>{{ctx.Locale.Tr "repo.settings.block_on_official_review_requests"}}</label> + <p class="help">{{ctx.Locale.Tr "repo.settings.block_on_official_review_requests_desc"}}</p> </div> </div> <div class="field"> <div class="ui checkbox"> <input name="block_on_outdated_branch" type="checkbox" {{if .Rule.BlockOnOutdatedBranch}}checked{{end}}> - <label>{{.locale.Tr "repo.settings.block_outdated_branch"}}</label> - <p class="help">{{.locale.Tr "repo.settings.block_outdated_branch_desc"}}</p> + <label>{{ctx.Locale.Tr "repo.settings.block_outdated_branch"}}</label> + <p class="help">{{ctx.Locale.Tr "repo.settings.block_outdated_branch_desc"}}</p> </div> </div> <div class="divider"></div> <div class="field"> - <button class="ui primary button">{{$.locale.Tr "repo.settings.protected_branch.save_rule"}}</button> + <button class="ui primary button">{{ctx.Locale.Tr "repo.settings.protected_branch.save_rule"}}</button> </div> </div> </form> diff --git a/templates/repo/settings/push_mirror_sync_modal.tmpl b/templates/repo/settings/push_mirror_sync_modal.tmpl index a04574add5..e8dad61a48 100644 --- a/templates/repo/settings/push_mirror_sync_modal.tmpl +++ b/templates/repo/settings/push_mirror_sync_modal.tmpl @@ -1,6 +1,6 @@ <div class="ui small modal" id="push-mirror-edit-modal"> <div class="header"> - {{$.locale.Tr "repo.settings.mirror_settings.push_mirror.edit_sync_time"}} + {{ctx.Locale.Tr "repo.settings.mirror_settings.push_mirror.edit_sync_time"}} </div> <div class="content"> <form class="ui form ignore-dirty" method="post"> @@ -8,23 +8,23 @@ <input type="hidden" name="action" value="push-mirror-update"> <input type="hidden" name="push_mirror_id" id="push-mirror-edit-id"> <div class="field"> - <label for="name">{{$.locale.Tr "repo.settings.mirror_settings.mirrored_repository"}}</label> + <label for="name">{{ctx.Locale.Tr "repo.settings.mirror_settings.mirrored_repository"}}</label> <div class="ui small input"> <input id="push-mirror-edit-address" readonly> </div> </div> <div class="inline field"> - <label for="push-mirror-edit-interval">{{.locale.Tr "repo.mirror_interval" .MinimumMirrorInterval}}</label> + <label for="push-mirror-edit-interval">{{ctx.Locale.Tr "repo.mirror_interval" .MinimumMirrorInterval}}</label> <input id="push-mirror-edit-interval" name="push_mirror_interval" autofocus> </div> <div class="actions"> <button class="ui small basic cancel button"> {{svg "octicon-x"}} - {{.locale.Tr "cancel"}} + {{ctx.Locale.Tr "cancel"}} </button> <button class="ui primary small approve button"> {{svg "fontawesome-save"}} - {{.locale.Tr "save"}} + {{ctx.Locale.Tr "save"}} </button> </div> </form> diff --git a/templates/repo/settings/tags.tmpl b/templates/repo/settings/tags.tmpl index 48b67697c8..ed7762acc5 100644 --- a/templates/repo/settings/tags.tmpl +++ b/templates/repo/settings/tags.tmpl @@ -2,11 +2,11 @@ <div class="repo-setting-content"> {{if .Repository.IsArchived}} <div class="ui warning message gt-text-center"> - {{.locale.Tr "repo.settings.archive.tagsettings_unavailable"}} + {{ctx.Locale.Tr "repo.settings.archive.tagsettings_unavailable"}} </div> {{else}} <h4 class="ui top attached header"> - {{.locale.Tr "repo.settings.tags.protection"}} + {{ctx.Locale.Tr "repo.settings.tags.protection"}} </h4> <div class="ui attached segment"> @@ -16,19 +16,19 @@ <form class="ui form" action="{{.Link}}" method="post"> {{.CsrfTokenHtml}} <div class="field"> - <label>{{.locale.Tr "repo.settings.tags.protection.pattern"}}</label> + <label>{{ctx.Locale.Tr "repo.settings.tags.protection.pattern"}}</label> <div id="search-tag-box" class="ui search"> <div class="ui input"> <input class="prompt" name="name_pattern" autocomplete="off" value="{{.name_pattern}}" placeholder="v*" autofocus required> </div> - <div class="help">{{.locale.Tr "repo.settings.tags.protection.pattern.description" | Safe}}</div> + <div class="help">{{ctx.Locale.Tr "repo.settings.tags.protection.pattern.description" | Safe}}</div> </div> </div> <div class="whitelist field"> - <label>{{.locale.Tr "repo.settings.tags.protection.allowed.users"}}</label> + <label>{{ctx.Locale.Tr "repo.settings.tags.protection.allowed.users"}}</label> <div class="ui multiple search selection dropdown"> <input type="hidden" name="allowlist_users" value="{{.allowlist_users}}"> - <div class="default text">{{.locale.Tr "repo.settings.protect_whitelist_search_users"}}</div> + <div class="default text">{{ctx.Locale.Tr "repo.settings.protect_whitelist_search_users"}}</div> <div class="menu"> {{range .Users}} <div class="item" data-value="{{.ID}}"> @@ -40,10 +40,10 @@ </div> {{if .Owner.IsOrganization}} <div class="whitelist field"> - <label>{{.locale.Tr "repo.settings.tags.protection.allowed.teams"}}</label> + <label>{{ctx.Locale.Tr "repo.settings.tags.protection.allowed.teams"}}</label> <div class="ui multiple search selection dropdown"> <input type="hidden" name="allowlist_teams" value="{{.allowlist_teams}}"> - <div class="default text">{{.locale.Tr "repo.settings.protect_whitelist_search_teams"}}</div> + <div class="default text">{{ctx.Locale.Tr "repo.settings.protect_whitelist_search_teams"}}</div> <div class="menu"> {{range .Teams}} <div class="item" data-value="{{.ID}}"> @@ -58,14 +58,14 @@ <div class="field"> {{if .PageIsEditProtectedTag}} <button class="ui primary button"> - {{$.locale.Tr "save"}} + {{ctx.Locale.Tr "save"}} </button> <a class="ui primary button" href="{{$.RepoLink}}/settings/tags"> - {{$.locale.Tr "cancel"}} + {{ctx.Locale.Tr "cancel"}} </a> {{else}} <button class="ui primary button"> - {{$.locale.Tr "repo.settings.tags.protection.create"}} + {{ctx.Locale.Tr "repo.settings.tags.protection.create"}} </button> {{end}} </div> @@ -76,8 +76,8 @@ <div class="sixteen wide column"> <table class="ui single line table"> <thead> - <th>{{.locale.Tr "repo.settings.tags.protection.pattern"}}</th> - <th>{{.locale.Tr "repo.settings.tags.protection.allowed"}}</th> + <th>{{ctx.Locale.Tr "repo.settings.tags.protection.pattern"}}</th> + <th>{{ctx.Locale.Tr "repo.settings.tags.protection.allowed"}}</th> <th></th> </thead> <tbody> @@ -101,20 +101,20 @@ {{end}} {{end}} {{else}} - {{$.locale.Tr "repo.settings.tags.protection.allowed.noone"}} + {{ctx.Locale.Tr "repo.settings.tags.protection.allowed.noone"}} {{end}} </td> <td class="right aligned"> - <a class="ui tiny primary button" href="{{$.RepoLink}}/settings/tags/{{.ID}}">{{$.locale.Tr "edit"}}</a> + <a class="ui tiny primary button" href="{{$.RepoLink}}/settings/tags/{{.ID}}">{{ctx.Locale.Tr "edit"}}</a> <form class="gt-dib" action="{{$.RepoLink}}/settings/tags/delete" method="post"> {{$.CsrfTokenHtml}} <input type="hidden" name="id" value="{{.ID}}"> - <button class="ui tiny red button">{{$.locale.Tr "remove"}}</button> + <button class="ui tiny red button">{{ctx.Locale.Tr "remove"}}</button> </form> </td> </tr> {{else}} - <tr class="center aligned"><td colspan="3">{{.locale.Tr "repo.settings.tags.protection.none"}}</td></tr> + <tr class="center aligned"><td colspan="3">{{ctx.Locale.Tr "repo.settings.tags.protection.none"}}</td></tr> {{end}} </tbody> </table> diff --git a/templates/repo/settings/webhook/base_list.tmpl b/templates/repo/settings/webhook/base_list.tmpl index b0e8ace410..ed6e670d60 100644 --- a/templates/repo/settings/webhook/base_list.tmpl +++ b/templates/repo/settings/webhook/base_list.tmpl @@ -2,51 +2,51 @@ {{.Title}} <div class="ui right"> <div class="ui jump dropdown"> - <div class="ui primary tiny button">{{.locale.Tr "repo.settings.add_webhook"}}</div> + <div class="ui primary tiny button">{{ctx.Locale.Tr "repo.settings.add_webhook"}}</div> <div class="menu"> <a class="item" href="{{.BaseLinkNew}}/gitea/new"> {{template "shared/webhook/icon" (dict "HookType" "gitea" "Size" 20)}} - {{.locale.Tr "repo.settings.web_hook_name_gitea"}} + {{ctx.Locale.Tr "repo.settings.web_hook_name_gitea"}} </a> <a class="item" href="{{.BaseLinkNew}}/gogs/new"> {{template "shared/webhook/icon" (dict "HookType" "gogs" "Size" 20)}} - {{.locale.Tr "repo.settings.web_hook_name_gogs"}} + {{ctx.Locale.Tr "repo.settings.web_hook_name_gogs"}} </a> <a class="item" href="{{.BaseLinkNew}}/slack/new"> {{template "shared/webhook/icon" (dict "HookType" "slack" "Size" 20)}} - {{.locale.Tr "repo.settings.web_hook_name_slack"}} + {{ctx.Locale.Tr "repo.settings.web_hook_name_slack"}} </a> <a class="item" href="{{.BaseLinkNew}}/discord/new"> {{template "shared/webhook/icon" (dict "HookType" "discord" "Size" 20)}} - {{.locale.Tr "repo.settings.web_hook_name_discord"}} + {{ctx.Locale.Tr "repo.settings.web_hook_name_discord"}} </a> <a class="item" href="{{.BaseLinkNew}}/dingtalk/new"> {{template "shared/webhook/icon" (dict "HookType" "dingtalk" "Size" 20)}} - {{.locale.Tr "repo.settings.web_hook_name_dingtalk"}} + {{ctx.Locale.Tr "repo.settings.web_hook_name_dingtalk"}} </a> <a class="item" href="{{.BaseLinkNew}}/telegram/new"> {{template "shared/webhook/icon" (dict "HookType" "telegram" "Size" 20)}} - {{.locale.Tr "repo.settings.web_hook_name_telegram"}} + {{ctx.Locale.Tr "repo.settings.web_hook_name_telegram"}} </a> <a class="item" href="{{.BaseLinkNew}}/msteams/new"> {{template "shared/webhook/icon" (dict "HookType" "msteams" "Size" 20)}} - {{.locale.Tr "repo.settings.web_hook_name_msteams"}} + {{ctx.Locale.Tr "repo.settings.web_hook_name_msteams"}} </a> <a class="item" href="{{.BaseLinkNew}}/feishu/new"> {{template "shared/webhook/icon" (dict "HookType" "feishu" "Size" 20)}} - {{.locale.Tr "repo.settings.web_hook_name_feishu_or_larksuite"}} + {{ctx.Locale.Tr "repo.settings.web_hook_name_feishu_or_larksuite"}} </a> <a class="item" href="{{.BaseLinkNew}}/matrix/new"> {{template "shared/webhook/icon" (dict "HookType" "matrix" "Size" 20)}} - {{.locale.Tr "repo.settings.web_hook_name_matrix"}} + {{ctx.Locale.Tr "repo.settings.web_hook_name_matrix"}} </a> <a class="item" href="{{.BaseLinkNew}}/wechatwork/new"> {{template "shared/webhook/icon" (dict "HookType" "wechatwork" "Size" 20)}} - {{.locale.Tr "repo.settings.web_hook_name_wechatwork"}} + {{ctx.Locale.Tr "repo.settings.web_hook_name_wechatwork"}} </a> <a class="item" href="{{.BaseLinkNew}}/packagist/new"> {{template "shared/webhook/icon" (dict "HookType" "packagist" "Size" 20)}} - {{.locale.Tr "repo.settings.web_hook_name_packagist"}} + {{ctx.Locale.Tr "repo.settings.web_hook_name_packagist"}} </a> </div> </div> diff --git a/templates/repo/settings/webhook/delete_modal.tmpl b/templates/repo/settings/webhook/delete_modal.tmpl index b78e69e6f4..9955ed3a2f 100644 --- a/templates/repo/settings/webhook/delete_modal.tmpl +++ b/templates/repo/settings/webhook/delete_modal.tmpl @@ -1,10 +1,10 @@ <div class="ui g-modal-confirm delete modal"> <div class="header"> {{svg "octicon-trash"}} - {{.locale.Tr "repo.settings.webhook_deletion"}} + {{ctx.Locale.Tr "repo.settings.webhook_deletion"}} </div> <div class="content"> - <p>{{.locale.Tr "repo.settings.webhook_deletion_desc"}}</p> + <p>{{ctx.Locale.Tr "repo.settings.webhook_deletion_desc"}}</p> </div> {{template "base/modal_actions_confirm" .}} </div> diff --git a/templates/repo/settings/webhook/dingtalk.tmpl b/templates/repo/settings/webhook/dingtalk.tmpl index 25d5adf9b9..76c4452b75 100644 --- a/templates/repo/settings/webhook/dingtalk.tmpl +++ b/templates/repo/settings/webhook/dingtalk.tmpl @@ -1,9 +1,9 @@ {{if eq .HookType "dingtalk"}} - <p>{{.locale.Tr "repo.settings.add_web_hook_desc" "https://dingtalk.com" (.locale.Tr "repo.settings.web_hook_name_dingtalk") | Str2html}}</p> + <p>{{ctx.Locale.Tr "repo.settings.add_web_hook_desc" "https://dingtalk.com" (.locale.Tr "repo.settings.web_hook_name_dingtalk") | Str2html}}</p> <form class="ui form" action="{{.BaseLink}}/dingtalk/{{or .Webhook.ID "new"}}" method="post"> {{.CsrfTokenHtml}} <div class="required field {{if .Err_PayloadURL}}error{{end}}"> - <label for="payload_url">{{.locale.Tr "repo.settings.payload_url"}}</label> + <label for="payload_url">{{ctx.Locale.Tr "repo.settings.payload_url"}}</label> <input id="payload_url" name="payload_url" type="url" value="{{.Webhook.URL}}" autofocus required> </div> {{template "repo/settings/webhook/settings" .}} diff --git a/templates/repo/settings/webhook/discord.tmpl b/templates/repo/settings/webhook/discord.tmpl index 3d943c8219..d61981c748 100644 --- a/templates/repo/settings/webhook/discord.tmpl +++ b/templates/repo/settings/webhook/discord.tmpl @@ -1,17 +1,17 @@ {{if eq .HookType "discord"}} - <p>{{.locale.Tr "repo.settings.add_web_hook_desc" "https://discord.com" (.locale.Tr "repo.settings.web_hook_name_discord") | Str2html}}</p> + <p>{{ctx.Locale.Tr "repo.settings.add_web_hook_desc" "https://discord.com" (.locale.Tr "repo.settings.web_hook_name_discord") | Str2html}}</p> <form class="ui form" action="{{.BaseLink}}/discord/{{or .Webhook.ID "new"}}" method="post"> {{.CsrfTokenHtml}} <div class="required field {{if .Err_PayloadURL}}error{{end}}"> - <label for="payload_url">{{.locale.Tr "repo.settings.payload_url"}}</label> + <label for="payload_url">{{ctx.Locale.Tr "repo.settings.payload_url"}}</label> <input id="payload_url" name="payload_url" type="url" value="{{.Webhook.URL}}" autofocus required> </div> <div class="field"> - <label for="username">{{.locale.Tr "repo.settings.discord_username"}}</label> + <label for="username">{{ctx.Locale.Tr "repo.settings.discord_username"}}</label> <input id="username" name="username" value="{{.DiscordHook.Username}}" placeholder="Gitea"> </div> <div class="field"> - <label for="icon_url">{{.locale.Tr "repo.settings.discord_icon_url"}}</label> + <label for="icon_url">{{ctx.Locale.Tr "repo.settings.discord_icon_url"}}</label> <input id="icon_url" name="icon_url" value="{{.DiscordHook.IconURL}}" placeholder="https://example.com/assets/img/logo.svg"> </div> {{template "repo/settings/webhook/settings" .}} diff --git a/templates/repo/settings/webhook/feishu.tmpl b/templates/repo/settings/webhook/feishu.tmpl index 7de4430204..3bf61b4031 100644 --- a/templates/repo/settings/webhook/feishu.tmpl +++ b/templates/repo/settings/webhook/feishu.tmpl @@ -1,10 +1,10 @@ {{if eq .HookType "feishu"}} - <p>{{.locale.Tr "repo.settings.add_web_hook_desc" "https://feishu.cn" (.locale.Tr "repo.settings.web_hook_name_feishu") | Str2html}}</p> - <p>{{.locale.Tr "repo.settings.add_web_hook_desc" "https://larksuite.com" (.locale.Tr "repo.settings.web_hook_name_larksuite") | Str2html}}</p> + <p>{{ctx.Locale.Tr "repo.settings.add_web_hook_desc" "https://feishu.cn" (.locale.Tr "repo.settings.web_hook_name_feishu") | Str2html}}</p> + <p>{{ctx.Locale.Tr "repo.settings.add_web_hook_desc" "https://larksuite.com" (.locale.Tr "repo.settings.web_hook_name_larksuite") | Str2html}}</p> <form class="ui form" action="{{.BaseLink}}/feishu/{{or .Webhook.ID "new"}}" method="post"> {{.CsrfTokenHtml}} <div class="required field {{if .Err_PayloadURL}}error{{end}}"> - <label for="payload_url">{{.locale.Tr "repo.settings.payload_url"}}</label> + <label for="payload_url">{{ctx.Locale.Tr "repo.settings.payload_url"}}</label> <input id="payload_url" name="payload_url" type="url" value="{{.Webhook.URL}}" autofocus required> </div> {{template "repo/settings/webhook/settings" .}} diff --git a/templates/repo/settings/webhook/gitea.tmpl b/templates/repo/settings/webhook/gitea.tmpl index 1850c663b1..41dfc69105 100644 --- a/templates/repo/settings/webhook/gitea.tmpl +++ b/templates/repo/settings/webhook/gitea.tmpl @@ -1,14 +1,14 @@ {{if eq .HookType "gitea"}} - <p>{{.locale.Tr "repo.settings.add_web_hook_desc" "https://docs.gitea.com/usage/webhooks" (.locale.Tr "repo.settings.web_hook_name_gitea") | Str2html}}</p> + <p>{{ctx.Locale.Tr "repo.settings.add_web_hook_desc" "https://docs.gitea.com/usage/webhooks" (.locale.Tr "repo.settings.web_hook_name_gitea") | Str2html}}</p> <form class="ui form" action="{{.BaseLink}}/gitea/{{or .Webhook.ID "new"}}" method="post"> {{template "base/disable_form_autofill"}} {{.CsrfTokenHtml}} <div class="required field {{if .Err_PayloadURL}}error{{end}}"> - <label for="payload_url">{{.locale.Tr "repo.settings.payload_url"}}</label> + <label for="payload_url">{{ctx.Locale.Tr "repo.settings.payload_url"}}</label> <input id="payload_url" name="payload_url" type="url" value="{{.Webhook.URL}}" autofocus required> </div> <div class="field"> - <label>{{.locale.Tr "repo.settings.http_method"}}</label> + <label>{{ctx.Locale.Tr "repo.settings.http_method"}}</label> <div class="ui selection dropdown"> <input type="hidden" id="http_method" name="http_method" value="{{if .Webhook.HTTPMethod}}{{.Webhook.HTTPMethod}}{{else}}POST{{end}}"> <div class="default text"></div> @@ -20,7 +20,7 @@ </div> </div> <div class="field"> - <label>{{.locale.Tr "repo.settings.content_type"}}</label> + <label>{{ctx.Locale.Tr "repo.settings.content_type"}}</label> <div class="ui selection dropdown"> <input type="hidden" id="content_type" name="content_type" value="{{if .Webhook.ContentType}}{{.Webhook.ContentType}}{{else}}1{{end}}"> <div class="default text"></div> @@ -32,7 +32,7 @@ </div> </div> <div class="field {{if .Err_Secret}}error{{end}}"> - <label for="secret">{{.locale.Tr "repo.settings.secret"}}</label> + <label for="secret">{{ctx.Locale.Tr "repo.settings.secret"}}</label> <input id="secret" name="secret" type="password" value="{{.Webhook.Secret}}" autocomplete="off"> </div> {{template "repo/settings/webhook/settings" .}} diff --git a/templates/repo/settings/webhook/gogs.tmpl b/templates/repo/settings/webhook/gogs.tmpl index 176c24eb93..e047df3388 100644 --- a/templates/repo/settings/webhook/gogs.tmpl +++ b/templates/repo/settings/webhook/gogs.tmpl @@ -1,14 +1,14 @@ {{if eq .HookType "gogs"}} - <p>{{.locale.Tr "repo.settings.add_web_hook_desc" "https://docs.gitea.com/usage/webhooks" (.locale.Tr "repo.settings.web_hook_name_gogs") | Str2html}}</p> + <p>{{ctx.Locale.Tr "repo.settings.add_web_hook_desc" "https://docs.gitea.com/usage/webhooks" (.locale.Tr "repo.settings.web_hook_name_gogs") | Str2html}}</p> <form class="ui form" action="{{.BaseLink}}/gogs/{{or .Webhook.ID "new"}}" method="post"> {{template "base/disable_form_autofill"}} {{.CsrfTokenHtml}} <div class="required field {{if .Err_PayloadURL}}error{{end}}"> - <label for="payload_url">{{.locale.Tr "repo.settings.payload_url"}}</label> + <label for="payload_url">{{ctx.Locale.Tr "repo.settings.payload_url"}}</label> <input id="payload_url" name="payload_url" type="url" value="{{.Webhook.URL}}" autofocus required> </div> <div class="field"> - <label>{{.locale.Tr "repo.settings.content_type"}}</label> + <label>{{ctx.Locale.Tr "repo.settings.content_type"}}</label> <div class="ui selection dropdown"> <input type="hidden" id="content_type" name="content_type" value="{{if .Webhook.ContentType}}{{.Webhook.ContentType}}{{else}}1{{end}}"> <div class="default text"></div> @@ -20,7 +20,7 @@ </div> </div> <div class="field {{if .Err_Secret}}error{{end}}"> - <label for="secret">{{.locale.Tr "repo.settings.secret"}}</label> + <label for="secret">{{ctx.Locale.Tr "repo.settings.secret"}}</label> <input id="secret" name="secret" type="password" value="{{.Webhook.Secret}}" autocomplete="off"> </div> {{template "repo/settings/webhook/settings" .}} diff --git a/templates/repo/settings/webhook/history.tmpl b/templates/repo/settings/webhook/history.tmpl index 69e50989e6..fd404ae834 100644 --- a/templates/repo/settings/webhook/history.tmpl +++ b/templates/repo/settings/webhook/history.tmpl @@ -1,12 +1,12 @@ {{$isNew:=or .PageIsSettingsHooksNew .PageIsAdminDefaultHooksNew .PageIsAdminSystemHooksNew}} {{if .PageIsSettingsHooksEdit}} <h4 class="ui top attached header"> - {{.locale.Tr "repo.settings.recent_deliveries"}} + {{ctx.Locale.Tr "repo.settings.recent_deliveries"}} {{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}}{{.locale.Tr "repo.settings.webhook.test_delivery_desc"}}{{else}}{{.locale.Tr "repo.settings.webhook.test_delivery_desc_disabled"}}{{end}}"> - <button class="ui teal tiny button{{if not (or $isNew .Webhook.IsActive)}} disabled{{end}}" id="test-delivery" data-link="{{.Link}}/test" data-redirect="{{.Link}}">{{.locale.Tr "repo.settings.webhook.test_delivery"}}</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 teal tiny button{{if not (or $isNew .Webhook.IsActive)}} disabled{{end}}" id="test-delivery" data-link="{{.Link}}/test" data-redirect="{{.Link}}">{{ctx.Locale.Tr "repo.settings.webhook.test_delivery"}}</button> </span> </div> {{end}} @@ -30,9 +30,9 @@ </div> <div class="info gt-hidden" id="info-{{.ID}}"> <div class="ui top attached tabular menu"> - <a class="item active" data-tab="request-{{.ID}}">{{$.locale.Tr "repo.settings.webhook.request"}}</a> + <a class="item active" data-tab="request-{{.ID}}">{{ctx.Locale.Tr "repo.settings.webhook.request"}}</a> <a class="item" data-tab="response-{{.ID}}"> - {{$.locale.Tr "repo.settings.webhook.response"}} + {{ctx.Locale.Tr "repo.settings.webhook.response"}} {{if .ResponseInfo}} {{if .IsSucceed}} <span class="ui green label">{{.ResponseInfo.Status}}</span> @@ -47,7 +47,7 @@ <div class="right menu"> <form class="item" action="{{$.Link}}/replay/{{.UUID}}" method="post"> {{$.CsrfTokenHtml}} - <span data-tooltip-content="{{if $.Webhook.IsActive}}{{$.locale.Tr "repo.settings.webhook.replay.description"}}{{else}}{{$.locale.Tr "repo.settings.webhook.replay.description_disabled"}}{{end}}"> + <span data-tooltip-content="{{if $.Webhook.IsActive}}{{ctx.Locale.Tr "repo.settings.webhook.replay.description"}}{{else}}{{ctx.Locale.Tr "repo.settings.webhook.replay.description_disabled"}}{{end}}"> <button class="ui tiny button{{if not $.Webhook.IsActive}} disabled{{end}}">{{svg "octicon-sync"}}</button> </span> </form> @@ -56,12 +56,12 @@ </div> <div class="ui bottom attached tab segment active" data-tab="request-{{.ID}}"> {{if .RequestInfo}} - <h5>{{$.locale.Tr "repo.settings.webhook.headers"}}</h5> + <h5>{{ctx.Locale.Tr "repo.settings.webhook.headers"}}</h5> <pre class="webhook-info"><strong>Request URL:</strong> {{.RequestInfo.URL}} <strong>Request method:</strong> {{if .RequestInfo.HTTPMethod}}{{.RequestInfo.HTTPMethod}}{{else}}POST{{end}} {{range $key, $val := .RequestInfo.Headers}}<strong>{{$key}}:</strong> {{$val}} {{end}}</pre> - <h5>{{$.locale.Tr "repo.settings.webhook.payload"}}</h5> + <h5>{{ctx.Locale.Tr "repo.settings.webhook.payload"}}</h5> <pre class="webhook-info"><code class="json">{{.PayloadContent}}</code></pre> {{else}} - @@ -69,10 +69,10 @@ </div> <div class="ui bottom attached tab segment" data-tab="response-{{.ID}}"> {{if .ResponseInfo}} - <h5>{{$.locale.Tr "repo.settings.webhook.headers"}}</h5> + <h5>{{ctx.Locale.Tr "repo.settings.webhook.headers"}}</h5> <pre class="webhook-info">{{range $key, $val := .ResponseInfo.Headers}}<strong>{{$key}}:</strong> {{$val}} {{end}}</pre> - <h5>{{$.locale.Tr "repo.settings.webhook.body"}}</h5> + <h5>{{ctx.Locale.Tr "repo.settings.webhook.body"}}</h5> <pre class="webhook-info"><code>{{.ResponseInfo.Body}}</code></pre> {{else}} - diff --git a/templates/repo/settings/webhook/matrix.tmpl b/templates/repo/settings/webhook/matrix.tmpl index d3ab5588bf..01c81914b0 100644 --- a/templates/repo/settings/webhook/matrix.tmpl +++ b/templates/repo/settings/webhook/matrix.tmpl @@ -1,17 +1,17 @@ {{if eq .HookType "matrix"}} - <p>{{.locale.Tr "repo.settings.add_web_hook_desc" "https://matrix.org/" (.locale.Tr "repo.settings.web_hook_name_matrix") | Str2html}}</p> + <p>{{ctx.Locale.Tr "repo.settings.add_web_hook_desc" "https://matrix.org/" (.locale.Tr "repo.settings.web_hook_name_matrix") | Str2html}}</p> <form class="ui form" action="{{.BaseLink}}/matrix/{{or .Webhook.ID "new"}}" method="post"> {{.CsrfTokenHtml}} <div class="required field {{if .Err_HomeserverURL}}error{{end}}"> - <label for="homeserver_url">{{.locale.Tr "repo.settings.matrix.homeserver_url"}}</label> + <label for="homeserver_url">{{ctx.Locale.Tr "repo.settings.matrix.homeserver_url"}}</label> <input id="homeserver_url" name="homeserver_url" type="url" value="{{.MatrixHook.HomeserverURL}}" autofocus required> </div> <div class="required field {{if .Err_Room}}error{{end}}"> - <label for="room_id">{{.locale.Tr "repo.settings.matrix.room_id"}}</label> + <label for="room_id">{{ctx.Locale.Tr "repo.settings.matrix.room_id"}}</label> <input id="room_id" name="room_id" type="text" value="{{.MatrixHook.Room}}" required> </div> <div class="field"> - <label>{{.locale.Tr "repo.settings.matrix.message_type"}}</label> + <label>{{ctx.Locale.Tr "repo.settings.matrix.message_type"}}</label> <div class="ui selection dropdown"> <input type="hidden" id="message_type" name="message_type" value="{{if .MatrixHook.MessageType}}{{.MatrixHook.MessageType}}{{else}}1{{end}}"> <div class="default text"></div> diff --git a/templates/repo/settings/webhook/msteams.tmpl b/templates/repo/settings/webhook/msteams.tmpl index fecb4d97be..e2d1826d07 100644 --- a/templates/repo/settings/webhook/msteams.tmpl +++ b/templates/repo/settings/webhook/msteams.tmpl @@ -1,9 +1,9 @@ {{if eq .HookType "msteams"}} - <p>{{.locale.Tr "repo.settings.add_web_hook_desc" "https://teams.microsoft.com" (.locale.Tr "repo.settings.web_hook_name_msteams") | Str2html}}</p> + <p>{{ctx.Locale.Tr "repo.settings.add_web_hook_desc" "https://teams.microsoft.com" (.locale.Tr "repo.settings.web_hook_name_msteams") | Str2html}}</p> <form class="ui form" action="{{.BaseLink}}/msteams/{{or .Webhook.ID "new"}}" method="post"> {{.CsrfTokenHtml}} <div class="required field {{if .Err_PayloadURL}}error{{end}}"> - <label for="payload_url">{{.locale.Tr "repo.settings.payload_url"}}</label> + <label for="payload_url">{{ctx.Locale.Tr "repo.settings.payload_url"}}</label> <input id="payload_url" name="payload_url" type="url" value="{{.Webhook.URL}}" autofocus required> </div> {{template "repo/settings/webhook/settings" .}} diff --git a/templates/repo/settings/webhook/new.tmpl b/templates/repo/settings/webhook/new.tmpl index 67a5f7296f..b04a44213a 100644 --- a/templates/repo/settings/webhook/new.tmpl +++ b/templates/repo/settings/webhook/new.tmpl @@ -1,7 +1,7 @@ {{template "repo/settings/layout_head" (dict "ctxData" . "pageClass" "repository settings new webhook")}} <div class="repo-setting-content"> - {{$CustomHeaderTitle := .locale.Tr "repo.settings.update_webhook"}} - {{if .PageIsSettingsHooksNew}}{{$CustomHeaderTitle = .locale.Tr "repo.settings.add_webhook"}}{{end}} + {{$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)}} </div> {{template "repo/settings/layout_footer" .}} diff --git a/templates/repo/settings/webhook/packagist.tmpl b/templates/repo/settings/webhook/packagist.tmpl index b8033c1043..7c37684369 100644 --- a/templates/repo/settings/webhook/packagist.tmpl +++ b/templates/repo/settings/webhook/packagist.tmpl @@ -1,17 +1,17 @@ {{if eq .HookType "packagist"}} - <p>{{.locale.Tr "repo.settings.add_web_hook_desc" "https://packagist.org" (.locale.Tr "repo.settings.web_hook_name_packagist") | Str2html}}</p> + <p>{{ctx.Locale.Tr "repo.settings.add_web_hook_desc" "https://packagist.org" (.locale.Tr "repo.settings.web_hook_name_packagist") | Str2html}}</p> <form class="ui form" action="{{.BaseLink}}/packagist/{{or .Webhook.ID "new"}}" method="post"> {{.CsrfTokenHtml}} <div class="required field {{if .Err_Username}}error{{end}}"> - <label for="username">{{.locale.Tr "repo.settings.packagist_username"}}</label> + <label for="username">{{ctx.Locale.Tr "repo.settings.packagist_username"}}</label> <input id="username" name="username" value="{{.PackagistHook.Username}}" placeholder="Gitea" autofocus required> </div> <div class="required field {{if .Err_APIToken}}error{{end}}"> - <label for="api_token">{{.locale.Tr "repo.settings.packagist_api_token"}}</label> + <label for="api_token">{{ctx.Locale.Tr "repo.settings.packagist_api_token"}}</label> <input id="api_token" name="api_token" value="{{.PackagistHook.APIToken}}" placeholder="X5F_tZ-Wj3c1vqaU2Rky" required> </div> <div class="required field {{if .Err_PackageURL}}error{{end}}"> - <label for="package_url">{{.locale.Tr "repo.settings.packagist_package_url"}}</label> + <label for="package_url">{{ctx.Locale.Tr "repo.settings.packagist_package_url"}}</label> <input id="package_url" name="package_url" value="{{.PackagistHook.PackageURL}}" placeholder="https://packagist.org/packages/laravel/framework" required> </div> {{template "repo/settings/webhook/settings" .}} diff --git a/templates/repo/settings/webhook/settings.tmpl b/templates/repo/settings/webhook/settings.tmpl index a669d2c9a3..addf99d45a 100644 --- a/templates/repo/settings/webhook/settings.tmpl +++ b/templates/repo/settings/webhook/settings.tmpl @@ -1,23 +1,23 @@ {{$isNew:=or .PageIsSettingsHooksNew .PageIsAdminDefaultHooksNew .PageIsAdminSystemHooksNew}} <div class="field"> - <h4>{{.locale.Tr "repo.settings.event_desc"}}</h4> + <h4>{{ctx.Locale.Tr "repo.settings.event_desc"}}</h4> <div class="grouped event type fields"> <div class="field"> <div class="ui radio non-events checkbox"> <input name="events" type="radio" value="push_only" {{if or $isNew .Webhook.PushOnly}}checked{{end}}> - <label>{{.locale.Tr "repo.settings.event_push_only" | Str2html}}</label> + <label>{{ctx.Locale.Tr "repo.settings.event_push_only" | Str2html}}</label> </div> </div> <div class="field"> <div class="ui radio non-events checkbox"> <input name="events" type="radio" value="send_everything" {{if .Webhook.SendEverything}}checked{{end}}> - <label>{{.locale.Tr "repo.settings.event_send_everything" | Str2html}}</label> + <label>{{ctx.Locale.Tr "repo.settings.event_send_everything" | Str2html}}</label> </div> </div> <div class="field"> <div class="ui radio events checkbox"> <input name="events" type="radio" value="choose_events" {{if .Webhook.ChooseEvents}}checked{{end}}> - <label>{{.locale.Tr "repo.settings.event_choose" | Str2html}}</label> + <label>{{ctx.Locale.Tr "repo.settings.event_choose" | Str2html}}</label> </div> </div> </div> @@ -25,15 +25,15 @@ <div class="events fields ui grid {{if not .Webhook.ChooseEvents}}gt-hidden{{end}}"> <!-- Repository Events --> <div class="fourteen wide column"> - <label>{{.locale.Tr "repo.settings.event_header_repository"}}</label> + <label>{{ctx.Locale.Tr "repo.settings.event_header_repository"}}</label> </div> <!-- Create --> <div class="seven wide column"> <div class="field"> <div class="ui checkbox"> <input name="create" type="checkbox" {{if .Webhook.Create}}checked{{end}}> - <label>{{.locale.Tr "repo.settings.event_create"}}</label> - <span class="help">{{.locale.Tr "repo.settings.event_create_desc"}}</span> + <label>{{ctx.Locale.Tr "repo.settings.event_create"}}</label> + <span class="help">{{ctx.Locale.Tr "repo.settings.event_create_desc"}}</span> </div> </div> </div> @@ -42,8 +42,8 @@ <div class="field"> <div class="ui checkbox"> <input name="delete" type="checkbox" {{if .Webhook.Delete}}checked{{end}}> - <label>{{.locale.Tr "repo.settings.event_delete"}}</label> - <span class="help">{{.locale.Tr "repo.settings.event_delete_desc"}}</span> + <label>{{ctx.Locale.Tr "repo.settings.event_delete"}}</label> + <span class="help">{{ctx.Locale.Tr "repo.settings.event_delete_desc"}}</span> </div> </div> </div> @@ -52,8 +52,8 @@ <div class="field"> <div class="ui checkbox"> <input name="fork" type="checkbox" {{if .Webhook.Fork}}checked{{end}}> - <label>{{.locale.Tr "repo.settings.event_fork"}}</label> - <span class="help">{{.locale.Tr "repo.settings.event_fork_desc"}}</span> + <label>{{ctx.Locale.Tr "repo.settings.event_fork"}}</label> + <span class="help">{{ctx.Locale.Tr "repo.settings.event_fork_desc"}}</span> </div> </div> </div> @@ -62,8 +62,8 @@ <div class="field"> <div class="ui checkbox"> <input name="push" type="checkbox" {{if .Webhook.Push}}checked{{end}}> - <label>{{.locale.Tr "repo.settings.event_push"}}</label> - <span class="help">{{.locale.Tr "repo.settings.event_push_desc"}}</span> + <label>{{ctx.Locale.Tr "repo.settings.event_push"}}</label> + <span class="help">{{ctx.Locale.Tr "repo.settings.event_push_desc"}}</span> </div> </div> </div> @@ -72,8 +72,8 @@ <div class="field"> <div class="ui checkbox"> <input name="repository" type="checkbox" {{if .Webhook.Repository}}checked{{end}}> - <label>{{.locale.Tr "repo.settings.event_repository"}}</label> - <span class="help">{{.locale.Tr "repo.settings.event_repository_desc"}}</span> + <label>{{ctx.Locale.Tr "repo.settings.event_repository"}}</label> + <span class="help">{{ctx.Locale.Tr "repo.settings.event_repository_desc"}}</span> </div> </div> </div> @@ -82,8 +82,8 @@ <div class="field"> <div class="ui checkbox"> <input name="release" type="checkbox" {{if .Webhook.Release}}checked{{end}}> - <label>{{.locale.Tr "repo.settings.event_release"}}</label> - <span class="help">{{.locale.Tr "repo.settings.event_release_desc"}}</span> + <label>{{ctx.Locale.Tr "repo.settings.event_release"}}</label> + <span class="help">{{ctx.Locale.Tr "repo.settings.event_release_desc"}}</span> </div> </div> </div> @@ -92,8 +92,8 @@ <div class="field"> <div class="ui checkbox"> <input name="package" type="checkbox" {{if .Webhook.Package}}checked{{end}}> - <label>{{.locale.Tr "repo.settings.event_package"}}</label> - <span class="help">{{.locale.Tr "repo.settings.event_package_desc"}}</span> + <label>{{ctx.Locale.Tr "repo.settings.event_package"}}</label> + <span class="help">{{ctx.Locale.Tr "repo.settings.event_package_desc"}}</span> </div> </div> </div> @@ -103,23 +103,23 @@ <div class="field"> <div class="ui checkbox"> <input name="wiki" type="checkbox" {{if .Webhook.Wiki}}checked{{end}}> - <label>{{.locale.Tr "repo.settings.event_wiki"}}</label> - <span class="help">{{.locale.Tr "repo.settings.event_wiki_desc"}}</span> + <label>{{ctx.Locale.Tr "repo.settings.event_wiki"}}</label> + <span class="help">{{ctx.Locale.Tr "repo.settings.event_wiki_desc"}}</span> </div> </div> </div> <!-- Issue Events --> <div class="fourteen wide column"> - <label>{{.locale.Tr "repo.settings.event_header_issue"}}</label> + <label>{{ctx.Locale.Tr "repo.settings.event_header_issue"}}</label> </div> <!-- Issues --> <div class="seven wide column"> <div class="field"> <div class="ui checkbox"> <input name="issues" type="checkbox" {{if .Webhook.Issues}}checked{{end}}> - <label>{{.locale.Tr "repo.settings.event_issues"}}</label> - <span class="help">{{.locale.Tr "repo.settings.event_issues_desc"}}</span> + <label>{{ctx.Locale.Tr "repo.settings.event_issues"}}</label> + <span class="help">{{ctx.Locale.Tr "repo.settings.event_issues_desc"}}</span> </div> </div> </div> @@ -128,8 +128,8 @@ <div class="field"> <div class="ui checkbox"> <input name="issue_assign" type="checkbox" {{if .Webhook.IssueAssign}}checked{{end}}> - <label>{{.locale.Tr "repo.settings.event_issue_assign"}}</label> - <span class="help">{{.locale.Tr "repo.settings.event_issue_assign_desc"}}</span> + <label>{{ctx.Locale.Tr "repo.settings.event_issue_assign"}}</label> + <span class="help">{{ctx.Locale.Tr "repo.settings.event_issue_assign_desc"}}</span> </div> </div> </div> @@ -138,8 +138,8 @@ <div class="field"> <div class="ui checkbox"> <input name="issue_label" type="checkbox" {{if .Webhook.IssueLabel}}checked{{end}}> - <label>{{.locale.Tr "repo.settings.event_issue_label"}}</label> - <span class="help">{{.locale.Tr "repo.settings.event_issue_label_desc"}}</span> + <label>{{ctx.Locale.Tr "repo.settings.event_issue_label"}}</label> + <span class="help">{{ctx.Locale.Tr "repo.settings.event_issue_label_desc"}}</span> </div> </div> </div> @@ -148,8 +148,8 @@ <div class="field"> <div class="ui checkbox"> <input name="issue_milestone" type="checkbox" {{if .Webhook.IssueMilestone}}checked{{end}}> - <label>{{.locale.Tr "repo.settings.event_issue_milestone"}}</label> - <span class="help">{{.locale.Tr "repo.settings.event_issue_milestone_desc"}}</span> + <label>{{ctx.Locale.Tr "repo.settings.event_issue_milestone"}}</label> + <span class="help">{{ctx.Locale.Tr "repo.settings.event_issue_milestone_desc"}}</span> </div> </div> </div> @@ -158,23 +158,23 @@ <div class="field"> <div class="ui checkbox"> <input name="issue_comment" type="checkbox" {{if .Webhook.IssueComment}}checked{{end}}> - <label>{{.locale.Tr "repo.settings.event_issue_comment"}}</label> - <span class="help">{{.locale.Tr "repo.settings.event_issue_comment_desc"}}</span> + <label>{{ctx.Locale.Tr "repo.settings.event_issue_comment"}}</label> + <span class="help">{{ctx.Locale.Tr "repo.settings.event_issue_comment_desc"}}</span> </div> </div> </div> <!-- Pull Request Events --> <div class="fourteen wide column"> - <label>{{.locale.Tr "repo.settings.event_header_pull_request"}}</label> + <label>{{ctx.Locale.Tr "repo.settings.event_header_pull_request"}}</label> </div> <!-- Pull Request --> <div class="seven wide column"> <div class="field"> <div class="ui checkbox"> <input name="pull_request" type="checkbox" {{if .Webhook.PullRequest}}checked{{end}}> - <label>{{.locale.Tr "repo.settings.event_pull_request"}}</label> - <span class="help">{{.locale.Tr "repo.settings.event_pull_request_desc"}}</span> + <label>{{ctx.Locale.Tr "repo.settings.event_pull_request"}}</label> + <span class="help">{{ctx.Locale.Tr "repo.settings.event_pull_request_desc"}}</span> </div> </div> </div> @@ -183,8 +183,8 @@ <div class="field"> <div class="ui checkbox"> <input name="pull_request_assign" type="checkbox" {{if .Webhook.PullRequestAssign}}checked{{end}}> - <label>{{.locale.Tr "repo.settings.event_pull_request_assign"}}</label> - <span class="help">{{.locale.Tr "repo.settings.event_pull_request_assign_desc"}}</span> + <label>{{ctx.Locale.Tr "repo.settings.event_pull_request_assign"}}</label> + <span class="help">{{ctx.Locale.Tr "repo.settings.event_pull_request_assign_desc"}}</span> </div> </div> </div> @@ -193,8 +193,8 @@ <div class="field"> <div class="ui checkbox"> <input name="pull_request_label" type="checkbox" {{if .Webhook.PullRequestLabel}}checked{{end}}> - <label>{{.locale.Tr "repo.settings.event_pull_request_label"}}</label> - <span class="help">{{.locale.Tr "repo.settings.event_pull_request_label_desc"}}</span> + <label>{{ctx.Locale.Tr "repo.settings.event_pull_request_label"}}</label> + <span class="help">{{ctx.Locale.Tr "repo.settings.event_pull_request_label_desc"}}</span> </div> </div> </div> @@ -203,8 +203,8 @@ <div class="field"> <div class="ui checkbox"> <input name="pull_request_milestone" type="checkbox" {{if .Webhook.PullRequestMilestone}}checked{{end}}> - <label>{{.locale.Tr "repo.settings.event_pull_request_milestone"}}</label> - <span class="help">{{.locale.Tr "repo.settings.event_pull_request_milestone_desc"}}</span> + <label>{{ctx.Locale.Tr "repo.settings.event_pull_request_milestone"}}</label> + <span class="help">{{ctx.Locale.Tr "repo.settings.event_pull_request_milestone_desc"}}</span> </div> </div> </div> @@ -213,8 +213,8 @@ <div class="field"> <div class="ui checkbox"> <input name="pull_request_comment" type="checkbox" {{if .Webhook.PullRequestComment}}checked{{end}}> - <label>{{.locale.Tr "repo.settings.event_pull_request_comment"}}</label> - <span class="help">{{.locale.Tr "repo.settings.event_pull_request_comment_desc"}}</span> + <label>{{ctx.Locale.Tr "repo.settings.event_pull_request_comment"}}</label> + <span class="help">{{ctx.Locale.Tr "repo.settings.event_pull_request_comment_desc"}}</span> </div> </div> </div> @@ -223,8 +223,8 @@ <div class="field"> <div class="ui checkbox"> <input name="pull_request_review" type="checkbox" {{if .Webhook.PullRequestReview}}checked{{end}}> - <label>{{.locale.Tr "repo.settings.event_pull_request_review"}}</label> - <span class="help">{{.locale.Tr "repo.settings.event_pull_request_review_desc"}}</span> + <label>{{ctx.Locale.Tr "repo.settings.event_pull_request_review"}}</label> + <span class="help">{{ctx.Locale.Tr "repo.settings.event_pull_request_review_desc"}}</span> </div> </div> </div> @@ -233,8 +233,8 @@ <div class="field"> <div class="ui checkbox"> <input name="pull_request_sync" type="checkbox" {{if .Webhook.PullRequestSync}}checked{{end}}> - <label>{{.locale.Tr "repo.settings.event_pull_request_sync"}}</label> - <span class="help">{{.locale.Tr "repo.settings.event_pull_request_sync_desc"}}</span> + <label>{{ctx.Locale.Tr "repo.settings.event_pull_request_sync"}}</label> + <span class="help">{{ctx.Locale.Tr "repo.settings.event_pull_request_sync_desc"}}</span> </div> </div> </div> @@ -243,8 +243,8 @@ <div class="field"> <div class="ui checkbox"> <input name="pull_request_review_request" type="checkbox" {{if .Webhook.PullRequestReviewRequest}}checked{{end}}> - <label>{{.locale.Tr "repo.settings.event_pull_request_review_request"}}</label> - <span class="help">{{.locale.Tr "repo.settings.event_pull_request_review_request_desc"}}</span> + <label>{{ctx.Locale.Tr "repo.settings.event_pull_request_review_request"}}</label> + <span class="help">{{ctx.Locale.Tr "repo.settings.event_pull_request_review_request_desc"}}</span> </div> </div> </div> @@ -253,17 +253,17 @@ <!-- Branch filter --> <div class="field"> - <label for="branch_filter">{{.locale.Tr "repo.settings.branch_filter"}}</label> + <label for="branch_filter">{{ctx.Locale.Tr "repo.settings.branch_filter"}}</label> <input name="branch_filter" type="text" value="{{or .Webhook.BranchFilter "*"}}"> - <span class="help">{{.locale.Tr "repo.settings.branch_filter_desc" | Str2html}}</span> + <span class="help">{{ctx.Locale.Tr "repo.settings.branch_filter_desc" | Str2html}}</span> </div> <!-- Authorization Header --> <div class="field{{if eq .HookType "matrix"}} required{{end}}"> - <label for="authorization_header">{{.locale.Tr "repo.settings.authorization_header"}}</label> + <label for="authorization_header">{{ctx.Locale.Tr "repo.settings.authorization_header"}}</label> <input id="authorization_header" name="authorization_header" type="text" value="{{.Webhook.HeaderAuthorization}}"{{if eq .HookType "matrix"}} placeholder="Bearer $access_token" required{{end}}> {{if ne .HookType "matrix"}}{{/* Matrix doesn't make the authorization optional but it is implied by the help string, should be changed.*/}} - <span class="help">{{.locale.Tr "repo.settings.authorization_header_desc" "<code>Bearer token123456</code>, <code>Basic YWxhZGRpbjpvcGVuc2VzYW1l</code>" | Str2html}}</span> + <span class="help">{{ctx.Locale.Tr "repo.settings.authorization_header_desc" "<code>Bearer token123456</code>, <code>Basic YWxhZGRpbjpvcGVuc2VzYW1l</code>" | Str2html}}</span> {{end}} </div> @@ -272,16 +272,16 @@ <div class="inline field"> <div class="ui checkbox"> <input name="active" type="checkbox" {{if or $isNew .Webhook.IsActive}}checked{{end}}> - <label>{{.locale.Tr "repo.settings.active"}}</label> - <span class="help">{{.locale.Tr "repo.settings.active_helper"}}</span> + <label>{{ctx.Locale.Tr "repo.settings.active"}}</label> + <span class="help">{{ctx.Locale.Tr "repo.settings.active_helper"}}</span> </div> </div> <div class="field"> {{if $isNew}} - <button class="ui primary button">{{.locale.Tr "repo.settings.add_webhook"}}</button> + <button class="ui primary button">{{ctx.Locale.Tr "repo.settings.add_webhook"}}</button> {{else}} - <button class="ui primary button">{{.locale.Tr "repo.settings.update_webhook"}}</button> - <a class="ui red delete-button button" data-url="{{.BaseLink}}/delete" data-id="{{.Webhook.ID}}">{{.locale.Tr "repo.settings.delete_webhook"}}</a> + <button class="ui primary button">{{ctx.Locale.Tr "repo.settings.update_webhook"}}</button> + <a class="ui red delete-button button" data-url="{{.BaseLink}}/delete" data-id="{{.Webhook.ID}}">{{ctx.Locale.Tr "repo.settings.delete_webhook"}}</a> {{end}} </div> diff --git a/templates/repo/settings/webhook/slack.tmpl b/templates/repo/settings/webhook/slack.tmpl index 335966a6d1..8607ec4d3c 100644 --- a/templates/repo/settings/webhook/slack.tmpl +++ b/templates/repo/settings/webhook/slack.tmpl @@ -1,26 +1,26 @@ {{if eq .HookType "slack"}} - <p>{{.locale.Tr "repo.settings.add_web_hook_desc" "https://slack.com" (.locale.Tr "repo.settings.web_hook_name_slack") | Str2html}}</p> + <p>{{ctx.Locale.Tr "repo.settings.add_web_hook_desc" "https://slack.com" (.locale.Tr "repo.settings.web_hook_name_slack") | Str2html}}</p> <form class="ui form" action="{{.BaseLink}}/slack/{{or .Webhook.ID "new"}}" method="post"> {{.CsrfTokenHtml}} <div class="required field {{if .Err_PayloadURL}}error{{end}}"> - <label for="payload_url">{{.locale.Tr "repo.settings.payload_url"}}</label> + <label for="payload_url">{{ctx.Locale.Tr "repo.settings.payload_url"}}</label> <input id="payload_url" name="payload_url" type="url" value="{{.Webhook.URL}}" autofocus required> </div> <div class="required field {{if .Err_Channel}}error{{end}}"> - <label for="channel">{{.locale.Tr "repo.settings.slack_channel"}}</label> + <label for="channel">{{ctx.Locale.Tr "repo.settings.slack_channel"}}</label> <input id="channel" name="channel" value="{{.SlackHook.Channel}}" placeholder="#general" required> </div> <div class="field"> - <label for="username">{{.locale.Tr "repo.settings.slack_username"}}</label> + <label for="username">{{ctx.Locale.Tr "repo.settings.slack_username"}}</label> <input id="username" name="username" value="{{.SlackHook.Username}}" placeholder="Gitea"> </div> <div class="field"> - <label for="icon_url">{{.locale.Tr "repo.settings.slack_icon_url"}}</label> + <label for="icon_url">{{ctx.Locale.Tr "repo.settings.slack_icon_url"}}</label> <input id="icon_url" name="icon_url" value="{{.SlackHook.IconURL}}" placeholder="https://example.com/img/favicon.png"> </div> <div class="field"> - <label for="color">{{.locale.Tr "repo.settings.slack_color"}}</label> + <label for="color">{{ctx.Locale.Tr "repo.settings.slack_color"}}</label> <input id="color" name="color" value="{{.SlackHook.Color}}" placeholder="#dd4b39, good, warning, danger"> </div> {{template "repo/settings/webhook/settings" .}} diff --git a/templates/repo/settings/webhook/telegram.tmpl b/templates/repo/settings/webhook/telegram.tmpl index f618fea140..f9858c365f 100644 --- a/templates/repo/settings/webhook/telegram.tmpl +++ b/templates/repo/settings/webhook/telegram.tmpl @@ -1,17 +1,17 @@ {{if eq .HookType "telegram"}} - <p>{{.locale.Tr "repo.settings.add_web_hook_desc" "https://core.telegram.org/bots" (.locale.Tr "repo.settings.web_hook_name_telegram") | Str2html}}</p> + <p>{{ctx.Locale.Tr "repo.settings.add_web_hook_desc" "https://core.telegram.org/bots" (.locale.Tr "repo.settings.web_hook_name_telegram") | Str2html}}</p> <form class="ui form" action="{{.BaseLink}}/telegram/{{or .Webhook.ID "new"}}" method="post"> {{.CsrfTokenHtml}} <div class="required field {{if .Err_BotToken}}error{{end}}"> - <label for="bot_token">{{.locale.Tr "repo.settings.bot_token"}}</label> + <label for="bot_token">{{ctx.Locale.Tr "repo.settings.bot_token"}}</label> <input id="bot_token" name="bot_token" type="text" value="{{.TelegramHook.BotToken}}" autofocus required> </div> <div class="required field {{if .Err_ChatID}}error{{end}}"> - <label for="chat_id">{{.locale.Tr "repo.settings.chat_id"}}</label> + <label for="chat_id">{{ctx.Locale.Tr "repo.settings.chat_id"}}</label> <input id="chat_id" name="chat_id" type="text" value="{{.TelegramHook.ChatID}}" required> </div> <div class="field {{if .Err_ThreadID}}error{{end}}"> - <label for="thread_id">{{.locale.Tr "repo.settings.thread_id"}}</label> + <label for="thread_id">{{ctx.Locale.Tr "repo.settings.thread_id"}}</label> <input id="thread_id" name="thread_id" type="text" value="{{.TelegramHook.ThreadID}}"> </div> {{template "repo/settings/webhook/settings" .}} diff --git a/templates/repo/settings/webhook/wechatwork.tmpl b/templates/repo/settings/webhook/wechatwork.tmpl index a84bbfa5e1..e571a32539 100644 --- a/templates/repo/settings/webhook/wechatwork.tmpl +++ b/templates/repo/settings/webhook/wechatwork.tmpl @@ -1,9 +1,9 @@ {{if eq .HookType "wechatwork"}} - <p>{{.locale.Tr "repo.settings.add_web_hook_desc" "https://work.weixin.qq.com" (.locale.Tr "repo.settings.web_hook_name_wechatwork") | Str2html}}</p> + <p>{{ctx.Locale.Tr "repo.settings.add_web_hook_desc" "https://work.weixin.qq.com" (.locale.Tr "repo.settings.web_hook_name_wechatwork") | Str2html}}</p> <form class="ui form" action="{{.BaseLink}}/wechatwork/{{or .Webhook.ID "new"}}" method="post"> {{.CsrfTokenHtml}} <div class="required field {{if .Err_PayloadURL}}error{{end}}"> - <label for="payload_url">{{.locale.Tr "repo.settings.payload_url"}}</label> + <label for="payload_url">{{ctx.Locale.Tr "repo.settings.payload_url"}}</label> <input id="payload_url" name="payload_url" type="url" value="{{.Webhook.URL}}" autofocus required> </div> {{template "repo/settings/webhook/settings" .}} diff --git a/templates/repo/sub_menu.tmpl b/templates/repo/sub_menu.tmpl index 3a1400575c..e4a0416e3f 100644 --- a/templates/repo/sub_menu.tmpl +++ b/templates/repo/sub_menu.tmpl @@ -3,14 +3,14 @@ <div class="ui segment sub-menu repository-menu"> {{if and (.Permission.CanRead $.UnitTypeCode) (not .IsEmptyRepo)}} <a class="item muted {{if .PageIsCommits}}active{{end}}" href="{{.RepoLink}}/commits/{{.BranchNameSubURL}}"> - {{svg "octicon-history"}} <b>{{.locale.PrettyNumber .CommitsCount}}</b> {{.locale.TrN .CommitsCount "repo.commit" "repo.commits"}} + {{svg "octicon-history"}} <b>{{.locale.PrettyNumber .CommitsCount}}</b> {{ctx.Locale.TrN .CommitsCount "repo.commit" "repo.commits"}} </a> <a class="item muted {{if .PageIsBranches}}active{{end}}" href="{{.RepoLink}}/branches"> - {{svg "octicon-git-branch"}} <b>{{.locale.PrettyNumber .BranchesCount}}</b> {{.locale.TrN .BranchesCount "repo.branch" "repo.branches"}} + {{svg "octicon-git-branch"}} <b>{{.locale.PrettyNumber .BranchesCount}}</b> {{ctx.Locale.TrN .BranchesCount "repo.branch" "repo.branches"}} </a> {{if $.Permission.CanRead $.UnitTypeCode}} <a class="item muted {{if .PageIsTagList}}active{{end}}" href="{{.RepoLink}}/tags"> - {{svg "octicon-tag"}} <b>{{.locale.PrettyNumber .NumTags}}</b> {{.locale.TrN .NumTags "repo.tag" "repo.tags"}} + {{svg "octicon-tag"}} <b>{{.locale.PrettyNumber .NumTags}}</b> {{ctx.Locale.TrN .NumTags "repo.tag" "repo.tags"}} </a> {{end}} <span class="item not-mobile" {{if not (eq .Repository.Size 0)}}data-tooltip-content="{{.Repository.SizeDetailsString}}"{{end}}> @@ -27,7 +27,7 @@ <i class="color-icon" style="background-color: {{.Color}}"></i> <span class="gt-font-semibold"> {{if eq .Language "other"}} - {{$.locale.Tr "repo.language_other"}} + {{ctx.Locale.Tr "repo.language_other"}} {{else}} {{.Language}} {{end}} diff --git a/templates/repo/tag/list.tmpl b/templates/repo/tag/list.tmpl index 5dfa79cd18..61c79fdcae 100644 --- a/templates/repo/tag/list.tmpl +++ b/templates/repo/tag/list.tmpl @@ -6,7 +6,7 @@ {{template "repo/release_tag_header" .}} <h4 class="ui top attached header"> <div class="five wide column gt-df gt-ac"> - {{svg "octicon-tag" 16 "gt-mr-2"}}{{.locale.Tr "repo.release.tags"}} + {{svg "octicon-tag" 16 "gt-mr-2"}}{{ctx.Locale.Tr "repo.release.tags"}} </div> </h4> {{$canReadReleases := $.Permission.CanRead $.UnitTypeReleases}} @@ -37,17 +37,17 @@ {{end}} {{if (and $canReadReleases $.CanCreateRelease $release.IsTag)}} - <a class="gt-mr-3 muted" href="{{$.RepoLink}}/releases/new?tag={{.TagName}}">{{svg "octicon-tag" 16 "gt-mr-2"}}{{$.locale.Tr "repo.release.new_release"}}</a> + <a class="gt-mr-3 muted" href="{{$.RepoLink}}/releases/new?tag={{.TagName}}">{{svg "octicon-tag" 16 "gt-mr-2"}}{{ctx.Locale.Tr "repo.release.new_release"}}</a> {{end}} {{if (and ($.Permission.CanWrite $.UnitTypeCode) $release.IsTag)}} <a class="ui delete-button gt-mr-3 muted" data-url="{{$.RepoLink}}/tags/delete" data-id="{{.ID}}"> - {{svg "octicon-trash" 16 "gt-mr-2"}}{{$.locale.Tr "repo.release.delete_tag"}} + {{svg "octicon-trash" 16 "gt-mr-2"}}{{ctx.Locale.Tr "repo.release.delete_tag"}} </a> {{end}} {{if and $canReadReleases (not $release.IsTag)}} - <a class="gt-mr-3 muted" href="{{$.RepoLink}}/releases/tag/{{.TagName | PathEscapeSegments}}">{{svg "octicon-tag" 16 "gt-mr-2"}}{{$.locale.Tr "repo.release.detail"}}</a> + <a class="gt-mr-3 muted" href="{{$.RepoLink}}/releases/tag/{{.TagName | PathEscapeSegments}}">{{svg "octicon-tag" 16 "gt-mr-2"}}{{ctx.Locale.Tr "repo.release.detail"}}</a> {{end}} {{end}} </div> @@ -66,10 +66,10 @@ <div class="ui g-modal-confirm delete modal"> <div class="header"> {{svg "octicon-trash"}} - {{.locale.Tr "repo.release.delete_tag"}} + {{ctx.Locale.Tr "repo.release.delete_tag"}} </div> <div class="content"> - <p>{{.locale.Tr "repo.release.deletion_tag_desc"}}</p> + <p>{{ctx.Locale.Tr "repo.release.deletion_tag_desc"}}</p> </div> {{template "base/modal_actions_confirm" .}} </div> diff --git a/templates/repo/upload.tmpl b/templates/repo/upload.tmpl index 6ab4451bcc..eef51994ab 100644 --- a/templates/repo/upload.tmpl +++ b/templates/repo/upload.tmpl @@ -6,10 +6,10 @@ data-accepts="{{.UploadAccepts}}" data-max-file="{{.UploadMaxFiles}}" data-max-size="{{.UploadMaxSize}}" - data-default-message="{{.locale.Tr "dropzone.default_message"}}" - data-invalid-input-type="{{.locale.Tr "dropzone.invalid_input_type"}}" - data-file-too-big="{{.locale.Tr "dropzone.file_too_big"}}" - data-remove-file="{{.locale.Tr "dropzone.remove_file"}}" + data-default-message="{{ctx.Locale.Tr "dropzone.default_message"}}" + data-invalid-input-type="{{ctx.Locale.Tr "dropzone.invalid_input_type"}}" + data-file-too-big="{{ctx.Locale.Tr "dropzone.file_too_big"}}" + data-remove-file="{{ctx.Locale.Tr "dropzone.remove_file"}}" > <div class="files"></div> </div> diff --git a/templates/repo/user_cards.tmpl b/templates/repo/user_cards.tmpl index 61ed11366c..12fb23f067 100644 --- a/templates/repo/user_cards.tmpl +++ b/templates/repo/user_cards.tmpl @@ -18,7 +18,7 @@ {{else if .Location}} {{svg "octicon-location"}} {{.Location}} {{else}} - {{svg "octicon-calendar"}} {{$.locale.Tr "user.joined_on" (DateTime "short" .CreatedUnix) | Safe}} + {{svg "octicon-calendar"}} {{ctx.Locale.Tr "user.joined_on" (DateTime "short" .CreatedUnix) | Safe}} {{end}} </div> </li> diff --git a/templates/repo/view_file.tmpl b/templates/repo/view_file.tmpl index 0882ff4b27..6c1920188a 100644 --- a/templates/repo/view_file.tmpl +++ b/templates/repo/view_file.tmpl @@ -21,27 +21,27 @@ <div class="file-header-right file-actions gt-df gt-ac gt-fw"> {{if .HasSourceRenderedToggle}} <div class="ui compact icon buttons"> - <a href="{{$.Link}}?display=source" class="ui mini basic button {{if .IsDisplayingSource}}active{{end}}" data-tooltip-content="{{.locale.Tr "repo.file_view_source"}}">{{svg "octicon-code" 15}}</a> - <a href="{{$.Link}}" class="ui mini basic button {{if .IsDisplayingRendered}}active{{end}}" data-tooltip-content="{{.locale.Tr "repo.file_view_rendered"}}">{{svg "octicon-file" 15}}</a> + <a href="{{$.Link}}?display=source" class="ui mini basic button {{if .IsDisplayingSource}}active{{end}}" data-tooltip-content="{{ctx.Locale.Tr "repo.file_view_source"}}">{{svg "octicon-code" 15}}</a> + <a href="{{$.Link}}" class="ui mini basic button {{if .IsDisplayingRendered}}active{{end}}" data-tooltip-content="{{ctx.Locale.Tr "repo.file_view_rendered"}}">{{svg "octicon-file" 15}}</a> </div> {{end}} {{if not .ReadmeInList}} <div class="ui buttons gt-mr-2"> - <a class="ui mini basic button" href="{{$.RawFileLink}}">{{.locale.Tr "repo.file_raw"}}</a> + <a class="ui mini basic button" href="{{$.RawFileLink}}">{{ctx.Locale.Tr "repo.file_raw"}}</a> {{if not .IsViewCommit}} - <a class="ui mini basic button" href="{{.RepoLink}}/src/commit/{{PathEscape .CommitID}}/{{PathEscapeSegments .TreePath}}">{{.locale.Tr "repo.file_permalink"}}</a> + <a class="ui mini basic button" href="{{.RepoLink}}/src/commit/{{PathEscape .CommitID}}/{{PathEscapeSegments .TreePath}}">{{ctx.Locale.Tr "repo.file_permalink"}}</a> {{end}} {{if .IsRepresentableAsText}} - <a class="ui mini basic button" href="{{.RepoLink}}/blame/{{.BranchNameSubURL}}/{{PathEscapeSegments .TreePath}}">{{.locale.Tr "repo.blame"}}</a> + <a class="ui mini basic button" href="{{.RepoLink}}/blame/{{.BranchNameSubURL}}/{{PathEscapeSegments .TreePath}}">{{ctx.Locale.Tr "repo.blame"}}</a> {{end}} - <a class="ui mini basic button" href="{{.RepoLink}}/commits/{{.BranchNameSubURL}}/{{PathEscapeSegments .TreePath}}">{{.locale.Tr "repo.file_history"}}</a> + <a class="ui mini basic button" href="{{.RepoLink}}/commits/{{.BranchNameSubURL}}/{{PathEscapeSegments .TreePath}}">{{ctx.Locale.Tr "repo.file_history"}}</a> {{if .EscapeStatus.Escaped}} - <button class="ui mini basic button unescape-button gt-hidden">{{.locale.Tr "repo.unescape_control_characters"}}</button> - <button class="ui mini basic button escape-button">{{.locale.Tr "repo.escape_control_characters"}}</button> + <button class="ui mini basic button unescape-button gt-hidden">{{ctx.Locale.Tr "repo.unescape_control_characters"}}</button> + <button class="ui mini basic button escape-button">{{ctx.Locale.Tr "repo.escape_control_characters"}}</button> {{end}} </div> - <a download href="{{$.RawFileLink}}"><span class="btn-octicon" data-tooltip-content="{{.locale.Tr "repo.download_file"}}">{{svg "octicon-download"}}</span></a> - <a id="copy-content" class="btn-octicon {{if not .CanCopyContent}} disabled{{end}}"{{if or .IsImageFile (and .HasSourceRenderedToggle (not .IsDisplayingSource))}} data-link="{{$.RawFileLink}}"{{end}} data-tooltip-content="{{if .CanCopyContent}}{{.locale.Tr "copy_content"}}{{else}}{{.locale.Tr "copy_type_unsupported"}}{{end}}">{{svg "octicon-copy" 14}}</a> + <a download href="{{$.RawFileLink}}"><span class="btn-octicon" data-tooltip-content="{{ctx.Locale.Tr "repo.download_file"}}">{{svg "octicon-download"}}</span></a> + <a id="copy-content" class="btn-octicon {{if not .CanCopyContent}} disabled{{end}}"{{if or .IsImageFile (and .HasSourceRenderedToggle (not .IsDisplayingSource))}} data-link="{{$.RawFileLink}}"{{end}} data-tooltip-content="{{if .CanCopyContent}}{{ctx.Locale.Tr "copy_content"}}{{else}}{{.locale.Tr "copy_type_unsupported"}}{{end}}">{{svg "octicon-copy" 14}}</a> {{if .EnableFeed}} <a class="btn-octicon" href="{{$.FeedURL}}/rss/{{$.BranchNameSubURL}}/{{PathEscapeSegments .TreePath}}">{{svg "octicon-rss" 14}}</a> {{end}} @@ -58,8 +58,8 @@ {{end}} {{end}} {{else if .EscapeStatus.Escaped}} - <button class="ui mini basic button unescape-button gt-mr-2 gt-hidden">{{.locale.Tr "repo.unescape_control_characters"}}</button> - <button class="ui mini basic button escape-button gt-mr-2">{{.locale.Tr "repo.escape_control_characters"}}</button> + <button class="ui mini basic button unescape-button gt-mr-2 gt-hidden">{{ctx.Locale.Tr "repo.unescape_control_characters"}}</button> + <button class="ui mini basic button escape-button gt-mr-2">{{ctx.Locale.Tr "repo.escape_control_characters"}}</button> {{end}} </div> </h4> @@ -78,16 +78,16 @@ <img src="{{$.RawFileLink}}"> {{else if .IsVideoFile}} <video controls src="{{$.RawFileLink}}"> - <strong>{{.locale.Tr "repo.video_not_supported_in_browser"}}</strong> + <strong>{{ctx.Locale.Tr "repo.video_not_supported_in_browser"}}</strong> </video> {{else if .IsAudioFile}} <audio controls src="{{$.RawFileLink}}"> - <strong>{{.locale.Tr "repo.audio_not_supported_in_browser"}}</strong> + <strong>{{ctx.Locale.Tr "repo.audio_not_supported_in_browser"}}</strong> </audio> {{else if .IsPDFFile}} - <div class="pdf-content is-loading" data-src="{{$.RawFileLink}}" data-fallback-button-text="{{.locale.Tr "repo.diff.view_file"}}"></div> + <div class="pdf-content is-loading" data-src="{{$.RawFileLink}}" data-fallback-button-text="{{ctx.Locale.Tr "repo.diff.view_file"}}"></div> {{else}} - <a href="{{$.RawFileLink}}" rel="nofollow" class="btn btn-gray btn-radius">{{.locale.Tr "repo.file_view_raw"}}</a> + <a href="{{$.RawFileLink}}" rel="nofollow" class="btn btn-gray btn-radius">{{ctx.Locale.Tr "repo.file_view_raw"}}</a> {{end}} </div> {{else if .FileSize}} @@ -95,7 +95,7 @@ <table> <tbody> <tr> - <td><strong>{{.locale.Tr "repo.file_too_large"}}</strong></td> + <td><strong>{{ctx.Locale.Tr "repo.file_too_large"}}</strong></td> </tr> </tbody> </table> @@ -107,7 +107,7 @@ <tr> <td id="L{{$line}}" class="lines-num"><span id="L{{$line}}" data-line-number="{{$line}}"></span></td> {{if $.EscapeStatus.Escaped}} - <td class="lines-escape">{{if (index $.LineEscapeStatus $idx).Escaped}}<button class="toggle-escape-button btn interact-bg" title="{{if (index $.LineEscapeStatus $idx).HasInvisible}}{{$.locale.Tr "repo.invisible_runes_line"}} {{end}}{{if (index $.LineEscapeStatus $idx).HasAmbiguous}}{{$.locale.Tr "repo.ambiguous_runes_line"}}{{end}}"></button>{{end}}</td> + <td class="lines-escape">{{if (index $.LineEscapeStatus $idx).Escaped}}<button class="toggle-escape-button btn interact-bg" title="{{if (index $.LineEscapeStatus $idx).HasInvisible}}{{ctx.Locale.Tr "repo.invisible_runes_line"}} {{end}}{{if (index $.LineEscapeStatus $idx).HasAmbiguous}}{{ctx.Locale.Tr "repo.ambiguous_runes_line"}}{{end}}"></button>{{end}}</td> {{end}} <td rel="L{{$line}}" class="lines-code chroma"><code class="code-inner">{{$code | Safe}}</code></td> </tr> @@ -116,10 +116,10 @@ </table> <div class="code-line-menu ui vertical pointing menu tippy-target"> {{if $.Permission.CanRead $.UnitTypeIssues}} - <a class="item ref-in-new-issue" 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">{{.locale.Tr "repo.issues.context.reference_issue"}}</a> + <a class="item ref-in-new-issue" data-url-issue-new="{{.RepoLink}}/issues/new" data-url-param-body-link="{{.Repository.Link}}/src/commit/{{PathEscape .CommitID}}/{{PathEscapeSegments .TreePath}}{{if $.HasSourceRenderedToggle}}?display=source{{end}}" rel="nofollow noindex">{{ctx.Locale.Tr "repo.issues.context.reference_issue"}}</a> {{end}} - <a class="item view_git_blame" href="{{.Repository.Link}}/blame/commit/{{PathEscape .CommitID}}/{{PathEscapeSegments .TreePath}}">{{.locale.Tr "repo.view_git_blame"}}</a> - <a class="item copy-line-permalink" data-url="{{.Repository.Link}}/src/commit/{{PathEscape .CommitID}}/{{PathEscapeSegments .TreePath}}{{if $.HasSourceRenderedToggle}}?display=source{{end}}">{{.locale.Tr "repo.file_copy_permalink"}}</a> + <a class="item view_git_blame" href="{{.Repository.Link}}/blame/commit/{{PathEscape .CommitID}}/{{PathEscapeSegments .TreePath}}">{{ctx.Locale.Tr "repo.view_git_blame"}}</a> + <a class="item copy-line-permalink" data-url="{{.Repository.Link}}/src/commit/{{PathEscape .CommitID}}/{{PathEscapeSegments .TreePath}}{{if $.HasSourceRenderedToggle}}?display=source{{end}}">{{ctx.Locale.Tr "repo.file_copy_permalink"}}</a> </div> {{end}} {{end}} diff --git a/templates/repo/wiki/new.tmpl b/templates/repo/wiki/new.tmpl index 291089d5a6..3cd6bb9591 100644 --- a/templates/repo/wiki/new.tmpl +++ b/templates/repo/wiki/new.tmpl @@ -4,40 +4,40 @@ <div class="ui container"> {{template "base/alert" .}} <div class="ui header flex-text-block gt-sb"> - {{.locale.Tr "repo.wiki.new_page"}} + {{ctx.Locale.Tr "repo.wiki.new_page"}} {{if .PageIsWikiEdit}} - <a class="ui tiny primary button" href="{{.RepoLink}}/wiki?action=_new">{{.locale.Tr "repo.wiki.new_page_button"}}</a> + <a class="ui tiny primary button" href="{{.RepoLink}}/wiki?action=_new">{{ctx.Locale.Tr "repo.wiki.new_page_button"}}</a> {{end}} </div> <form class="ui form" action="{{.Link}}?action={{if .PageIsWikiEdit}}_edit{{else}}_new{{end}}" method="post"> {{.CsrfTokenHtml}} <div class="field {{if .Err_Title}}error{{end}}"> - <input name="title" value="{{.title}}" aria-label="{{.locale.Tr "repo.wiki.page_title"}}" placeholder="{{.locale.Tr "repo.wiki.page_title"}}" autofocus required> + <input name="title" value="{{.title}}" aria-label="{{ctx.Locale.Tr "repo.wiki.page_title"}}" placeholder="{{.locale.Tr "repo.wiki.page_title"}}" autofocus required> </div> <div class="help"> - {{.locale.Tr "repo.wiki.page_name_desc"}} + {{ctx.Locale.Tr "repo.wiki.page_name_desc"}} </div> {{$content := .content}} {{if not .PageIsWikiEdit}} - {{$content = .locale.Tr "repo.wiki.welcome"}} + {{$content = ctx.Locale.Tr "repo.wiki.welcome"}} {{end}} {{template "shared/combomarkdowneditor" (dict "MarkdownPreviewUrl" (print .Repository.Link "/markup") "MarkdownPreviewContext" .RepoLink "TextareaName" "content" - "TextareaPlaceholder" (.locale.Tr "repo.wiki.page_content") - "TextareaAriaLabel" (.locale.Tr "repo.wiki.page_content") + "TextareaPlaceholder" (ctx.Locale.Tr "repo.wiki.page_content") + "TextareaAriaLabel" (ctx.Locale.Tr "repo.wiki.page_content") "TextareaContent" $content )}} <div class="field gt-mt-4"> - <input name="message" aria-label="{{.locale.Tr "repo.wiki.default_commit_message"}}" placeholder="{{.locale.Tr "repo.wiki.default_commit_message"}}"> + <input name="message" aria-label="{{ctx.Locale.Tr "repo.wiki.default_commit_message"}}" placeholder="{{.locale.Tr "repo.wiki.default_commit_message"}}"> </div> <div class="divider"></div> <div class="text right"> <button class="ui primary button"> - {{.locale.Tr "repo.wiki.save_page"}} + {{ctx.Locale.Tr "repo.wiki.save_page"}} </button> </div> </form> diff --git a/templates/repo/wiki/pages.tmpl b/templates/repo/wiki/pages.tmpl index c778933e8b..1e1245e191 100644 --- a/templates/repo/wiki/pages.tmpl +++ b/templates/repo/wiki/pages.tmpl @@ -3,10 +3,10 @@ {{template "repo/header" .}} <div class="ui container"> <h2 class="ui header gt-df gt-ac gt-sb"> - <span>{{.locale.Tr "repo.wiki.pages"}}</span> + <span>{{ctx.Locale.Tr "repo.wiki.pages"}}</span> <span> {{if and .CanWriteWiki (not .Repository.IsMirror)}} - <a class="ui small primary button" href="{{.RepoLink}}/wiki?action=_new">{{.locale.Tr "repo.wiki.new_page_button"}}</a> + <a class="ui small primary button" href="{{.RepoLink}}/wiki?action=_new">{{ctx.Locale.Tr "repo.wiki.new_page_button"}}</a> {{end}} </span> </h2> @@ -17,10 +17,10 @@ <td> {{svg "octicon-file"}} <a href="{{$.RepoLink}}/wiki/{{.SubURL}}">{{.Name}}</a> - <a class="wiki-git-entry" href="{{$.RepoLink}}/wiki/{{.GitEntryName | PathEscape}}" data-tooltip-content="{{$.locale.Tr "repo.wiki.original_git_entry_tooltip"}}">{{svg "octicon-chevron-right"}}</a> + <a class="wiki-git-entry" href="{{$.RepoLink}}/wiki/{{.GitEntryName | PathEscape}}" data-tooltip-content="{{ctx.Locale.Tr "repo.wiki.original_git_entry_tooltip"}}">{{svg "octicon-chevron-right"}}</a> </td> {{$timeSince := TimeSinceUnix .UpdatedUnix $.locale}} - <td class="text right">{{$.locale.Tr "repo.wiki.last_updated" $timeSince | Safe}}</td> + <td class="text right">{{ctx.Locale.Tr "repo.wiki.last_updated" $timeSince | Safe}}</td> </tr> {{end}} </tbody> diff --git a/templates/repo/wiki/revision.tmpl b/templates/repo/wiki/revision.tmpl index b2c6ccf900..d6f179c3ab 100644 --- a/templates/repo/wiki/revision.tmpl +++ b/templates/repo/wiki/revision.tmpl @@ -6,11 +6,11 @@ <div class="ui stackable grid"> <div class="ui eight wide column"> <div class="ui header"> - <a class="file-revisions-btn ui basic button" title="{{.locale.Tr "repo.wiki.back_to_wiki"}}" href="{{.RepoLink}}/wiki/{{.PageURL}}"><span>{{.revision}}</span> {{svg "octicon-home"}}</a> + <a class="file-revisions-btn ui basic button" title="{{ctx.Locale.Tr "repo.wiki.back_to_wiki"}}" href="{{.RepoLink}}/wiki/{{.PageURL}}"><span>{{.revision}}</span> {{svg "octicon-home"}}</a> {{$title}} <div class="ui sub header gt-word-break"> {{$timeSince := TimeSince .Author.When $.locale}} - {{.locale.Tr "repo.wiki.last_commit_info" .Author.Name $timeSince | Safe}} + {{ctx.Locale.Tr "repo.wiki.last_commit_info" .Author.Name $timeSince | Safe}} </div> </div> </div> @@ -21,12 +21,12 @@ </div> </div> </div> - <h2 class="ui top header">{{.locale.Tr "repo.wiki.wiki_page_revisions"}}</h2> + <h2 class="ui top header">{{ctx.Locale.Tr "repo.wiki.wiki_page_revisions"}}</h2> <div class="gt-mt-4"> <h4 class="ui top attached header"> <div class="ui stackable grid"> <div class="sixteen wide column"> - {{.CommitCount}} {{.locale.Tr "repo.commits.commits"}} + {{.CommitCount}} {{ctx.Locale.Tr "repo.commits.commits"}} </div> </div> </h4> diff --git a/templates/repo/wiki/start.tmpl b/templates/repo/wiki/start.tmpl index dbe625c568..dca7a074aa 100644 --- a/templates/repo/wiki/start.tmpl +++ b/templates/repo/wiki/start.tmpl @@ -4,10 +4,10 @@ <div class="ui container"> <div class="ui center segment gt-py-5"> {{svg "octicon-book" 48}} - <h2>{{.locale.Tr "repo.wiki.welcome"}}</h2> - <p>{{.locale.Tr "repo.wiki.welcome_desc"}}</p> + <h2>{{ctx.Locale.Tr "repo.wiki.welcome"}}</h2> + <p>{{ctx.Locale.Tr "repo.wiki.welcome_desc"}}</p> {{if and .CanWriteWiki (not .Repository.IsMirror)}} - <a class="ui primary button" href="{{.RepoLink}}/wiki?action=_new">{{.locale.Tr "repo.wiki.create_first_page"}}</a> + <a class="ui primary button" href="{{.RepoLink}}/wiki?action=_new">{{ctx.Locale.Tr "repo.wiki.create_first_page"}}</a> {{end}} </div> </div> diff --git a/templates/repo/wiki/view.tmpl b/templates/repo/wiki/view.tmpl index 4427a986df..2e3274919c 100644 --- a/templates/repo/wiki/view.tmpl +++ b/templates/repo/wiki/view.tmpl @@ -5,10 +5,10 @@ <div class="ui container"> <div class="repo-button-row"> <div class="gt-df gt-ac"> - <div class="ui floating filter dropdown" data-no-results="{{.locale.Tr "repo.pulls.no_results"}}"> + <div class="ui floating filter dropdown" data-no-results="{{ctx.Locale.Tr "repo.pulls.no_results"}}"> <div class="ui basic small button"> <span class="text"> - {{.locale.Tr "repo.wiki.page"}}: + {{ctx.Locale.Tr "repo.wiki.page"}}: <strong>{{$title}}</strong> </span> {{svg "octicon-triangle-down" 14 "dropdown icon"}} @@ -16,10 +16,10 @@ <div class="menu"> <div class="ui icon search input"> <i class="icon">{{svg "octicon-filter" 16}}</i> - <input name="search" placeholder="{{.locale.Tr "repo.wiki.filter_page"}}..."> + <input name="search" placeholder="{{ctx.Locale.Tr "repo.wiki.filter_page"}}..."> </div> <div class="scrolling menu"> - <a class="item muted" href="{{.RepoLink}}/wiki/?action=_pages">{{.locale.Tr "repo.wiki.pages"}}</a> + <a class="item muted" href="{{.RepoLink}}/wiki/?action=_pages">{{ctx.Locale.Tr "repo.wiki.pages"}}</a> <div class="divider"></div> {{range .Pages}} <a class="item {{if eq $.Title .Name}}selected{{end}}" href="{{$.RepoLink}}/wiki/{{.SubURL}}">{{.Name}}</a> @@ -36,23 +36,23 @@ <div class="ui dividing header"> <div class="ui stackable grid"> <div class="eight wide column"> - <a class="file-revisions-btn ui basic button" title="{{.locale.Tr "repo.wiki.file_revision"}}" href="{{.RepoLink}}/wiki/{{.PageURL}}?action=_revision" ><span>{{.CommitCount}}</span> {{svg "octicon-history"}}</a> + <a class="file-revisions-btn ui basic button" title="{{ctx.Locale.Tr "repo.wiki.file_revision"}}" href="{{.RepoLink}}/wiki/{{.PageURL}}?action=_revision" ><span>{{.CommitCount}}</span> {{svg "octicon-history"}}</a> {{$title}} <div class="ui sub header"> {{$timeSince := TimeSince .Author.When $.locale}} - {{.locale.Tr "repo.wiki.last_commit_info" .Author.Name $timeSince | Safe}} + {{ctx.Locale.Tr "repo.wiki.last_commit_info" .Author.Name $timeSince | Safe}} </div> </div> <div class="eight wide right aligned column"> {{if .EscapeStatus.Escaped}} - <a class="ui small button unescape-button gt-hidden">{{.locale.Tr "repo.unescape_control_characters"}}</a> - <a class="ui small button escape-button">{{.locale.Tr "repo.escape_control_characters"}}</a> + <a class="ui small button unescape-button gt-hidden">{{ctx.Locale.Tr "repo.unescape_control_characters"}}</a> + <a class="ui small button escape-button">{{ctx.Locale.Tr "repo.escape_control_characters"}}</a> {{end}} {{if and .CanWriteWiki (not .Repository.IsMirror)}} <div class="ui right"> - <a class="ui small button" href="{{.RepoLink}}/wiki/{{.PageURL}}?action=_edit">{{.locale.Tr "repo.wiki.edit_page_button"}}</a> - <a class="ui small primary button" href="{{.RepoLink}}/wiki?action=_new">{{.locale.Tr "repo.wiki.new_page_button"}}</a> - <a class="ui small red button delete-button" href="" data-url="{{.RepoLink}}/wiki/{{.PageURL}}?action=_delete" data-id="{{.PageURL}}">{{.locale.Tr "repo.wiki.delete_page_button"}}</a> + <a class="ui small button" href="{{.RepoLink}}/wiki/{{.PageURL}}?action=_edit">{{ctx.Locale.Tr "repo.wiki.edit_page_button"}}</a> + <a class="ui small primary button" href="{{.RepoLink}}/wiki?action=_new">{{ctx.Locale.Tr "repo.wiki.new_page_button"}}</a> + <a class="ui small red button delete-button" href="" data-url="{{.RepoLink}}/wiki/{{.PageURL}}?action=_delete" data-id="{{.PageURL}}">{{ctx.Locale.Tr "repo.wiki.delete_page_button"}}</a> </div> {{end}} </div> @@ -79,7 +79,7 @@ {{if .sidebarPresent}} <div class="markup wiki-content-sidebar"> {{if and .CanWriteWiki (not .Repository.IsMirror)}} - <a class="gt-float-right muted" href="{{.RepoLink}}/wiki/_Sidebar?action=_edit" aria-label="{{.locale.Tr "repo.wiki.edit_page_button"}}">{{svg "octicon-pencil"}}</a> + <a class="gt-float-right muted" href="{{.RepoLink}}/wiki/_Sidebar?action=_edit" aria-label="{{ctx.Locale.Tr "repo.wiki.edit_page_button"}}">{{svg "octicon-pencil"}}</a> {{end}} {{template "repo/unicode_escape_prompt" dict "EscapeStatus" .sidebarEscapeStatus "root" $}} {{.sidebarContent | Safe}} @@ -91,7 +91,7 @@ {{if .footerPresent}} <div class="markup wiki-content-footer"> {{if and .CanWriteWiki (not .Repository.IsMirror)}} - <a class="gt-float-right muted" href="{{.RepoLink}}/wiki/_Footer?action=_edit" aria-label="{{.locale.Tr "repo.wiki.edit_page_button"}}">{{svg "octicon-pencil"}}</a> + <a class="gt-float-right muted" href="{{.RepoLink}}/wiki/_Footer?action=_edit" aria-label="{{ctx.Locale.Tr "repo.wiki.edit_page_button"}}">{{svg "octicon-pencil"}}</a> {{end}} {{template "repo/unicode_escape_prompt" dict "footerEscapeStatus" .sidebarEscapeStatus "root" $}} {{.footerContent | Safe}} @@ -104,10 +104,10 @@ <div class="ui g-modal-confirm delete modal"> <div class="header"> {{svg "octicon-trash"}} - {{.locale.Tr "repo.wiki.delete_page_button"}} + {{ctx.Locale.Tr "repo.wiki.delete_page_button"}} </div> <div class="content"> - <p>{{.locale.Tr "repo.wiki.delete_page_notice_1" ($title|Escape) | Safe}}</p> + <p>{{ctx.Locale.Tr "repo.wiki.delete_page_notice_1" ($title|Escape) | Safe}}</p> </div> {{template "base/modal_actions_confirm" .}} </div> |