From dd136858f1ea40ad3c94191d647487fa4f31926c Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 18 Oct 2024 20:33:49 +0200 Subject: Adding upstream version 9.0.0. Signed-off-by: Daniel Baumann --- templates/repo/actions/dispatch.tmpl | 99 +++ templates/repo/actions/list.tmpl | 92 +++ templates/repo/actions/no_workflows.tmpl | 8 + templates/repo/actions/runs_list.tmpl | 43 ++ templates/repo/actions/status.tmpl | 29 + templates/repo/actions/view.tmpl | 33 + templates/repo/activity.tmpl | 19 + templates/repo/admin_flags.tmpl | 8 + templates/repo/blame.tmpl | 96 +++ templates/repo/branch/list.tmpl | 262 +++++++ templates/repo/branch_dropdown.tmpl | 89 +++ templates/repo/cite/cite_buttons.tmpl | 8 + templates/repo/cite/cite_modal.tmpl | 20 + templates/repo/clone_buttons.tmpl | 15 + templates/repo/clone_script.tmpl | 50 ++ .../repo/code/recently_pushed_new_branches.tmpl | 17 + templates/repo/code_frequency.tmpl | 9 + templates/repo/commit_load_branches_and_tags.tmpl | 20 + templates/repo/commit_page.tmpl | 285 ++++++++ templates/repo/commit_status.tmpl | 16 + templates/repo/commit_statuses.tmpl | 14 + templates/repo/commits.tmpl | 23 + templates/repo/commits_list.tmpl | 96 +++ templates/repo/commits_list_small.tmpl | 55 ++ templates/repo/commits_search_dropdown.tmpl | 8 + templates/repo/commits_table.tmpl | 36 + templates/repo/contributors.tmpl | 14 + templates/repo/create.tmpl | 224 ++++++ templates/repo/create_helper.tmpl | 3 + templates/repo/diff/blob_excerpt.tmpl | 80 +++ templates/repo/diff/box.tmpl | 260 +++++++ templates/repo/diff/comment_form.tmpl | 49 ++ templates/repo/diff/comment_form_datahandler.tmpl | 7 + templates/repo/diff/comments.tmpl | 75 ++ templates/repo/diff/compare.tmpl | 238 ++++++ templates/repo/diff/conversation.tmpl | 66 ++ templates/repo/diff/conversations.tmpl | 3 + templates/repo/diff/csv_diff.tmpl | 58 ++ templates/repo/diff/escape_title.tmpl | 2 + templates/repo/diff/image_diff.tmpl | 83 +++ templates/repo/diff/new_comment.tmpl | 5 + templates/repo/diff/new_review.tmpl | 52 ++ templates/repo/diff/options_dropdown.tmpl | 33 + templates/repo/diff/section_code.tmpl | 1 + templates/repo/diff/section_split.tmpl | 156 ++++ templates/repo/diff/section_unified.tmpl | 72 ++ templates/repo/diff/stats.tmpl | 5 + templates/repo/diff/whitespace_dropdown.tmpl | 30 + templates/repo/editor/cherry_pick.tmpl | 30 + templates/repo/editor/commit_form.tmpl | 82 +++ templates/repo/editor/delete.tmpl | 13 + templates/repo/editor/diff_preview.tmpl | 11 + templates/repo/editor/edit.tmpl | 74 ++ templates/repo/editor/patch.tmpl | 57 ++ templates/repo/editor/upload.tmpl | 33 + templates/repo/empty.tmpl | 82 +++ templates/repo/file_info.tmpl | 53 ++ templates/repo/find/files.tmpl | 21 + templates/repo/flags.tmpl | 33 + templates/repo/forks.tmpl | 18 + templates/repo/graph.tmpl | 65 ++ templates/repo/graph/commits.tmpl | 79 ++ templates/repo/graph/div.tmpl | 7 + templates/repo/graph/svgcontainer.tmpl | 24 + templates/repo/header.tmpl | 201 ++++++ templates/repo/header_fork.tmpl | 52 ++ templates/repo/home.tmpl | 164 +++++ templates/repo/icon.tmpl | 10 + templates/repo/issue/card.tmpl | 78 ++ templates/repo/issue/choose.tmpl | 59 ++ templates/repo/issue/comment_tab.tmpl | 21 + templates/repo/issue/fields/checkboxes.tmpl | 14 + templates/repo/issue/fields/dropdown.tmpl | 17 + templates/repo/issue/fields/header.tmpl | 6 + templates/repo/issue/fields/input.tmpl | 4 + templates/repo/issue/fields/markdown.tmpl | 3 + templates/repo/issue/fields/textarea.tmpl | 24 + templates/repo/issue/filter_actions.tmpl | 128 ++++ templates/repo/issue/filter_list.tmpl | 158 ++++ templates/repo/issue/filters.tmpl | 26 + templates/repo/issue/label_precolors.tmpl | 22 + templates/repo/issue/labels.tmpl | 22 + templates/repo/issue/labels/edit_delete_label.tmpl | 72 ++ templates/repo/issue/labels/label.tmpl | 8 + templates/repo/issue/labels/label_archived.tmpl | 5 + templates/repo/issue/labels/label_list.tmpl | 88 +++ .../repo/issue/labels/label_load_template.tmpl | 24 + templates/repo/issue/labels/label_new.tmpl | 48 ++ .../repo/issue/labels/labels_selector_field.tmpl | 46 ++ templates/repo/issue/labels/labels_sidebar.tmpl | 11 + templates/repo/issue/list.tmpl | 55 ++ templates/repo/issue/milestone/filter_list.tmpl | 16 + templates/repo/issue/milestone/select_menu.tmpl | 39 + templates/repo/issue/milestone_issues.tmpl | 65 ++ templates/repo/issue/milestone_new.tmpl | 59 ++ templates/repo/issue/milestones.tmpl | 110 +++ templates/repo/issue/navbar.tmpl | 4 + templates/repo/issue/new.tmpl | 8 + templates/repo/issue/new_form.tmpl | 155 ++++ templates/repo/issue/openclose.tmpl | 16 + templates/repo/issue/search.tmpl | 20 + templates/repo/issue/view.tmpl | 12 + templates/repo/issue/view_content.tmpl | 188 +++++ .../repo/issue/view_content/add_reaction.tmpl | 12 + templates/repo/issue/view_content/attachments.tmpl | 42 ++ templates/repo/issue/view_content/comments.tmpl | 691 ++++++++++++++++++ .../issue/view_content/comments_authorlink.tmpl | 11 + .../issue/view_content/comments_delete_time.tmpl | 18 + .../repo/issue/view_content/context_menu.tmpl | 27 + .../repo/issue/view_content/conversation.tmpl | 137 ++++ templates/repo/issue/view_content/pull.tmpl | 396 ++++++++++ .../issue/view_content/pull_merge_instruction.tmpl | 57 ++ templates/repo/issue/view_content/reactions.tmpl | 17 + .../issue/view_content/reference_issue_dialog.tmpl | 28 + templates/repo/issue/view_content/show_role.tmpl | 15 + templates/repo/issue/view_content/sidebar.tmpl | 66 ++ .../repo/issue/view_content/sidebar/actions.tmpl | 114 +++ .../repo/issue/view_content/sidebar/assignees.tmpl | 62 ++ .../sidebar/branch_selector_field.tmpl | 59 ++ .../issue/view_content/sidebar/dependencies.tmpl | 146 ++++ .../issue/view_content/sidebar/due_deadline.tmpl | 41 ++ .../issue/view_content/sidebar/milestones.tmpl | 24 + .../issue/view_content/sidebar/participants.tmpl | 8 + .../repo/issue/view_content/sidebar/projects.tmpl | 54 ++ .../sidebar/pull_maintainer_edits.tmpl | 10 + .../issue/view_content/sidebar/pull_review.tmpl | 45 ++ .../issue/view_content/sidebar/pull_reviewers.tmpl | 67 ++ .../repo/issue/view_content/sidebar/pull_wip.tmpl | 11 + .../repo/issue/view_content/sidebar/reference.tmpl | 7 + .../issue/view_content/sidebar/timetracking.tmpl | 73 ++ .../repo/issue/view_content/sidebar/watch.tmpl | 6 + .../repo/issue/view_content/sidebar/watching.tmpl | 19 + .../issue/view_content/update_branch_by_merge.tmpl | 37 + templates/repo/issue/view_title.tmpl | 144 ++++ templates/repo/latest_commit.tmpl | 31 + templates/repo/migrate/codebase.tmpl | 126 ++++ templates/repo/migrate/forgejo.tmpl | 1 + templates/repo/migrate/git.tmpl | 94 +++ templates/repo/migrate/gitbucket.tmpl | 142 ++++ templates/repo/migrate/gitea.tmpl | 138 ++++ templates/repo/migrate/github.tmpl | 140 ++++ templates/repo/migrate/gitlab.tmpl | 137 ++++ templates/repo/migrate/gogs.tmpl | 137 ++++ templates/repo/migrate/helper.tmpl | 0 templates/repo/migrate/migrate.tmpl | 32 + templates/repo/migrate/migrating.tmpl | 101 +++ templates/repo/migrate/onedev.tmpl | 126 ++++ templates/repo/migrate/options.tmpl | 26 + templates/repo/navbar.tmpl | 14 + templates/repo/packages.tmpl | 8 + templates/repo/projects/list.tmpl | 8 + templates/repo/projects/new.tmpl | 8 + templates/repo/projects/view.tmpl | 15 + templates/repo/pulls/commits.tmpl | 10 + templates/repo/pulls/files.tmpl | 14 + templates/repo/pulls/fork.tmpl | 90 +++ templates/repo/pulls/status.tmpl | 59 ++ templates/repo/pulls/tab_menu.tmpl | 28 + templates/repo/pulse.tmpl | 239 +++++++ templates/repo/recent_commits.tmpl | 9 + templates/repo/release/list.tmpl | 142 ++++ templates/repo/release/new.tmpl | 183 +++++ templates/repo/release_tag_header.tmpl | 31 + templates/repo/search.tmpl | 14 + templates/repo/search_name.tmpl | 1 + templates/repo/settings/actions.tmpl | 11 + templates/repo/settings/branches.tmpl | 78 ++ templates/repo/settings/collaboration.tmpl | 117 +++ templates/repo/settings/deploy_keys.tmpl | 86 +++ templates/repo/settings/githook_edit.tmpl | 27 + templates/repo/settings/githooks.tmpl | 23 + templates/repo/settings/layout_footer.tmpl | 11 + templates/repo/settings/layout_head.tmpl | 14 + templates/repo/settings/lfs.tmpl | 53 ++ templates/repo/settings/lfs_file.tmpl | 57 ++ templates/repo/settings/lfs_file_find.tmpl | 46 ++ templates/repo/settings/lfs_locks.tmpl | 56 ++ templates/repo/settings/lfs_pointers.tmpl | 56 ++ templates/repo/settings/navbar.tmpl | 72 ++ templates/repo/settings/options.tmpl | 794 +++++++++++++++++++++ templates/repo/settings/protected_branch.tmpl | 262 +++++++ .../repo/settings/push_mirror_sync_modal.tmpl | 32 + templates/repo/settings/runner_edit.tmpl | 5 + templates/repo/settings/secrets.tmpl | 5 + templates/repo/settings/tags.tmpl | 126 ++++ templates/repo/settings/units.tmpl | 13 + templates/repo/settings/units/issues.tmpl | 102 +++ templates/repo/settings/units/overview.tmpl | 62 ++ templates/repo/settings/units/pulls.tmpl | 132 ++++ templates/repo/settings/units/wiki.tmpl | 51 ++ templates/repo/settings/webhook/base.tmpl | 5 + templates/repo/settings/webhook/base_list.tmpl | 26 + templates/repo/settings/webhook/delete_modal.tmpl | 10 + templates/repo/settings/webhook/history.tmpl | 90 +++ templates/repo/settings/webhook/link_menu.tmpl | 12 + templates/repo/settings/webhook/list.tmpl | 4 + templates/repo/settings/webhook/new.tmpl | 7 + templates/repo/shabox_badge.tmpl | 15 + templates/repo/star_unstar.tmpl | 14 + templates/repo/sub_menu.tmpl | 45 ++ templates/repo/tag/list.tmpl | 79 ++ templates/repo/tag/verification_box.tmpl | 27 + templates/repo/tag/verification_line.tmpl | 80 +++ templates/repo/unicode_escape_prompt.tmpl | 22 + templates/repo/upload.tmpl | 15 + templates/repo/user_cards.tmpl | 32 + templates/repo/view_file.tmpl | 158 ++++ templates/repo/view_list.tmpl | 72 ++ templates/repo/watch_unwatch.tmpl | 14 + templates/repo/watchers.tmpl | 8 + templates/repo/wiki/new.tmpl | 48 ++ templates/repo/wiki/pages.tmpl | 30 + templates/repo/wiki/revision.tmpl | 40 ++ templates/repo/wiki/search.tmpl | 12 + templates/repo/wiki/start.tmpl | 15 + templates/repo/wiki/view.tmpl | 124 ++++ 216 files changed, 13549 insertions(+) create mode 100644 templates/repo/actions/dispatch.tmpl create mode 100644 templates/repo/actions/list.tmpl create mode 100644 templates/repo/actions/no_workflows.tmpl create mode 100644 templates/repo/actions/runs_list.tmpl create mode 100644 templates/repo/actions/status.tmpl create mode 100644 templates/repo/actions/view.tmpl create mode 100644 templates/repo/activity.tmpl create mode 100644 templates/repo/admin_flags.tmpl create mode 100644 templates/repo/blame.tmpl create mode 100644 templates/repo/branch/list.tmpl create mode 100644 templates/repo/branch_dropdown.tmpl create mode 100644 templates/repo/cite/cite_buttons.tmpl create mode 100644 templates/repo/cite/cite_modal.tmpl create mode 100644 templates/repo/clone_buttons.tmpl create mode 100644 templates/repo/clone_script.tmpl create mode 100644 templates/repo/code/recently_pushed_new_branches.tmpl create mode 100644 templates/repo/code_frequency.tmpl create mode 100644 templates/repo/commit_load_branches_and_tags.tmpl create mode 100644 templates/repo/commit_page.tmpl create mode 100644 templates/repo/commit_status.tmpl create mode 100644 templates/repo/commit_statuses.tmpl create mode 100644 templates/repo/commits.tmpl create mode 100644 templates/repo/commits_list.tmpl create mode 100644 templates/repo/commits_list_small.tmpl create mode 100644 templates/repo/commits_search_dropdown.tmpl create mode 100644 templates/repo/commits_table.tmpl create mode 100644 templates/repo/contributors.tmpl create mode 100644 templates/repo/create.tmpl create mode 100644 templates/repo/create_helper.tmpl create mode 100644 templates/repo/diff/blob_excerpt.tmpl create mode 100644 templates/repo/diff/box.tmpl create mode 100644 templates/repo/diff/comment_form.tmpl create mode 100644 templates/repo/diff/comment_form_datahandler.tmpl create mode 100644 templates/repo/diff/comments.tmpl create mode 100644 templates/repo/diff/compare.tmpl create mode 100644 templates/repo/diff/conversation.tmpl create mode 100644 templates/repo/diff/conversations.tmpl create mode 100644 templates/repo/diff/csv_diff.tmpl create mode 100644 templates/repo/diff/escape_title.tmpl create mode 100644 templates/repo/diff/image_diff.tmpl create mode 100644 templates/repo/diff/new_comment.tmpl create mode 100644 templates/repo/diff/new_review.tmpl create mode 100644 templates/repo/diff/options_dropdown.tmpl create mode 100644 templates/repo/diff/section_code.tmpl create mode 100644 templates/repo/diff/section_split.tmpl create mode 100644 templates/repo/diff/section_unified.tmpl create mode 100644 templates/repo/diff/stats.tmpl create mode 100644 templates/repo/diff/whitespace_dropdown.tmpl create mode 100644 templates/repo/editor/cherry_pick.tmpl create mode 100644 templates/repo/editor/commit_form.tmpl create mode 100644 templates/repo/editor/delete.tmpl create mode 100644 templates/repo/editor/diff_preview.tmpl create mode 100644 templates/repo/editor/edit.tmpl create mode 100644 templates/repo/editor/patch.tmpl create mode 100644 templates/repo/editor/upload.tmpl create mode 100644 templates/repo/empty.tmpl create mode 100644 templates/repo/file_info.tmpl create mode 100644 templates/repo/find/files.tmpl create mode 100644 templates/repo/flags.tmpl create mode 100644 templates/repo/forks.tmpl create mode 100644 templates/repo/graph.tmpl create mode 100644 templates/repo/graph/commits.tmpl create mode 100644 templates/repo/graph/div.tmpl create mode 100644 templates/repo/graph/svgcontainer.tmpl create mode 100644 templates/repo/header.tmpl create mode 100644 templates/repo/header_fork.tmpl create mode 100644 templates/repo/home.tmpl create mode 100644 templates/repo/icon.tmpl create mode 100644 templates/repo/issue/card.tmpl create mode 100644 templates/repo/issue/choose.tmpl create mode 100644 templates/repo/issue/comment_tab.tmpl create mode 100644 templates/repo/issue/fields/checkboxes.tmpl create mode 100644 templates/repo/issue/fields/dropdown.tmpl create mode 100644 templates/repo/issue/fields/header.tmpl create mode 100644 templates/repo/issue/fields/input.tmpl create mode 100644 templates/repo/issue/fields/markdown.tmpl create mode 100644 templates/repo/issue/fields/textarea.tmpl create mode 100644 templates/repo/issue/filter_actions.tmpl create mode 100644 templates/repo/issue/filter_list.tmpl create mode 100644 templates/repo/issue/filters.tmpl create mode 100644 templates/repo/issue/label_precolors.tmpl create mode 100644 templates/repo/issue/labels.tmpl create mode 100644 templates/repo/issue/labels/edit_delete_label.tmpl create mode 100644 templates/repo/issue/labels/label.tmpl create mode 100644 templates/repo/issue/labels/label_archived.tmpl create mode 100644 templates/repo/issue/labels/label_list.tmpl create mode 100644 templates/repo/issue/labels/label_load_template.tmpl create mode 100644 templates/repo/issue/labels/label_new.tmpl create mode 100644 templates/repo/issue/labels/labels_selector_field.tmpl create mode 100644 templates/repo/issue/labels/labels_sidebar.tmpl create mode 100644 templates/repo/issue/list.tmpl create mode 100644 templates/repo/issue/milestone/filter_list.tmpl create mode 100644 templates/repo/issue/milestone/select_menu.tmpl create mode 100644 templates/repo/issue/milestone_issues.tmpl create mode 100644 templates/repo/issue/milestone_new.tmpl create mode 100644 templates/repo/issue/milestones.tmpl create mode 100644 templates/repo/issue/navbar.tmpl create mode 100644 templates/repo/issue/new.tmpl create mode 100644 templates/repo/issue/new_form.tmpl create mode 100644 templates/repo/issue/openclose.tmpl create mode 100644 templates/repo/issue/search.tmpl create mode 100644 templates/repo/issue/view.tmpl create mode 100644 templates/repo/issue/view_content.tmpl create mode 100644 templates/repo/issue/view_content/add_reaction.tmpl create mode 100644 templates/repo/issue/view_content/attachments.tmpl create mode 100644 templates/repo/issue/view_content/comments.tmpl create mode 100644 templates/repo/issue/view_content/comments_authorlink.tmpl create mode 100644 templates/repo/issue/view_content/comments_delete_time.tmpl create mode 100644 templates/repo/issue/view_content/context_menu.tmpl create mode 100644 templates/repo/issue/view_content/conversation.tmpl create mode 100644 templates/repo/issue/view_content/pull.tmpl create mode 100644 templates/repo/issue/view_content/pull_merge_instruction.tmpl create mode 100644 templates/repo/issue/view_content/reactions.tmpl create mode 100644 templates/repo/issue/view_content/reference_issue_dialog.tmpl create mode 100644 templates/repo/issue/view_content/show_role.tmpl create mode 100644 templates/repo/issue/view_content/sidebar.tmpl create mode 100644 templates/repo/issue/view_content/sidebar/actions.tmpl create mode 100644 templates/repo/issue/view_content/sidebar/assignees.tmpl create mode 100644 templates/repo/issue/view_content/sidebar/branch_selector_field.tmpl create mode 100644 templates/repo/issue/view_content/sidebar/dependencies.tmpl create mode 100644 templates/repo/issue/view_content/sidebar/due_deadline.tmpl create mode 100644 templates/repo/issue/view_content/sidebar/milestones.tmpl create mode 100644 templates/repo/issue/view_content/sidebar/participants.tmpl create mode 100644 templates/repo/issue/view_content/sidebar/projects.tmpl create mode 100644 templates/repo/issue/view_content/sidebar/pull_maintainer_edits.tmpl create mode 100644 templates/repo/issue/view_content/sidebar/pull_review.tmpl create mode 100644 templates/repo/issue/view_content/sidebar/pull_reviewers.tmpl create mode 100644 templates/repo/issue/view_content/sidebar/pull_wip.tmpl create mode 100644 templates/repo/issue/view_content/sidebar/reference.tmpl create mode 100644 templates/repo/issue/view_content/sidebar/timetracking.tmpl create mode 100644 templates/repo/issue/view_content/sidebar/watch.tmpl create mode 100644 templates/repo/issue/view_content/sidebar/watching.tmpl create mode 100644 templates/repo/issue/view_content/update_branch_by_merge.tmpl create mode 100644 templates/repo/issue/view_title.tmpl create mode 100644 templates/repo/latest_commit.tmpl create mode 100644 templates/repo/migrate/codebase.tmpl create mode 100644 templates/repo/migrate/forgejo.tmpl create mode 100644 templates/repo/migrate/git.tmpl create mode 100644 templates/repo/migrate/gitbucket.tmpl create mode 100644 templates/repo/migrate/gitea.tmpl create mode 100644 templates/repo/migrate/github.tmpl create mode 100644 templates/repo/migrate/gitlab.tmpl create mode 100644 templates/repo/migrate/gogs.tmpl create mode 100644 templates/repo/migrate/helper.tmpl create mode 100644 templates/repo/migrate/migrate.tmpl create mode 100644 templates/repo/migrate/migrating.tmpl create mode 100644 templates/repo/migrate/onedev.tmpl create mode 100644 templates/repo/migrate/options.tmpl create mode 100644 templates/repo/navbar.tmpl create mode 100644 templates/repo/packages.tmpl create mode 100644 templates/repo/projects/list.tmpl create mode 100644 templates/repo/projects/new.tmpl create mode 100644 templates/repo/projects/view.tmpl create mode 100644 templates/repo/pulls/commits.tmpl create mode 100644 templates/repo/pulls/files.tmpl create mode 100644 templates/repo/pulls/fork.tmpl create mode 100644 templates/repo/pulls/status.tmpl create mode 100644 templates/repo/pulls/tab_menu.tmpl create mode 100644 templates/repo/pulse.tmpl create mode 100644 templates/repo/recent_commits.tmpl create mode 100644 templates/repo/release/list.tmpl create mode 100644 templates/repo/release/new.tmpl create mode 100644 templates/repo/release_tag_header.tmpl create mode 100644 templates/repo/search.tmpl create mode 100644 templates/repo/search_name.tmpl create mode 100644 templates/repo/settings/actions.tmpl create mode 100644 templates/repo/settings/branches.tmpl create mode 100644 templates/repo/settings/collaboration.tmpl create mode 100644 templates/repo/settings/deploy_keys.tmpl create mode 100644 templates/repo/settings/githook_edit.tmpl create mode 100644 templates/repo/settings/githooks.tmpl create mode 100644 templates/repo/settings/layout_footer.tmpl create mode 100644 templates/repo/settings/layout_head.tmpl create mode 100644 templates/repo/settings/lfs.tmpl create mode 100644 templates/repo/settings/lfs_file.tmpl create mode 100644 templates/repo/settings/lfs_file_find.tmpl create mode 100644 templates/repo/settings/lfs_locks.tmpl create mode 100644 templates/repo/settings/lfs_pointers.tmpl create mode 100644 templates/repo/settings/navbar.tmpl create mode 100644 templates/repo/settings/options.tmpl create mode 100644 templates/repo/settings/protected_branch.tmpl create mode 100644 templates/repo/settings/push_mirror_sync_modal.tmpl create mode 100644 templates/repo/settings/runner_edit.tmpl create mode 100644 templates/repo/settings/secrets.tmpl create mode 100644 templates/repo/settings/tags.tmpl create mode 100644 templates/repo/settings/units.tmpl create mode 100644 templates/repo/settings/units/issues.tmpl create mode 100644 templates/repo/settings/units/overview.tmpl create mode 100644 templates/repo/settings/units/pulls.tmpl create mode 100644 templates/repo/settings/units/wiki.tmpl create mode 100644 templates/repo/settings/webhook/base.tmpl create mode 100644 templates/repo/settings/webhook/base_list.tmpl create mode 100644 templates/repo/settings/webhook/delete_modal.tmpl create mode 100644 templates/repo/settings/webhook/history.tmpl create mode 100644 templates/repo/settings/webhook/link_menu.tmpl create mode 100644 templates/repo/settings/webhook/list.tmpl create mode 100644 templates/repo/settings/webhook/new.tmpl create mode 100644 templates/repo/shabox_badge.tmpl create mode 100644 templates/repo/star_unstar.tmpl create mode 100644 templates/repo/sub_menu.tmpl create mode 100644 templates/repo/tag/list.tmpl create mode 100644 templates/repo/tag/verification_box.tmpl create mode 100644 templates/repo/tag/verification_line.tmpl create mode 100644 templates/repo/unicode_escape_prompt.tmpl create mode 100644 templates/repo/upload.tmpl create mode 100644 templates/repo/user_cards.tmpl create mode 100644 templates/repo/view_file.tmpl create mode 100644 templates/repo/view_list.tmpl create mode 100644 templates/repo/watch_unwatch.tmpl create mode 100644 templates/repo/watchers.tmpl create mode 100644 templates/repo/wiki/new.tmpl create mode 100644 templates/repo/wiki/pages.tmpl create mode 100644 templates/repo/wiki/revision.tmpl create mode 100644 templates/repo/wiki/search.tmpl create mode 100644 templates/repo/wiki/start.tmpl create mode 100644 templates/repo/wiki/view.tmpl (limited to 'templates/repo') diff --git a/templates/repo/actions/dispatch.tmpl b/templates/repo/actions/dispatch.tmpl new file mode 100644 index 0000000..2372e61 --- /dev/null +++ b/templates/repo/actions/dispatch.tmpl @@ -0,0 +1,99 @@ +
+ + {{ctx.Locale.Tr "actions.workflow.dispatch.trigger_found"}} + + + +
diff --git a/templates/repo/actions/list.tmpl b/templates/repo/actions/list.tmpl new file mode 100644 index 0000000..263530f --- /dev/null +++ b/templates/repo/actions/list.tmpl @@ -0,0 +1,92 @@ +{{template "base/head" .}} +
+ {{template "repo/header" .}} +
+ {{template "base/alert" .}} + + {{if .HasWorkflowsOrRuns}} +
+ +
+ + + {{if $.CurWorkflowDispatch}} + {{template "repo/actions/dispatch" .}} + {{end}} + + {{template "repo/actions/runs_list" .}} +
+
+ {{else}} + {{template "repo/actions/no_workflows" .}} + {{end}} +
+
+{{template "base/footer" .}} diff --git a/templates/repo/actions/no_workflows.tmpl b/templates/repo/actions/no_workflows.tmpl new file mode 100644 index 0000000..88d6e51 --- /dev/null +++ b/templates/repo/actions/no_workflows.tmpl @@ -0,0 +1,8 @@ +
+ {{svg "octicon-no-entry" 48}} +

{{ctx.Locale.Tr "actions.runs.no_workflows"}}

+ {{if and .CanWriteCode .CanWriteActions}} +

{{ctx.Locale.Tr "actions.runs.no_workflows.quick_start" "https://forgejo.org/docs/latest/admin/actions/"}}

+ {{end}} +

{{ctx.Locale.Tr "actions.runs.no_workflows.documentation" "https://forgejo.org/docs/latest/admin/actions/"}}

+
diff --git a/templates/repo/actions/runs_list.tmpl b/templates/repo/actions/runs_list.tmpl new file mode 100644 index 0000000..7bab492 --- /dev/null +++ b/templates/repo/actions/runs_list.tmpl @@ -0,0 +1,43 @@ +
+ {{if not .Runs}} +
+ {{svg "octicon-no-entry" 48}} +

{{if $.IsFiltered}}{{ctx.Locale.Tr "actions.runs.no_results"}}{{else}}{{ctx.Locale.Tr "actions.runs.no_runs"}}{{end}}

+
+ {{end}} + {{range .Runs}} +
+
+ {{template "repo/actions/status" (dict "status" .Status.String)}} +
+
+ + {{if .Title}}{{.Title}}{{else}}{{ctx.Locale.Tr "actions.runs.empty_commit_message"}}{{end}} + +
+ {{if not $.CurWorkflow}}{{.WorkflowID}} {{end}}#{{.Index}} - + {{- if .ScheduleID -}} + {{ctx.Locale.Tr "actions.runs.scheduled"}} + {{- else -}} + {{ctx.Locale.Tr "actions.runs.commit"}} + {{ShortSha .CommitSHA}} + {{ctx.Locale.Tr "actions.runs.pushed_by"}} + {{.TriggerUser.GetDisplayName}} + {{- end -}} +
+
+
+ {{if .RefLink}} + {{.PrettyRef}} + {{else}} + {{.PrettyRef}} + {{end}} +
+
{{svg "octicon-calendar" 16}}{{TimeSinceUnix .Updated ctx.Locale}}
+
{{svg "octicon-stopwatch" 16}}{{.Duration}}
+
+
+
+ {{end}} +
+{{template "base/paginate" .}} diff --git a/templates/repo/actions/status.tmpl b/templates/repo/actions/status.tmpl new file mode 100644 index 0000000..a0e02cf --- /dev/null +++ b/templates/repo/actions/status.tmpl @@ -0,0 +1,29 @@ + +{{- $size := 16 -}} +{{- if .size -}} +{{- $size = .size -}} +{{- end -}} + +{{- $className := "" -}} +{{- if .className -}} +{{- $className = .className -}} +{{- end -}} + + +{{if eq .status "success"}} + {{svg "octicon-check-circle-fill" $size (printf "text green %s" $className)}} +{{else if eq .status "skipped"}} + {{svg "octicon-skip" $size (printf "text grey %s" $className)}} +{{else if eq .status "waiting"}} + {{svg "octicon-clock" $size (printf "text yellow %s" $className)}} +{{else if eq .status "blocked"}} + {{svg "octicon-blocked" $size (printf "text yellow %s" $className)}} +{{else if eq .status "running"}} + {{svg "octicon-meter" $size (printf "text yellow job-status-rotate %s" $className)}} +{{else if or (eq .status "failure") or (eq .status "cancelled") or (eq .status "unknown")}} + {{svg "octicon-x-circle-fill" $size (printf "text red %s" $className)}} +{{end}} + diff --git a/templates/repo/actions/view.tmpl b/templates/repo/actions/view.tmpl new file mode 100644 index 0000000..b787762 --- /dev/null +++ b/templates/repo/actions/view.tmpl @@ -0,0 +1,33 @@ +{{template "base/head" .}} + +
+ {{template "repo/header" .}} +
+
+
+ +{{template "base/footer" .}} diff --git a/templates/repo/activity.tmpl b/templates/repo/activity.tmpl new file mode 100644 index 0000000..19a09b9 --- /dev/null +++ b/templates/repo/activity.tmpl @@ -0,0 +1,19 @@ +{{template "base/head" .}} +
+ {{template "repo/header" .}} +
+ {{if and (not .IsEmptyRepo) (.Permission.CanRead $.UnitTypeCode)}} +
+ {{template "repo/navbar" .}} +
+ {{end}} +
+ {{if .PageIsPulse}}{{template "repo/pulse" .}}{{end}} + {{if .PageIsContributors}}{{template "repo/contributors" .}}{{end}} + {{if .PageIsCodeFrequency}}{{template "repo/code_frequency" .}}{{end}} + {{if .PageIsRecentCommits}}{{template "repo/recent_commits" .}}{{end}} +
+
+
+{{template "base/footer" .}} + diff --git a/templates/repo/admin_flags.tmpl b/templates/repo/admin_flags.tmpl new file mode 100644 index 0000000..2a65c9c --- /dev/null +++ b/templates/repo/admin_flags.tmpl @@ -0,0 +1,8 @@ +{{if .Repository.IsFlagged $.Context}} +
+ {{ctx.Locale.Tr "repo.admin.enabled_flags"}} + {{range .Repository.ListFlags $.Context}} + {{.Name}} + {{end}} +
+{{end}} diff --git a/templates/repo/blame.tmpl b/templates/repo/blame.tmpl new file mode 100644 index 0000000..58be0b1 --- /dev/null +++ b/templates/repo/blame.tmpl @@ -0,0 +1,96 @@ +{{if or .UsesIgnoreRevs .FaultyIgnoreRevsFile}} + {{$revsFileLink := URLJoin .RepoLink "src" .BranchNameSubURL "/.git-blame-ignore-revs"}} + {{if .UsesIgnoreRevs}} +
+

{{ctx.Locale.Tr "repo.blame.ignore_revs" $revsFileLink "?bypass-blame-ignore=true"}}

+
+ {{else}} +
+

{{ctx.Locale.Tr "repo.blame.ignore_revs.failed" $revsFileLink}}

+
+ {{end}} +{{end}} +
+

+
+ {{template "repo/file_info" .}} +
+
+
+ {{ctx.Locale.Tr "repo.file_raw"}} + {{if not .IsViewCommit}} + {{ctx.Locale.Tr "repo.file_permalink"}} + {{end}} + {{ctx.Locale.Tr "repo.normal_view"}} + {{ctx.Locale.Tr "repo.file_history"}} + + +
+
+

+
+
+ {{if .IsFileTooLarge}} + + + + + + +
{{ctx.Locale.Tr "repo.file_too_large"}}
+ {{else}} + + + {{range $row := .BlameRows}} + + + + + {{if $.EscapeStatus.Escaped}} + + {{end}} + + + {{end}} + +
+
+
+
+ {{$row.Avatar}} +
+ +
+ {{$row.CommitSince}} +
+
+
+
+ {{if $row.PreviousSha}} + + {{svg "octicon-versions"}} + + {{end}} + + + + {{if $row.EscapeStatus.Escaped}} + + {{end}} + + {{$row.Code}} +
+
+ {{if $.Permission.CanRead $.UnitTypeIssues}} + {{ctx.Locale.Tr "repo.issues.context.reference_issue"}} + {{end}} + {{ctx.Locale.Tr "repo.file_copy_permalink"}} +
+ {{end}} +
+
+
diff --git a/templates/repo/branch/list.tmpl b/templates/repo/branch/list.tmpl new file mode 100644 index 0000000..f5bffb0 --- /dev/null +++ b/templates/repo/branch/list.tmpl @@ -0,0 +1,262 @@ +{{template "base/head" .}} +
+ {{template "repo/header" .}} +
+ {{template "base/alert" .}} + {{template "repo/sub_menu" .}} + {{if .DefaultBranchBranch}} +

+ {{ctx.Locale.Tr "repo.default_branch"}} + {{if and $.IsWriter (not $.Repository.IsArchived) (not .IsDeleted)}} + + {{svg "octicon-arrow-switch"}} + + {{end}} +

+ +
+ + + + + + + +
+
+ {{.DefaultBranchBranch.DBBranch.Name}} + {{if .DefaultBranchBranch.IsProtected}} + {{svg "octicon-shield-lock"}} + {{end}} + + {{template "repo/commit_statuses" dict "Status" (index $.CommitStatus .DefaultBranchBranch.DBBranch.CommitID) "Statuses" (index $.CommitStatuses .DefaultBranchBranch.DBBranch.CommitID)}} +
+

{{svg "octicon-git-commit" 16 "tw-mr-1"}}{{ShortSha .DefaultBranchBranch.DBBranch.CommitID}} · {{RenderCommitMessage $.Context .DefaultBranchBranch.DBBranch.CommitMessage (.Repository.ComposeMetas ctx)}} · {{ctx.Locale.Tr "org.repo_updated" (TimeSince .DefaultBranchBranch.DBBranch.CommitTime.AsTime ctx.Locale)}} {{if .DefaultBranchBranch.DBBranch.Pusher}}  {{template "shared/user/avatarlink" dict "user" .DefaultBranchBranch.DBBranch.Pusher}}{{template "shared/user/namelink" .DefaultBranchBranch.DBBranch.Pusher}}{{end}}

+
+ {{if and $.IsWriter (not $.Repository.IsArchived) (not .IsDeleted)}} + + {{end}} + {{if .EnableFeed}} + {{svg "octicon-rss"}} + {{end}} + {{if not $.DisableDownloadSourceArchives}} + + {{end}} + {{if and $.IsWriter (not $.Repository.IsArchived) (not .IsDeleted) (not $.IsMirror)}} + + {{end}} +
+
+ {{end}} + +

+
+ {{ctx.Locale.Tr "repo.branches"}} +
+

+ +
+
+ {{template "shared/search/combo" dict "Value" .Keyword "Placeholder" (ctx.Locale.Tr "search.branch_kind")}} +
+
+ +
+ + + {{range .Branches}} + + + + + + + {{end}} + +
+ {{if .DBBranch.IsDeleted}} +
+ {{.DBBranch.Name}} + +
+

{{ctx.Locale.Tr "repo.branch.deleted_by" .DBBranch.DeletedBy.Name}} {{TimeSinceUnix .DBBranch.DeletedUnix ctx.Locale}}

+ {{else}} +
+ {{.DBBranch.Name}} + {{if .IsProtected}} + {{svg "octicon-shield-lock"}} + {{end}} + + {{template "repo/commit_statuses" dict "Status" (index $.CommitStatus .DBBranch.CommitID) "Statuses" (index $.CommitStatuses .DBBranch.CommitID)}} +
+

{{svg "octicon-git-commit" 16 "tw-mr-1"}}{{ShortSha .DBBranch.CommitID}} · {{RenderCommitMessage $.Context .DBBranch.CommitMessage ($.Repository.ComposeMetas ctx)}} · {{ctx.Locale.Tr "org.repo_updated" (TimeSince .DBBranch.CommitTime.AsTime ctx.Locale)}} {{if .DBBranch.Pusher}}  {{template "shared/user/avatarlink" dict "user" .DBBranch.Pusher}}  {{template "shared/user/namelink" .DBBranch.Pusher}}{{end}}

+ {{end}} +
+ {{if and (not .DBBranch.IsDeleted) $.DefaultBranchBranch}} +
+
+
{{.CommitsBehind}}
+ {{/* old code bears 0/0.0 = NaN output, so it might output invalid "width: NaNpx", it just works and doesn't cause any problem. */}} +
+
+
+
{{.CommitsAhead}}
+
+
+
+ {{end}} +
+ {{if not .LatestPullRequest}} + {{if .IsIncluded}} + + {{svg "octicon-git-pull-request"}} {{ctx.Locale.Tr "repo.branch.included"}} + + {{else if and (not .DBBranch.IsDeleted) $.AllowsPulls (gt .CommitsAhead 0)}} + + + + {{end}} + {{else if and .LatestPullRequest.HasMerged .MergeMovedOn}} + {{if and (not .DBBranch.IsDeleted) $.AllowsPulls (gt .CommitsAhead 0)}} + + + + {{end}} + {{else}} + {{if not .LatestPullRequest.IsSameRepo}}{{.LatestPullRequest.BaseRepo.FullName}}{{end}}#{{.LatestPullRequest.Issue.Index}} + {{if .LatestPullRequest.HasMerged}} + {{svg "octicon-git-merge" 16 "tw-mr-1"}}{{ctx.Locale.Tr "repo.pulls.merged"}} + {{else if .LatestPullRequest.Issue.IsClosed}} + {{svg "octicon-git-pull-request-closed" 16 "tw-mr-1"}}{{ctx.Locale.Tr "repo.issues.closed_title"}} + {{else if .LatestPullRequest.IsWorkInProgress ctx}} + {{svg "octicon-git-pull-request-draft" 16 "tw-mr-1"}}{{ctx.Locale.Tr "repo.issues.draft_title"}} + {{else}} + {{svg "octicon-git-pull-request" 16 "tw-mr-1"}}{{ctx.Locale.Tr "repo.issues.open_title"}} + {{end}} + {{end}} + + {{if and $.IsWriter (not $.Repository.IsArchived) (not .DBBranch.IsDeleted)}} + + {{end}} + {{if $.EnableFeed}} + {{svg "octicon-rss"}} + {{end}} + {{if and (not .DBBranch.IsDeleted) (not $.DisableDownloadSourceArchives)}} + + {{end}} + {{if and $.IsWriter (not $.Repository.IsArchived) (not .DBBranch.IsDeleted) (not $.IsMirror)}} + + {{end}} + {{if and $.IsWriter (not $.IsMirror) (not $.Repository.IsArchived) (not .IsProtected)}} + {{if .DBBranch.IsDeleted}} + + {{else}} + + {{end}} + {{end}} +
+
+ {{template "base/paginate" .}} +
+
+ + + + + + +{{template "base/footer" .}} diff --git a/templates/repo/branch_dropdown.tmpl b/templates/repo/branch_dropdown.tmpl new file mode 100644 index 0000000..f2bda8e --- /dev/null +++ b/templates/repo/branch_dropdown.tmpl @@ -0,0 +1,89 @@ +{{/* Attributes: +* root +* ContainerClasses +* (TODO: search "branch_dropdown" in the template directory) +*/}} +{{$defaultSelectedRefName := $.root.BranchName}} +{{if and .root.IsViewTag (not .noTag)}} + {{$defaultSelectedRefName = .root.TagName}} +{{end}} +{{if eq $defaultSelectedRefName ""}} + {{$defaultSelectedRefName = $.root.Repository.DefaultBranch}} +{{end}} + +{{$type := ""}} +{{if and .root.IsViewTag (not .noTag)}} + {{$type = "tag"}} +{{else if .root.IsViewBranch}} + {{$type = "branch"}} +{{else}} + {{$type = "tree"}} +{{end}} + +{{$showBranchesInDropdown := not .root.HideBranchesInDropdown}} + + + +
+ {{/* show dummy elements before Vue componment is mounted, this code must match the code in BranchTagSelector.vue */}} + +
diff --git a/templates/repo/cite/cite_buttons.tmpl b/templates/repo/cite/cite_buttons.tmpl new file mode 100644 index 0000000..5a6de23 --- /dev/null +++ b/templates/repo/cite/cite_buttons.tmpl @@ -0,0 +1,8 @@ + +BibTeX + + + + diff --git a/templates/repo/cite/cite_modal.tmpl b/templates/repo/cite/cite_modal.tmpl new file mode 100644 index 0000000..1ce959a --- /dev/null +++ b/templates/repo/cite/cite_modal.tmpl @@ -0,0 +1,20 @@ + diff --git a/templates/repo/clone_buttons.tmpl b/templates/repo/clone_buttons.tmpl new file mode 100644 index 0000000..89daba9 --- /dev/null +++ b/templates/repo/clone_buttons.tmpl @@ -0,0 +1,15 @@ + +{{if $.CloneButtonShowHTTPS}} + +{{end}} +{{if $.CloneButtonShowSSH}} + +{{end}} + + diff --git a/templates/repo/clone_script.tmpl b/templates/repo/clone_script.tmpl new file mode 100644 index 0000000..40dae76 --- /dev/null +++ b/templates/repo/clone_script.tmpl @@ -0,0 +1,50 @@ + diff --git a/templates/repo/code/recently_pushed_new_branches.tmpl b/templates/repo/code/recently_pushed_new_branches.tmpl new file mode 100644 index 0000000..d996acc --- /dev/null +++ b/templates/repo/code/recently_pushed_new_branches.tmpl @@ -0,0 +1,17 @@ +{{range .RecentlyPushedNewBranches}} +
+
+ {{$timeSince := TimeSince .CommitTime.AsTime ctx.Locale}} + {{$repo := .GetRepo $.Context}} + {{$name := .Name}} + {{if ne $repo.ID $.Repository.ID}} + {{$name = (print $repo.FullName ":" .Name)}} + {{end}} + {{$branchLink := (print ($repo.Link) "/src/branch/" (PathEscapeSegments .Name))}} + {{ctx.Locale.Tr "repo.pulls.recently_pushed_new_branches" $name $timeSince $branchLink}} +
+ + {{ctx.Locale.Tr "repo.pulls.compare_changes"}} + +
+{{end}} diff --git a/templates/repo/code_frequency.tmpl b/templates/repo/code_frequency.tmpl new file mode 100644 index 0000000..50ec1be --- /dev/null +++ b/templates/repo/code_frequency.tmpl @@ -0,0 +1,9 @@ +{{if .Permission.CanRead $.UnitTypeCode}} +
+
+{{end}} diff --git a/templates/repo/commit_load_branches_and_tags.tmpl b/templates/repo/commit_load_branches_and_tags.tmpl new file mode 100644 index 0000000..ffa0e53 --- /dev/null +++ b/templates/repo/commit_load_branches_and_tags.tmpl @@ -0,0 +1,20 @@ +{{if not .PageIsWiki}} +
+ +
+
+
{{ctx.Locale.Tr "repo.commit.contained_in"}}
+
+
{{svg "octicon-git-branch"}}
+
+
+
+
{{svg "octicon-tag"}}
+
+
+
+
+{{end}} diff --git a/templates/repo/commit_page.tmpl b/templates/repo/commit_page.tmpl new file mode 100644 index 0000000..e376860 --- /dev/null +++ b/templates/repo/commit_page.tmpl @@ -0,0 +1,285 @@ +{{template "base/head" .}} +
+ {{template "repo/header" .}} +
+ {{$class := ""}} + {{if .Commit.Signature}} + {{$class = (print $class " isSigned")}} + {{if .Verification.Verified}} + {{if eq .Verification.TrustStatus "trusted"}} + {{$class = (print $class " isVerified")}} + {{else if eq .Verification.TrustStatus "untrusted"}} + {{$class = (print $class " isVerifiedUntrusted")}} + {{else}} + {{$class = (print $class " isVerifiedUnmatched")}} + {{end}} + {{else if .Verification.Warning}} + {{$class = (print $class " isWarning")}} + {{end}} + {{end}} +
+
+

{{RenderCommitMessage $.Context .Commit.Message ($.Repository.ComposeMetas ctx)}}{{template "repo/commit_statuses" dict "Status" .CommitStatus "Statuses" .CommitStatuses}}

+ {{if not $.PageIsWiki}} +
+ + {{ctx.Locale.Tr "repo.diff.browse_source"}} + + {{if and ($.Permission.CanWrite $.UnitTypeCode) (not $.Repository.IsArchived) (not .IsDeleted)}}{{- /* */ -}} + + {{end}} +
+ {{end}} +
+ {{if IsMultilineCommitMessage .Commit.Message}} +
{{RenderCommitBody $.Context .Commit.Message ($.Repository.ComposeMetas ctx)}}
+ {{end}} + {{template "repo/commit_load_branches_and_tags" .}} +
+
+
+ {{if .Author}} + {{ctx.AvatarUtils.Avatar .Author 28 "tw-mr-2"}} + {{if .Author.FullName}} + {{.Author.FullName}} + {{else}} + {{.Commit.Author.Name}} + {{end}} + {{else}} + {{ctx.AvatarUtils.AvatarByEmail .Commit.Author.Email .Commit.Author.Email 28 "tw-mr-2"}} + {{.Commit.Author.Name}} + {{end}} + {{TimeSince .Commit.Author.When ctx.Locale}} + {{if or (ne .Commit.Committer.Name .Commit.Author.Name) (ne .Commit.Committer.Email .Commit.Author.Email)}} + {{ctx.Locale.Tr "repo.diff.committed_by"}} + {{if ne .Verification.CommittingUser.ID 0}} + {{ctx.AvatarUtils.Avatar .Verification.CommittingUser 28 "tw-mx-2"}} + {{.Commit.Committer.Name}} + {{else}} + {{ctx.AvatarUtils.AvatarByEmail .Commit.Committer.Email .Commit.Committer.Name 28 "tw-mr-2"}} + {{.Commit.Committer.Name}} + {{end}} + {{end}} +
+
+ {{if .Parents}} +
+ {{ctx.Locale.Tr "repo.diff.parent"}} + {{range .Parents}} + {{if $.PageIsWiki}} + {{ShortSha .}} + {{else}} + {{ShortSha .}} + {{end}} + {{end}} +
+ {{end}} +
+ {{ctx.Locale.Tr "repo.diff.commit"}} + {{ShortSha .CommitID}} +
+
+
+ {{if .Commit.Signature}} +
+
+ {{if .Verification.Verified}} + {{if ne .Verification.SigningUser.ID 0}} + {{svg "gitea-lock" 16 "tw-mr-2"}} + {{if eq .Verification.TrustStatus "trusted"}} + {{ctx.Locale.Tr "repo.commits.signed_by"}}: + {{else if eq .Verification.TrustStatus "untrusted"}} + {{ctx.Locale.Tr "repo.commits.signed_by_untrusted_user"}}: + {{else}} + {{ctx.Locale.Tr "repo.commits.signed_by_untrusted_user_unmatched"}}: + {{end}} + {{ctx.AvatarUtils.Avatar .Verification.SigningUser 28 "tw-mr-2"}} + {{.Verification.SigningUser.GetDisplayName}} + {{else}} + {{svg "gitea-lock-cog" 16 "tw-mr-2"}} + {{ctx.Locale.Tr "repo.commits.signed_by"}}: + {{ctx.AvatarUtils.AvatarByEmail .Verification.SigningEmail "" 28 "tw-mr-2"}} + {{.Verification.SigningUser.GetDisplayName}} + {{end}} + {{else}} + {{svg "gitea-unlock" 16 "tw-mr-2"}} + {{ctx.Locale.Tr .Verification.Reason}} + {{end}} +
+
+ {{if .Verification.Verified}} + {{if ne .Verification.SigningUser.ID 0}} + {{svg "octicon-verified" 16 "tw-mr-2"}} + {{if .Verification.SigningSSHKey}} + {{ctx.Locale.Tr "repo.commits.ssh_key_fingerprint"}}: + {{.Verification.SigningSSHKey.Fingerprint}} + {{else}} + {{ctx.Locale.Tr "repo.commits.gpg_key_id"}}: + {{.Verification.SigningKey.PaddedKeyID}} + {{end}} + {{else}} + {{svg "octicon-unverified" 16 "tw-mr-2"}} + {{if .Verification.SigningSSHKey}} + {{ctx.Locale.Tr "repo.commits.ssh_key_fingerprint"}}: + {{.Verification.SigningSSHKey.Fingerprint}} + {{else}} + {{ctx.Locale.Tr "repo.commits.gpg_key_id"}}: + {{.Verification.SigningKey.PaddedKeyID}} + {{end}} + {{end}} + {{else if .Verification.Warning}} + {{svg "octicon-unverified" 16 "tw-mr-2"}} + {{if .Verification.SigningSSHKey}} + {{ctx.Locale.Tr "repo.commits.ssh_key_fingerprint"}}: + {{.Verification.SigningSSHKey.Fingerprint}} + {{else}} + {{ctx.Locale.Tr "repo.commits.gpg_key_id"}}: + {{.Verification.SigningKey.PaddedKeyID}} + {{end}} + {{else}} + {{if .Verification.SigningKey}} + {{if ne .Verification.SigningKey.KeyID ""}} + {{svg "octicon-verified" 16 "tw-mr-2"}} + {{ctx.Locale.Tr "repo.commits.gpg_key_id"}}: + {{.Verification.SigningKey.PaddedKeyID}} + {{end}} + {{end}} + {{if .Verification.SigningSSHKey}} + {{if ne .Verification.SigningSSHKey.Fingerprint ""}} + {{svg "octicon-verified" 16 "tw-mr-2"}} + {{ctx.Locale.Tr "repo.commits.ssh_key_fingerprint"}}: + {{.Verification.SigningSSHKey.Fingerprint}} + {{end}} + {{end}} + {{end}} +
+
+ {{end}} + {{if .NoteRendered}} +
+ {{svg "octicon-note" 16 "tw-mr-2"}} + {{ctx.Locale.Tr "repo.diff.git-notes"}}: + {{if .NoteAuthor}} + + {{if .NoteAuthor.FullName}} + {{.NoteAuthor.FullName}} + {{else}} + {{.NoteCommit.Author.Name}} + {{end}} + + {{else}} + {{.NoteCommit.Author.Name}} + {{end}} + {{TimeSince .NoteCommit.Author.When ctx.Locale}} +
+
+
{{.NoteRendered | SanitizeHTML}}
+
+ {{end}} + {{template "repo/diff/box" .}} +
+
+{{template "base/footer" .}} diff --git a/templates/repo/commit_status.tmpl b/templates/repo/commit_status.tmpl new file mode 100644 index 0000000..eb700ab --- /dev/null +++ b/templates/repo/commit_status.tmpl @@ -0,0 +1,16 @@ + +{{if eq .State "pending"}} + {{svg "octicon-dot-fill" 18 "commit-status icon text yellow"}} +{{end}} +{{if eq .State "success"}} + {{svg "octicon-check" 18 "commit-status icon text green"}} +{{end}} +{{if eq .State "error"}} + {{svg "gitea-exclamation" 18 "commit-status icon text red"}} +{{end}} +{{if eq .State "failure"}} + {{svg "octicon-x" 18 "commit-status icon text red"}} +{{end}} +{{if eq .State "warning"}} + {{svg "gitea-exclamation" 18 "commit-status icon text yellow"}} +{{end}} diff --git a/templates/repo/commit_statuses.tmpl b/templates/repo/commit_statuses.tmpl new file mode 100644 index 0000000..f451ac0 --- /dev/null +++ b/templates/repo/commit_statuses.tmpl @@ -0,0 +1,14 @@ +{{if .Statuses}} + {{if and (eq (len .Statuses) 1) .Status.TargetURL}} + + {{template "repo/commit_status" .Status}} + + {{else}} + + {{template "repo/commit_status" .Status}} + + {{end}} +
+ {{template "repo/pulls/status" (dict "CommitStatuses" .Statuses "CommitStatus" .Status)}} +
+{{end}} diff --git a/templates/repo/commits.tmpl b/templates/repo/commits.tmpl new file mode 100644 index 0000000..86df88f --- /dev/null +++ b/templates/repo/commits.tmpl @@ -0,0 +1,23 @@ +{{template "base/head" .}} +
+ {{template "repo/header" .}} +
+ {{template "repo/sub_menu" .}} +
+
+ {{template "repo/branch_dropdown" dict "root" . "ContainerClasses" "tw-mr-1"}} + + {{svg "octicon-git-branch"}} + {{ctx.Locale.Tr "repo.commit_graph"}} + +
+
+ {{template "repo/commits_table" .}} + {{if .OldFilename}} +
+ {{ctx.Locale.Tr "repo.commits.renamed_from" .OldFilename}} ({{ctx.Locale.Tr "repo.commits.browse_further"}}) +
+ {{end}} +
+
+{{template "base/footer" .}} diff --git a/templates/repo/commits_list.tmpl b/templates/repo/commits_list.tmpl new file mode 100644 index 0000000..c8c695e --- /dev/null +++ b/templates/repo/commits_list.tmpl @@ -0,0 +1,96 @@ +
+ + + + + + + + + + + + {{$commitRepoLink := $.RepoLink}}{{if $.CommitRepoLink}}{{$commitRepoLink = $.CommitRepoLink}}{{end}} + {{range .Commits}} + + + + + {{if .Committer}} + + {{else}} + + {{end}} + + + {{end}} + +
{{ctx.Locale.Tr "repo.commits.author"}}{{StringUtils.ToUpper $.Repository.ObjectFormatName}}{{ctx.Locale.Tr "repo.commits.message"}}{{ctx.Locale.Tr "repo.commits.date"}}
+
+ {{$userName := .Author.Name}} + {{if .User}} + {{if and .User.FullName DefaultShowFullName}} + {{$userName = .User.FullName}} + {{end}} + {{ctx.AvatarUtils.Avatar .User 28 "tw-mr-2"}}{{$userName}} + {{else}} + {{ctx.AvatarUtils.AvatarByEmail .Author.Email .Author.Name 28 "tw-mr-2"}} + {{$userName}} + {{end}} +
+
+ {{$class := "ui sha label"}} + {{if .Signature}} + {{$class = (print $class " isSigned")}} + {{if .Verification.Verified}} + {{if eq .Verification.TrustStatus "trusted"}} + {{$class = (print $class " isVerified")}} + {{else if eq .Verification.TrustStatus "untrusted"}} + {{$class = (print $class " isVerifiedUntrusted")}} + {{else}} + {{$class = (print $class " isVerifiedUnmatched")}} + {{end}} + {{else if .Verification.Warning}} + {{$class = (print $class " isWarning")}} + {{end}} + {{end}} + {{$commitShaLink := ""}} + {{if $.PageIsWiki}} + {{$commitShaLink = (printf "%s/wiki/commit/%s" $commitRepoLink (PathEscape .ID.String))}} + {{else if $.PageIsPullCommits}} + {{$commitShaLink = (printf "%s/pulls/%d/commits/%s" $commitRepoLink $.Issue.Index (PathEscape .ID.String))}} + {{else if $.Reponame}} + {{$commitShaLink = (printf "%s/commit/%s" $commitRepoLink (PathEscape .ID.String))}} + {{end}} + + {{ShortSha .ID.String}} + {{if .Signature}}{{template "repo/shabox_badge" dict "root" $ "verification" .Verification}}{{end}} + + + + {{if $.PageIsWiki}} + {{.Summary | RenderEmoji $.Context}} + {{else}} + {{$commitLink:= printf "%s/commit/%s" $commitRepoLink (PathEscape .ID.String)}} + {{RenderCommitMessageLinkSubject $.Context .Message $commitLink ($.Repository.ComposeMetas ctx)}} + {{end}} + + {{if IsMultilineCommitMessage .Message}} + + {{end}} + {{template "repo/commit_statuses" dict "Status" .Status "Statuses" .Statuses}} + {{if IsMultilineCommitMessage .Message}} +
{{RenderCommitBody $.Context .Message ($.Repository.ComposeMetas ctx)}}
+ {{end}} +
{{TimeSince .Committer.When ctx.Locale}}{{TimeSince .Author.When ctx.Locale}} + + {{if not $.PageIsWiki}} + + {{svg "octicon-file-code"}} + + {{end}} +
+
diff --git a/templates/repo/commits_list_small.tmpl b/templates/repo/commits_list_small.tmpl new file mode 100644 index 0000000..4c67319 --- /dev/null +++ b/templates/repo/commits_list_small.tmpl @@ -0,0 +1,55 @@ +{{$index := 0}} +
+{{range .comment.Commits}} + {{$tag := printf "%s-%d" $.comment.HashTag $index}} + {{$index = Eval $index "+" 1}} +
+ {{svg "octicon-git-commit"}} + {{if .User}} + {{ctx.AvatarUtils.Avatar .User 20}} + {{else}} + {{ctx.AvatarUtils.AvatarByEmail .Author.Email .Author.Name 20}} + {{end}} + + {{$commitLink:= printf "%s/commit/%s" $.comment.Issue.PullRequest.BaseRepo.Link (PathEscape .ID.String)}} + + + {{- RenderCommitMessageLinkSubject $.root.Context .Message $commitLink ($.comment.Issue.PullRequest.BaseRepo.ComposeMetas ctx) -}} + + + {{if IsMultilineCommitMessage .Message}} + + {{end}} + + + {{template "repo/commit_statuses" dict "Status" .Status "Statuses" .Statuses}} + {{$class := "ui sha label"}} + {{if .Signature}} + {{$class = (print $class " isSigned")}} + {{if .Verification.Verified}} + {{if eq .Verification.TrustStatus "trusted"}} + {{$class = (print $class " isVerified")}} + {{else if eq .Verification.TrustStatus "untrusted"}} + {{$class = (print $class " isVerifiedUntrusted")}} + {{else}} + {{$class = (print $class " isVerifiedUnmatched")}} + {{end}} + {{else if .Verification.Warning}} + {{$class = (print $class " isWarning")}} + {{end}} + {{end}} + + {{ShortSha .ID.String}} + {{if .Signature}} + {{template "repo/shabox_badge" dict "root" $.root "verification" .Verification}} + {{end}} + + +
+ {{if IsMultilineCommitMessage .Message}} +
+		{{- RenderCommitBody $.root.Context .Message ($.comment.Issue.PullRequest.BaseRepo.ComposeMetas ctx) -}}
+	
+ {{end}} +{{end}} +
diff --git a/templates/repo/commits_search_dropdown.tmpl b/templates/repo/commits_search_dropdown.tmpl new file mode 100644 index 0000000..5aa3f4f --- /dev/null +++ b/templates/repo/commits_search_dropdown.tmpl @@ -0,0 +1,8 @@ + diff --git a/templates/repo/commits_table.tmpl b/templates/repo/commits_table.tmpl new file mode 100644 index 0000000..7249bec --- /dev/null +++ b/templates/repo/commits_table.tmpl @@ -0,0 +1,36 @@ +

+
+ {{if or .PageIsCommits (gt .CommitCount 0)}} + {{ctx.Locale.TrN .CommitCount "repo.n_commit_one" "repo.n_commit_few" (StringUtils.ToString .CommitCount)}} + {{else if .IsNothingToCompare}} + {{ctx.Locale.Tr "repo.commits.nothing_to_compare"}} + {{else}} + {{ctx.Locale.Tr "repo.commits.no_commits" $.BaseBranch $.HeadBranch}} + {{end}} +
+ {{if .IsDiffCompare}} + + {{end}} +

+ +{{if .PageIsCommits}} +
+
+
+ {{template "shared/search/input" dict "Value" .Keyword "Placeholder" (ctx.Locale.Tr "search.commit_kind")}} + {{template "repo/commits_search_dropdown" .}} + {{template "shared/search/button" dict "Tooltip" (ctx.Locale.Tr "repo.commits.search.tooltip")}} +
+
+
+{{end}} + +{{if and .Commits (gt .CommitCount 0)}} + {{template "repo/commits_list" .}} +{{end}} + +{{template "base/paginate" .}} diff --git a/templates/repo/contributors.tmpl b/templates/repo/contributors.tmpl new file mode 100644 index 0000000..f7f5d79 --- /dev/null +++ b/templates/repo/contributors.tmpl @@ -0,0 +1,14 @@ +{{if .Permission.CanRead $.UnitTypeCode}} +
+
+{{end}} diff --git a/templates/repo/create.tmpl b/templates/repo/create.tmpl new file mode 100644 index 0000000..df4288a --- /dev/null +++ b/templates/repo/create.tmpl @@ -0,0 +1,224 @@ +{{template "base/head" .}} +
+
+
+
+ {{.CsrfTokenHtml}} +

+ {{ctx.Locale.Tr "new_repo.title"}} +

+
+ {{template "base/alert" .}} + {{template "repo/create_helper" .}} + + {{if not .CanCreateRepo}} +
+

{{ctx.Locale.TrN .MaxCreationLimit "repo.form.reach_limit_of_creation_1" "repo.form.reach_limit_of_creation_n" .MaxCreationLimit}}

+
+ {{end}} +
+ + + {{ctx.Locale.Tr "repo.owner_helper"}} +
+ +
+ + + {{ctx.Locale.Tr "repo.repo_name_helper"}} +
+
+ +
+ + +
+ {{if .IsForcedPrivate}} + {{ctx.Locale.Tr "repo.visibility_helper_forced"}} + {{end}} + {{ctx.Locale.Tr "repo.visibility_description"}} +
+
+ + +
+
+ + +
+ +
+
+ +
+ + +
+
+ + +
+
+
+ +
+ + +
+
+ + +
+
+
+ +
+ + +
+
+ + +
+
+
+ +
+ + +
+
+
+ +
+
+ + +
+ +
+ +
+ + + {{ctx.Locale.Tr "repo.repo_gitignore_helper_desc"}} +
+
+ + + {{ctx.Locale.Tr "repo.license_helper_desc" "https://choosealicense.com/"}} +
+ +
+ + + {{ctx.Locale.Tr "repo.readme_helper_desc"}} +
+
+
+ + +
+
+
+ + + {{ctx.Locale.Tr "repo.default_branch_helper"}} +
+
+ + + {{ctx.Locale.Tr "repo.object_format_helper"}} +
+
+ +
+ + +
+
+
+
+
+ + +
+
+
+
+
+
+{{template "base/footer" .}} diff --git a/templates/repo/create_helper.tmpl b/templates/repo/create_helper.tmpl new file mode 100644 index 0000000..70c28b7 --- /dev/null +++ b/templates/repo/create_helper.tmpl @@ -0,0 +1,3 @@ +{{if not $.DisableMigrations}} +

{{ctx.Locale.Tr "repo.new_repo_helper" (print AppSubUrl "/repo/migrate")}}

+{{end}} diff --git a/templates/repo/diff/blob_excerpt.tmpl b/templates/repo/diff/blob_excerpt.tmpl new file mode 100644 index 0000000..d6ab87f --- /dev/null +++ b/templates/repo/diff/blob_excerpt.tmpl @@ -0,0 +1,80 @@ +{{if $.IsSplitStyle}} + {{range $k, $line := $.section.Lines}} + + {{if eq .GetType 4}} + +
+ {{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 5)}} + + {{end}} + {{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 4)}} + + {{end}} + {{if eq $line.GetExpandDirection 2}} + + {{end}} +
+ + {{$inlineDiff := $.section.GetComputedInlineDiffFor $line ctx.Locale}}{{/* + */}}{{template "repo/diff/section_code" dict "diff" $inlineDiff}} + {{else}} + {{$inlineDiff := $.section.GetComputedInlineDiffFor $line ctx.Locale}} + + {{if and $line.LeftIdx $inlineDiff.EscapeStatus.Escaped}}{{end}} + {{if $line.LeftIdx}}{{end}} + {{/* + */}}{{if $line.LeftIdx}}{{template "repo/diff/section_code" dict "diff" $inlineDiff}}{{else}}{{/* + */}}{{/* + */}}{{end}}{{/* + */}} + + {{if and $line.RightIdx $inlineDiff.EscapeStatus.Escaped}}{{end}} + {{if $line.RightIdx}}{{end}} + {{/* + */}}{{if $line.RightIdx}}{{template "repo/diff/section_code" dict "diff" $inlineDiff}}{{else}}{{/* + */}}{{/* + */}}{{end}}{{/* + */}} + {{end}} + + {{end}} +{{else}} + {{range $k, $line := $.section.Lines}} + + {{if eq .GetType 4}} + +
+ {{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 5)}} + + {{end}} + {{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 4)}} + + {{end}} + {{if eq $line.GetExpandDirection 2}} + + {{end}} +
+ + {{else}} + + + {{end}} + {{$inlineDiff := $.section.GetComputedInlineDiffFor $line ctx.Locale}} + {{if $inlineDiff.EscapeStatus.Escaped}}{{end}} + + {{$inlineDiff.Content}} + + {{end}} +{{end}} diff --git a/templates/repo/diff/box.tmpl b/templates/repo/diff/box.tmpl new file mode 100644 index 0000000..230e497 --- /dev/null +++ b/templates/repo/diff/box.tmpl @@ -0,0 +1,260 @@ +{{$showFileTree := (and (not .DiffNotAvailable) (gt .Diff.NumFiles 1))}} +
+
+
+ {{if $showFileTree}} + + + {{end}} + {{if not .DiffNotAvailable}} +
+ {{svg "octicon-diff" 16 "tw-mr-1"}}{{ctx.Locale.Tr "repo.diff.stats_desc" .Diff.NumFiles .Diff.TotalAddition .Diff.TotalDeletion}} +
+ {{end}} +
+
+ {{if and .PageIsPullFiles $.SignedUserID (not .IsArchived) (not .DiffNotAvailable)}} +
+ + +
+ {{end}} + {{template "repo/diff/whitespace_dropdown" .}} + {{template "repo/diff/options_dropdown" .}} + {{if .PageIsPullFiles}} +
+ {{/* + the following will be replaced by vue component + but this avoids any loading artifacts till the vue component is initialized + */}} + +
+ {{end}} + {{if and .PageIsPullFiles $.SignedUserID (not .IsArchived)}} + {{template "repo/diff/new_review" .}} + {{end}} +
+
+ {{if not .DiffNotAvailable}} + {{if and .IsShowingOnlySingleCommit .PageIsPullFiles}} +
+
{{ctx.Locale.Tr "repo.pulls.showing_only_single_commit" (ShortSha .AfterCommitID)}} - {{ctx.Locale.Tr "repo.pulls.show_all_commits"}}
+
+ {{else if and (not .IsShowingAllCommits) .PageIsPullFiles}} +
+
{{ctx.Locale.Tr "repo.pulls.showing_specified_commit_range" (ShortSha .BeforeCommitID) (ShortSha .AfterCommitID)}} - {{ctx.Locale.Tr "repo.pulls.show_all_commits"}}
+
+ {{end}} + +
+ {{end}} +
+ {{if $showFileTree}} +
+ + {{end}} + {{if .DiffNotAvailable}} +

{{ctx.Locale.Tr "repo.diff.data_not_available"}}

+ {{else}} +
+ {{range $i, $file := .Diff.Files}} + {{/*notice: the index of Diff.Files should not be used for element ID, because the index will be restarted from 0 when doing load-more for PRs with a lot of files*/}} + {{$blobBase := call $.GetBlobByPathForCommit $.BeforeCommit $file.OldName}} + {{$blobHead := call $.GetBlobByPathForCommit $.HeadCommit $file.Name}} + {{$sniffedTypeBase := call $.GetSniffedTypeForBlob $blobBase}} + {{$sniffedTypeHead := call $.GetSniffedTypeForBlob $blobHead}} + {{$isImage:= or (call $.IsSniffedTypeAnImage $sniffedTypeBase) (call $.IsSniffedTypeAnImage $sniffedTypeHead)}} + {{$isCsv := (call $.IsCsvFile $file)}} + {{$showFileViewToggle := or $isImage (and (not $file.IsIncomplete) $isCsv)}} + {{$isExpandable := or (gt $file.Addition 0) (gt $file.Deletion 0) $file.IsBin}} + {{$isReviewFile := and $.IsSigned $.PageIsPullFiles (not $.IsArchived) $.IsShowingAllCommits}} +
+

+
+ +
+ {{if $file.IsBin}} + + {{ctx.Locale.Tr "repo.diff.bin"}} + + {{else}} + {{template "repo/diff/stats" dict "file" . "root" $}} + {{end}} +
+ {{if $file.IsRenamed}}{{$file.OldName}} → {{end}}{{$file.Name}} + {{if .IsLFSFile}} ({{ctx.Locale.Tr "repo.stored_lfs"}}){{end}} + + {{if $file.IsGenerated}} + {{ctx.Locale.Tr "repo.diff.generated"}} + {{end}} + {{if $file.IsVendored}} + {{ctx.Locale.Tr "repo.diff.vendored"}} + {{end}} + {{if and $file.Mode $file.OldMode}} + {{$old := ctx.Locale.Tr ($file.ModeTranslationKey $file.OldMode)}} + {{$new := ctx.Locale.Tr ($file.ModeTranslationKey $file.Mode)}} + {{ctx.Locale.Tr "git.filemode.changed_filemode" $old $new}} + {{else if $file.Mode}} + {{ctx.Locale.Tr ($file.ModeTranslationKey $file.Mode)}} + {{end}} + +
+
+ {{if $showFileViewToggle}} +
+ + +
+ {{end}} + {{if $file.IsProtected}} + {{ctx.Locale.Tr "repo.diff.protected"}} + {{end}} + {{if and $isReviewFile $file.HasChangedSinceLastReview}} + {{ctx.Locale.Tr "repo.pulls.has_changed_since_last_review"}} + {{end}} + {{if not (or $file.IsIncomplete $file.IsBin $file.IsSubmodule)}} + + + {{end}} + {{if and (not $file.IsSubmodule) (not $.PageIsWiki)}} + {{if $file.IsDeleted}} + {{ctx.Locale.Tr "repo.diff.view_file"}} + {{else}} + {{ctx.Locale.Tr "repo.diff.view_file"}} + {{if and $.HeadBranchIsEditable (not $file.IsLFSFile)}} + {{ctx.Locale.Tr "repo.editor.edit_this_file"}} + {{end}} + {{end}} + {{end}} + {{if $isReviewFile}} + + {{end}} +
+

+
+
+ {{if or $file.IsIncomplete $file.IsBin}} +
+ {{if $file.IsIncomplete}} + {{if $file.IsIncompleteLineTooLong}} + {{ctx.Locale.Tr "repo.diff.file_suppressed_line_too_long"}} + {{else}} + {{ctx.Locale.Tr "repo.diff.file_suppressed"}} + {{ctx.Locale.Tr "repo.diff.load"}} + {{end}} + {{else}} + {{ctx.Locale.Tr "repo.diff.bin_not_shown"}} + {{end}} +
+ {{else}} + + {{if $.IsSplitStyle}} + {{template "repo/diff/section_split" dict "file" . "root" $}} + {{else}} + {{template "repo/diff/section_unified" dict "file" . "root" $}} + {{end}} +
+ {{end}} +
+ {{if $showFileViewToggle}} + {{/* for image or CSV, it can have a horizontal scroll bar, there won't be review comment context menu (position absolute) which would be clipped by "overflow" */}} +
+ + {{if $isImage}} + {{template "repo/diff/image_diff" dict "file" . "root" $ "blobBase" $blobBase "blobHead" $blobHead "sniffedTypeBase" $sniffedTypeBase "sniffedTypeHead" $sniffedTypeHead}} + {{else}} + {{template "repo/diff/csv_diff" dict "file" . "root" $ "blobBase" $blobBase "blobHead" $blobHead "sniffedTypeBase" $sniffedTypeBase "sniffedTypeHead" $sniffedTypeHead}} + {{end}} +
+
+ {{end}} +
+
+ {{end}} + + {{if .Diff.IsIncomplete}} +
+

+ {{ctx.Locale.Tr "repo.diff.too_many_files"}} + {{ctx.Locale.Tr "repo.diff.show_more"}} +

+
+ {{end}} +
+ {{end}} +
+ + {{if and (not $.Repository.IsArchived) (not .DiffNotAvailable)}} + + {{end}} + {{if (not .DiffNotAvailable)}} + {{template "repo/issue/view_content/reference_issue_dialog" .}} + {{end}} +
diff --git a/templates/repo/diff/comment_form.tmpl b/templates/repo/diff/comment_form.tmpl new file mode 100644 index 0000000..856b3da --- /dev/null +++ b/templates/repo/diff/comment_form.tmpl @@ -0,0 +1,49 @@ +{{if and $.root.SignedUserID (not $.Repository.IsArchived)}} +
+ {{$.root.CsrfTokenHtml}} + + + + + + + + + + {{template "shared/combomarkdowneditor" (dict + "MarkdownPreviewUrl" (print $.root.Repository.Link "/markup") + "MarkdownPreviewContext" $.root.RepoLink + "TextareaName" "content" + "TextareaPlaceholder" (ctx.Locale.Tr "repo.diff.comment.placeholder") + "DropzoneParentContainer" "form" + "DisableAutosize" "true" + )}} + + {{if $.root.IsAttachmentEnabled}} +
+ {{template "repo/upload" $.root}} +
+ {{end}} + + +
+{{end}} diff --git a/templates/repo/diff/comment_form_datahandler.tmpl b/templates/repo/diff/comment_form_datahandler.tmpl new file mode 100644 index 0000000..d0e4934 --- /dev/null +++ b/templates/repo/diff/comment_form_datahandler.tmpl @@ -0,0 +1,7 @@ +{{if $.comment}} + {{template "repo/diff/comment_form" dict "root" $.root "hidden" $.hidden "reply" $.reply "Line" $.comment.UnsignedLine "File" $.comment.TreePath "Side" $.comment.DiffSide "HasComments" true}} +{{else if $.root}} + {{template "repo/diff/comment_form" $}} +{{else}} + {{template "repo/diff/comment_form" dict "root" $}} +{{end}} diff --git a/templates/repo/diff/comments.tmpl b/templates/repo/diff/comments.tmpl new file mode 100644 index 0000000..2e0c85d --- /dev/null +++ b/templates/repo/diff/comments.tmpl @@ -0,0 +1,75 @@ +{{range .comments}} + +{{$createdStr:= TimeSinceUnix .CreatedUnix ctx.Locale}} +
+ {{if .OriginalAuthor}} + {{ctx.AvatarUtils.Avatar nil}} + {{else}} + {{template "shared/user/avatarlink" dict "user" .Poster}} + {{end}} +
+
+
+ {{if .OriginalAuthor}} + + {{svg (MigrationIcon $.root.Repository.GetOriginalURLHostname)}} + {{.OriginalAuthor}} + + + {{ctx.Locale.Tr "repo.issues.commented_at" .HashTag $createdStr}} + + + {{if $.root.Repository.OriginalURL}} + ({{ctx.Locale.Tr "repo.migrated_from" $.root.Repository.OriginalURL $.root.Repository.GetOriginalURLHostname}}) + {{end}} + + {{else}} + + {{template "shared/user/namelink" .Poster}} + {{ctx.Locale.Tr "repo.issues.commented_at" .HashTag $createdStr}} + + {{end}} +
+
+ {{if .Invalidated}} + {{$referenceUrl := printf "%s#%s" $.root.Issue.Link .HashTag}} + + {{ctx.Locale.Tr "repo.issues.review.outdated"}} + + {{end}} + {{if and .Review}} + {{if eq .Review.Type 0}} +
+ {{ctx.Locale.Tr "repo.issues.review.pending"}} +
+ {{else}} +
+ {{ctx.Locale.Tr "repo.issues.review.review"}} +
+ {{end}} + {{end}} + {{template "repo/issue/view_content/add_reaction" dict "ctxData" $.root "ActionURL" (printf "%s/comments/%d/reactions" $.root.RepoLink .ID)}} + {{template "repo/issue/view_content/context_menu" dict "ctxData" $.root "item" . "delete" true "issue" false "diff" true "IsCommentPoster" (and $.root.IsSigned (eq $.root.SignedUserID .PosterID))}} +
+
+
+
+ {{if .RenderedContent}} + {{.RenderedContent}} + {{else}} + {{ctx.Locale.Tr "repo.issues.no_content"}} + {{end}} +
+
{{.Content}}
+
+ {{if .Attachments}} + {{template "repo/issue/view_content/attachments" dict "Attachments" .Attachments "RenderedContent" .RenderedContent}} + {{end}} +
+ {{$reactions := .Reactions.GroupByType}} + {{if $reactions}} + {{template "repo/issue/view_content/reactions" dict "ctxData" $.root "ActionURL" (printf "%s/comments/%d/reactions" $.root.RepoLink .ID) "Reactions" $reactions}} + {{end}} +
+
+{{end}} diff --git a/templates/repo/diff/compare.tmpl b/templates/repo/diff/compare.tmpl new file mode 100644 index 0000000..110f8ac --- /dev/null +++ b/templates/repo/diff/compare.tmpl @@ -0,0 +1,238 @@ +{{template "base/head" .}} +
+ {{template "repo/header" .}} + {{$showDiffBox := false}} +
+

+ {{if and $.PageIsComparePull $.IsSigned (not .Repository.IsArchived)}} + {{ctx.Locale.Tr "repo.pulls.compare_changes"}} +
{{ctx.Locale.Tr "repo.pulls.compare_changes_desc"}}
+ {{else}} + {{ctx.Locale.Tr "action.compare_commits_general"}} + {{end}} +

+ {{$BaseCompareName := $.BaseName -}} + {{- $HeadCompareName := $.HeadRepo.OwnerName -}} + {{- if and (eq $.BaseName $.HeadRepo.OwnerName) (ne $.Repository.Name $.HeadRepo.Name) -}} + {{- $HeadCompareName = printf "%s/%s" $.HeadRepo.OwnerName $.HeadRepo.Name -}} + {{- end -}} + {{- $OwnForkCompareName := "" -}} + {{- if .OwnForkRepo -}} + {{- $OwnForkCompareName = .OwnForkRepo.OwnerName -}} + {{- end -}} + {{- $RootRepoCompareName := "" -}} + {{- if .RootRepo -}} + {{- $RootRepoCompareName = .RootRepo.OwnerName -}} + {{- if eq $.HeadRepo.OwnerName .RootRepo.OwnerName -}} + {{- $HeadCompareName = printf "%s/%s" $.HeadRepo.OwnerName $.HeadRepo.Name -}} + {{- end -}} + {{- end -}} +
+ {{svg "octicon-git-compare"}} + + {{svg "octicon-arrow-left" 16}}
{{.CompareSeparator}}
+ +
+ + {{if .IsNothingToCompare}} + {{if and $.IsSigned $.AllowEmptyPr (not .Repository.IsArchived) .PageIsComparePull}} +
{{ctx.Locale.Tr "repo.pulls.nothing_to_compare_and_allow_empty_pr"}}
+
+ +
+
+ {{template "repo/issue/new_form" .}} +
+ {{else if and .HeadIsBranch .BaseIsBranch}} +
{{ctx.Locale.Tr "repo.pulls.nothing_to_compare"}}
+ {{else}} +
{{ctx.Locale.Tr "repo.pulls.nothing_to_compare_have_tag"}}
+ {{end}} + {{else if and .PageIsComparePull (gt .CommitCount 0)}} + {{if .HasPullRequest}} +
+
+ {{ctx.Locale.Tr "repo.pulls.has_pull_request" (print $.RepoLink "/pulls/" .PullRequest.Issue.Index) $.RepoRelPath .PullRequest.Index}} +

+ {{RenderIssueTitle $.Context .PullRequest.Issue.Title ($.Repository.ComposeMetas ctx)}} + #{{.PullRequest.Issue.Index}} +

+
+ +
+ {{else}} + {{if and $.IsSigned (not .Repository.IsArchived)}} +
+ +
+ {{else if .Repository.IsArchived}} +
+ {{if .Repository.ArchivedUnix.IsZero}} + {{ctx.Locale.Tr "repo.archive.title"}} + {{else}} + {{ctx.Locale.Tr "repo.archive.title_date" (DateTime "long" .Repository.ArchivedUnix)}} + {{end}} +
+ {{end}} + {{if $.IsSigned}} +
+ {{template "repo/issue/new_form" .}} +
+ {{end}} + {{$showDiffBox = true}} + {{end}} + {{else if not .IsNothingToCompare}} + {{$showDiffBox = true}} + {{end}} +
+ + {{if $showDiffBox}} +
+ {{template "repo/commits_table" .}} + {{template "repo/diff/box" .}} +
+ {{end}} +
+{{template "base/footer" .}} diff --git a/templates/repo/diff/conversation.tmpl b/templates/repo/diff/conversation.tmpl new file mode 100644 index 0000000..c80d999 --- /dev/null +++ b/templates/repo/diff/conversation.tmpl @@ -0,0 +1,66 @@ +{{$resolved := (index .comments 0).IsResolved}} +{{$invalid := (index .comments 0).Invalidated}} +{{$resolveDoer := (index .comments 0).ResolveDoer}} +{{$isNotPending := (not (eq (index .comments 0).Review.Type 0))}} +{{$referenceUrl := printf "%s#%s" $.Issue.Link (index .comments 0).HashTag}} +
+ {{if $resolved}} +
+
+ {{svg "octicon-check" 16 "icon tw-mr-1"}} + {{$resolveDoer.Name}} {{ctx.Locale.Tr "repo.issues.review.resolved_by"}} + {{if $invalid}} + + + {{ctx.Locale.Tr "repo.issues.review.outdated"}} + + {{end}} +
+
+ + +
+
+ {{end}} +
+
+ + {{template "repo/diff/comments" dict "root" $ "comments" .comments}} + +
+
+
+ + +
+ {{if and $.CanMarkConversation $isNotPending}} + + {{end}} + {{if and $.SignedUserID (not $.Repository.IsArchived)}} + + {{end}} +
+ {{template "repo/diff/comment_form_datahandler" dict "hidden" true "reply" (index .comments 0).ReviewID "root" $ "comment" (index .comments 0)}} +
+
diff --git a/templates/repo/diff/conversations.tmpl b/templates/repo/diff/conversations.tmpl new file mode 100644 index 0000000..5945337 --- /dev/null +++ b/templates/repo/diff/conversations.tmpl @@ -0,0 +1,3 @@ +{{range .conversations}} + {{template "repo/diff/conversation" dict "." $ "comments" .}} +{{end}} diff --git a/templates/repo/diff/csv_diff.tmpl b/templates/repo/diff/csv_diff.tmpl new file mode 100644 index 0000000..0f46da3 --- /dev/null +++ b/templates/repo/diff/csv_diff.tmpl @@ -0,0 +1,58 @@ + + + {{$result := call .root.CreateCsvDiff .file .blobBase .blobHead}} + {{if $result.Error}} +
{{$result.Error}}
+ {{else if $result.Sections}} + + {{range $i, $section := $result.Sections}} + + {{range $j, $row := $section.Rows}} + + {{if and (eq $i 0) (eq $j 0)}} + + {{range $j, $cell := $row.Cells}} + {{if not $cell}} + + {{else if eq $cell.Type 2}} + + {{else if eq $cell.Type 3}} + + {{else if eq $cell.Type 4}} + + {{else if eq $cell.Type 5}} + + {{else if eq $cell.Type 6}} + + {{else}} + + {{end}} + {{end}} + {{else}} + + {{range $j, $cell := $row.Cells}} + {{if not $cell}} + + {{else if eq $cell.Type 2}} + + {{else if eq $cell.Type 3}} + + {{else if eq $cell.Type 4}} + + {{else if eq $cell.Type 5}} + + {{else if eq $cell.Type 6}} + + {{else}} + + {{end}} + {{end}} + {{end}} + + {{end}} + + {{end}} +
{{.RowIdx}}{{.LeftCell}} {{.RightCell}}{{.RightCell}}{{.LeftCell}}{{.RightCell}}{{.LeftCell}} {{.RightCell}}{{.RightCell}}{{if .RowIdx}}{{.RowIdx}}{{end}}{{.LeftCell}} {{.RightCell}}{{.RightCell}}{{.LeftCell}}{{.RightCell}}{{.LeftCell}} {{.RightCell}}{{.RightCell}}
+ {{end}} + + diff --git a/templates/repo/diff/escape_title.tmpl b/templates/repo/diff/escape_title.tmpl new file mode 100644 index 0000000..e70f402 --- /dev/null +++ b/templates/repo/diff/escape_title.tmpl @@ -0,0 +1,2 @@ +{{if .diff.EscapeStatus.HasInvisible}}{{ctx.Locale.Tr "repo.invisible_runes_line"}} {{end}}{{/* +*/}}{{if .diff.EscapeStatus.HasAmbiguous}}{{ctx.Locale.Tr "repo.ambiguous_runes_line"}}{{end}} diff --git a/templates/repo/diff/image_diff.tmpl b/templates/repo/diff/image_diff.tmpl new file mode 100644 index 0000000..0612854 --- /dev/null +++ b/templates/repo/diff/image_diff.tmpl @@ -0,0 +1,83 @@ +{{if or .blobBase .blobHead}} + + +
+ + + +
+
+
+ {{if .blobBase}} + +

{{ctx.Locale.Tr "repo.diff.file_before"}}

+ +

+ + {{ctx.Locale.Tr "repo.diff.file_image_width"}}: +  |  + {{ctx.Locale.Tr "repo.diff.file_image_height"}}: +  |  + + {{ctx.Locale.Tr "repo.diff.file_byte_size"}}: {{ctx.Locale.TrSize .blobBase.Size}} +

+
+ {{end}} + {{if .blobHead}} + +

{{ctx.Locale.Tr "repo.diff.file_after"}}

+ +

+ + {{ctx.Locale.Tr "repo.diff.file_image_width"}}: +  |  + {{ctx.Locale.Tr "repo.diff.file_image_height"}}: +  |  + + {{ctx.Locale.Tr "repo.diff.file_byte_size"}}: {{ctx.Locale.TrSize .blobHead.Size}} +

+
+ {{end}} +
+
+ {{if and .blobBase .blobHead}} +
+
+
+ + + + + + + + +
+
+
+
+
+ +
+ + +
+
+
+ {{end}} +
+
+ + +{{end}} diff --git a/templates/repo/diff/new_comment.tmpl b/templates/repo/diff/new_comment.tmpl new file mode 100644 index 0000000..6a71539 --- /dev/null +++ b/templates/repo/diff/new_comment.tmpl @@ -0,0 +1,5 @@ +
+
+ {{template "repo/diff/comment_form_datahandler" .}} +
+
diff --git a/templates/repo/diff/new_review.tmpl b/templates/repo/diff/new_review.tmpl new file mode 100644 index 0000000..a2eae00 --- /dev/null +++ b/templates/repo/diff/new_review.tmpl @@ -0,0 +1,52 @@ +
+ + {{if $.IsShowingAllCommits}} +
+
+
+ {{.CsrfTokenHtml}} + +
+
{{ctx.Locale.Tr "repo.diff.review.header"}}
+ {{svg "octicon-x" 16}} +
+
+ {{template "shared/combomarkdowneditor" (dict + "MarkdownPreviewUrl" (print .Repository.Link "/markup") + "MarkdownPreviewContext" .RepoLink + "TextareaName" "content" + "TextareaPlaceholder" (ctx.Locale.Tr "repo.diff.review.placeholder") + "DropzoneParentContainer" "form" + )}} +
+ {{if .IsAttachmentEnabled}} +
+ {{template "repo/upload" .}} +
+ {{end}} +
+ {{$showSelfTooltip := (and $.IsSigned ($.Issue.IsPoster $.SignedUser.ID))}} + {{if $showSelfTooltip}} + + + + {{else}} + + {{end}} + + {{if $showSelfTooltip}} + + + + {{else}} + + {{end}} +
+
+
+ {{end}} +
diff --git a/templates/repo/diff/options_dropdown.tmpl b/templates/repo/diff/options_dropdown.tmpl new file mode 100644 index 0000000..09b7b80 --- /dev/null +++ b/templates/repo/diff/options_dropdown.tmpl @@ -0,0 +1,33 @@ + diff --git a/templates/repo/diff/section_code.tmpl b/templates/repo/diff/section_code.tmpl new file mode 100644 index 0000000..3e8303e --- /dev/null +++ b/templates/repo/diff/section_code.tmpl @@ -0,0 +1 @@ +{{.diff.Content}} diff --git a/templates/repo/diff/section_split.tmpl b/templates/repo/diff/section_split.tmpl new file mode 100644 index 0000000..50522d9 --- /dev/null +++ b/templates/repo/diff/section_split.tmpl @@ -0,0 +1,156 @@ +{{$file := .file}} +{{$blobExcerptRepoLink := or $.root.CommitRepoLink $.root.RepoLink}} + + + + + + + + + + +{{range $j, $section := $file.Sections}} + {{range $k, $line := $section.Lines}} + {{$hasmatch := ne $line.Match -1}} + {{if or (ne .GetType 2) (not $hasmatch)}} + + {{if eq .GetType 4}} + +
+ {{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 5)}} + + {{end}} + {{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 4)}} + + {{end}} + {{if eq $line.GetExpandDirection 2}} + + {{end}} +
+ {{$inlineDiff := $section.GetComputedInlineDiffFor $line ctx.Locale}} + {{if $inlineDiff.EscapeStatus.Escaped}}{{end}} + {{/* + */}}{{template "repo/diff/section_code" dict "diff" $inlineDiff}}{{/* + */}} + {{else if and (eq .GetType 3) $hasmatch}}{{/* DEL */}} + {{$match := index $section.Lines $line.Match}} + {{- $leftDiff := ""}}{{if $line.LeftIdx}}{{$leftDiff = $section.GetComputedInlineDiffFor $line ctx.Locale}}{{end}} + {{- $rightDiff := ""}}{{if $match.RightIdx}}{{$rightDiff = $section.GetComputedInlineDiffFor $match ctx.Locale}}{{end}} + + {{if $line.LeftIdx}}{{if $leftDiff.EscapeStatus.Escaped}}{{end}}{{end}} + + {{/* + */}}{{if and $.root.SignedUserID $.root.PageIsPullFiles}}{{/* + */}}{{/* + */}}{{end}}{{/* + */}}{{if $line.LeftIdx}}{{/* + */}}{{template "repo/diff/section_code" dict "diff" $leftDiff}}{{/* + */}}{{else}}{{/* + */}}{{/* + */}}{{end}}{{/* + */}} + + {{if $match.RightIdx}}{{if $rightDiff.EscapeStatus.Escaped}}{{end}}{{end}} + {{if $match.RightIdx}}{{end}} + {{/* + */}}{{if and $.root.SignedUserID $.root.PageIsPullFiles}}{{/* + */}}{{/* + */}}{{end}}{{/* + */}}{{if $match.RightIdx}}{{/* + */}}{{template "repo/diff/section_code" dict "diff" $rightDiff}}{{/* + */}}{{else}}{{/* + */}}{{/* + */}}{{end}}{{/* + */}} + {{else}} + {{$inlineDiff := $section.GetComputedInlineDiffFor $line ctx.Locale}} + + {{if $line.LeftIdx}}{{if $inlineDiff.EscapeStatus.Escaped}}{{end}}{{end}} + {{if $line.LeftIdx}}{{end}} + {{/* + */}}{{if and $.root.SignedUserID $.root.PageIsPullFiles (not (eq .GetType 2))}}{{/* + */}}{{/* + */}}{{end}}{{/* + */}}{{if $line.LeftIdx}}{{/* + */}}{{template "repo/diff/section_code" dict "diff" $inlineDiff}}{{/* + */}}{{else}}{{/* + */}}{{/* + */}}{{end}}{{/* + */}} + + {{if $line.RightIdx}}{{if $inlineDiff.EscapeStatus.Escaped}}{{end}}{{end}} + {{if $line.RightIdx}}{{end}} + {{/* + */}}{{if and $.root.SignedUserID $.root.PageIsPullFiles (not (eq .GetType 3))}}{{/* + */}}{{/* + */}}{{end}}{{/* + */}}{{if $line.RightIdx}}{{/* + */}}{{template "repo/diff/section_code" dict "diff" $inlineDiff}}{{/* + */}}{{else}}{{/* + */}}{{/* + */}}{{end}}{{/* + */}} + {{end}} + + {{if and (eq .GetType 3) $hasmatch}} + {{$match := index $section.Lines $line.Match}} + {{if or $line.Conversations $match.Conversations}} + + + {{if $line.Conversations}} + {{if eq $line.GetCommentSide "previous"}} + {{template "repo/diff/conversations" dict "." $.root "conversations" $line.Conversations}} + {{end}} + {{end}} + {{if $match.Conversations}} + {{if eq $match.GetCommentSide "previous"}} + {{template "repo/diff/conversations" dict "." $.root "conversations" $match.Conversations}} + {{end}} + {{end}} + + + {{if $line.Conversations}} + {{if eq $line.GetCommentSide "proposed"}} + {{template "repo/diff/conversations" dict "." $.root "conversations" $line.Conversations}} + {{end}} + {{end}} + {{if $match.Conversations}} + {{if eq $match.GetCommentSide "proposed"}} + {{template "repo/diff/conversations" dict "." $.root "conversations" $match.Conversations}} + {{end}} + {{end}} + + + {{end}} + {{else if $line.Conversations}} + + + {{if eq $line.GetCommentSide "previous"}} + {{template "repo/diff/conversations" dict "." $.root "conversations" $line.Conversations}} + {{end}} + + + {{if eq $line.GetCommentSide "proposed"}} + {{template "repo/diff/conversations" dict "." $.root "conversations" $line.Conversations}} + {{end}} + + + {{end}} + {{end}} + {{end}} +{{end}} diff --git a/templates/repo/diff/section_unified.tmpl b/templates/repo/diff/section_unified.tmpl new file mode 100644 index 0000000..ab78097 --- /dev/null +++ b/templates/repo/diff/section_unified.tmpl @@ -0,0 +1,72 @@ +{{$file := .file}} +{{$blobExcerptRepoLink := or $.root.CommitRepoLink $.root.RepoLink}} + + + + + + + +{{range $j, $section := $file.Sections}} + {{range $k, $line := $section.Lines}} + + {{if eq .GetType 4}} + {{if $.root.AfterCommitID}} + +
+ {{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 5)}} + + {{end}} + {{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 4)}} + + {{end}} + {{if eq $line.GetExpandDirection 2}} + + {{end}} +
+ + {{else}} + {{/* for code file preview page or comment diffs on pull comment pages, do not show the expansion arrows */}} + + {{end}} + {{else}} + + + {{end}} + {{$inlineDiff := $section.GetComputedInlineDiffFor $line ctx.Locale -}} + + {{- if $inlineDiff.EscapeStatus.Escaped -}} + + {{- end -}} + + + {{if eq .GetType 4}} + {{/* + */}}{{template "repo/diff/section_code" dict "diff" $inlineDiff}}{{/* + */}} + {{else}} + {{/* + */}}{{if and $.root.SignedUserID $.root.PageIsPullFiles}}{{/* + */}}{{/* + */}}{{end}}{{/* + */}}{{template "repo/diff/section_code" dict "diff" $inlineDiff}}{{/* + */}} + {{end}} + + {{if $line.Conversations}} + + + {{template "repo/diff/conversations" dict "." $.root "conversations" $line.Conversations}} + + + {{end}} + {{end}} +{{end}} diff --git a/templates/repo/diff/stats.tmpl b/templates/repo/diff/stats.tmpl new file mode 100644 index 0000000..d0dff1b --- /dev/null +++ b/templates/repo/diff/stats.tmpl @@ -0,0 +1,5 @@ +{{Eval .file.Addition "+" .file.Deletion}} + + {{/* if the denominator is zero, then the float result is "width: NaNpx", as before, it just works */}} +
+
diff --git a/templates/repo/diff/whitespace_dropdown.tmpl b/templates/repo/diff/whitespace_dropdown.tmpl new file mode 100644 index 0000000..c54de16 --- /dev/null +++ b/templates/repo/diff/whitespace_dropdown.tmpl @@ -0,0 +1,30 @@ + +{{if .IsSplitStyle}}{{svg "gitea-join"}}{{else}}{{svg "gitea-split"}}{{end}} diff --git a/templates/repo/editor/cherry_pick.tmpl b/templates/repo/editor/cherry_pick.tmpl new file mode 100644 index 0000000..f9c9eef --- /dev/null +++ b/templates/repo/editor/cherry_pick.tmpl @@ -0,0 +1,30 @@ +{{template "base/head" .}} +
+ {{template "repo/header" .}} +
+ {{template "base/alert" .}} +
+ {{.CsrfTokenHtml}} + + + +
+ +
+ {{template "repo/editor/commit_form" .}} +
+
+
+{{template "base/footer" .}} diff --git a/templates/repo/editor/commit_form.tmpl b/templates/repo/editor/commit_form.tmpl new file mode 100644 index 0000000..9f81b1d --- /dev/null +++ b/templates/repo/editor/commit_form.tmpl @@ -0,0 +1,82 @@ +
+ {{ctx.AvatarUtils.Avatar .SignedUser 48 "commit-avatar"}} +
+

{{- if .CanCommitToBranch.WillSign}} + {{svg "octicon-lock" 24}} + {{ctx.Locale.Tr "repo.editor.commit_signed_changes"}} + {{- else}} + {{svg "octicon-unlock" 24}} + {{ctx.Locale.Tr "repo.editor.commit_changes"}} + {{- end}}

+
+ +
+
+ +
+
+
+ + +
+
+
+
+
+ + +
+
+ {{if not .Repository.IsEmpty}} +
+
+ {{if .CanCreatePullRequest}} + + {{else}} + + {{end}} + +
+
+
+
+ {{svg "octicon-git-branch"}} + + +
+
+ {{end}} +
+
+ + +
+
+ + {{ctx.Locale.Tr "repo.editor.cancel"}} +
diff --git a/templates/repo/editor/delete.tmpl b/templates/repo/editor/delete.tmpl new file mode 100644 index 0000000..2c0c2fc --- /dev/null +++ b/templates/repo/editor/delete.tmpl @@ -0,0 +1,13 @@ +{{template "base/head" .}} +
+ {{template "repo/header" .}} +
+ {{template "base/alert" .}} +
+ {{.CsrfTokenHtml}} + + {{template "repo/editor/commit_form" .}} +
+
+
+{{template "base/footer" .}} diff --git a/templates/repo/editor/diff_preview.tmpl b/templates/repo/editor/diff_preview.tmpl new file mode 100644 index 0000000..e2e922b --- /dev/null +++ b/templates/repo/editor/diff_preview.tmpl @@ -0,0 +1,11 @@ +
+
+
+ + + {{template "repo/diff/section_unified" dict "file" .File "root" $}} + +
+
+
+
diff --git a/templates/repo/editor/edit.tmpl b/templates/repo/editor/edit.tmpl new file mode 100644 index 0000000..71cecf1 --- /dev/null +++ b/templates/repo/editor/edit.tmpl @@ -0,0 +1,74 @@ +{{template "base/head" .}} +
+ {{template "repo/header" .}} +
+ {{template "base/alert" .}} +
+ {{.CsrfTokenHtml}} + + +
+ +
+ + {{template "repo/editor/commit_form" .}} +
+
+ +
+{{template "base/footer" .}} diff --git a/templates/repo/editor/patch.tmpl b/templates/repo/editor/patch.tmpl new file mode 100644 index 0000000..1f046a8 --- /dev/null +++ b/templates/repo/editor/patch.tmpl @@ -0,0 +1,57 @@ +{{template "base/head" .}} +
+ {{template "repo/header" .}} +
+ {{template "base/alert" .}} +
+ {{.CsrfTokenHtml}} + + +
+ +
+ + {{template "repo/editor/commit_form" .}} +
+
+ + +
+{{template "base/footer" .}} diff --git a/templates/repo/editor/upload.tmpl b/templates/repo/editor/upload.tmpl new file mode 100644 index 0000000..5725020 --- /dev/null +++ b/templates/repo/editor/upload.tmpl @@ -0,0 +1,33 @@ +{{template "base/head" .}} +
+ {{template "repo/header" .}} +
+ {{template "base/alert" .}} +
+ {{.CsrfTokenHtml}} +
+ +
+
+ {{template "repo/upload" .}} +
+ {{template "repo/editor/commit_form" .}} +
+
+
+{{template "base/footer" .}} diff --git a/templates/repo/empty.tmpl b/templates/repo/empty.tmpl new file mode 100644 index 0000000..7613643 --- /dev/null +++ b/templates/repo/empty.tmpl @@ -0,0 +1,82 @@ +{{template "base/head" .}} +
+ {{template "repo/header" .}} +
+
+
+ {{template "base/alert" .}} + {{if .Repository.IsArchived}} +
+ {{if .Repository.ArchivedUnix.IsZero}} + {{ctx.Locale.Tr "repo.archive.title"}} + {{else}} + {{ctx.Locale.Tr "repo.archive.title_date" (DateTime "long" .Repository.ArchivedUnix)}} + {{end}} +
+ {{end}} + {{if .Repository.IsBroken}} +
+ {{ctx.Locale.Tr "repo.broken_message"}} +
+ {{else if .CanWriteCode}} +

+ {{ctx.Locale.Tr "repo.quick_guide"}} +

+
+
+

{{ctx.Locale.Tr "repo.clone_this_repo"}} {{ctx.Locale.Tr "repo.clone_helper" "http://git-scm.com/book/en/v2/Git-Basics-Getting-a-Git-Repository"}}

+ +
+ {{if and .CanWriteCode (not .Repository.IsArchived)}} + + {{ctx.Locale.Tr "repo.editor.new_file"}} + + {{if .RepositoryUploadEnabled}} + + {{ctx.Locale.Tr "repo.editor.upload_file"}} + + {{end}} + {{end}} +
+ {{template "repo/clone_buttons" .}} +
+
+
+ + {{if not .Repository.IsArchived}} +
+ +
+

{{ctx.Locale.Tr "repo.create_new_repo_command"}}

+
+
touch README.md
+git init
+{{if ne .Repository.DefaultBranch "master"}}git checkout -b {{.Repository.DefaultBranch}}{{end}}
+git add README.md
+git commit -m "first commit"
+git remote add origin {{$.CloneButtonOriginLink.HTTPS}}
+git push -u origin {{.Repository.DefaultBranch}}
+
+
+
+ +
+

{{ctx.Locale.Tr "repo.push_exist_repo"}}

+
+
git remote add origin {{$.CloneButtonOriginLink.HTTPS}}
+git push -u origin {{.Repository.DefaultBranch}}
+
+
+ {{end}} + {{else}} +
+ {{ctx.Locale.Tr "repo.empty_message"}} +
+ {{end}} + {{template "repo/clone_script" .}} +
+
+
+
+
+{{template "base/footer" .}} diff --git a/templates/repo/file_info.tmpl b/templates/repo/file_info.tmpl new file mode 100644 index 0000000..6ae7c15 --- /dev/null +++ b/templates/repo/file_info.tmpl @@ -0,0 +1,53 @@ +
+ {{if .FileIsSymlink}} +
+ {{ctx.Locale.Tr "repo.symbolic_link"}} +
+ {{end}} + {{if .NumLinesSet}}{{/* Explicit attribute needed to show 0 line changes */}} +
+ {{.NumLines}} {{ctx.Locale.TrN .NumLines "repo.line" "repo.lines"}} +
+ {{end}} + {{if .HasNoTrailingEOL}} +
+ {{ctx.Locale.Tr "repo.no_eol.text"}} +
+ {{end}} + {{if .FileSize}} +
+ {{ctx.Locale.TrSize .FileSize}}{{if .IsLFSFile}} ({{ctx.Locale.Tr "repo.stored_lfs"}}){{end}} +
+ {{end}} + {{if .LFSLock}} +
+ {{svg "octicon-lock" 16 "tw-mr-1"}} + {{.LFSLockOwner}} +
+ {{end}} + {{if .LexerName}} +
+ {{.LexerName}} +
+ {{end}} + {{if .IsExecutable}} +
+ {{ctx.Locale.Tr "repo.executable_file"}} +
+ {{end}} + {{if .IsVendored}} +
+ {{ctx.Locale.Tr "repo.vendored"}} +
+ {{end}} + {{if .IsGenerated}} +
+ {{ctx.Locale.Tr "repo.generated"}} +
+ {{end}} + {{if .ImageSize}} +
+ {{.ImageSize}} +
+ {{end}} +
diff --git a/templates/repo/find/files.tmpl b/templates/repo/find/files.tmpl new file mode 100644 index 0000000..548ce2f --- /dev/null +++ b/templates/repo/find/files.tmpl @@ -0,0 +1,21 @@ +{{template "base/head" .}} +
+ {{template "repo/header" .}} +
+
+ {{.RepoName}} + / +
+ +
+
+ + + +
+
+

{{ctx.Locale.Tr "repo.find_file.no_matching"}}

+
+
+
+{{template "base/footer" .}} diff --git a/templates/repo/flags.tmpl b/templates/repo/flags.tmpl new file mode 100644 index 0000000..620357b --- /dev/null +++ b/templates/repo/flags.tmpl @@ -0,0 +1,33 @@ +{{template "base/head" .}} +
+ {{template "repo/header" .}} +
+ {{template "base/alert" .}} +
+

+ {{ctx.Locale.Tr "repo.admin.manage_flags"}} +

+
+
+ {{.CsrfTokenHtml}} + {{ctx.Locale.Tr "repo.admin.enabled_flags"}} +
+ {{range $flag, $checked := .Flags}} +
+
+ + +
+
+ {{end}} +
+ +
+ +
+
+
+
+
+
+{{template "base/footer" .}} diff --git a/templates/repo/forks.tmpl b/templates/repo/forks.tmpl new file mode 100644 index 0000000..412c59b --- /dev/null +++ b/templates/repo/forks.tmpl @@ -0,0 +1,18 @@ +{{template "base/head" .}} +
+ {{template "repo/header" .}} +
+

+ {{ctx.Locale.Tr "repo.forks"}} +

+ {{range .Forks}} +
+ {{ctx.AvatarUtils.Avatar .Owner}} + {{.Owner.Name}} / {{.Name}} +
+ {{end}} +
+ + {{template "base/paginate" .}} +
+{{template "base/footer" .}} diff --git a/templates/repo/graph.tmpl b/templates/repo/graph.tmpl new file mode 100644 index 0000000..04b056c --- /dev/null +++ b/templates/repo/graph.tmpl @@ -0,0 +1,65 @@ +{{template "base/head" .}} +
+ {{template "repo/header" .}} +
+
+
+
+

{{ctx.Locale.Tr "repo.commit_graph"}}

+ +
+
+ + +
+
+
+
+ {{template "repo/graph/svgcontainer" .}} + {{template "repo/graph/commits" .}} +
+
+
+
+ +{{template "base/footer" .}} diff --git a/templates/repo/graph/commits.tmpl b/templates/repo/graph/commits.tmpl new file mode 100644 index 0000000..5c768f3 --- /dev/null +++ b/templates/repo/graph/commits.tmpl @@ -0,0 +1,79 @@ +
+ +
diff --git a/templates/repo/graph/div.tmpl b/templates/repo/graph/div.tmpl new file mode 100644 index 0000000..c0bd4e2 --- /dev/null +++ b/templates/repo/graph/div.tmpl @@ -0,0 +1,7 @@ +
+ {{template "repo/graph/svgcontainer" .}} + {{template "repo/graph/commits" .}} + +
diff --git a/templates/repo/graph/svgcontainer.tmpl b/templates/repo/graph/svgcontainer.tmpl new file mode 100644 index 0000000..99c3c87 --- /dev/null +++ b/templates/repo/graph/svgcontainer.tmpl @@ -0,0 +1,24 @@ +
+ + {{range $flowid, $flow := .Graph.Flows}} + + + {{range $flow.Commits}} + + {{end}} + + {{end}} + +
diff --git a/templates/repo/header.tmpl b/templates/repo/header.tmpl new file mode 100644 index 0000000..777453e --- /dev/null +++ b/templates/repo/header.tmpl @@ -0,0 +1,201 @@ +
+{{with .Repository}} +
+
+
+
+ {{template "repo/icon" .}} +
+ +
+ {{if .IsArchived}} + {{ctx.Locale.Tr "repo.desc.archived"}} +
{{svg "octicon-archive" 18}}
+ {{end}} + {{if .IsPrivate}} + {{ctx.Locale.Tr "repo.desc.private"}} +
{{svg "octicon-lock" 18}}
+ {{else}} + {{if .Owner.Visibility.IsPrivate}} + {{ctx.Locale.Tr "repo.desc.internal"}} +
{{svg "octicon-shield-lock" 18}}
+ {{end}} + {{end}} + {{if .IsTemplate}} + {{ctx.Locale.Tr "repo.desc.template"}} +
{{svg "octicon-repo-template" 18}}
+ {{end}} + {{if eq .ObjectFormatName "sha256"}} + {{ctx.Locale.Tr "repo.desc.sha256"}} + {{end}} +
+
+ {{if not (or .IsBeingCreated .IsBroken)}} +
+ {{if $.RepoTransfer}} +
+ {{$.CsrfTokenHtml}} +
+ +
+
+
+ {{$.CsrfTokenHtml}} +
+ +
+
+ {{end}} + {{if $.EnableFeed}} + {{/* An extra div-element is not necessary here, as this button does not secretly contain two buttons. */}} + + {{svg "octicon-rss" 16}} + + {{end}} + {{template "repo/watch_unwatch" $}} + {{if not $.DisableStars}} + {{template "repo/star_unstar" $}} + {{end}} + {{if not $.DisableForks}} + {{template "repo/header_fork" $}} + {{end}} +
+ {{end}} +
+ {{if $.PullMirror}} +
+ {{ctx.Locale.Tr "repo.mirror_from"}} + {{$.PullMirror.RemoteAddress}} + {{if $.PullMirror.UpdatedUnix}}{{ctx.Locale.Tr "repo.mirror_sync"}} {{TimeSinceUnix $.PullMirror.UpdatedUnix ctx.Locale}}{{end}} +
+ {{end}} + {{if .IsFork}}
{{ctx.Locale.Tr "repo.forked_from"}} {{.BaseRepo.FullName}}
{{end}} + {{if .IsGenerated}}
{{ctx.Locale.Tr "repo.generated_from"}} {{(.TemplateRepo ctx).FullName}}
{{end}} +
+{{end}} + + {{if not (or .Repository.IsBeingCreated .Repository.IsBroken)}} +
+ {{if .Permission.CanRead $.UnitTypeCode}} + + {{svg "octicon-code"}} {{ctx.Locale.Tr "repo.code"}} + + {{end}} + + {{if .Permission.CanRead $.UnitTypeIssues}} + + {{svg "octicon-issue-opened"}} {{ctx.Locale.Tr "repo.issues"}} + {{if .Repository.NumOpenIssues}} + {{CountFmt .Repository.NumOpenIssues}} + {{end}} + + {{end}} + + {{if .Permission.CanRead $.UnitTypeExternalTracker}} + + {{svg "octicon-link-external"}} {{ctx.Locale.Tr "repo.issues"}} + + {{end}} + + {{if and .Repository.CanEnablePulls (.Permission.CanRead $.UnitTypePullRequests)}} + + {{svg "octicon-git-pull-request"}} {{ctx.Locale.Tr "repo.pulls"}} + {{if .Repository.NumOpenPulls}} + {{CountFmt .Repository.NumOpenPulls}} + {{end}} + + {{end}} + + {{if and (not .UnitProjectsGlobalDisabled) (.Permission.CanRead $.UnitTypeProjects)}} + + {{svg "octicon-project"}} {{ctx.Locale.Tr "repo.project"}} + {{if .Repository.NumOpenProjects}} + {{CountFmt .Repository.NumOpenProjects}} + {{end}} + + {{end}} + + {{if and (.Permission.CanRead $.UnitTypeReleases) (not .IsEmptyRepo)}} + + {{svg "octicon-tag"}} {{ctx.Locale.Tr "repo.releases"}} + {{if .NumReleases}} + {{CountFmt .NumReleases}} + {{end}} + + {{end}} + + {{if .Permission.CanRead $.UnitTypePackages}} + + {{svg "octicon-package"}} {{ctx.Locale.Tr "packages.title"}} + {{if .NumPackages}} + {{CountFmt .NumPackages}} + {{end}} + + {{end}} + + {{if .Permission.CanRead $.UnitTypeWiki}} + + {{svg "octicon-book"}} {{ctx.Locale.Tr "repo.wiki"}} + + {{end}} + + {{if .Permission.CanRead $.UnitTypeExternalWiki}} + + {{svg "octicon-link-external"}} {{ctx.Locale.Tr "repo.wiki"}} + + {{end}} + + {{if and (.Permission.CanReadAny $.UnitTypeCode $.UnitTypePullRequests $.UnitTypeIssues $.UnitTypeReleases)}} + + {{svg "octicon-pulse"}} {{ctx.Locale.Tr "repo.activity"}} + + {{end}} + + {{if and .EnableActions (not .UnitActionsGlobalDisabled) (.Permission.CanRead $.UnitTypeActions)}} + + {{svg "octicon-play"}} {{ctx.Locale.Tr "actions.actions"}} + {{if .Repository.NumOpenActionRuns}} + {{CountFmt .Repository.NumOpenActionRuns}} + {{end}} + + {{end}} + + {{template "custom/extra_tabs" .}} + + {{if and RepoFlagsEnabled .SignedUser.IsAdmin}} + + {{svg "octicon-milestone"}} {{ctx.Locale.Tr "repo.admin.manage_flags"}} + + {{end}} + + {{if .Permission.IsAdmin}} + {{$highlightSettings := true}} + {{if and .SignedUser.EnableRepoUnitHints (not (.Repository.AllUnitsEnabled ctx))}} + {{$highlightSettings = false}} + + {{svg "octicon-plus"}} {{ctx.Locale.Tr "repo.settings.units.add_more"}} + + {{end}} + + {{svg "octicon-tools"}} {{ctx.Locale.Tr "repo.settings"}} + + {{end}} +
+ {{else if .Permission.IsAdmin}} + + {{end}} +
+
+
diff --git a/templates/repo/header_fork.tmpl b/templates/repo/header_fork.tmpl new file mode 100644 index 0000000..de83000 --- /dev/null +++ b/templates/repo/header_fork.tmpl @@ -0,0 +1,52 @@ +{{with .Repository}} +{{if and (not .IsEmpty) ($.Permission.CanRead $.UnitTypeCode)}} +
+ + {{svg "octicon-repo-forked"}}{{ctx.Locale.Tr "repo.fork"}} + + + + {{CountFmt .NumForks}} + +
+{{end}} +{{end}} diff --git a/templates/repo/home.tmpl b/templates/repo/home.tmpl new file mode 100644 index 0000000..f2a6179 --- /dev/null +++ b/templates/repo/home.tmpl @@ -0,0 +1,164 @@ +{{template "base/head" .}} +
+ {{template "repo/header" .}} +
+ {{template "base/alert" .}} + {{template "repo/code/recently_pushed_new_branches" .}} + {{if and (not .HideRepoInfo) (not .IsBlame)}} +
+
+ {{$description := .Repository.DescriptionHTML $.Context}} + {{if $description}}{{$description | RenderCodeBlock}}{{else}}{{ctx.Locale.Tr "repo.no_desc"}}{{end}} + {{if .Repository.Website}}{{.Repository.Website}}{{end}} +
+
+
+ + {{template "shared/search/button"}} +
+
+
+
+ {{/* it should match the code in issue-home.js */}} + {{range .Topics}}{{.Name}}{{end}} + {{if and .Permission.IsAdmin (not .Repository.IsArchived)}}{{end}} +
+ {{end}} + {{if and .Permission.IsAdmin (not .Repository.IsArchived)}} +
+ +
+ + +
+
+ {{end}} + + {{if RepoFlagsEnabled}} + {{template "custom/repo_flag_banners" .}} + {{if .SignedUser.IsAdmin}} + {{template "repo/admin_flags" .}} + {{end}} + {{end}} + + {{if .Repository.IsArchived}} +
+ {{if .Repository.ArchivedUnix.IsZero}} + {{ctx.Locale.Tr "repo.archive.title"}} + {{else}} + {{ctx.Locale.Tr "repo.archive.title_date" (DateTime "long" .Repository.ArchivedUnix)}} + {{end}} +
+ {{end}} + {{template "repo/sub_menu" .}} + {{$n := len .TreeNames}} + {{$l := Eval $n "-" 1}} + {{$isHomepage := (eq $n 0)}} +
+
+ {{template "repo/branch_dropdown" dict "root" . "ContainerClasses" "tw-mr-1"}} + {{if and .CanCompareOrPull .IsViewBranch (not .Repository.IsArchived)}} + {{$cmpBranch := ""}} + {{if ne .Repository.ID .BaseRepo.ID}} + {{$cmpBranch = printf "%s/%s:" (.Repository.OwnerName|PathEscape) (.Repository.Name|PathEscape)}} + {{end}} + {{$cmpBranch = print $cmpBranch (.BranchName|PathEscapeSegments)}} + {{$compareLink := printf "%s/compare/%s...%s" .BaseRepo.Link (.BaseRepo.DefaultBranch|PathEscapeSegments) $cmpBranch}} + + {{svg "octicon-git-pull-request"}} + + {{end}} + + {{if $isHomepage}} + {{ctx.Locale.Tr "repo.find_file.go_to_file"}} + {{end}} + + {{if and .CanWriteCode .IsViewBranch (not .Repository.IsMirror) (not .Repository.IsArchived) (not .IsViewFile)}} + + {{end}} + + {{if and $isHomepage (.Repository.IsTemplate)}} + + {{ctx.Locale.Tr "repo.use_template"}} + + {{end}} + {{if (not $isHomepage)}} + + {{StringUtils.EllipsisString .Repository.Name 30}} + {{- range $i, $v := .TreeNames -}} + / + {{- if eq $i $l -}} + {{$v}} + {{- else -}} + {{$p := index $.Paths $i}}{{$v}} + {{- end -}} + {{- end -}} + + {{end}} +
+
+ + {{if $isHomepage}} +
+ {{template "repo/clone_buttons" .}} + + {{template "repo/clone_script" .}}{{/* the script will update `.js-clone-url` and related elements */}} +
+ {{template "repo/cite/cite_modal" .}} + {{end}} + {{if and (not $isHomepage) (not .IsViewFile) (not .IsBlame)}}{{/* IsViewDirectory (not home), TODO: split the templates, avoid using "if" tricks */}} + + {{svg "octicon-history" 16 "tw-mr-2"}}{{ctx.Locale.Tr "repo.file_history"}} + + {{end}} +
+
+ {{if .IsViewFile}} + {{template "repo/view_file" .}} + {{else if .IsBlame}} + {{template "repo/blame" .}} + {{else}}{{/* IsViewDirectory */}} + {{template "repo/view_list" .}} + {{end}} +
+
+{{template "base/footer" .}} diff --git a/templates/repo/icon.tmpl b/templates/repo/icon.tmpl new file mode 100644 index 0000000..e5e0bd6 --- /dev/null +++ b/templates/repo/icon.tmpl @@ -0,0 +1,10 @@ +{{$avatarLink := (.RelAvatarLink ctx)}} +{{if $avatarLink}} + {{.FullName}} +{{else if $.IsMirror}} + {{svg "octicon-mirror" 24}} +{{else if $.IsFork}} + {{svg "octicon-repo-forked" 24}} +{{else}} + {{svg "octicon-repo" 24}} +{{end}} diff --git a/templates/repo/issue/card.tmpl b/templates/repo/issue/card.tmpl new file mode 100644 index 0000000..0b255d6 --- /dev/null +++ b/templates/repo/issue/card.tmpl @@ -0,0 +1,78 @@ +{{with .Issue}} + {{if eq $.Page.Project.CardType 1}}{{/* Images and Text*/}} + {{$attachments := index $.Page.issuesAttachmentMap .ID}} + {{if $attachments}} +
+ {{range $attachments}} + {{.Name}} + {{end}} +
+ {{end}} + {{end}} +
+
+
+ {{template "shared/issueicon" .}} +
+ {{RenderRefIssueTitle $.Context .Title}} + {{if and $.isPinnedIssueCard $.Page.IsRepoAdmin}} + + {{svg "octicon-x" 16}} + + {{end}} +
+
+ + {{if not $.Page.Repository}}{{.Repo.FullName}}{{end}}#{{.Index}} + {{$timeStr := TimeSinceUnix .GetLastEventTimestamp ctx.Locale}} + {{if .OriginalAuthor}} + {{ctx.Locale.Tr .GetLastEventLabelFake $timeStr .OriginalAuthor}} + {{else if gt .Poster.ID 0}} + {{ctx.Locale.Tr .GetLastEventLabel $timeStr .Poster.HomeLink .Poster.GetDisplayName}} + {{else}} + {{ctx.Locale.Tr .GetLastEventLabelFake $timeStr .Poster.GetDisplayName}} + {{end}} + +
+ {{if .MilestoneID}} + + {{end}} + {{if $.Page.LinkedPRs}} + {{range index $.Page.LinkedPRs .ID}} + + {{end}} + {{end}} + {{$tasks := .GetTasks}} + {{if gt $tasks 0}} +
+ {{svg "octicon-checklist" 16 "tw-mr-1 tw-align-middle"}} + {{.GetTasksDone}} / {{$tasks}} +
+ {{end}} +
+ + {{if or .Labels .Assignees}} +
+
+ {{range .Labels}} + {{RenderLabel ctx ctx.Locale .}} + {{end}} +
+
+ {{range .Assignees}} + {{ctx.AvatarUtils.Avatar . 28}} + {{end}} +
+
+ {{end}} +{{end}} diff --git a/templates/repo/issue/choose.tmpl b/templates/repo/issue/choose.tmpl new file mode 100644 index 0000000..38cf9e4 --- /dev/null +++ b/templates/repo/issue/choose.tmpl @@ -0,0 +1,59 @@ +{{template "base/head" .}} +
+ {{template "repo/header" .}} +
+ {{template "base/alert" .}} +
+ {{template "repo/issue/navbar" .}} +
+
+ {{range .IssueTemplates}} +
+
+
+ {{.Name}} +
{{.About}} +
+ +
+
+ {{end}} + {{range .IssueConfig.ContactLinks}} + + {{end}} + {{if .IssueConfig.BlankIssuesEnabled}} +
+
+
+ {{ctx.Locale.Tr "repo.issues.choose.blank"}} +
{{ctx.Locale.Tr "repo.issues.choose.blank_about"}} +
+ +
+
+ {{end}} + {{- if .IssueConfigError}}{{/* normal warning flash makes problems here*/}} +
+
+
{{ctx.Locale.Tr "repo.issues.choose.invalid_config"}}
+
{{.IssueConfigError}}
+
+
+ {{end}} +
+
+{{template "base/footer" .}} diff --git a/templates/repo/issue/comment_tab.tmpl b/templates/repo/issue/comment_tab.tmpl new file mode 100644 index 0000000..4197ea4 --- /dev/null +++ b/templates/repo/issue/comment_tab.tmpl @@ -0,0 +1,21 @@ +{{$textareaContent := .BodyQuery}} +{{if not $textareaContent}}{{$textareaContent = .IssueTemplate}}{{end}} +{{if not $textareaContent}}{{$textareaContent = .PullRequestTemplate}}{{end}} +{{if not $textareaContent}}{{$textareaContent = .content}}{{end}} + +
+ {{template "shared/combomarkdowneditor" (dict + "MarkdownPreviewUrl" (print .Repository.Link "/markup") + "MarkdownPreviewContext" .RepoLink + "TextareaName" "content" + "TextareaContent" $textareaContent + "TextareaPlaceholder" (ctx.Locale.Tr "repo.diff.comment.placeholder") + "DropzoneParentContainer" "form, .ui.form" + )}} +
+ +{{if .IsAttachmentEnabled}} +
+ {{template "repo/upload" .}} +
+{{end}} diff --git a/templates/repo/issue/fields/checkboxes.tmpl b/templates/repo/issue/fields/checkboxes.tmpl new file mode 100644 index 0000000..531f401 --- /dev/null +++ b/templates/repo/issue/fields/checkboxes.tmpl @@ -0,0 +1,14 @@ +
+ {{template "repo/issue/fields/header" .}} + {{range $i, $opt := .item.Attributes.options}} +
+
+ + +
+ {{if $opt.required}} + + {{end}} +
+ {{end}} +
diff --git a/templates/repo/issue/fields/dropdown.tmpl b/templates/repo/issue/fields/dropdown.tmpl new file mode 100644 index 0000000..26505f5 --- /dev/null +++ b/templates/repo/issue/fields/dropdown.tmpl @@ -0,0 +1,17 @@ +
+ {{template "repo/issue/fields/header" .}} + {{/* FIXME: required validation */}} + +
diff --git a/templates/repo/issue/fields/header.tmpl b/templates/repo/issue/fields/header.tmpl new file mode 100644 index 0000000..06c41af --- /dev/null +++ b/templates/repo/issue/fields/header.tmpl @@ -0,0 +1,6 @@ +{{if and (.item.Attributes.label) (not .item.Attributes.hide_label)}} +

{{.item.Attributes.label}}{{if .item.Validations.required}}{{end}}

+{{end}} +{{if .item.Attributes.description}} + {{RenderMarkdownToHtml .Context .item.Attributes.description}} +{{end}} diff --git a/templates/repo/issue/fields/input.tmpl b/templates/repo/issue/fields/input.tmpl new file mode 100644 index 0000000..039f9a9 --- /dev/null +++ b/templates/repo/issue/fields/input.tmpl @@ -0,0 +1,4 @@ +
+ {{template "repo/issue/fields/header" .}} + +
diff --git a/templates/repo/issue/fields/markdown.tmpl b/templates/repo/issue/fields/markdown.tmpl new file mode 100644 index 0000000..934699e --- /dev/null +++ b/templates/repo/issue/fields/markdown.tmpl @@ -0,0 +1,3 @@ +
+
{{RenderMarkdownToHtml .Context .item.Attributes.value}}
+
diff --git a/templates/repo/issue/fields/textarea.tmpl b/templates/repo/issue/fields/textarea.tmpl new file mode 100644 index 0000000..3ad69e1 --- /dev/null +++ b/templates/repo/issue/fields/textarea.tmpl @@ -0,0 +1,24 @@ +{{$useMarkdownEditor := not .item.Attributes.render}} +
+ {{template "repo/issue/fields/header" .}} + + {{/* the real form element to provide the value */}} + + + {{if $useMarkdownEditor}} + {{template "shared/combomarkdowneditor" (dict + "ContainerClasses" "tw-hidden" + "MarkdownPreviewUrl" (print .root.RepoLink "/markup") + "MarkdownPreviewContext" .root.RepoLink + "TextareaContent" .item.Attributes.value + "TextareaPlaceholder" .item.Attributes.placeholder + "DropzoneParentContainer" ".combo-editor-dropzone" + )}} + + {{if .root.IsAttachmentEnabled}} +
+ {{template "repo/upload" .root}} +
+ {{end}} + {{end}} +
diff --git a/templates/repo/issue/filter_actions.tmpl b/templates/repo/issue/filter_actions.tmpl new file mode 100644 index 0000000..58b1ef8 --- /dev/null +++ b/templates/repo/issue/filter_actions.tmpl @@ -0,0 +1,128 @@ + + diff --git a/templates/repo/issue/filter_list.tmpl b/templates/repo/issue/filter_list.tmpl new file mode 100644 index 0000000..09f87b5 --- /dev/null +++ b/templates/repo/issue/filter_list.tmpl @@ -0,0 +1,158 @@ + +{{template "shared/label_filter" .}} + +{{if not .Milestone}} + + +{{end}} + + + + + + + + + + +{{if .IsSigned}} + + +{{end}} + + + diff --git a/templates/repo/issue/filters.tmpl b/templates/repo/issue/filters.tmpl new file mode 100644 index 0000000..06e7c1a --- /dev/null +++ b/templates/repo/issue/filters.tmpl @@ -0,0 +1,26 @@ +
+
+ {{if and $.CanWriteIssuesOrPulls .Issues}} + + {{end}} + {{template "repo/issue/openclose" .}} + + {{if .TotalTrackedTime}} + + {{end}} +
+
+ +
+
diff --git a/templates/repo/issue/label_precolors.tmpl b/templates/repo/issue/label_precolors.tmpl new file mode 100644 index 0000000..8000766 --- /dev/null +++ b/templates/repo/issue/label_precolors.tmpl @@ -0,0 +1,22 @@ +
+
+ + + + + + + + +
+
+ + + + + + + + +
+
diff --git a/templates/repo/issue/labels.tmpl b/templates/repo/issue/labels.tmpl new file mode 100644 index 0000000..230777e --- /dev/null +++ b/templates/repo/issue/labels.tmpl @@ -0,0 +1,22 @@ +{{template "base/head" .}} +
+ {{template "repo/header" .}} +
+
+ {{template "repo/issue/navbar" .}} + {{if and (or .CanWriteIssues .CanWritePulls) (not .Repository.IsArchived)}} + + {{end}} +
+ {{if and (or .CanWriteIssues .CanWritePulls) (not .Repository.IsArchived)}} + {{template "repo/issue/labels/label_new" .}} + {{end}} + {{template "base/alert" .}} + {{template "repo/issue/labels/label_list" .}} +
+
+ +{{if and (or .CanWriteIssues .CanWritePulls) (not .Repository.IsArchived)}} + {{template "repo/issue/labels/edit_delete_label" .}} +{{end}} +{{template "base/footer" .}} diff --git a/templates/repo/issue/labels/edit_delete_label.tmpl b/templates/repo/issue/labels/edit_delete_label.tmpl new file mode 100644 index 0000000..fcf6921 --- /dev/null +++ b/templates/repo/issue/labels/edit_delete_label.tmpl @@ -0,0 +1,72 @@ + + + diff --git a/templates/repo/issue/labels/label.tmpl b/templates/repo/issue/labels/label.tmpl new file mode 100644 index 0000000..7844362 --- /dev/null +++ b/templates/repo/issue/labels/label.tmpl @@ -0,0 +1,8 @@ + + {{- RenderLabel $.Context ctx.Locale .label -}} + diff --git a/templates/repo/issue/labels/label_archived.tmpl b/templates/repo/issue/labels/label_archived.tmpl new file mode 100644 index 0000000..feaf77e --- /dev/null +++ b/templates/repo/issue/labels/label_archived.tmpl @@ -0,0 +1,5 @@ +{{if .IsArchived}} + + {{ctx.Locale.Tr "archived"}} + +{{end}} diff --git a/templates/repo/issue/labels/label_list.tmpl b/templates/repo/issue/labels/label_list.tmpl new file mode 100644 index 0000000..8d7fc2c --- /dev/null +++ b/templates/repo/issue/labels/label_list.tmpl @@ -0,0 +1,88 @@ +

+ {{ctx.Locale.Tr "repo.issues.label_count" .NumLabels}} + +

+ +
+ {{if and (not $.PageIsOrgSettingsLabels) (or $.CanWriteIssues $.CanWritePulls) (eq .NumLabels 0) (not $.Repository.IsArchived)}} + {{template "repo/issue/labels/label_load_template" .}} +
+ {{else if and ($.PageIsOrgSettingsLabels) (eq .NumLabels 0)}} + {{template "repo/issue/labels/label_load_template" .}} +
+ {{end}} + + +
diff --git a/templates/repo/issue/labels/label_load_template.tmpl b/templates/repo/issue/labels/label_load_template.tmpl new file mode 100644 index 0000000..0249430 --- /dev/null +++ b/templates/repo/issue/labels/label_load_template.tmpl @@ -0,0 +1,24 @@ +
+
+
+

{{ctx.Locale.Tr "repo.issues.label_templates.info"}}

+
+
+ {{.CsrfTokenHtml}} +
+ +
+ +
+
+
+
diff --git a/templates/repo/issue/labels/label_new.tmpl b/templates/repo/issue/labels/label_new.tmpl new file mode 100644 index 0000000..32fd8e7 --- /dev/null +++ b/templates/repo/issue/labels/label_new.tmpl @@ -0,0 +1,48 @@ + diff --git a/templates/repo/issue/labels/labels_selector_field.tmpl b/templates/repo/issue/labels/labels_selector_field.tmpl new file mode 100644 index 0000000..9e54e7a --- /dev/null +++ b/templates/repo/issue/labels/labels_selector_field.tmpl @@ -0,0 +1,46 @@ + diff --git a/templates/repo/issue/labels/labels_sidebar.tmpl b/templates/repo/issue/labels/labels_sidebar.tmpl new file mode 100644 index 0000000..81fc970 --- /dev/null +++ b/templates/repo/issue/labels/labels_sidebar.tmpl @@ -0,0 +1,11 @@ +
+ {{ctx.Locale.Tr "repo.issues.new.no_label"}} + + {{range .root.Labels}} + {{template "repo/issue/labels/label" dict "root" $.root "label" .}} + {{end}} + {{range .root.OrgLabels}} + {{template "repo/issue/labels/label" dict "root" $.root "label" .}} + {{end}} + +
diff --git a/templates/repo/issue/list.tmpl b/templates/repo/issue/list.tmpl new file mode 100644 index 0000000..8c81bf0 --- /dev/null +++ b/templates/repo/issue/list.tmpl @@ -0,0 +1,55 @@ +{{template "base/head" .}} +
+ {{template "repo/header" .}} +
+ {{template "base/alert" .}} + + {{if .PinnedIssues}} +
+ {{range .PinnedIssues}} +
+ {{template "repo/issue/card" (dict "Issue" . "Page" $ "isPinnedIssueCard" true)}} +
+ {{end}} +
+ {{end}} + +
+ {{template "repo/issue/navbar" .}} + {{template "repo/issue/search" .}} + {{if not .Repository.IsArchived}} + {{if .PageIsIssueList}} + {{ctx.Locale.Tr "repo.issues.new"}} + {{else}} + {{ctx.Locale.Tr "repo.pulls.new"}} + {{end}} + {{else}} + {{if not .PageIsIssueList}} + {{ctx.Locale.Tr "action.compare_commits_general"}} + {{end}} + {{end}} +
+ + {{template "repo/issue/filters" .}} + +
+
+ {{template "repo/issue/openclose" .}} + + {{if .TotalTrackedTime}} + + {{end}} +
+
+ {{template "repo/issue/filter_actions" .}} +
+
+ {{template "shared/issuelist" dict "." . "listType" "repo"}} +
+
+{{template "base/footer" .}} diff --git a/templates/repo/issue/milestone/filter_list.tmpl b/templates/repo/issue/milestone/filter_list.tmpl new file mode 100644 index 0000000..cc45d3b --- /dev/null +++ b/templates/repo/issue/milestone/filter_list.tmpl @@ -0,0 +1,16 @@ + + diff --git a/templates/repo/issue/milestone/select_menu.tmpl b/templates/repo/issue/milestone/select_menu.tmpl new file mode 100644 index 0000000..570acc2 --- /dev/null +++ b/templates/repo/issue/milestone/select_menu.tmpl @@ -0,0 +1,39 @@ +{{$useHTMX := not .NewIssuePage}} +{{if or .OpenMilestones .ClosedMilestones}} + +
+{{end}} +
{{ctx.Locale.Tr "repo.issues.new.clear_milestone"}}
+{{if and (not .OpenMilestones) (not .ClosedMilestones)}} +
+ {{ctx.Locale.Tr "repo.issues.new.no_items"}} +
+{{else}} + {{if .OpenMilestones}} +
+
+ {{ctx.Locale.Tr "repo.issues.new.open_milestone"}} +
+ {{range .OpenMilestones}} + + {{svg "octicon-milestone" 16 "tw-mr-1"}} + {{.Name}} + + {{end}} + {{end}} + {{if .ClosedMilestones}} +
+
+ {{ctx.Locale.Tr "repo.issues.new.closed_milestone"}} +
+ {{range .ClosedMilestones}} + + {{svg "octicon-milestone" 16 "tw-mr-1"}} + {{.Name}} + + {{end}} + {{end}} +{{end}} diff --git a/templates/repo/issue/milestone_issues.tmpl b/templates/repo/issue/milestone_issues.tmpl new file mode 100644 index 0000000..e5dc8cb --- /dev/null +++ b/templates/repo/issue/milestone_issues.tmpl @@ -0,0 +1,65 @@ +{{template "base/head" .}} +
+ {{template "repo/header" .}} +
+ {{template "base/alert" .}} +
+

{{.Milestone.Name}}

+ {{if not .Repository.IsArchived}} +
+ {{if or .CanWriteIssues .CanWritePulls}} + {{if .Milestone.IsClosed}} + {{ctx.Locale.Tr "repo.milestones.open"}} + + {{else}} + {{ctx.Locale.Tr "repo.milestones.close"}} + + {{end}} + {{ctx.Locale.Tr "repo.milestones.edit"}} + {{end}} + {{ctx.Locale.Tr "repo.issues.new"}} +
+ {{end}} +
+ {{if .Milestone.RenderedContent}} +
+ {{.Milestone.RenderedContent}} +
+ {{end}} +
+ +
+
+ {{$closedDate:= TimeSinceUnix .Milestone.ClosedDateUnix ctx.Locale}} + {{if .IsClosed}} + {{svg "octicon-clock"}} {{ctx.Locale.Tr "repo.milestones.closed" $closedDate}} + {{else}} + + {{if .Milestone.DeadlineString}} + + {{svg "octicon-calendar"}} + {{DateTime "short" .Milestone.DeadlineString}} + + {{else}} + {{svg "octicon-calendar"}} + {{ctx.Locale.Tr "repo.milestones.no_due_date"}} + {{end}} + {{end}} +
+
{{ctx.Locale.Tr "repo.milestones.completeness" .Milestone.Completeness}}
+ {{if .TotalTrackedTime}} +
+ {{svg "octicon-clock"}} + {{.TotalTrackedTime | Sec2Time}} +
+ {{end}} +
+
+
+ + {{template "repo/issue/filters" .}} + + {{template "shared/issuelist" dict "." . "listType" "milestone"}} +
+
+{{template "base/footer" .}} diff --git a/templates/repo/issue/milestone_new.tmpl b/templates/repo/issue/milestone_new.tmpl new file mode 100644 index 0000000..9f32df0 --- /dev/null +++ b/templates/repo/issue/milestone_new.tmpl @@ -0,0 +1,59 @@ +{{template "base/head" .}} +
+ {{template "repo/header" .}} +
+
+ {{template "repo/issue/navbar" .}} + {{if and (or .CanWriteIssues .CanWritePulls) .PageIsEditMilestone}} + + {{end}} +
+
+

+ {{if .PageIsEditMilestone}} + {{ctx.Locale.Tr "repo.milestones.edit"}} +
{{ctx.Locale.Tr "repo.milestones.edit_subheader"}}
+ {{else}} + {{ctx.Locale.Tr "repo.milestones.new"}} +
{{ctx.Locale.Tr "repo.milestones.new_subheader"}}
+ {{end}} +

+ {{template "base/alert" .}} +
+ {{.CsrfTokenHtml}} +
+ + +
+
+ + +
+
+ + +
+
+
+ {{if .PageIsEditMilestone}} + + {{ctx.Locale.Tr "repo.milestones.cancel"}} + + + {{else}} + + {{end}} +
+
+
+
+{{template "base/footer" .}} diff --git a/templates/repo/issue/milestones.tmpl b/templates/repo/issue/milestones.tmpl new file mode 100644 index 0000000..63a6f6b --- /dev/null +++ b/templates/repo/issue/milestones.tmpl @@ -0,0 +1,110 @@ +{{template "base/head" .}} +
+ {{template "repo/header" .}} +
+ {{template "base/alert" .}} + +
+ {{template "repo/issue/navbar" .}} + {{template "repo/issue/search" .}} + {{if and (or .CanWriteIssues .CanWritePulls) (not .Repository.IsArchived)}} + + {{end}} +
+ + {{template "repo/issue/filters" .}} + + +
+ {{range .Milestones}} +
  • +
    +

    + {{svg "octicon-milestone" 16}} + {{.Name}} +

    +
    + {{.Completeness}}% + +
    +
    +
    +
    +
    + {{svg "octicon-issue-opened" 14}} + {{ctx.Locale.PrettyNumber .NumOpenIssues}} {{ctx.Locale.Tr "repo.issues.open_title"}} +
    +
    + {{svg "octicon-check" 14}} + {{ctx.Locale.PrettyNumber .NumClosedIssues}} {{ctx.Locale.Tr "repo.issues.closed_title"}} +
    + {{if .TotalTrackedTime}} +
    + {{svg "octicon-clock"}} + {{.TotalTrackedTime|Sec2Time}} +
    + {{end}} + {{if .UpdatedUnix}} +
    + {{svg "octicon-clock"}} + {{ctx.Locale.Tr "repo.milestones.update_ago" (TimeSinceUnix .UpdatedUnix ctx.Locale)}} +
    + {{end}} +
    + {{if .IsClosed}} + {{$closedDate:= TimeSinceUnix .ClosedDateUnix ctx.Locale}} + {{svg "octicon-clock" 14}} + {{ctx.Locale.Tr "repo.milestones.closed" $closedDate}} + {{else}} + {{if .DeadlineString}} + + {{svg "octicon-calendar" 14}} + {{DateTime "short" .DeadlineString}} + + {{else}} + {{svg "octicon-calendar" 14}} + {{ctx.Locale.Tr "repo.milestones.no_due_date"}} + {{end}} + {{end}} +
    +
    + {{if and (or $.CanWriteIssues $.CanWritePulls) (not $.Repository.IsArchived)}} + + {{end}} +
    + {{if .Content}} +
    + {{.RenderedContent}} +
    + {{end}} +
  • + {{end}} + + {{template "base/paginate" .}} +
    +
    +
    + +{{if or .CanWriteIssues .CanWritePulls}} + +{{end}} +{{template "base/footer" .}} diff --git a/templates/repo/issue/navbar.tmpl b/templates/repo/issue/navbar.tmpl new file mode 100644 index 0000000..30e42c7 --- /dev/null +++ b/templates/repo/issue/navbar.tmpl @@ -0,0 +1,4 @@ + diff --git a/templates/repo/issue/new.tmpl b/templates/repo/issue/new.tmpl new file mode 100644 index 0000000..ccd45fd --- /dev/null +++ b/templates/repo/issue/new.tmpl @@ -0,0 +1,8 @@ +{{template "base/head" .}} +
    + {{template "repo/header" .}} +
    + {{template "repo/issue/new_form" .}} +
    +
    +{{template "base/footer" .}} diff --git a/templates/repo/issue/new_form.tmpl b/templates/repo/issue/new_form.tmpl new file mode 100644 index 0000000..c2cf4ee --- /dev/null +++ b/templates/repo/issue/new_form.tmpl @@ -0,0 +1,155 @@ +{{if .Flash}} +{{template "base/alert" .}} +{{end}} +
    + {{.CsrfTokenHtml}} +
    +
    +
    + {{ctx.AvatarUtils.Avatar .SignedUser 40}} +
    +
    + + {{if .PageIsComparePull}} +
    {{ctx.Locale.Tr "repo.pulls.title_wip_desc" (index .PullRequestWorkInProgressPrefixes 0)}}
    + {{end}} +
    + {{if .Fields}} + + {{range .Fields}} + {{if eq .Type "input"}} + {{template "repo/issue/fields/input" dict "Context" $.Context "item" .}} + {{else if eq .Type "markdown"}} + {{template "repo/issue/fields/markdown" dict "Context" $.Context "item" .}} + {{else if eq .Type "textarea"}} + {{template "repo/issue/fields/textarea" dict "Context" $.Context "item" . "root" $}} + {{else if eq .Type "dropdown"}} + {{template "repo/issue/fields/dropdown" dict "Context" $.Context "item" .}} + {{else if eq .Type "checkboxes"}} + {{template "repo/issue/fields/checkboxes" dict "Context" $.Context "item" .}} + {{end}} + {{end}} + {{else}} + {{template "repo/issue/comment_tab" .}} + {{end}} +
    + +
    +
    +
    +
    +
    + +
    + {{template "repo/issue/view_content/sidebar/branch_selector_field" .}} + + + {{template "repo/issue/labels/labels_selector_field" .}} + {{template "repo/issue/labels/labels_sidebar" dict "root" $}} + +
    + + + +
    + {{ctx.Locale.Tr "repo.issues.new.no_milestone"}} + +
    + + {{if .IsProjectsEnabled}} +
    + + + +
    + {{ctx.Locale.Tr "repo.issues.new.no_projects"}} + +
    + {{end}} +
    + {{template "repo/issue/view_content/sidebar/assignees" dict "isExistingIssue" false "." .}} + {{if and .PageIsComparePull (not (eq .HeadRepo.FullName .BaseCompareRepo.FullName)) .CanWriteToHeadRepo}} +
    +
    +
    + + +
    +
    + {{end}} +
    + +
    diff --git a/templates/repo/issue/openclose.tmpl b/templates/repo/issue/openclose.tmpl new file mode 100644 index 0000000..eb2d6e0 --- /dev/null +++ b/templates/repo/issue/openclose.tmpl @@ -0,0 +1,16 @@ + diff --git a/templates/repo/issue/search.tmpl b/templates/repo/issue/search.tmpl new file mode 100644 index 0000000..f1c0ea3 --- /dev/null +++ b/templates/repo/issue/search.tmpl @@ -0,0 +1,20 @@ + diff --git a/templates/repo/issue/view.tmpl b/templates/repo/issue/view.tmpl new file mode 100644 index 0000000..1ef9e73 --- /dev/null +++ b/templates/repo/issue/view.tmpl @@ -0,0 +1,12 @@ +{{template "base/head" .}} +
    + {{template "repo/header" .}} +
    + {{template "repo/issue/view_title" .}} + {{if .Issue.IsPull}} + {{template "repo/pulls/tab_menu" .}} + {{end}} + {{template "repo/issue/view_content" .}} +
    +
    +{{template "base/footer" .}} diff --git a/templates/repo/issue/view_content.tmpl b/templates/repo/issue/view_content.tmpl new file mode 100644 index 0000000..683dea8 --- /dev/null +++ b/templates/repo/issue/view_content.tmpl @@ -0,0 +1,188 @@ +
    + + + + + + + + {{$createdStr:= TimeSinceUnix .Issue.CreatedUnix ctx.Locale}} +
    +
    +
    + {{if .Issue.OriginalAuthor}} + + {{ctx.AvatarUtils.Avatar nil 40}} + + {{else}} + + {{ctx.AvatarUtils.Avatar .Issue.Poster 40}} + + {{end}} +
    +
    +
    + {{if .Issue.OriginalAuthor}} + + {{svg (MigrationIcon .Repository.GetOriginalURLHostname)}} + {{.Issue.OriginalAuthor}} + + + {{ctx.Locale.Tr "repo.issues.commented_at" .Issue.HashTag $createdStr}} + + + {{if .Repository.OriginalURL}} ({{ctx.Locale.Tr "repo.migrated_from" .Repository.OriginalURL .Repository.GetOriginalURLHostname}}){{end}} + + {{else}} + + {{ctx.AvatarUtils.Avatar .Issue.Poster 24}} + + + {{template "shared/user/authorlink" .Issue.Poster}} + {{ctx.Locale.Tr "repo.issues.commented_at" .Issue.HashTag $createdStr}} + + {{end}} +
    +
    + {{template "repo/issue/view_content/show_role" dict "ShowRole" .Issue.ShowRole "IgnorePoster" true "IsPull" .Issue.IsPull}} + {{if not $.Repository.IsArchived}} + {{template "repo/issue/view_content/add_reaction" dict "ctxData" $ "ActionURL" (printf "%s/issues/%d/reactions" $.RepoLink .Issue.Index)}} + {{end}} + {{template "repo/issue/view_content/context_menu" dict "ctxData" $ "item" .Issue "delete" false "issue" true "diff" false "IsCommentPoster" $.IsIssuePoster}} +
    +
    +
    +
    + {{if .Issue.RenderedContent}} + {{.Issue.RenderedContent}} + {{else}} + {{ctx.Locale.Tr "repo.issues.no_content"}} + {{end}} +
    +
    {{.Issue.Content}}
    +
    + {{if .Issue.Attachments}} + {{template "repo/issue/view_content/attachments" dict "Attachments" .Issue.Attachments "RenderedContent" .Issue.RenderedContent}} + {{end}} +
    + {{$reactions := .Issue.Reactions.GroupByType}} + {{if $reactions}} + {{template "repo/issue/view_content/reactions" dict "ctxData" $ "ActionURL" (printf "%s/issues/%d/reactions" $.RepoLink .Issue.Index) "Reactions" $reactions}} + {{end}} +
    +
    + + {{template "repo/issue/view_content/comments" .}} +
    + + {{if and .Issue.IsPull (not $.Repository.IsArchived)}} + {{template "repo/issue/view_content/pull".}} + {{end}} + + {{if .IsSigned}} + {{if and (or .IsRepoAdmin .HasIssuesOrPullsWritePermission (not .Issue.IsLocked)) (not .Repository.IsArchived)}} +
    + + {{ctx.AvatarUtils.Avatar .SignedUser 40}} + +
    +
    + {{template "repo/issue/comment_tab" .}} + {{.CsrfTokenHtml}} + +
    +
    +
    + {{else if .Repository.IsArchived}} +
    + {{if .Issue.IsPull}} + {{ctx.Locale.Tr "repo.archive.pull.nocomment"}} + {{else}} + {{ctx.Locale.Tr "repo.archive.issue.nocomment"}} + {{end}} +
    + {{end}} + {{else}} {{/* not .IsSigned */}} + {{if .Repository.IsArchived}} +
    + {{if .Issue.IsPull}} + {{ctx.Locale.Tr "repo.archive.pull.nocomment"}} + {{else}} + {{ctx.Locale.Tr "repo.archive.issue.nocomment"}} + {{end}} +
    + {{else}} +
    + {{ctx.Locale.Tr "repo.issues.sign_in_require_desc" .SignInLink}} +
    + {{end}} + {{end}}{{/* end if: .IsSigned */}} +
    +
    + + {{template "repo/issue/view_content/sidebar" .}} +
    + + + +{{template "repo/issue/view_content/reference_issue_dialog" .}} + +
    + {{ctx.Locale.Tr "repo.issues.no_content"}} +
    + + diff --git a/templates/repo/issue/view_content/add_reaction.tmpl b/templates/repo/issue/view_content/add_reaction.tmpl new file mode 100644 index 0000000..37931f2 --- /dev/null +++ b/templates/repo/issue/view_content/add_reaction.tmpl @@ -0,0 +1,12 @@ +{{if .ctxData.IsSigned}} + +{{end}} diff --git a/templates/repo/issue/view_content/attachments.tmpl b/templates/repo/issue/view_content/attachments.tmpl new file mode 100644 index 0000000..79085df --- /dev/null +++ b/templates/repo/issue/view_content/attachments.tmpl @@ -0,0 +1,42 @@ +
    + {{if .Attachments}} +
    + {{end}} + {{$hasThumbnails := false}} + {{- range .Attachments -}} + + {{end -}} + + {{if $hasThumbnails}} +
    +
    + {{- range .Attachments -}} + {{if FilenameIsImage .Name}} + {{if not (StringUtils.Contains (StringUtils.ToString $.RenderedContent) .UUID)}} + + {{.Name}} + + {{end}} + {{end}} + {{end -}} +
    + {{end}} + +
    diff --git a/templates/repo/issue/view_content/comments.tmpl b/templates/repo/issue/view_content/comments.tmpl new file mode 100644 index 0000000..08c83c0 --- /dev/null +++ b/templates/repo/issue/view_content/comments.tmpl @@ -0,0 +1,691 @@ +{{template "base/alert"}} +{{range .Issue.Comments}} + {{if call $.ShouldShowCommentType .Type}} + {{$createdStr:= TimeSinceUnix .CreatedUnix ctx.Locale}} + + + {{if eq .Type 0}} +
    + {{if .OriginalAuthor}} + + {{ctx.AvatarUtils.Avatar nil 40}} + + {{else}} + + {{ctx.AvatarUtils.Avatar .Poster 40}} + + {{end}} +
    +
    +
    + {{if .OriginalAuthor}} + + {{svg (MigrationIcon $.Repository.GetOriginalURLHostname)}} + {{.OriginalAuthor}} + + + {{ctx.Locale.Tr "repo.issues.commented_at" .HashTag $createdStr}} {{if $.Repository.OriginalURL}} + + + ({{ctx.Locale.Tr "repo.migrated_from" $.Repository.OriginalURL $.Repository.GetOriginalURLHostname}}){{end}} + + {{else}} + {{if gt .Poster.ID 0}} + + {{ctx.AvatarUtils.Avatar .Poster 24}} + + {{end}} + + {{template "shared/user/authorlink" .Poster}} + {{ctx.Locale.Tr "repo.issues.commented_at" .HashTag $createdStr}} + + {{end}} +
    +
    + {{template "repo/issue/view_content/show_role" dict "ShowRole" .ShowRole "IsPull" .Issue.IsPull}} + {{if not $.Repository.IsArchived}} + {{template "repo/issue/view_content/add_reaction" dict "ctxData" $ "ActionURL" (printf "%s/comments/%d/reactions" $.RepoLink .ID)}} + {{end}} + {{template "repo/issue/view_content/context_menu" dict "ctxData" $ "item" . "delete" true "issue" true "diff" false "IsCommentPoster" (and $.IsSigned (eq $.SignedUserID .PosterID))}} +
    +
    +
    +
    + {{if .RenderedContent}} + {{.RenderedContent}} + {{else}} + {{ctx.Locale.Tr "repo.issues.no_content"}} + {{end}} +
    +
    {{.Content}}
    +
    + {{if .Attachments}} + {{template "repo/issue/view_content/attachments" dict "Attachments" .Attachments "RenderedContent" .RenderedContent}} + {{end}} +
    + {{$reactions := .Reactions.GroupByType}} + {{if $reactions}} + {{template "repo/issue/view_content/reactions" dict "ctxData" $ "ActionURL" (printf "%s/comments/%d/reactions" $.RepoLink .ID) "Reactions" $reactions}} + {{end}} +
    +
    + {{else if eq .Type 1}} +
    + {{svg "octicon-dot-fill"}} + {{if not .OriginalAuthor}} + {{template "shared/user/avatarlink" dict "user" .Poster}} + {{end}} + + {{template "repo/issue/view_content/comments_authorlink" dict "ctxData" $ "comment" .}} + {{if .Issue.IsPull}} + {{ctx.Locale.Tr "repo.pulls.reopened_at" .EventTag $createdStr}} + {{else}} + {{ctx.Locale.Tr "repo.issues.reopened_at" .EventTag $createdStr}} + {{end}} + +
    + {{else if eq .Type 2}} +
    + {{svg "octicon-circle-slash"}} + {{if not .OriginalAuthor}} + {{template "shared/user/avatarlink" dict "user" .Poster}} + {{end}} + + {{template "repo/issue/view_content/comments_authorlink" dict "ctxData" $ "comment" .}} + {{if .Issue.IsPull}} + {{ctx.Locale.Tr "repo.pulls.closed_at" .EventTag $createdStr}} + {{else}} + {{ctx.Locale.Tr "repo.issues.closed_at" .EventTag $createdStr}} + {{end}} + +
    + {{else if eq .Type 28}} +
    + {{svg "octicon-git-merge"}} + {{if not .OriginalAuthor}} + {{template "shared/user/avatarlink" dict "user" .Poster}} + {{end}} + + {{template "repo/issue/view_content/comments_authorlink" dict "ctxData" $ "comment" .}} + {{$link := printf "%s/commit/%s" $.Repository.Link ($.Issue.PullRequest.MergedCommitID|PathEscape)}} + {{if eq $.Issue.PullRequest.Status 3}} + {{ctx.Locale.Tr "repo.issues.comment_manually_pull_merged_at" (HTMLFormat `%[2]s` $link (ShortSha $.Issue.PullRequest.MergedCommitID)) (HTMLFormat "%[1]s" $.BaseTarget) $createdStr}} + {{else}} + {{ctx.Locale.Tr "repo.issues.comment_pull_merged_at" (HTMLFormat `%[2]s` $link (ShortSha $.Issue.PullRequest.MergedCommitID)) (HTMLFormat "%[1]s" $.BaseTarget) $createdStr}} + {{end}} + +
    + {{else if eq .Type 3 5 6}} + {{$refFrom:= ""}} + {{if ne .RefRepoID .Issue.RepoID}} + {{$refFrom = ctx.Locale.Tr "repo.issues.ref_from" .RefRepo.FullName}} + {{end}} + {{$refTr := "repo.issues.ref_issue_from"}} + {{if .Issue.IsPull}} + {{$refTr = "repo.issues.ref_pull_from"}} + {{else if eq .RefAction 1}} + {{$refTr = "repo.issues.ref_closing_from"}} + {{else if eq .RefAction 2}} + {{$refTr = "repo.issues.ref_reopening_from"}} + {{end}} + {{$createdStr:= TimeSinceUnix .CreatedUnix ctx.Locale}} +
    + {{svg "octicon-bookmark"}} + {{template "shared/user/avatarlink" dict "user" .Poster}} + {{if eq .RefAction 3}}{{end}} + + {{template "shared/user/authorlink" .Poster}} + {{ctx.Locale.Tr $refTr .EventTag $createdStr (.RefCommentLink ctx) $refFrom}} + + {{if eq .RefAction 3}}{{end}} + + +
    + {{else if eq .Type 4}} +
    + {{svg "octicon-bookmark"}} + {{template "shared/user/avatarlink" dict "user" .Poster}} + + {{template "shared/user/authorlink" .Poster}} + {{if .Issue.IsPull}} + {{ctx.Locale.Tr "repo.pulls.commit_ref_at" .EventTag $createdStr}} + {{else}} + {{ctx.Locale.Tr "repo.issues.commit_ref_at" .EventTag $createdStr}} + {{end}} + +
    + {{svg "octicon-git-commit"}} + {{.Content | SanitizeHTML}} +
    +
    + {{else if eq .Type 7}} + {{if or .AddedLabels .RemovedLabels}} +
    + {{svg "octicon-tag"}} + {{template "shared/user/avatarlink" dict "user" .Poster}} + + {{template "shared/user/authorlink" .Poster}} + {{if and .AddedLabels (not .RemovedLabels)}} + {{ctx.Locale.TrN (len .AddedLabels) "repo.issues.add_label" "repo.issues.add_labels" (RenderLabels $.Context ctx.Locale .AddedLabels $.RepoLink .Issue.IsPull) $createdStr}} + {{else if and (not .AddedLabels) .RemovedLabels}} + {{ctx.Locale.TrN (len .RemovedLabels) "repo.issues.remove_label" "repo.issues.remove_labels" (RenderLabels $.Context ctx.Locale .RemovedLabels $.RepoLink .Issue.IsPull) $createdStr}} + {{else}} + {{ctx.Locale.Tr "repo.issues.add_remove_labels" (RenderLabels $.Context ctx.Locale .AddedLabels $.RepoLink .Issue.IsPull) (RenderLabels $.Context ctx.Locale .RemovedLabels $.RepoLink .Issue.IsPull) $createdStr}} + {{end}} + +
    + {{end}} + {{else if eq .Type 8}} +
    + {{svg "octicon-milestone"}} + {{template "shared/user/avatarlink" dict "user" .Poster}} + + {{template "shared/user/authorlink" .Poster}} + {{if gt .OldMilestoneID 0}}{{if gt .MilestoneID 0}}{{ctx.Locale.Tr "repo.issues.change_milestone_at" .OldMilestone.Name .Milestone.Name $createdStr}}{{else}}{{ctx.Locale.Tr "repo.issues.remove_milestone_at" .OldMilestone.Name $createdStr}}{{end}}{{else if gt .MilestoneID 0}}{{ctx.Locale.Tr "repo.issues.add_milestone_at" .Milestone.Name $createdStr}}{{end}} + +
    + {{else if and (eq .Type 9) (gt .AssigneeID 0)}} +
    + {{svg "octicon-person"}} + {{if .RemovedAssignee}} + {{template "shared/user/avatarlink" dict "user" .Assignee}} + + {{template "shared/user/authorlink" .Assignee}} + {{if eq .Poster.ID .Assignee.ID}} + {{ctx.Locale.Tr "repo.issues.remove_self_assignment" $createdStr}} + {{else}} + {{ctx.Locale.Tr "repo.issues.remove_assignee_at" .Poster.GetDisplayName $createdStr}} + {{end}} + + {{else}} + {{template "shared/user/avatarlink" dict "user" .Assignee}} + + {{template "shared/user/authorlink" .Assignee}} + {{if eq .Poster.ID .AssigneeID}} + {{ctx.Locale.Tr "repo.issues.self_assign_at" $createdStr}} + {{else}} + {{ctx.Locale.Tr "repo.issues.add_assignee_at" .Poster.GetDisplayName $createdStr}} + {{end}} + + {{end}} +
    + {{else if eq .Type 10}} +
    + {{svg "octicon-pencil"}} + {{template "shared/user/avatarlink" dict "user" .Poster}} + + {{template "shared/user/authorlink" .Poster}} + {{ctx.Locale.Tr "repo.issues.change_title_at" (RenderRefIssueTitle $.Context .OldTitle) (RenderRefIssueTitle $.Context .NewTitle) $createdStr}} + +
    + {{else if eq .Type 11}} +
    + {{svg "octicon-git-branch"}} + {{template "shared/user/avatarlink" dict "user" .Poster}} + + {{template "shared/user/authorlink" .Poster}} + {{ctx.Locale.Tr "repo.issues.delete_branch_at" .OldRef $createdStr}} + +
    + {{else if eq .Type 12}} +
    + {{svg "octicon-clock"}} + {{template "shared/user/avatarlink" dict "user" .Poster}} + + {{template "shared/user/authorlink" .Poster}} + {{ctx.Locale.Tr "repo.issues.start_tracking_history" $createdStr}} + +
    + {{else if eq .Type 13}} +
    + {{svg "octicon-clock"}} + {{template "shared/user/avatarlink" dict "user" .Poster}} + + {{template "shared/user/authorlink" .Poster}} + {{ctx.Locale.Tr "repo.issues.stop_tracking_history" $createdStr}} + + {{template "repo/issue/view_content/comments_delete_time" dict "ctxData" $ "comment" .}} +
    + {{svg "octicon-clock"}} + {{if .RenderedContent}} + {{/* compatibility with time comments made before v1.21 */}} + {{.RenderedContent}} + {{else}} + {{.Content|Sec2Time}} + {{end}} +
    +
    + {{else if eq .Type 14}} +
    + {{svg "octicon-clock"}} + {{template "shared/user/avatarlink" dict "user" .Poster}} + + {{template "shared/user/authorlink" .Poster}} + {{ctx.Locale.Tr "repo.issues.add_time_history" $createdStr}} + + {{template "repo/issue/view_content/comments_delete_time" dict "ctxData" $ "comment" .}} +
    + {{svg "octicon-clock"}} + {{if .RenderedContent}} + {{/* compatibility with time comments made before v1.21 */}} + {{.RenderedContent}} + {{else}} + {{.Content|Sec2Time}} + {{end}} +
    +
    + {{else if eq .Type 15}} +
    + {{svg "octicon-clock"}} + {{template "shared/user/avatarlink" dict "user" .Poster}} + + {{template "shared/user/authorlink" .Poster}} + {{ctx.Locale.Tr "repo.issues.cancel_tracking_history" $createdStr}} + +
    + {{else if eq .Type 16}} +
    + {{svg "octicon-clock"}} + {{template "shared/user/avatarlink" dict "user" .Poster}} + + {{template "shared/user/authorlink" .Poster}} + {{ctx.Locale.Tr "repo.issues.due_date_added" (DateTime "long" .Content) $createdStr}} + +
    + {{else if eq .Type 17}} +
    + {{svg "octicon-clock"}} + {{template "shared/user/avatarlink" dict "user" .Poster}} + + {{template "shared/user/authorlink" .Poster}} + {{$parsedDeadline := StringUtils.Split .Content "|"}} + {{if eq (len $parsedDeadline) 2}} + {{$from := DateTime "long" (index $parsedDeadline 1)}} + {{$to := DateTime "long" (index $parsedDeadline 0)}} + {{ctx.Locale.Tr "repo.issues.due_date_modified" $to $from $createdStr}} + {{end}} + +
    + {{else if eq .Type 18}} +
    + {{svg "octicon-clock"}} + {{template "shared/user/avatarlink" dict "user" .Poster}} + + {{template "shared/user/authorlink" .Poster}} + {{ctx.Locale.Tr "repo.issues.due_date_remove" (DateTime "long" .Content) $createdStr}} + +
    + {{else if eq .Type 19}} +
    + {{svg "octicon-package-dependents"}} + {{template "shared/user/avatarlink" dict "user" .Poster}} + + {{template "shared/user/authorlink" .Poster}} + {{ctx.Locale.Tr "repo.issues.dependency.added_dependency" $createdStr}} + + {{if .DependentIssue}} + + {{end}} +
    + {{else if eq .Type 20}} +
    + {{svg "octicon-package-dependents"}} + {{template "shared/user/avatarlink" dict "user" .Poster}} + + {{template "shared/user/authorlink" .Poster}} + {{ctx.Locale.Tr "repo.issues.dependency.removed_dependency" $createdStr}} + + {{if .DependentIssue}} + + {{end}} +
    + {{else if eq .Type 22}} +
    +
    + {{if not .OriginalAuthor}} + {{/* Some timeline avatars need a offset to correctly align with their speech bubble. + The condition depends on whether the comment has contents/attachments or reviews */}} + + {{ctx.AvatarUtils.Avatar .Poster 40}} + + {{end}} + {{svg (printf "octicon-%s" .Review.Type.Icon)}} + + {{template "repo/issue/view_content/comments_authorlink" dict "ctxData" $ "comment" .}} + {{if eq .Review.Type 1}} + {{ctx.Locale.Tr "repo.issues.review.approve" $createdStr}} + {{else if eq .Review.Type 2}} + {{ctx.Locale.Tr "repo.issues.review.comment" $createdStr}} + {{else if eq .Review.Type 3}} + {{ctx.Locale.Tr "repo.issues.review.reject" $createdStr}} + {{else}} + {{ctx.Locale.Tr "repo.issues.review.comment" $createdStr}} + {{end}} + {{if .Review.Dismissed}} +
    {{ctx.Locale.Tr "repo.issues.review.dismissed_label"}}
    + {{end}} +
    +
    + {{if or .Content .Attachments}} +
    +
    +
    +
    + {{if gt .Poster.ID 0}} + + {{ctx.AvatarUtils.Avatar .Poster 24}} + + {{end}} + + {{if .OriginalAuthor}} + + {{svg (MigrationIcon $.Repository.GetOriginalURLHostname)}} + {{.OriginalAuthor}} + + {{if $.Repository.OriginalURL}} + ({{ctx.Locale.Tr "repo.migrated_from" $.Repository.OriginalURL $.Repository.GetOriginalURLHostname}}){{end}} + {{else}} + {{template "shared/user/authorlink" .Poster}} + {{end}} + + {{ctx.Locale.Tr "repo.issues.review.left_comment"}} + +
    +
    + {{template "repo/issue/view_content/show_role" dict "ShowRole" .ShowRole "IsPull" .Issue.IsPull}} + {{if not $.Repository.IsArchived}} + {{template "repo/issue/view_content/add_reaction" dict "ctxData" $ "ActionURL" (printf "%s/comments/%d/reactions" $.RepoLink .ID)}} + {{template "repo/issue/view_content/context_menu" dict "ctxData" $ "item" . "delete" false "issue" true "diff" false "IsCommentPoster" (and $.IsSigned (eq $.SignedUserID .PosterID))}} + {{end}} +
    +
    +
    +
    + {{if .RenderedContent}} + {{.RenderedContent}} + {{else}} + {{ctx.Locale.Tr "repo.issues.no_content"}} + {{end}} +
    +
    {{.Content}}
    +
    + {{if .Attachments}} + {{template "repo/issue/view_content/attachments" dict "Attachments" .Attachments "RenderedContent" .RenderedContent}} + {{end}} +
    + {{$reactions := .Reactions.GroupByType}} + {{if $reactions}} + {{template "repo/issue/view_content/reactions" dict "ctxData" $ "ActionURL" (printf "%s/comments/%d/reactions" $.RepoLink .ID) "Reactions" $reactions}} + {{end}} +
    +
    + {{end}} + + {{if .Review.CodeComments}} +
    + {{range $filename, $lines := .Review.CodeComments}} + {{range $line, $comms := $lines}} + {{template "repo/issue/view_content/conversation" dict "." $ "comments" $comms}} + {{end}} + {{end}} +
    + {{end}} +
    + {{else if eq .Type 23}} +
    + {{svg "octicon-lock"}} + {{template "shared/user/avatarlink" dict "user" .Poster}} + {{if .Content}} + + {{template "shared/user/authorlink" .Poster}} + {{ctx.Locale.Tr "repo.issues.lock_with_reason" .Content $createdStr}} + + {{else}} + + {{template "shared/user/authorlink" .Poster}} + {{ctx.Locale.Tr "repo.issues.lock_no_reason" $createdStr}} + + {{end}} +
    + {{else if eq .Type 24}} +
    + {{svg "octicon-key"}} + {{template "shared/user/avatarlink" dict "user" .Poster}} + + {{template "shared/user/authorlink" .Poster}} + {{ctx.Locale.Tr "repo.issues.unlock_comment" $createdStr}} + +
    + {{else if eq .Type 25}} +
    + {{svg "octicon-git-branch"}} + {{if not .OriginalAuthor}} + {{template "shared/user/avatarlink" dict "user" .Poster}} + {{end}} + + {{template "repo/issue/view_content/comments_authorlink" dict "ctxData" $ "comment" .}} + {{ctx.Locale.Tr "repo.pulls.change_target_branch_at" .OldRef .NewRef $createdStr}} + +
    + {{else if eq .Type 26}} +
    + {{svg "octicon-clock"}} + {{template "shared/user/avatarlink" dict "user" .Poster}} + + {{template "shared/user/authorlink" .Poster}} + + {{ctx.Locale.Tr "repo.issues.del_time_history" $createdStr}} + +
    + {{svg "octicon-clock"}} + {{if .RenderedContent}} + {{/* compatibility with time comments made before v1.21 */}} + {{.RenderedContent}} + {{else}} + - {{.Content|Sec2Time}} + {{end}} +
    +
    + {{else if eq .Type 27}} +
    + {{svg "octicon-eye"}} + {{template "shared/user/avatarlink" dict "user" .Poster}} + + {{template "shared/user/authorlink" .Poster}} + {{if (gt .AssigneeID 0)}} + {{if .RemovedAssignee}} + {{if eq .PosterID .AssigneeID}} + {{ctx.Locale.Tr "repo.issues.review.remove_review_request_self" $createdStr}} + {{else}} + {{ctx.Locale.Tr "repo.issues.review.remove_review_request" .Assignee.GetDisplayName $createdStr}} + {{end}} + {{else}} + {{ctx.Locale.Tr "repo.issues.review.add_review_request" .Assignee.GetDisplayName $createdStr}} + {{end}} + {{else}} + + {{$teamName := "Ghost Team"}} + {{if .AssigneeTeam}} + {{$teamName = .AssigneeTeam.Name}} + {{end}} + {{if .RemovedAssignee}} + {{ctx.Locale.Tr "repo.issues.review.remove_review_request" $teamName $createdStr}} + {{else}} + {{ctx.Locale.Tr "repo.issues.review.add_review_request" $teamName $createdStr}} + {{end}} + {{end}} + +
    + {{else if and (eq .Type 29) (or (gt .CommitsNum 0) .IsForcePush)}} + + {{if and .Issue.IsClosed (gt .ID $.LatestCloseCommentID)}} + {{continue}} + {{end}} +
    + {{svg "octicon-repo-push"}} + + {{template "shared/user/authorlink" .Poster}} + {{if .IsForcePush}} + {{ctx.Locale.Tr "repo.issues.force_push_codes" $.Issue.PullRequest.HeadBranch (ShortSha .OldCommit) ($.Issue.Repo.CommitLink .OldCommit) (ShortSha .NewCommit) ($.Issue.Repo.CommitLink .NewCommit) $createdStr}} + {{else}} + {{ctx.Locale.TrN (len .Commits) "repo.issues.push_commit_1" "repo.issues.push_commits_n" (len .Commits) $createdStr}} + {{end}} + + {{if and .IsForcePush $.Issue.PullRequest.BaseRepo.Name}} + + {{ctx.Locale.Tr "repo.issues.force_push_compare"}} + + {{end}} +
    + {{if not .IsForcePush}} + {{template "repo/commits_list_small" dict "comment" . "root" $}} + {{end}} + {{else if eq .Type 30}} + {{if not $.UnitProjectsGlobalDisabled}} +
    + {{svg "octicon-project"}} + {{template "shared/user/avatarlink" dict "user" .Poster}} + + {{template "shared/user/authorlink" .Poster}} + {{$oldProjectDisplayHtml := "Unknown Project"}} + {{if .OldProject}} + {{$tooltip := ctx.Locale.Tr "projects.deleted.display_name"}} + {{if not .OldProject.IsGhost}} + {{$tooltip = ctx.Locale.Tr (printf "projects.type-%d.display_name" .OldProject.Type)}} + {{end}} + {{$oldProjectDisplayHtml = HTMLFormat `%s` $tooltip .OldProject.Title}} + {{end}} + {{$newProjectDisplayHtml := "Unknown Project"}} + {{if .Project}} + {{$tooltip := ctx.Locale.Tr "projects.deleted.display_name"}} + {{if not .Project.IsGhost}} + {{$tooltip = ctx.Locale.Tr (printf "projects.type-%d.display_name" .Project.Type)}} + {{end}} + {{$newProjectDisplayHtml = HTMLFormat `%s` $tooltip .Project.Title}} + {{end}} + {{if and (gt .OldProjectID 0) (gt .ProjectID 0)}} + {{ctx.Locale.Tr "repo.issues.change_project_at" $oldProjectDisplayHtml $newProjectDisplayHtml $createdStr}} + {{else if gt .OldProjectID 0}} + {{ctx.Locale.Tr "repo.issues.remove_project_at" $oldProjectDisplayHtml $createdStr}} + {{else if gt .ProjectID 0}} + {{ctx.Locale.Tr "repo.issues.add_project_at" $newProjectDisplayHtml $createdStr}} + {{end}} + +
    + {{end}} + {{else if eq .Type 32}} +
    +
    + + + + {{svg "octicon-x" 16}} + + {{template "shared/user/authorlink" .Poster}} + {{$reviewerName := ""}} + {{if eq .Review.OriginalAuthor ""}} + {{$reviewerName = .Review.Reviewer.Name}} + {{else}} + {{$reviewerName = .Review.OriginalAuthor}} + {{end}} + {{ctx.Locale.Tr "repo.issues.review.dismissed" $reviewerName $createdStr}} + +
    + {{if .Content}} +
    +
    +
    + {{if gt .Poster.ID 0}} + + {{ctx.AvatarUtils.Avatar .Poster 24}} + + {{end}} + + {{ctx.Locale.Tr "action.review_dismissed_reason"}} + +
    +
    +
    + {{if .RenderedContent}} + {{.RenderedContent}} + {{else}} + {{ctx.Locale.Tr "repo.issues.no_content"}} + {{end}} +
    +
    +
    +
    + {{end}} +
    + {{else if eq .Type 33}} +
    + {{svg "octicon-git-branch"}} + {{template "shared/user/avatarlink" dict "user" .Poster}} + + {{template "shared/user/authorlink" .Poster}} + {{if and .OldRef .NewRef}} + {{ctx.Locale.Tr "repo.issues.change_ref_at" .OldRef .NewRef $createdStr}} + {{else if .OldRef}} + {{ctx.Locale.Tr "repo.issues.remove_ref_at" .OldRef $createdStr}} + {{else}} + {{ctx.Locale.Tr "repo.issues.add_ref_at" .NewRef $createdStr}} + {{end}} + +
    + {{else if or (eq .Type 34) (eq .Type 35)}} +
    + {{svg "octicon-git-merge" 16}} + + {{template "repo/issue/view_content/comments_authorlink" dict "ctxData" $ "comment" .}} + {{if eq .Type 34}}{{ctx.Locale.Tr "repo.pulls.auto_merge_newly_scheduled_comment" $createdStr}} + {{else}}{{ctx.Locale.Tr "repo.pulls.auto_merge_canceled_schedule_comment" $createdStr}}{{end}} + +
    + {{else if or (eq .Type 36) (eq .Type 37)}} +
    + {{svg "octicon-pin" 16}} + {{template "shared/user/avatarlink" dict "user" .Poster}} + + {{template "shared/user/authorlink" .Poster}} + {{if eq .Type 36}}{{ctx.Locale.Tr "repo.issues.pin_comment" $createdStr}} + {{else}}{{ctx.Locale.Tr "repo.issues.unpin_comment" $createdStr}}{{end}} + +
    + {{end}} + {{end}} +{{end}} diff --git a/templates/repo/issue/view_content/comments_authorlink.tmpl b/templates/repo/issue/view_content/comments_authorlink.tmpl new file mode 100644 index 0000000..f652a0b --- /dev/null +++ b/templates/repo/issue/view_content/comments_authorlink.tmpl @@ -0,0 +1,11 @@ +{{if .comment.OriginalAuthor}} + + {{svg (MigrationIcon .ctxData.Repository.GetOriginalURLHostname)}} + {{.comment.OriginalAuthor}} + + {{if .ctxData.Repository.OriginalURL}} + ({{ctx.Locale.Tr "repo.migrated_from" .ctxData.Repository.OriginalURL .ctxData.Repository.GetOriginalURLHostname}}) + {{end}} +{{else}} + {{template "shared/user/authorlink" .comment.Poster}} +{{end}} diff --git a/templates/repo/issue/view_content/comments_delete_time.tmpl b/templates/repo/issue/view_content/comments_delete_time.tmpl new file mode 100644 index 0000000..2377e7c --- /dev/null +++ b/templates/repo/issue/view_content/comments_delete_time.tmpl @@ -0,0 +1,18 @@ +{{if and .comment.Time (.ctxData.Repository.IsTimetrackerEnabled ctx)}} {{/* compatibility with time comments made before v1.14 */}} + {{if (not .comment.Time.Deleted)}} + {{if (or .ctxData.IsAdmin (and .ctxData.IsSigned (eq .ctxData.SignedUserID .comment.PosterID)))}} + + + + + {{end}} + {{end}} +{{end}} diff --git a/templates/repo/issue/view_content/context_menu.tmpl b/templates/repo/issue/view_content/context_menu.tmpl new file mode 100644 index 0000000..4afd73c --- /dev/null +++ b/templates/repo/issue/view_content/context_menu.tmpl @@ -0,0 +1,27 @@ + diff --git a/templates/repo/issue/view_content/conversation.tmpl b/templates/repo/issue/view_content/conversation.tmpl new file mode 100644 index 0000000..c788a61 --- /dev/null +++ b/templates/repo/issue/view_content/conversation.tmpl @@ -0,0 +1,137 @@ +{{$invalid := (index .comments 0).Invalidated}} +{{$resolved := (index .comments 0).IsResolved}} +{{$resolveDoer := (index .comments 0).ResolveDoer}} +{{$isNotPending := (not (eq (index .comments 0).Review.Type 0))}} +
    +
    +
    + {{(index .comments 0).TreePath}} + {{if $invalid}} + + {{ctx.Locale.Tr "repo.issues.review.outdated"}} + + {{end}} +
    +
    + {{if or $invalid $resolved}} + + + {{end}} +
    +
    + {{$diff := (CommentMustAsDiff ctx (index .comments 0))}} + {{if $diff}} + {{$file := (index $diff.Files 0)}} +
    +
    +
    + + + {{template "repo/diff/section_unified" dict "file" $file "root" $}} + +
    +
    +
    +
    + {{end}} +
    +
    + {{range .comments}} + {{$createdSubStr:= TimeSinceUnix .CreatedUnix ctx.Locale}} +
    +
    +
    +
    + {{if not .OriginalAuthor}} + + {{ctx.AvatarUtils.Avatar .Poster 20}} + + {{end}} + + {{if .OriginalAuthor}} + + {{svg (MigrationIcon $.Repository.GetOriginalURLHostname)}} + {{.OriginalAuthor}} + + {{if $.Repository.OriginalURL}} + ({{ctx.Locale.Tr "repo.migrated_from" $.Repository.OriginalURL $.Repository.GetOriginalURLHostname}}) + {{end}} + {{else}} + {{template "shared/user/authorlink" .Poster}} + {{end}} + {{ctx.Locale.Tr "repo.issues.commented_at" .HashTag $createdSubStr}} + +
    +
    + {{template "repo/issue/view_content/show_role" dict "ShowRole" .ShowRole "IsPull" $.Issue.IsPull}} + {{if not $.Repository.IsArchived}} + {{template "repo/issue/view_content/add_reaction" dict "ctxData" $ "ActionURL" (printf "%s/comments/%d/reactions" $.RepoLink .ID)}} + {{template "repo/issue/view_content/context_menu" dict "ctxData" $ "item" . "delete" true "issue" true "diff" true "IsCommentPoster" (and $.IsSigned (eq $.SignedUserID .PosterID))}} + {{end}} +
    +
    +
    +
    + {{if .RenderedContent}} + {{.RenderedContent}} + {{else}} + {{ctx.Locale.Tr "repo.issues.no_content"}} + {{end}} +
    +
    {{.Content}}
    +
    + {{if .Attachments}} + {{template "repo/issue/view_content/attachments" dict "Attachments" .Attachments "RenderedContent" .RenderedContent}} + {{end}} +
    + {{$reactions := .Reactions.GroupByType}} + {{if $reactions}} + {{template "repo/issue/view_content/reactions" dict "ctxData" $ "ActionURL" (printf "%s/comments/%d/reactions" $.RepoLink .ID) "Reactions" $reactions}} + {{end}} +
    +
    + {{end}} +
    +
    +
    + {{if $resolved}} +
    + {{svg "octicon-check" 16 "tw-mr-1"}} + {{$resolveDoer.Name}} {{ctx.Locale.Tr "repo.issues.review.resolved_by"}} +
    + {{end}} +
    +
    + {{if and $.CanMarkConversation $isNotPending}} + + {{end}} + {{if and $.SignedUserID (not $.Repository.IsArchived)}} + + {{end}} +
    +
    + {{template "repo/diff/comment_form_datahandler" dict "hidden" true "reply" (index .comments 0).ReviewID "root" $ "comment" (index .comments 0)}} +
    +
    diff --git a/templates/repo/issue/view_content/pull.tmpl b/templates/repo/issue/view_content/pull.tmpl new file mode 100644 index 0000000..ca3c6f8 --- /dev/null +++ b/templates/repo/issue/view_content/pull.tmpl @@ -0,0 +1,396 @@ +{{if and .Issue.PullRequest.HasMerged (not .IsPullBranchDeletable)}} +{{/* Then the merge box will not be displayed because this page already contains enough information */}} +{{else}} +
    +
    {{svg "octicon-git-merge" 40}}
    +
    + {{if .LatestCommitStatus}} +
    + {{template "repo/pulls/status" (dict + "CommitStatus" .LatestCommitStatus + "CommitStatuses" .LatestCommitStatuses + "MissingRequiredChecks" .MissingRequiredChecks + "ShowHideChecks" true + "is_context_required" .is_context_required + )}} +
    + {{end}} + {{$showGeneralMergeForm := false}} +
    + {{if .Issue.PullRequest.HasMerged}} + {{if .IsPullBranchDeletable}} +
    +
    +

    + {{ctx.Locale.Tr "repo.pulls.merged_success"}} +

    + +
    +
    + +
    +
    + {{end}} + {{else if .Issue.IsClosed}} +
    +
    +

    {{ctx.Locale.Tr "repo.pulls.closed"}}

    + +
    + {{if and .IsPullBranchDeletable (not .IsPullRequestBroken)}} +
    + +
    + {{end}} +
    + {{else if .IsPullFilesConflicted}} +
    + {{svg "octicon-x"}} + {{ctx.Locale.Tr "repo.pulls.files_conflicted"}} +
    +
      + {{range .ConflictedFiles}} +
    • {{.}}
    • + {{end}} +
    + {{else if .IsPullRequestBroken}} +
    + {{svg "octicon-x"}} + {{ctx.Locale.Tr "repo.pulls.data_broken"}} +
    + {{else if .IsPullWorkInProgress}} +
    +
    + {{svg "octicon-x"}} + {{ctx.Locale.Tr "repo.pulls.cannot_merge_work_in_progress"}} +
    + {{if or .HasIssuesOrPullsWritePermission .IsIssuePoster}} + + {{end}} +
    + {{template "repo/issue/view_content/update_branch_by_merge" $}} + {{else if .Issue.PullRequest.IsChecking}} +
    + {{svg "octicon-sync"}} + {{ctx.Locale.Tr "repo.pulls.is_checking"}} +
    + {{else if .Issue.PullRequest.IsAncestor}} +
    + {{svg "octicon-alert"}} + {{ctx.Locale.Tr "repo.pulls.is_ancestor"}} +
    + {{else if or .Issue.PullRequest.CanAutoMerge .Issue.PullRequest.IsEmpty}} + {{if .IsBlockedByApprovals}} +
    + {{svg "octicon-x"}} + {{ctx.Locale.Tr "repo.pulls.blocked_by_approvals" .GrantedApprovals .ProtectedBranch.RequiredApprovals}} +
    + {{else if .IsBlockedByRejection}} +
    + {{svg "octicon-x"}} + {{ctx.Locale.Tr "repo.pulls.blocked_by_rejection"}} +
    + {{else if .IsBlockedByOfficialReviewRequests}} +
    + {{svg "octicon-x"}} + {{ctx.Locale.Tr "repo.pulls.blocked_by_official_review_requests"}} +
    + {{else if .IsBlockedByOutdatedBranch}} +
    + {{svg "octicon-x"}} + {{ctx.Locale.Tr "repo.pulls.blocked_by_outdated_branch"}} +
    + {{else if .IsBlockedByChangedProtectedFiles}} +
    + {{svg "octicon-x"}} + {{ctx.Locale.TrN $.ChangedProtectedFilesNum "repo.pulls.blocked_by_changed_protected_files_1" "repo.pulls.blocked_by_changed_protected_files_n"}} +
    +
      + {{range .ChangedProtectedFiles}} +
    • {{.}}
    • + {{end}} +
    + {{else if and .EnableStatusCheck (or .RequiredStatusCheckState.IsError .RequiredStatusCheckState.IsFailure)}} +
    + {{svg "octicon-x"}} + {{ctx.Locale.Tr "repo.pulls.required_status_check_failed"}} +
    + {{else if and .EnableStatusCheck (not .RequiredStatusCheckState.IsSuccess)}} +
    + {{svg "octicon-x"}} + {{ctx.Locale.Tr "repo.pulls.required_status_check_missing"}} +
    + {{else if and .AllowMerge .RequireSigned (not .WillSign)}} +
    + {{svg "octicon-x"}} + {{ctx.Locale.Tr "repo.pulls.require_signed_wont_sign"}} +
    +
    + {{svg "octicon-unlock"}} + {{ctx.Locale.Tr (printf "repo.signing.wont_sign.%s" .WontSignReason)}} +
    + {{end}} + + {{$notAllOverridableChecksOk := or .IsBlockedByApprovals .IsBlockedByRejection .IsBlockedByOfficialReviewRequests .IsBlockedByOutdatedBranch .IsBlockedByChangedProtectedFiles (and .EnableStatusCheck (not .RequiredStatusCheckState.IsSuccess))}} + + {{/* admin can merge without checks, writer can merge when checks succeed */}} + {{$canMergeNow := and (or (and $.IsRepoAdmin (not .ProtectedBranch.ApplyToAdmins)) (not $notAllOverridableChecksOk)) (or (not .AllowMerge) (not .RequireSigned) .WillSign)}} + {{/* admin and writer both can make an auto merge schedule */}} + + {{if $canMergeNow}} + {{if $notAllOverridableChecksOk}} +
    + {{svg "octicon-dot-fill"}} + {{ctx.Locale.Tr "repo.pulls.required_status_check_administrator"}} +
    + {{else}} +
    + {{svg "octicon-check"}} + {{ctx.Locale.Tr "repo.pulls.can_auto_merge_desc"}} +
    + {{end}} + {{if .WillSign}} +
    + {{svg "octicon-lock" 16 "text green"}} + {{ctx.Locale.Tr "repo.signing.will_sign" .SigningKey}} +
    + {{else if .IsSigned}} +
    + {{svg "octicon-unlock"}} + {{ctx.Locale.Tr (printf "repo.signing.wont_sign.%s" .WontSignReason)}} +
    + {{end}} + {{end}} + {{template "repo/issue/view_content/update_branch_by_merge" $}} + {{if .Issue.PullRequest.IsEmpty}} +
    + +
    + {{svg "octicon-alert"}} + {{ctx.Locale.Tr "repo.pulls.is_empty"}} +
    + {{end}} + + {{if .AllowMerge}} {{/* user is allowed to merge */}} + {{$prUnit := .Repository.MustGetUnit $.Context $.UnitTypePullRequests}} + {{if or $prUnit.PullRequestsConfig.AllowMerge $prUnit.PullRequestsConfig.AllowRebase $prUnit.PullRequestsConfig.AllowRebaseMerge $prUnit.PullRequestsConfig.AllowSquash $prUnit.PullRequestsConfig.AllowFastForwardOnly}} + {{$hasPendingPullRequestMergeTip := ""}} + {{if .HasPendingPullRequestMerge}} + {{$createdPRMergeStr := TimeSinceUnix .PendingPullRequestMerge.CreatedUnix ctx.Locale}} + {{$hasPendingPullRequestMergeTip = ctx.Locale.Tr "repo.pulls.auto_merge_has_pending_schedule" .PendingPullRequestMerge.Doer.Name $createdPRMergeStr}} + {{end}} +
    + + + {{$showGeneralMergeForm = true}} +
    + {{else}} + {{/* no merge style was set in repo setting: not or ($prUnit.PullRequestsConfig.AllowMerge ...) */}} +
    +
    + {{svg "octicon-x"}} + {{ctx.Locale.Tr "repo.pulls.no_merge_desc"}} +
    +
    + {{svg "octicon-info"}} + {{ctx.Locale.Tr "repo.pulls.no_merge_helper"}} +
    + {{end}} {{/* end if the repo was set to use any merge style */}} + {{else}} + {{/* user is not allowed to merge */}} +
    +
    + {{svg "octicon-info"}} + {{ctx.Locale.Tr "repo.pulls.no_merge_access"}} +
    + {{end}} {{/* end if user is allowed to merge or not */}} + {{else}} + {{/* Merge conflict without specific file. Suggest manual merge, only if all reviews and status checks OK. */}} + {{if .IsBlockedByApprovals}} +
    + {{svg "octicon-x"}} + {{ctx.Locale.Tr "repo.pulls.blocked_by_approvals" .GrantedApprovals .ProtectedBranch.RequiredApprovals}} +
    + {{else if .IsBlockedByRejection}} +
    + {{svg "octicon-x"}} + {{ctx.Locale.Tr "repo.pulls.blocked_by_rejection"}} +
    + {{else if .IsBlockedByOfficialReviewRequests}} +
    + {{svg "octicon-x"}} + {{ctx.Locale.Tr "repo.pulls.blocked_by_official_review_requests"}} +
    + {{else if .IsBlockedByOutdatedBranch}} +
    + {{svg "octicon-x"}} + {{ctx.Locale.Tr "repo.pulls.blocked_by_outdated_branch"}} +
    + {{else if .IsBlockedByChangedProtectedFiles}} +
    + {{svg "octicon-x"}} + {{ctx.Locale.TrN $.ChangedProtectedFilesNum "repo.pulls.blocked_by_changed_protected_files_1" "repo.pulls.blocked_by_changed_protected_files_n"}} +
    +
      + {{range .ChangedProtectedFiles}} +
    • {{.}}
    • + {{end}} +
    + {{else if and .EnableStatusCheck (not .RequiredStatusCheckState.IsSuccess)}} +
    + {{svg "octicon-x"}} + {{ctx.Locale.Tr "repo.pulls.required_status_check_failed"}} +
    + {{else if and .RequireSigned (not .WillSign)}} +
    + {{svg "octicon-x"}} + {{ctx.Locale.Tr "repo.pulls.require_signed_wont_sign"}} +
    + {{else}} +
    + {{svg "octicon-x"}} + {{ctx.Locale.Tr "repo.pulls.cannot_auto_merge_desc"}} +
    +
    + {{svg "octicon-info"}} + {{ctx.Locale.Tr "repo.pulls.cannot_auto_merge_helper"}} +
    + {{end}} + {{end}}{{/* end if: pull request status */}} + + {{/* + Manually Merged is not a well-known feature, it is used to mark a non-mergeable PR (already merged, conflicted) as merged + To test it: + * Enable "Manually Merged" feature in the Repository Settings + * Create a pull request, either: + * - Merge the pull request branch locally and push the merged commit to Gitea + * - Make some conflicts between the base branch and the pull request branch + * Then the Manually Merged form will be shown in the merge form + */}} + {{if and $.StillCanManualMerge (not $showGeneralMergeForm)}} +
    +
    +
    + {{.CsrfTokenHtml}} +
    + +
    + +
    +
    + {{end}} + + {{if and .Issue.PullRequest.HeadRepo (not .Issue.PullRequest.HasMerged) (not .Issue.IsClosed)}} + {{template "repo/issue/view_content/pull_merge_instruction" dict "PullRequest" .Issue.PullRequest "ShowMergeInstructions" .ShowMergeInstructions "AutodetectManualMerge" .AutodetectManualMerge}} + {{end}} +
    +
    +
    +{{end}} diff --git a/templates/repo/issue/view_content/pull_merge_instruction.tmpl b/templates/repo/issue/view_content/pull_merge_instruction.tmpl new file mode 100644 index 0000000..b7aae53 --- /dev/null +++ b/templates/repo/issue/view_content/pull_merge_instruction.tmpl @@ -0,0 +1,57 @@ +
    +
    + {{ctx.Locale.Tr "repo.pulls.cmd_instruction_hint"}} +

    {{ctx.Locale.Tr "repo.pulls.cmd_instruction_checkout_title"}}

    {{ctx.Locale.Tr "repo.pulls.cmd_instruction_checkout_desc"}}
    + {{$localBranch := .PullRequest.HeadBranch}} + {{if ne .PullRequest.HeadRepo.ID .PullRequest.BaseRepo.ID}} + {{$localBranch = print .PullRequest.HeadRepo.OwnerName "-" .PullRequest.HeadBranch}} + {{end}} +
    + {{if eq .PullRequest.Flow 0}} +
    git fetch -u {{if ne .PullRequest.HeadRepo.ID .PullRequest.BaseRepo.ID}}{{else}}origin{{end}} {{.PullRequest.HeadBranch}}:{{$localBranch}}
    + {{else}} +
    git fetch -u origin +refs/pull/{{.PullRequest.Index}}/head:{{$localBranch}}
    + {{end}} +
    git checkout {{$localBranch}}
    +
    + {{if .ShowMergeInstructions}} +
    +

    {{ctx.Locale.Tr "repo.pulls.cmd_instruction_merge_title"}}

    + {{ctx.Locale.Tr "repo.pulls.cmd_instruction_merge_desc"}} + {{if not .AutodetectManualMerge}} +

    {{ctx.Locale.Tr "repo.pulls.cmd_instruction_merge_warning"}}

    + {{end}} +
    +
    +
    +
    git checkout {{.PullRequest.BaseBranch}}
    +
    git merge --no-ff {{$localBranch}}
    +
    +
    +
    git checkout {{$localBranch}}
    +
    git rebase {{.PullRequest.BaseBranch}}
    +
    git checkout {{.PullRequest.BaseBranch}}
    +
    git merge --ff-only {{$localBranch}}
    +
    +
    +
    git checkout {{$localBranch}}
    +
    git rebase {{.PullRequest.BaseBranch}}
    +
    git checkout {{.PullRequest.BaseBranch}}
    +
    git merge --no-ff {{$localBranch}}
    +
    +
    +
    git checkout {{.PullRequest.BaseBranch}}
    +
    git merge --squash {{$localBranch}}
    +
    +
    +
    git checkout {{.PullRequest.BaseBranch}}
    +
    git merge --ff-only {{$localBranch}}
    +
    +
    +
    git checkout {{.PullRequest.BaseBranch}}
    +
    git merge {{$localBranch}}
    +
    +
    git push origin {{.PullRequest.BaseBranch}}
    +
    + {{end}} +
    diff --git a/templates/repo/issue/view_content/reactions.tmpl b/templates/repo/issue/view_content/reactions.tmpl new file mode 100644 index 0000000..da63196 --- /dev/null +++ b/templates/repo/issue/view_content/reactions.tmpl @@ -0,0 +1,17 @@ +
    +{{range $key, $value := .Reactions}} + {{$hasReacted := $value.HasUser $.ctxData.SignedUserID}} + + {{ReactionToEmoji $key}} + {{len $value}} + +{{end}} +{{if AllowedReactions}} + {{template "repo/issue/view_content/add_reaction" dict "ctxData" $.ctxData "ActionURL" .ActionURL}} +{{end}} +
    diff --git a/templates/repo/issue/view_content/reference_issue_dialog.tmpl b/templates/repo/issue/view_content/reference_issue_dialog.tmpl new file mode 100644 index 0000000..c7a471f --- /dev/null +++ b/templates/repo/issue/view_content/reference_issue_dialog.tmpl @@ -0,0 +1,28 @@ + diff --git a/templates/repo/issue/view_content/show_role.tmpl b/templates/repo/issue/view_content/show_role.tmpl new file mode 100644 index 0000000..0f1b895 --- /dev/null +++ b/templates/repo/issue/view_content/show_role.tmpl @@ -0,0 +1,15 @@ +{{if and .ShowRole.IsPoster (not .IgnorePoster)}} +
    + {{ctx.Locale.Tr "repo.issues.author"}} +
    +{{end}} +{{if .ShowRole.RoleInRepo}} +
    + {{.ShowRole.RoleInRepo.LocaleString ctx.Locale}} +
    +{{end}} diff --git a/templates/repo/issue/view_content/sidebar.tmpl b/templates/repo/issue/view_content/sidebar.tmpl new file mode 100644 index 0000000..623023b --- /dev/null +++ b/templates/repo/issue/view_content/sidebar.tmpl @@ -0,0 +1,66 @@ +
    + {{template "repo/issue/view_content/sidebar/branch_selector_field" .}} + {{if .Issue.IsPull}} + {{template "repo/issue/view_content/sidebar/pull_review" .}} + {{template "repo/issue/view_content/sidebar/pull_wip" .}} +
    + {{end}} + + {{template "repo/issue/labels/labels_selector_field" .}} + {{template "repo/issue/labels/labels_sidebar" dict "root" $}} + +
    + + {{template "repo/issue/view_content/sidebar/milestones" .}} +
    + + {{template "repo/issue/view_content/sidebar/projects" .}} +
    + + {{template "repo/issue/view_content/sidebar/assignees" dict "isExistingIssue" true "." .}} +
    + + {{if .Participants}} + {{template "repo/issue/view_content/sidebar/participants" .}} + {{end}} + + {{if and $.IssueWatch (not .Repository.IsArchived)}} +
    + + {{template "repo/issue/view_content/sidebar/watch" .}} + {{end}} + + {{if .Repository.IsTimetrackerEnabled $.Context}} + {{template "repo/issue/view_content/sidebar/timetracking" .}} + {{end}} + +
    + {{template "repo/issue/view_content/sidebar/due_deadline" .}} + + {{if .Repository.IsDependenciesEnabled $.Context}} +
    + + {{template "repo/issue/view_content/sidebar/dependencies" .}} + {{end}} + +
    + {{template "repo/issue/view_content/sidebar/reference" .}} + + {{if and .IsRepoAdmin (not .Repository.IsArchived)}} +
    + + {{template "repo/issue/view_content/sidebar/actions" .}} + {{end}} + + {{if and + .Issue.IsPull + .IsIssuePoster + (not .Issue.IsClosed) + .Issue.PullRequest.HeadRepo + (not (eq .Issue.PullRequest.HeadRepo.FullName .Issue.PullRequest.BaseRepo.FullName)) + .CanWriteToHeadRepo + }} +
    + {{template "repo/issue/view_content/sidebar/pull_maintainer_edits" .}} + {{end}} +
    diff --git a/templates/repo/issue/view_content/sidebar/actions.tmpl b/templates/repo/issue/view_content/sidebar/actions.tmpl new file mode 100644 index 0000000..36f2182 --- /dev/null +++ b/templates/repo/issue/view_content/sidebar/actions.tmpl @@ -0,0 +1,114 @@ +{{if or .PinEnabled .Issue.IsPinned}} +
    + {{$.CsrfTokenHtml}} + +
    +{{end}} + + + + + diff --git a/templates/repo/issue/view_content/sidebar/assignees.tmpl b/templates/repo/issue/view_content/sidebar/assignees.tmpl new file mode 100644 index 0000000..7a928fa --- /dev/null +++ b/templates/repo/issue/view_content/sidebar/assignees.tmpl @@ -0,0 +1,62 @@ + + +
    + + {{ctx.Locale.Tr "repo.issues.new.no_assignees"}} + {{if and .HasIssuesOrPullsWritePermission (not .Repository.IsArchived)}} + {{with index .Assignees 0}} + – + + {{ctx.Locale.Tr "repo.issues.new.assign_to_me"}} + + {{end}} + {{end}} + +
    + {{if .isExistingIssue}} + {{range .Issue.Assignees}} + + {{end}} + {{else}} + {{range .Assignees}} + + {{ctx.AvatarUtils.Avatar . 28 "tw-mr-2"}}{{.GetDisplayName}} + + {{end}} + {{end}} +
    +
    diff --git a/templates/repo/issue/view_content/sidebar/branch_selector_field.tmpl b/templates/repo/issue/view_content/sidebar/branch_selector_field.tmpl new file mode 100644 index 0000000..c23e13b --- /dev/null +++ b/templates/repo/issue/view_content/sidebar/branch_selector_field.tmpl @@ -0,0 +1,59 @@ +{{if and (not .Issue.IsPull) (not .PageIsComparePull)}} + + +
    + {{$.CsrfTokenHtml}} +
    +{{/* TODO: share this branch selector dropdown with the same in repo page */}} + + +
    +{{end}} diff --git a/templates/repo/issue/view_content/sidebar/dependencies.tmpl b/templates/repo/issue/view_content/sidebar/dependencies.tmpl new file mode 100644 index 0000000..6a9b651 --- /dev/null +++ b/templates/repo/issue/view_content/sidebar/dependencies.tmpl @@ -0,0 +1,146 @@ +
    + {{if (and (not .BlockedByDependencies) (not .BlockedByDependenciesNotPermitted) (not .BlockingDependencies) (not .BlockingDependenciesNotPermitted))}} + {{ctx.Locale.Tr "repo.issues.dependency.title"}} +
    +

    + {{if .Issue.IsPull}} + {{ctx.Locale.Tr "repo.issues.dependency.pr_no_dependencies"}} + {{else}} + {{ctx.Locale.Tr "repo.issues.dependency.issue_no_dependencies"}} + {{end}} +

    + {{end}} + + {{if or .BlockingDependencies .BlockingDependenciesNotPermitted}} + + {{ctx.Locale.Tr "repo.issues.dependency.blocks_short"}} + +
    + {{range .BlockingDependencies}} +
    +
    + + #{{.Issue.Index}} {{RenderRefIssueTitle $.Context .Issue.Title}}} + +
    + {{.Repository.OwnerName}}/{{.Repository.Name}} +
    +
    +
    + {{if and $.CanCreateIssueDependencies (not $.Repository.IsArchived)}} + + {{svg "octicon-trash" 16}} + + {{end}} +
    +
    + {{end}} + {{if .BlockingDependenciesNotPermitted}} +
    + {{ctx.Locale.TrN (len .BlockingDependenciesNotPermitted) "repo.issues.dependency.no_permission_1" "repo.issues.dependency.no_permission_n" (len .BlockingDependenciesNotPermitted)}} +
    + {{end}} +
    + {{end}} + + {{if or .BlockedByDependencies .BlockedByDependenciesNotPermitted}} + + {{ctx.Locale.Tr "repo.issues.dependency.blocked_by_short"}} + +
    + {{range .BlockedByDependencies}} +
    +
    + {{$title := RenderRefIssueTitle $.Context .Issue.Title}} + + #{{.Issue.Index}} {{RenderRefIssueTitle $.Context .Issue.Title}} + +
    + {{.Repository.OwnerName}}/{{.Repository.Name}} +
    +
    +
    + {{if and $.CanCreateIssueDependencies (not $.Repository.IsArchived)}} + + {{svg "octicon-trash" 16}} + + {{end}} +
    +
    + {{end}} + {{if $.CanCreateIssueDependencies}} + {{range .BlockedByDependenciesNotPermitted}} +
    +
    +
    + {{svg "octicon-lock" 16}} + + #{{.Issue.Index}} {{RenderRefIssueTitle $.Context .DependentIssue.Title}} + +
    +
    + {{.Repository.OwnerName}}/{{.Repository.Name}} +
    +
    +
    + {{if and $.CanCreateIssueDependencies (not $.Repository.IsArchived)}} + + {{svg "octicon-trash" 16}} + + {{end}} +
    +
    + {{end}} + {{else if .BlockedByDependenciesNotPermitted}} +
    + {{ctx.Locale.TrN (len .BlockedByDependenciesNotPermitted) "repo.issues.dependency.no_permission_1" "repo.issues.dependency.no_permission_n" (len .BlockedByDependenciesNotPermitted)}} +
    + {{end}} +
    + {{end}} + + {{if and .CanCreateIssueDependencies (not .Repository.IsArchived)}} +
    +
    + {{$.CsrfTokenHtml}} +
    + + +
    +
    +
    + {{end}} +
    + +{{if and .CanCreateIssueDependencies (not .Repository.IsArchived)}} + + + +{{end}} diff --git a/templates/repo/issue/view_content/sidebar/due_deadline.tmpl b/templates/repo/issue/view_content/sidebar/due_deadline.tmpl new file mode 100644 index 0000000..2de836b --- /dev/null +++ b/templates/repo/issue/view_content/sidebar/due_deadline.tmpl @@ -0,0 +1,41 @@ +{{ctx.Locale.Tr "repo.issues.due_date"}} +
    +
    + {{svg "octicon-x" 16 "close icon"}} + {{ctx.Locale.Tr "repo.issues.due_date_invalid"}} +
    + {{if ne .Issue.DeadlineUnix 0}} +

    +

    +
    + {{svg "octicon-calendar" 16 "tw-mr-2"}} + {{DateTime "long" .Issue.DeadlineUnix.FormatDate}} +
    +
    + {{if and .HasIssuesOrPullsWritePermission (not .Repository.IsArchived)}} + {{svg "octicon-pencil" 16 "tw-mr-1"}} + {{svg "octicon-trash"}} + {{end}} +
    +
    +

    + {{else}} +

    {{ctx.Locale.Tr "repo.issues.due_date_not_set"}}

    + {{end}} + + {{if and .HasIssuesOrPullsWritePermission (not .Repository.IsArchived)}} +
    +
    + {{$.CsrfTokenHtml}} + + +
    +
    + {{end}} +
    diff --git a/templates/repo/issue/view_content/sidebar/milestones.tmpl b/templates/repo/issue/view_content/sidebar/milestones.tmpl new file mode 100644 index 0000000..44d9419 --- /dev/null +++ b/templates/repo/issue/view_content/sidebar/milestones.tmpl @@ -0,0 +1,24 @@ + diff --git a/templates/repo/issue/view_content/sidebar/participants.tmpl b/templates/repo/issue/view_content/sidebar/participants.tmpl new file mode 100644 index 0000000..93e2579 --- /dev/null +++ b/templates/repo/issue/view_content/sidebar/participants.tmpl @@ -0,0 +1,8 @@ +{{ctx.Locale.TrN .NumParticipants "repo.issues.num_participants_one" "repo.issues.num_participants_few" .NumParticipants}} +
    + {{range .Participants}} + + {{ctx.AvatarUtils.Avatar . 28 "tw-my-0.5 tw-mr-1"}} + + {{end}} +
    diff --git a/templates/repo/issue/view_content/sidebar/projects.tmpl b/templates/repo/issue/view_content/sidebar/projects.tmpl new file mode 100644 index 0000000..91d75f3 --- /dev/null +++ b/templates/repo/issue/view_content/sidebar/projects.tmpl @@ -0,0 +1,54 @@ + +
    + {{ctx.Locale.Tr "repo.issues.new.no_projects"}} + +
    diff --git a/templates/repo/issue/view_content/sidebar/pull_maintainer_edits.tmpl b/templates/repo/issue/view_content/sidebar/pull_maintainer_edits.tmpl new file mode 100644 index 0000000..6ec5c05 --- /dev/null +++ b/templates/repo/issue/view_content/sidebar/pull_maintainer_edits.tmpl @@ -0,0 +1,10 @@ +
    +
    + + +
    +
    diff --git a/templates/repo/issue/view_content/sidebar/pull_review.tmpl b/templates/repo/issue/view_content/sidebar/pull_review.tmpl new file mode 100644 index 0000000..930c2a6 --- /dev/null +++ b/templates/repo/issue/view_content/sidebar/pull_review.tmpl @@ -0,0 +1,45 @@ + + +{{template "repo/issue/view_content/sidebar/pull_reviewers" .}} diff --git a/templates/repo/issue/view_content/sidebar/pull_reviewers.tmpl b/templates/repo/issue/view_content/sidebar/pull_reviewers.tmpl new file mode 100644 index 0000000..102508f --- /dev/null +++ b/templates/repo/issue/view_content/sidebar/pull_reviewers.tmpl @@ -0,0 +1,67 @@ +
    + {{ctx.Locale.Tr "repo.issues.new.no_reviewers"}} +
    + {{range .PullReviewers}} +
    +
    + {{if .User}} + {{ctx.AvatarUtils.Avatar .User 20 "tw-mr-2"}}{{.User.GetDisplayName}} + {{else if .Team}} + {{svg "octicon-people" 20 "tw-mr-2"}}{{$.Issue.Repo.OwnerName}}/{{.Team.Name}} + {{end}} +
    +
    + {{if (and $.Permission.IsAdmin (or (eq .Review.Type 1) (eq .Review.Type 3)) (not $.Issue.IsClosed) (not $.Issue.PullRequest.HasMerged))}} + + {{svg "octicon-x" 20}} + + + {{end}} + {{if .Review.Stale}} + + {{svg "octicon-hourglass" 16}} + + {{end}} + {{if and .CanChange (or .Checked (and (not $.Issue.IsClosed) (not $.Issue.PullRequest.HasMerged)))}} + {{if .Checked}}{{svg "octicon-trash"}}{{else}}{{svg "octicon-sync"}}{{end}} + {{end}} + {{svg (printf "octicon-%s" .Review.Type.Icon) 16 (printf "text %s" (.Review.HTMLTypeColorName))}} +
    +
    + {{end}} + {{range .OriginalReviews}} +
    + +
    + {{svg (printf "octicon-%s" .Type.Icon) 16 (printf "text %s" (.HTMLTypeColorName))}} +
    +
    + {{end}} +
    +
    diff --git a/templates/repo/issue/view_content/sidebar/pull_wip.tmpl b/templates/repo/issue/view_content/sidebar/pull_wip.tmpl new file mode 100644 index 0000000..f1588b3 --- /dev/null +++ b/templates/repo/issue/view_content/sidebar/pull_wip.tmpl @@ -0,0 +1,11 @@ +{{if and (or .HasIssuesOrPullsWritePermission .IsIssuePoster) (not .HasMerged) (not .Issue.IsClosed)}} + +{{end}} diff --git a/templates/repo/issue/view_content/sidebar/reference.tmpl b/templates/repo/issue/view_content/sidebar/reference.tmpl new file mode 100644 index 0000000..bbbc099 --- /dev/null +++ b/templates/repo/issue/view_content/sidebar/reference.tmpl @@ -0,0 +1,7 @@ +
    + {{$issueReferenceLink := printf "%s#%d" .Issue.Repo.FullName .Issue.Index}} +
    + {{ctx.Locale.Tr "repo.issues.reference_link" $issueReferenceLink}} + +
    +
    diff --git a/templates/repo/issue/view_content/sidebar/timetracking.tmpl b/templates/repo/issue/view_content/sidebar/timetracking.tmpl new file mode 100644 index 0000000..610600b --- /dev/null +++ b/templates/repo/issue/view_content/sidebar/timetracking.tmpl @@ -0,0 +1,73 @@ +{{if and .CanUseTimetracker (not .Repository.IsArchived)}} +
    +
    + {{ctx.Locale.Tr "repo.issues.tracker"}} +
    +
    + {{$.CsrfTokenHtml}} +
    +
    + {{$.CsrfTokenHtml}} +
    + {{if $.IsStopwatchRunning}} + + + {{else}} + {{if .HasUserStopwatch}} +
    + {{ctx.Locale.Tr "repo.issues.tracking_already_started" .OtherStopwatchURL}} +
    + {{end}} + + + + {{end}} +
    +
    +{{end}} +{{if .WorkingUsers}} +
    +
    + {{ctx.Locale.Tr "repo.issues.time_spent_from_all_authors" ($.Issue.TotalTrackedTime | Sec2Time)}} +
    + {{range $user, $trackedtime := .WorkingUsers}} +
    + + {{ctx.AvatarUtils.Avatar $user}} + +
    + {{template "shared/user/authorlink" $user}} +
    + {{$trackedtime|Sec2Time}} +
    +
    +
    + {{end}} +
    +
    +{{end}} diff --git a/templates/repo/issue/view_content/sidebar/watch.tmpl b/templates/repo/issue/view_content/sidebar/watch.tmpl new file mode 100644 index 0000000..ee14168 --- /dev/null +++ b/templates/repo/issue/view_content/sidebar/watch.tmpl @@ -0,0 +1,6 @@ +
    + {{ctx.Locale.Tr "notification.notifications"}} +
    + {{template "repo/issue/view_content/sidebar/watching" .}} +
    +
    diff --git a/templates/repo/issue/view_content/sidebar/watching.tmpl b/templates/repo/issue/view_content/sidebar/watching.tmpl new file mode 100644 index 0000000..d3d7594 --- /dev/null +++ b/templates/repo/issue/view_content/sidebar/watching.tmpl @@ -0,0 +1,19 @@ +
    + + +
    diff --git a/templates/repo/issue/view_content/update_branch_by_merge.tmpl b/templates/repo/issue/view_content/update_branch_by_merge.tmpl new file mode 100644 index 0000000..adce052 --- /dev/null +++ b/templates/repo/issue/view_content/update_branch_by_merge.tmpl @@ -0,0 +1,37 @@ +{{if and (gt $.Issue.PullRequest.CommitsBehind 0) (not $.Issue.IsClosed) (not $.Issue.PullRequest.IsChecking) (not $.IsPullFilesConflicted) (not $.IsPullRequestBroken)}} +
    +
    +
    + {{svg "octicon-alert"}} + {{ctx.Locale.Tr "repo.pulls.outdated_with_base_branch"}} +
    +
    + {{if and $.UpdateAllowed $.UpdateByRebaseAllowed}} +
    +
    + + +
    +
    + {{end}} + {{if and $.UpdateAllowed (not $.UpdateByRebaseAllowed)}} +
    + {{$.CsrfTokenHtml}} + +
    + {{end}} +
    +
    +{{end}} diff --git a/templates/repo/issue/view_title.tmpl b/templates/repo/issue/view_title.tmpl new file mode 100644 index 0000000..f60d958 --- /dev/null +++ b/templates/repo/issue/view_title.tmpl @@ -0,0 +1,144 @@ +{{if .Flash}} +
    + {{template "base/alert" .}} +
    +{{end}} +
    + {{$canEditIssueTitle := and (or .HasIssuesOrPullsWritePermission .IsIssuePoster) (not .Repository.IsArchived)}} +
    +

    + {{RenderIssueTitle $.Context .Issue.Title ($.Repository.ComposeMetas ctx)}} #{{.Issue.Index}} +

    +
    + {{if $canEditIssueTitle}} + + {{end}} + {{if not .Issue.IsPull}} + {{ctx.Locale.Tr "repo.issues.new"}} + {{end}} +
    +
    + {{if $canEditIssueTitle}} +
    +
    + +
    +
    + + +
    +
    + {{end}} +
    + {{if .HasMerged}} +
    {{svg "octicon-git-merge" 16 "tw-mr-1"}} {{if eq .Issue.PullRequest.Status 3}}{{ctx.Locale.Tr "repo.pulls.manually_merged"}}{{else}}{{ctx.Locale.Tr "repo.pulls.merged"}}{{end}}
    + {{else if .Issue.IsClosed}} +
    {{if .Issue.IsPull}}{{svg "octicon-git-pull-request-closed"}}{{else}}{{svg "octicon-issue-closed"}}{{end}} {{ctx.Locale.Tr "repo.issues.closed_title"}}
    + {{else if .Issue.IsPull}} + {{if .IsPullWorkInProgress}} +
    {{svg "octicon-git-pull-request-draft"}} {{ctx.Locale.Tr "repo.issues.draft_title"}}
    + {{else}} +
    {{svg "octicon-git-pull-request"}} {{ctx.Locale.Tr "repo.issues.open_title"}}
    + {{end}} + {{else}} +
    {{svg "octicon-issue-opened"}} {{ctx.Locale.Tr "repo.issues.open_title"}}
    + {{end}} +
    + {{if .Issue.IsPull}} + {{$headHref := .HeadTarget}} + {{if .HeadBranchLink}} + {{$headHref = HTMLFormat `%s` .HeadBranchLink $headHref}} + {{end}} + {{if not .MadeUsingAGit}} + {{$headHref = HTMLFormat `%s ` $headHref (ctx.Locale.Tr "copy_branch") .HeadTarget (svg "octicon-copy" 14)}} + {{end}} + {{$baseHref := .BaseTarget}} + {{if .BaseBranchLink}} + {{$baseHref = HTMLFormat `%s` .BaseBranchLink $baseHref}} + {{end}} + {{if .Issue.PullRequest.HasMerged}} + {{$mergedStr:= TimeSinceUnix .Issue.PullRequest.MergedUnix ctx.Locale}} + {{if .Issue.OriginalAuthor}} + {{.Issue.OriginalAuthor}} + {{ctx.Locale.TrN .NumCommits "repo.pulls.merged_title_desc_one" "repo.pulls.merged_title_desc_few" .NumCommits $headHref $baseHref $mergedStr}} + {{else}} + {{.Issue.PullRequest.Merger.GetDisplayName}} + {{ctx.Locale.TrN .NumCommits "repo.pulls.merged_title_desc_one" "repo.pulls.merged_title_desc_few" .NumCommits $headHref $baseHref $mergedStr}} + {{end}} + {{if .MadeUsingAGit}} + {{/* TODO: Move documentation link to the instructions at the bottom of the PR, show instructions when clicking label */}} + {{/* Note: #agit-label is necessary for testing whether the label appears when it should in tests/integration/git_test.go */}} + + + {{ctx.Locale.Tr "repo.pulls.made_using_agit"}} + + + {{end}} + {{else}} + {{if .Issue.OriginalAuthor}} + {{.Issue.OriginalAuthor}} {{ctx.Locale.TrN .NumCommits "repo.pulls.title_desc_one" "repo.pulls.title_desc_few" .NumCommits $headHref $baseHref}} + {{else}} + + {{.Issue.Poster.GetDisplayName}} + {{ctx.Locale.TrN .NumCommits "repo.pulls.title_desc_one" "repo.pulls.title_desc_few" .NumCommits $headHref $baseHref}} + + {{end}} + {{if .MadeUsingAGit}} + {{/* TODO: Move documentation link to the instructions at the bottom of the PR, show instructions when clicking label */}} + {{/* Note: #agit-label is necessary for testing whether the label appears when it should in tests/integration/git_test.go */}} + + + {{ctx.Locale.Tr "repo.pulls.made_using_agit"}} + + + {{end}} + + + {{svg "octicon-arrow-right"}} + + + {{end}} + {{else}} + {{$createdStr:= TimeSinceUnix .Issue.CreatedUnix ctx.Locale}} + + {{if .Issue.OriginalAuthor}} + {{ctx.Locale.Tr "repo.issues.opened_by_fake" $createdStr .Issue.OriginalAuthor}} + {{else if gt .Issue.Poster.ID 0}} + {{ctx.Locale.Tr "repo.issues.opened_by" $createdStr .Issue.Poster.HomeLink .Issue.Poster.GetDisplayName}} + {{else}} + {{ctx.Locale.Tr "repo.issues.opened_by_fake" $createdStr .Issue.Poster.GetDisplayName}} + {{end}} + · + {{ctx.Locale.TrN .Issue.NumComments "repo.issues.num_comments_1" "repo.issues.num_comments" .Issue.NumComments}} + + {{end}} +
    +
    +
    diff --git a/templates/repo/latest_commit.tmpl b/templates/repo/latest_commit.tmpl new file mode 100644 index 0000000..222d582 --- /dev/null +++ b/templates/repo/latest_commit.tmpl @@ -0,0 +1,31 @@ +{{if not .LatestCommit}} +
    +{{else}} + {{if .LatestCommitUser}} + {{ctx.AvatarUtils.Avatar .LatestCommitUser 24 "tw-mr-2"}} + {{if and .LatestCommitUser.FullName DefaultShowFullName}} + {{.LatestCommitUser.FullName}} + {{else}} + {{if .LatestCommit.Author}}{{.LatestCommit.Author.Name}}{{else}}{{.LatestCommitUser.Name}}{{end}} + {{end}} + {{else}} + {{if .LatestCommit.Author}} + {{ctx.AvatarUtils.AvatarByEmail .LatestCommit.Author.Email .LatestCommit.Author.Name 24 "tw-mr-2"}} + {{.LatestCommit.Author.Name}} + {{end}} + {{end}} + + {{ShortSha .LatestCommit.ID.String}} + {{if .LatestCommit.Signature}} + {{template "repo/shabox_badge" dict "root" $ "verification" .LatestCommitVerification}} + {{end}} + + {{template "repo/commit_statuses" dict "Status" .LatestCommitStatus "Statuses" .LatestCommitStatuses}} + {{$commitLink:= printf "%s/commit/%s" .RepoLink (PathEscape .LatestCommit.ID.String)}} + {{RenderCommitMessageLinkSubject $.Context .LatestCommit.Message $commitLink ($.Repository.ComposeMetas ctx)}} + {{if IsMultilineCommitMessage .LatestCommit.Message}} + +
    {{RenderCommitBody $.Context .LatestCommit.Message ($.Repository.ComposeMetas ctx)}}
    + {{end}} +
    +{{end}} diff --git a/templates/repo/migrate/codebase.tmpl b/templates/repo/migrate/codebase.tmpl new file mode 100644 index 0000000..cf46c8d --- /dev/null +++ b/templates/repo/migrate/codebase.tmpl @@ -0,0 +1,126 @@ +{{template "base/head" .}} +
    +
    +
    +
    + {{template "base/disable_form_autofill"}} + {{.CsrfTokenHtml}} +

    + {{ctx.Locale.Tr "repo.migrate.migrate" .service.Title}} + +

    +
    + {{template "base/alert" .}} +
    + + + + {{ctx.Locale.Tr "repo.migrate.clone_address_desc"}}{{if .ContextUser.CanImportLocal}} {{ctx.Locale.Tr "repo.migrate.clone_local_path"}}{{end}} + +
    + +
    + + +
    +
    + + +
    + + {{template "repo/migrate/options" .}} + +
    +
    + +
    + + +
    +
    +
    + +
    + + +
    +
    +
    + +
    + + +
    +
    +
    + +
    + + +
    +
    +
    + +
    + +
    + + +
    + +
    + + +
    +
    + +
    + + +
    + {{if .IsForcedPrivate}} + {{ctx.Locale.Tr "repo.visibility_helper_forced"}} + {{end}} + {{ctx.Locale.Tr "repo.visibility_description"}} +
    +
    + + +
    + +
    + + +
    +
    +
    +
    +
    +
    +{{template "base/footer" .}} diff --git a/templates/repo/migrate/forgejo.tmpl b/templates/repo/migrate/forgejo.tmpl new file mode 100644 index 0000000..3caadbe --- /dev/null +++ b/templates/repo/migrate/forgejo.tmpl @@ -0,0 +1 @@ +{{template "repo/migrate/gitea" .}} diff --git a/templates/repo/migrate/git.tmpl b/templates/repo/migrate/git.tmpl new file mode 100644 index 0000000..5ebf4cf --- /dev/null +++ b/templates/repo/migrate/git.tmpl @@ -0,0 +1,94 @@ +{{template "base/head" .}} +
    +
    +
    +
    + {{template "base/disable_form_autofill"}} + {{.CsrfTokenHtml}} +

    + {{ctx.Locale.Tr "repo.migrate.migrate" .service.Title}} + +

    +
    + {{template "base/alert" .}} +
    + + + + {{ctx.Locale.Tr "repo.migrate.clone_address_desc"}}{{if .ContextUser.CanImportLocal}} {{ctx.Locale.Tr "repo.migrate.clone_local_path"}}{{end}} + +
    +
    + + +
    +
    + + +
    + + {{template "repo/migrate/options" .}} + +
    + +
    + + +
    + +
    + + +
    +
    + +
    + + +
    + {{if .IsForcedPrivate}} + {{ctx.Locale.Tr "repo.visibility_helper_forced"}} + {{end}} + {{ctx.Locale.Tr "repo.visibility_description"}} +
    +
    + + +
    + +
    + + +
    +
    +
    +
    +
    +
    +{{template "base/footer" .}} diff --git a/templates/repo/migrate/gitbucket.tmpl b/templates/repo/migrate/gitbucket.tmpl new file mode 100644 index 0000000..e8d6b60 --- /dev/null +++ b/templates/repo/migrate/gitbucket.tmpl @@ -0,0 +1,142 @@ +{{template "base/head" .}} +
    +
    +
    +
    + {{template "base/disable_form_autofill"}} + {{.CsrfTokenHtml}} +

    + {{ctx.Locale.Tr "repo.migrate.migrate" .service.Title}} + +

    +
    + {{template "base/alert" .}} +
    + + + + {{ctx.Locale.Tr "repo.migrate.clone_address_desc"}}{{if .ContextUser.CanImportLocal}} {{ctx.Locale.Tr "repo.migrate.clone_local_path"}}{{end}} + +
    + +
    + + +
    +
    + + +
    + + {{template "repo/migrate/options" .}} + +
    + +
    + + +
    +
    + +
    + {{ctx.Locale.Tr "repo.migrate.migrate_items_options"}} +
    + +
    + + +
    +
    +
    + +
    + + +
    +
    +
    + +
    + + +
    +
    +
    + +
    + + +
    +
    +
    + +
    + + +
    +
    +
    + +
    + +
    + + +
    + +
    + + +
    +
    + +
    + + +
    + {{if .IsForcedPrivate}} + {{ctx.Locale.Tr "repo.visibility_helper_forced"}} + {{end}} + {{ctx.Locale.Tr "repo.visibility_description"}} +
    +
    + + +
    + +
    + + +
    +
    +
    +
    +
    +
    +{{template "base/footer" .}} diff --git a/templates/repo/migrate/gitea.tmpl b/templates/repo/migrate/gitea.tmpl new file mode 100644 index 0000000..2f40d58 --- /dev/null +++ b/templates/repo/migrate/gitea.tmpl @@ -0,0 +1,138 @@ +{{template "base/head" .}} +
    +
    +
    +
    + {{.CsrfTokenHtml}} +

    + {{ctx.Locale.Tr "repo.migrate.migrate" .service.Title}} + +

    +
    + {{template "base/alert" .}} +
    + + + + {{ctx.Locale.Tr "repo.migrate.clone_address_desc"}}{{if .ContextUser.CanImportLocal}} {{ctx.Locale.Tr "repo.migrate.clone_local_path"}}{{end}} + +
    + +
    + + + {{svg "octicon-question"}} +
    + + {{template "repo/migrate/options" .}} + +
    + +
    + + +
    +
    + +
    + {{ctx.Locale.Tr "repo.migrate.migrate_items_options"}} +
    + +
    + + +
    +
    +
    + +
    + + +
    +
    +
    + +
    + + +
    +
    +
    + +
    + + +
    +
    +
    + +
    + + +
    +
    +
    + +
    + +
    + + +
    + +
    + + +
    +
    + +
    + + +
    + {{if .IsForcedPrivate}} + {{ctx.Locale.Tr "repo.visibility_helper_forced"}} + {{end}} + {{ctx.Locale.Tr "repo.visibility_description"}} +
    +
    + + +
    + +
    + + +
    +
    +
    +
    +
    +
    +{{template "base/footer" .}} diff --git a/templates/repo/migrate/github.tmpl b/templates/repo/migrate/github.tmpl new file mode 100644 index 0000000..91c1a27 --- /dev/null +++ b/templates/repo/migrate/github.tmpl @@ -0,0 +1,140 @@ +{{template "base/head" .}} +
    +
    +
    +
    + {{.CsrfTokenHtml}} +

    + {{ctx.Locale.Tr "repo.migrate.migrate" .service.Title}} + +

    +
    + {{template "base/alert" .}} +
    + + + + {{ctx.Locale.Tr "repo.migrate.clone_address_desc"}} + +
    + +
    + + + {{svg "octicon-question"}} + + {{ctx.Locale.Tr "repo.migrate.github_token_desc"}} + +
    + + {{template "repo/migrate/options" .}} + +
    + +
    + + +
    +
    +
    + {{ctx.Locale.Tr "repo.migrate.migrate_items_options"}} +
    + +
    + + +
    +
    +
    + +
    + + +
    +
    +
    + +
    + + +
    +
    +
    + +
    + + +
    +
    +
    + +
    + + +
    +
    +
    + +
    + +
    + + +
    + +
    + + +
    +
    + +
    + + +
    + {{if .IsForcedPrivate}} + {{ctx.Locale.Tr "repo.visibility_helper_forced"}} + {{end}} + {{ctx.Locale.Tr "repo.visibility_description"}} +
    +
    + + +
    + +
    + + +
    +
    +
    +
    +
    +
    +{{template "base/footer" .}} diff --git a/templates/repo/migrate/gitlab.tmpl b/templates/repo/migrate/gitlab.tmpl new file mode 100644 index 0000000..d93a001 --- /dev/null +++ b/templates/repo/migrate/gitlab.tmpl @@ -0,0 +1,137 @@ +{{template "base/head" .}} +
    +
    +
    +
    + {{.CsrfTokenHtml}} +

    + {{ctx.Locale.Tr "repo.migrate.migrate" .service.Title}} + +

    +
    + {{template "base/alert" .}} +
    + + + + {{ctx.Locale.Tr "repo.migrate.clone_address_desc"}}{{if .ContextUser.CanImportLocal}} {{ctx.Locale.Tr "repo.migrate.clone_local_path"}}{{end}} + +
    + +
    + + + {{svg "octicon-question"}} +
    + + {{template "repo/migrate/options" .}} + +
    + +
    + + +
    +
    +
    + {{ctx.Locale.Tr "repo.migrate.migrate_items_options"}} +
    + +
    + + +
    +
    +
    + +
    + + +
    +
    +
    + +
    + + +
    +
    +
    + +
    + + +
    +
    +
    + +
    + + +
    +
    +
    + +
    + +
    + + +
    + +
    + + +
    +
    + +
    + + +
    + {{if .IsForcedPrivate}} + {{ctx.Locale.Tr "repo.visibility_helper_forced"}} + {{end}} + {{ctx.Locale.Tr "repo.visibility_description"}} +
    +
    + + +
    + +
    + + +
    +
    +
    +
    +
    +
    +{{template "base/footer" .}} diff --git a/templates/repo/migrate/gogs.tmpl b/templates/repo/migrate/gogs.tmpl new file mode 100644 index 0000000..6c647be --- /dev/null +++ b/templates/repo/migrate/gogs.tmpl @@ -0,0 +1,137 @@ +{{template "base/head" .}} +
    +
    +
    +
    + {{.CsrfTokenHtml}} +

    + {{ctx.Locale.Tr "repo.migrate.migrate" .service.Title}} + +

    +
    + {{template "base/alert" .}} +
    + + + + {{ctx.Locale.Tr "repo.migrate.clone_address_desc"}}{{if .ContextUser.CanImportLocal}} {{ctx.Locale.Tr "repo.migrate.clone_local_path"}}{{end}} + +
    + +
    + + + +
    + + {{template "repo/migrate/options" .}} + +
    + +
    + + +
    +
    + +
    + {{ctx.Locale.Tr "repo.migrate.migrate_items_options"}} +
    + +
    + + +
    +
    +
    + +
    + + +
    +
    +
    + +
    + + +
    +
    + +
    + +
    + +
    + + +
    + +
    + + +
    +
    + +
    + + +
    + {{if .IsForcedPrivate}} + {{ctx.Locale.Tr "repo.visibility_helper_forced"}} + {{end}} + {{ctx.Locale.Tr "repo.visibility_description"}} +
    +
    + + +
    + +
    + + +
    +
    +
    +
    +
    +
    +{{template "base/footer" .}} diff --git a/templates/repo/migrate/helper.tmpl b/templates/repo/migrate/helper.tmpl new file mode 100644 index 0000000..e69de29 diff --git a/templates/repo/migrate/migrate.tmpl b/templates/repo/migrate/migrate.tmpl new file mode 100644 index 0000000..c5c697e --- /dev/null +++ b/templates/repo/migrate/migrate.tmpl @@ -0,0 +1,32 @@ +{{template "base/head" .}} + +{{template "base/footer" .}} diff --git a/templates/repo/migrate/migrating.tmpl b/templates/repo/migrate/migrating.tmpl new file mode 100644 index 0000000..0b53636 --- /dev/null +++ b/templates/repo/migrate/migrating.tmpl @@ -0,0 +1,101 @@ +{{template "base/head" .}} +
    + {{template "repo/header" .}} +
    +
    +
    + {{template "base/alert" .}} +
    +
    +
    +
    + +
    +
    +
    +
    + {{svg "octicon-git-pull-request-closed" 256 "ui red icon"}} +
    +
    +
    +
    +
    +
    +

    {{ctx.Locale.Tr "repo.migrate.migrating" .CloneAddr}}

    +

    +
    +
    + {{if .CloneAddr}} +

    {{ctx.Locale.Tr "repo.migrate.migrating_failed" .CloneAddr}}

    + {{else}} +

    {{ctx.Locale.Tr "repo.migrate.migrating_failed_no_addr"}}

    + {{end}} +

    +
    + {{if .Permission.IsAdmin}} +
    +
    + {{if .Failed}} + + {{else}} + + {{end}} + +
    + {{end}} +
    +
    +
    +
    +
    +
    +
    + + + + + +{{template "base/footer" .}} diff --git a/templates/repo/migrate/onedev.tmpl b/templates/repo/migrate/onedev.tmpl new file mode 100644 index 0000000..ec15555 --- /dev/null +++ b/templates/repo/migrate/onedev.tmpl @@ -0,0 +1,126 @@ +{{template "base/head" .}} +
    +
    +
    +
    + {{template "base/disable_form_autofill"}} + {{.CsrfTokenHtml}} +

    + {{ctx.Locale.Tr "repo.migrate.migrate" .service.Title}} + +

    +
    + {{template "base/alert" .}} +
    + + + + {{ctx.Locale.Tr "repo.migrate.clone_address_desc"}}{{if .ContextUser.CanImportLocal}} {{ctx.Locale.Tr "repo.migrate.clone_local_path"}}{{end}} + +
    + +
    + + +
    +
    + + +
    + + {{template "repo/migrate/options" .}} + +
    +
    + +
    + + +
    +
    +
    + +
    + + +
    +
    +
    + +
    + + +
    +
    +
    + +
    + + +
    +
    +
    + +
    + +
    + + +
    + +
    + + +
    +
    + +
    + + +
    + {{if .IsForcedPrivate}} + {{ctx.Locale.Tr "repo.visibility_helper_forced"}} + {{end}} + {{ctx.Locale.Tr "repo.visibility_description"}} +
    +
    + + +
    + +
    + + +
    +
    +
    +
    +
    +
    +{{template "base/footer" .}} diff --git a/templates/repo/migrate/options.tmpl b/templates/repo/migrate/options.tmpl new file mode 100644 index 0000000..8a46e57 --- /dev/null +++ b/templates/repo/migrate/options.tmpl @@ -0,0 +1,26 @@ +{{if not .DisableNewPullMirrors}} +
    + +
    + + +
    +
    +{{end}} +{{if .LFSActive}} +
    + +
    + + +
    + ({{ctx.Locale.Tr "repo.settings.advanced_settings"}}) +
    +
    + {{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"}}{{if .ContextUser.CanImportLocal}} {{ctx.Locale.Tr "repo.migrate_options_lfs_endpoint.description.local"}}{{end}} +
    + + +
    +
    +{{end}} diff --git a/templates/repo/navbar.tmpl b/templates/repo/navbar.tmpl new file mode 100644 index 0000000..b2471dc --- /dev/null +++ b/templates/repo/navbar.tmpl @@ -0,0 +1,14 @@ + diff --git a/templates/repo/packages.tmpl b/templates/repo/packages.tmpl new file mode 100644 index 0000000..14e32c1 --- /dev/null +++ b/templates/repo/packages.tmpl @@ -0,0 +1,8 @@ +{{template "base/head" .}} +
    + {{template "repo/header" .}} +
    + {{template "package/shared/list" .}} +
    +
    +{{template "base/footer" .}} diff --git a/templates/repo/projects/list.tmpl b/templates/repo/projects/list.tmpl new file mode 100644 index 0000000..9eae401 --- /dev/null +++ b/templates/repo/projects/list.tmpl @@ -0,0 +1,8 @@ +{{template "base/head" .}} +
    + {{template "repo/header" .}} +
    + {{template "projects/list" .}} +
    +
    +{{template "base/footer" .}} diff --git a/templates/repo/projects/new.tmpl b/templates/repo/projects/new.tmpl new file mode 100644 index 0000000..e70f3bc --- /dev/null +++ b/templates/repo/projects/new.tmpl @@ -0,0 +1,8 @@ +{{template "base/head" .}} +
    + {{template "repo/header" .}} +
    + {{template "projects/new" .}} +
    +
    +{{template "base/footer" .}} diff --git a/templates/repo/projects/view.tmpl b/templates/repo/projects/view.tmpl new file mode 100644 index 0000000..05ad726 --- /dev/null +++ b/templates/repo/projects/view.tmpl @@ -0,0 +1,15 @@ +{{template "base/head" .}} +
    + {{template "repo/header" .}} +
    +
    + {{template "repo/issue/navbar" .}} + {{ctx.Locale.Tr "repo.issues.new"}} +
    +
    +
    + {{template "projects/view" .}} +
    +
    + +{{template "base/footer" .}} diff --git a/templates/repo/pulls/commits.tmpl b/templates/repo/pulls/commits.tmpl new file mode 100644 index 0000000..bf6e812 --- /dev/null +++ b/templates/repo/pulls/commits.tmpl @@ -0,0 +1,10 @@ +{{template "base/head" .}} +
    + {{template "repo/header" .}} +
    + {{template "repo/issue/view_title" .}} + {{template "repo/pulls/tab_menu" .}} + {{template "repo/commits_table" .}} +
    +
    +{{template "base/footer" .}} diff --git a/templates/repo/pulls/files.tmpl b/templates/repo/pulls/files.tmpl new file mode 100644 index 0000000..402bec8 --- /dev/null +++ b/templates/repo/pulls/files.tmpl @@ -0,0 +1,14 @@ +{{template "base/head" .}} + + + + +
    + {{template "repo/header" .}} +
    + {{template "repo/issue/view_title" .}} + {{template "repo/pulls/tab_menu" .}} + {{template "repo/diff/box" .}} +
    +
    +{{template "base/footer" .}} diff --git a/templates/repo/pulls/fork.tmpl b/templates/repo/pulls/fork.tmpl new file mode 100644 index 0000000..2cf0a85 --- /dev/null +++ b/templates/repo/pulls/fork.tmpl @@ -0,0 +1,90 @@ +{{template "base/head" .}} +
    +
    +
    +
    + {{.CsrfTokenHtml}} +

    + {{ctx.Locale.Tr "new_fork"}} +

    +
    + {{template "base/alert" .}} +
    + + +
    + +
    + + {{.ForkRepo.FullName}} +
    +
    + + +
    +
    + +
    + + +
    + {{ctx.Locale.Tr "repo.fork_visibility_helper"}} +
    +
    + + +
    +
    + + +
    + +
    + + +
    +
    +
    +
    +
    +
    +{{template "base/footer" .}} diff --git a/templates/repo/pulls/status.tmpl b/templates/repo/pulls/status.tmpl new file mode 100644 index 0000000..e8636ba --- /dev/null +++ b/templates/repo/pulls/status.tmpl @@ -0,0 +1,59 @@ +{{/* +Template Attributes: +* CommitStatus: summary of all commit status state +* CommitStatuses: all commit status elements +* MissingRequiredChecks: commit check contexts that are required by branch protection but not present +* ShowHideChecks: whether use a button to show/hide the checks +* is_context_required: Used in pull request commit status check table +*/}} + +{{if .CommitStatus}} +
    +
    + {{if or (eq .CommitStatus.State "pending") (.MissingRequiredChecks)}} + {{ctx.Locale.Tr "repo.pulls.status_checking"}} + {{else if eq .CommitStatus.State "success"}} + {{ctx.Locale.Tr "repo.pulls.status_checks_success"}} + {{else if eq .CommitStatus.State "warning"}} + {{ctx.Locale.Tr "repo.pulls.status_checks_warning"}} + {{else if eq .CommitStatus.State "failure"}} + {{ctx.Locale.Tr "repo.pulls.status_checks_failure"}} + {{else if eq .CommitStatus.State "error"}} + {{ctx.Locale.Tr "repo.pulls.status_checks_error"}} + {{else}} + {{ctx.Locale.Tr "repo.pulls.status_checking"}} + {{end}} + + {{if .ShowHideChecks}} +
    + +
    + {{end}} +
    + +
    + {{range .CommitStatuses}} +
    + {{template "repo/commit_status" .}} +
    {{.Context}} {{.Description}}
    +
    + {{if $.is_context_required}} + {{if (call $.is_context_required .Context)}}
    {{ctx.Locale.Tr "repo.pulls.status_checks_requested"}}
    {{end}} + {{end}} + {{if .TargetURL}}{{ctx.Locale.Tr "repo.pulls.status_checks_details"}}{{end}} +
    +
    + {{end}} + {{range .MissingRequiredChecks}} +
    + {{svg "octicon-dot-fill" 18 "commit-status icon text yellow"}} +
    {{.}}
    +
    {{ctx.Locale.Tr "repo.pulls.status_checks_requested"}}
    +
    + {{end}} +
    +
    +{{end}} diff --git a/templates/repo/pulls/tab_menu.tmpl b/templates/repo/pulls/tab_menu.tmpl new file mode 100644 index 0000000..d5a8d6e --- /dev/null +++ b/templates/repo/pulls/tab_menu.tmpl @@ -0,0 +1,28 @@ + diff --git a/templates/repo/pulse.tmpl b/templates/repo/pulse.tmpl new file mode 100644 index 0000000..3554cf6 --- /dev/null +++ b/templates/repo/pulse.tmpl @@ -0,0 +1,239 @@ +

    + {{DateTime "long" .DateFrom}} - {{DateTime "long" .DateUntil}} + + +

    + +{{if (or (.Permission.CanRead $.UnitTypeIssues) (.Permission.CanRead $.UnitTypePullRequests))}} +

    {{ctx.Locale.Tr "repo.activity.overview"}}

    +
    + {{if .Permission.CanRead $.UnitTypePullRequests}} +
    + {{if gt .Activity.ActivePRCount 0}} +
    + {{if gt .Activity.MergedPRPerc 0}} + + {{end}} + +
    + {{else}} +
    + +
    + {{end}} + {{ctx.Locale.TrN .Activity.ActivePRCount "repo.activity.active_prs_count_1" "repo.activity.active_prs_count_n" .Activity.ActivePRCount}} +
    + {{end}} + {{if .Permission.CanRead $.UnitTypeIssues}} +
    + {{if gt .Activity.ActiveIssueCount 0}} +
    + {{if gt .Activity.ClosedIssuePerc 0}} + + {{end}} + +
    + {{else}} +
    + +
    + {{end}} + {{ctx.Locale.TrN .Activity.ActiveIssueCount "repo.activity.active_issues_count_1" "repo.activity.active_issues_count_n" .Activity.ActiveIssueCount}} +
    + {{end}} +
    + +{{end}} + +{{if .Permission.CanRead $.UnitTypeCode}} + {{if eq .Activity.Code.CommitCountInAllBranches 0}} +
    +

    {{ctx.Locale.Tr "repo.activity.no_git_activity"}}

    +
    + {{end}} + {{if gt .Activity.Code.CommitCountInAllBranches 0}} +
    +
    + {{ctx.Locale.Tr "repo.activity.git_stats_exclude_merges"}} + {{ctx.Locale.TrN .Activity.Code.AuthorCount "repo.activity.git_stats_author_1" "repo.activity.git_stats_author_n" .Activity.Code.AuthorCount}} + {{ctx.Locale.TrN .Activity.Code.AuthorCount "repo.activity.git_stats_pushed_1" "repo.activity.git_stats_pushed_n"}} + {{ctx.Locale.TrN .Activity.Code.CommitCount "repo.activity.git_stats_commit_1" "repo.activity.git_stats_commit_n" .Activity.Code.CommitCount}} + {{ctx.Locale.Tr "repo.activity.git_stats_push_to_branch" .Repository.DefaultBranch}} + {{ctx.Locale.TrN .Activity.Code.CommitCountInAllBranches "repo.activity.git_stats_commit_1" "repo.activity.git_stats_commit_n" .Activity.Code.CommitCountInAllBranches}} + {{ctx.Locale.Tr "repo.activity.git_stats_push_to_all_branches"}} + {{ctx.Locale.Tr "repo.activity.git_stats_on_default_branch" .Repository.DefaultBranch}} + {{ctx.Locale.TrN .Activity.Code.ChangedFiles "repo.activity.git_stats_file_1" "repo.activity.git_stats_file_n" .Activity.Code.ChangedFiles}} + {{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"}} + {{ctx.Locale.TrN .Activity.Code.Additions "repo.activity.git_stats_addition_1" "repo.activity.git_stats_addition_n" .Activity.Code.Additions}} + {{ctx.Locale.Tr "repo.activity.git_stats_and_deletions"}} + {{ctx.Locale.TrN .Activity.Code.Deletions "repo.activity.git_stats_deletion_1" "repo.activity.git_stats_deletion_n" .Activity.Code.Deletions}}. +
    +
    +
    +
    +
    + {{end}} +{{end}} + +{{if gt .Activity.PublishedReleaseCount 0}} +

    + {{svg "octicon-tag" 16 "tw-mr-2"}} + {{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) + }} +

    +
    + {{range .Activity.PublishedReleases}} +

    + {{if .IsTag}} + {{ctx.Locale.Tr "repo.activity.published_tag_label"}} + {{else if .IsPrerelease}} + {{ctx.Locale.Tr "repo.activity.published_prerelease_label"}} + {{else}} + {{ctx.Locale.Tr "repo.activity.published_release_label"}} + {{end}} + {{if .IsTag}} + {{.TagName}} + {{else}} + {{.TagName}} + {{.Title | RenderEmoji $.Context | RenderCodeBlock}} + {{end}} + {{TimeSinceUnix .CreatedUnix ctx.Locale}} +

    + {{end}} +
    +{{end}} + +{{if gt .Activity.MergedPRCount 0}} +

    + {{svg "octicon-git-pull-request" 16 "tw-mr-2"}} + {{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) + }} +

    +
    + {{range .Activity.MergedPRs}} +

    + {{ctx.Locale.Tr "repo.activity.merged_prs_label"}} + #{{.Index}} {{RenderRefIssueTitle $.Context .Issue.Title}} + {{TimeSinceUnix .MergedUnix ctx.Locale}} +

    + {{end}} +
    +{{end}} + +{{if gt .Activity.OpenedPRCount 0}} +

    + {{svg "octicon-git-branch" 16 "tw-mr-2"}} + {{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) + }} +

    +
    + {{range .Activity.OpenedPRs}} +

    + {{ctx.Locale.Tr "repo.activity.opened_prs_label"}} + #{{.Index}} {{RenderRefIssueTitle $.Context .Issue.Title}} + {{TimeSinceUnix .Issue.CreatedUnix ctx.Locale}} +

    + {{end}} +
    +{{end}} + +{{if gt .Activity.ClosedIssueCount 0}} +

    + {{svg "octicon-issue-closed" 16 "tw-mr-2"}} + {{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) + }} +

    +
    + {{range .Activity.ClosedIssues}} +

    + {{ctx.Locale.Tr "repo.activity.closed_issue_label"}} + #{{.Index}} {{RenderRefIssueTitle $.Context .Title}} + {{TimeSinceUnix .ClosedUnix ctx.Locale}} +

    + {{end}} +
    +{{end}} + +{{if gt .Activity.OpenedIssueCount 0}} +

    + {{svg "octicon-issue-opened" 16 "tw-mr-2"}} + {{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) + }} +

    +
    + {{range .Activity.OpenedIssues}} +

    + {{ctx.Locale.Tr "repo.activity.new_issue_label"}} + #{{.Index}} {{RenderRefIssueTitle $.Context .Title}} + {{TimeSinceUnix .CreatedUnix ctx.Locale}} +

    + {{end}} +
    +{{end}} + +{{if gt .Activity.UnresolvedIssueCount 0}} +

    + {{svg "octicon-comment-discussion" 16 "tw-mr-2"}} + {{ctx.Locale.TrN .Activity.UnresolvedIssueCount "repo.activity.title.unresolved_conv_1" "repo.activity.title.unresolved_conv_n" .Activity.UnresolvedIssueCount}} +

    +
    + {{range .Activity.UnresolvedIssues}} +

    + {{ctx.Locale.Tr "repo.activity.unresolved_conv_label"}} + #{{.Index}} + {{if .IsPull}} + {{RenderRefIssueTitle $.Context .Title}} + {{else}} + {{RenderRefIssueTitle $.Context .Title}} + {{end}} + {{TimeSinceUnix .UpdatedUnix ctx.Locale}} +

    + {{end}} +
    +{{end}} diff --git a/templates/repo/recent_commits.tmpl b/templates/repo/recent_commits.tmpl new file mode 100644 index 0000000..5c241d6 --- /dev/null +++ b/templates/repo/recent_commits.tmpl @@ -0,0 +1,9 @@ +{{if .Permission.CanRead $.UnitTypeCode}} +
    +
    +{{end}} diff --git a/templates/repo/release/list.tmpl b/templates/repo/release/list.tmpl new file mode 100644 index 0000000..cc5c670 --- /dev/null +++ b/templates/repo/release/list.tmpl @@ -0,0 +1,142 @@ +{{template "base/head" .}} +
    + {{template "repo/header" .}} +
    + {{template "base/alert" .}} + {{template "repo/release_tag_header" .}} +
      + {{range $idx, $info := .Releases}} + {{$release := $info.Release}} +
    • +
      + {{svg "octicon-tag" 16 "tw-mr-1"}}{{$release.TagName}} + {{if and $release.Sha1 ($.Permission.CanRead $.UnitTypeCode)}} + {{svg "octicon-git-commit" 16 "tw-mr-1"}}{{ShortSha $release.Sha1}} + {{template "repo/branch_dropdown" dict "root" $ "release" $release}} + {{end}} +
      +
      +
      +

      + {{$release.Title}} + {{template "repo/commit_statuses" dict "Status" $info.CommitStatus "Statuses" $info.CommitStatuses "AdditionalClasses" "tw-flex"}} + {{if $release.IsDraft}} + {{ctx.Locale.Tr "repo.release.draft"}} + {{else if $release.IsPrerelease}} + {{ctx.Locale.Tr "repo.release.prerelease"}} + {{else if (not $release.IsTag)}} + {{ctx.Locale.Tr "repo.release.stable"}} + {{end}} +

      +
      + {{if $.CanCreateRelease}} + + {{svg "octicon-pencil"}} + + {{end}} +
      +
      +

      + + {{if $release.OriginalAuthor}} + {{svg (MigrationIcon $release.Repo.GetOriginalURLHostname) 20 "tw-mr-1"}}{{$release.OriginalAuthor}} + {{else if $release.Publisher}} + {{ctx.AvatarUtils.Avatar $release.Publisher 20 "tw-mr-1"}} + {{$release.Publisher.GetDisplayName}} + {{else}} + Ghost + {{end}} + + + {{ctx.Locale.Tr "repo.released_this"}} + + {{if $release.CreatedUnix}} + {{TimeSinceUnix $release.CreatedUnix ctx.Locale}} + {{end}} + {{if and (not $release.IsDraft) ($.Permission.CanRead $.UnitTypeCode)}} + | {{ctx.Locale.Tr "repo.release.ahead.commits" $release.NumCommitsBehind}} {{ctx.Locale.Tr "repo.release.ahead.target" $release.TargetBehind}} + {{end}} +

      + {{template "repo/tag/verification_line" (dict "ctxData" $ "release" $release)}} +
      + {{$release.RenderedNote}} +
      + {{$hasReleaseAttachment := gt (len $release.Attachments) 0}} + {{$hasArchiveLinks := and (not $.DisableDownloadSourceArchives) (not $release.IsDraft) (not $release.HideArchiveLinks) ($.Permission.CanRead $.UnitTypeCode)}} + {{if or $hasArchiveLinks $hasReleaseAttachment}} +
      +
      + + {{ctx.Locale.Tr "repo.release.downloads"}} + + +
      + {{end}} +
      +
      +
    • + {{end}} +
    + + {{template "base/paginate" .}} +
    +
    + +{{if (and ($.Permission.CanWrite $.UnitTypeCode) .PageIsTagList)}} + +{{end}} + +{{template "base/footer" .}} diff --git a/templates/repo/release/new.tmpl b/templates/repo/release/new.tmpl new file mode 100644 index 0000000..9bbd11f --- /dev/null +++ b/templates/repo/release/new.tmpl @@ -0,0 +1,183 @@ +{{template "base/head" .}} +
    + {{template "repo/header" .}} +
    +

    + {{if .PageIsEditRelease}} + {{ctx.Locale.Tr "repo.release.edit_release"}} +
    {{ctx.Locale.Tr "repo.release.edit_subheader"}}
    + {{else}} + {{ctx.Locale.Tr "repo.release.new_release"}} +
    {{ctx.Locale.Tr "repo.release.new_subheader"}}
    + {{end}} +

    + {{template "base/alert" .}} +
    + {{.CsrfTokenHtml}} +
    +
    + {{if .PageIsEditRelease}} + {{.tag_name}}@{{.tag_target}} + {{else}} + + +
    + @ + +
    +
    + {{ctx.Locale.Tr "repo.release.tag_helper"}} +
    + {{end}} +
    +
    +
    +
    + +
    +
    + {{template "shared/combomarkdowneditor" (dict + "MarkdownPreviewUrl" (print .Repository.Link "/markup") + "MarkdownPreviewContext" .RepoLink + "TextareaName" "content" + "TextareaContent" .content + "TextareaPlaceholder" (ctx.Locale.Tr "repo.release.message") + "TextareaAriaLabel" (ctx.Locale.Tr "repo.release.message") + "DropzoneParentContainer" "form" + "EasyMDE" true + )}} +
    + {{range .attachments}} +
    +
    +
    + {{if .ExternalURL}} + {{svg "octicon-link-external" 16 "tw-mr-2"}} + {{else}} + {{svg "octicon-package" 16 "tw-mr-2"}} + {{end}} +
    + + + {{if .ExternalURL}} + + {{else}} + {{ctx.Locale.TrN + .DownloadCount "repo.release.download_count_one" + "repo.release.download_count_few" (ctx.Locale.PrettyNumber + .DownloadCount)}} · {{.Size | ctx.Locale.TrSize}} + {{end}} +
    + + {{ctx.Locale.Tr "remove"}} + +
    + {{end}} +
    +
    +
    + {{svg "octicon-link-external" 16 "tw-mr-2"}} +
    + + +
    + + {{ctx.Locale.Tr "remove"}} + +
    + + {{if .IsAttachmentEnabled}} +
    + {{template "repo/upload" .}} +
    + {{end}} +
    +
    +
    +
    +
    + {{if not .PageIsEditRelease}} + + {{else}} + + {{end}} + + {{if not .DisableDownloadSourceArchives}} + + {{end}} +
    +
    +
    + {{if .PageIsEditRelease}} + + {{ctx.Locale.Tr "repo.release.cancel"}} + + + {{ctx.Locale.Tr "repo.release.delete_release"}} + + {{if .IsDraft}} + + + {{else}} + + {{end}} + {{else}} + {{if not .tag_name}} + + {{end}} + + + {{end}} +
    +
    +
    +
    +
    +
    + +{{if .PageIsEditRelease}} + +{{end}} +{{template "base/footer" .}} diff --git a/templates/repo/release_tag_header.tmpl b/templates/repo/release_tag_header.tmpl new file mode 100644 index 0000000..dafe9f2 --- /dev/null +++ b/templates/repo/release_tag_header.tmpl @@ -0,0 +1,31 @@ +{{$canReadReleases := $.Permission.CanRead $.UnitTypeReleases}} +{{$canReadCode := $.Permission.CanRead $.UnitTypeCode}} + +{{if $canReadReleases}} + +
    +{{else if $canReadCode}} + {{/* if the "repo.releases" unit is disabled, only show the "commits / branches / tags" sub menu */}} + {{template "repo/sub_menu" .}} +{{end}} diff --git a/templates/repo/search.tmpl b/templates/repo/search.tmpl new file mode 100644 index 0000000..6d114c8 --- /dev/null +++ b/templates/repo/search.tmpl @@ -0,0 +1,14 @@ +{{template "base/head" .}} +
    + {{template "repo/header" .}} +
    + {{if $.CodeIndexerDisabled}} + {{$branchURLPrefix := printf "%s/search/branch/" $.RepoLink}} + {{$tagURLPrefix := printf "%s/search/tag/" $.RepoLink}} + {{$suffix := printf "?q=%s&fuzzy=%t" (.Keyword|QueryEscape) .IsFuzzy}} + {{template "repo/branch_dropdown" dict "root" . "ContainerClasses" "tw-mb-3" "branchURLPrefix" $branchURLPrefix "branchURLSuffix" $suffix "tagURLPrefix" $tagURLPrefix "tagURLSuffix" $suffix}} + {{end}} + {{template "shared/search/code/search" .}} +
    +
    +{{template "base/footer" .}} diff --git a/templates/repo/search_name.tmpl b/templates/repo/search_name.tmpl new file mode 100644 index 0000000..951f168 --- /dev/null +++ b/templates/repo/search_name.tmpl @@ -0,0 +1 @@ +{{.Name}}{{if DefaultShowFullName}} {{.FullName}}{{end}} diff --git a/templates/repo/settings/actions.tmpl b/templates/repo/settings/actions.tmpl new file mode 100644 index 0000000..f38ab5b --- /dev/null +++ b/templates/repo/settings/actions.tmpl @@ -0,0 +1,11 @@ +{{template "repo/settings/layout_head" (dict "ctxData" . "pageClass" "repository settings actions")}} +
    + {{if eq .PageType "runners"}} + {{template "shared/actions/runner_list" .}} + {{else if eq .PageType "secrets"}} + {{template "shared/secrets/add_list" .}} + {{else if eq .PageType "variables"}} + {{template "shared/variables/variable_list" .}} + {{end}} +
    +{{template "repo/settings/layout_footer" .}} diff --git a/templates/repo/settings/branches.tmpl b/templates/repo/settings/branches.tmpl new file mode 100644 index 0000000..52c0c2c --- /dev/null +++ b/templates/repo/settings/branches.tmpl @@ -0,0 +1,78 @@ +{{template "repo/settings/layout_head" (dict "ctxData" . "pageClass" "repository settings edit")}} +
    + {{if .Repository.IsArchived}} +
    + {{ctx.Locale.Tr "repo.settings.archive.branchsettings_unavailable"}} +
    + {{else}} +

    + {{ctx.Locale.Tr "repo.default_branch"}} +

    +
    +

    + {{ctx.Locale.Tr "repo.settings.default_branch_desc"}} +

    +
    + {{.CsrfTokenHtml}} + + {{if not .Repository.IsEmpty}} + + + {{end}} +
    +
    + +

    + {{ctx.Locale.Tr "repo.settings.protected_branch"}} + +

    + +
    +
    + {{range .ProtectedBranches}} +
    +
    +
    +
    {{.RuleName}}
    +
    +
    +
    + {{ctx.Locale.Tr "repo.settings.edit_protected_branch"}} + +
    +
    + {{else}} +
    + {{ctx.Locale.Tr "repo.settings.no_protected_branch"}} +
    + {{end}} +
    +
    + {{end}} +
    + + + +{{template "repo/settings/layout_footer" .}} diff --git a/templates/repo/settings/collaboration.tmpl b/templates/repo/settings/collaboration.tmpl new file mode 100644 index 0000000..8028642 --- /dev/null +++ b/templates/repo/settings/collaboration.tmpl @@ -0,0 +1,117 @@ +{{template "repo/settings/layout_head" (dict "ctxData" . "pageClass" "repository settings collaboration")}} +
    +

    + {{ctx.Locale.Tr "repo.settings.collaboration"}} +

    + {{if .Collaborators}} +
    +
    + {{range .Collaborators}} +
    + +
    +
    + {{template "shared/user/name" .}} +
    +
    +
    +
    + {{svg "octicon-shield-lock"}} + +
    + +
    +
    + {{end}} +
    +
    + {{end}} +
    +
    + {{.CsrfTokenHtml}} + + +
    +
    + + {{if .RepoOwnerIsOrganization}} +

    + {{ctx.Locale.Tr "repo.settings.teams"}} +

    + {{$allowedToChangeTeams := (or (.Org.RepoAdminChangeTeamAccess) (.Permission.IsOwner))}} + {{if .Teams}} +
    +
    + {{range $t, $team := .Teams}} +
    +
    + + {{.Name}} + +
    + {{svg "octicon-shield-lock"}} + {{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}}{{ctx.Locale.Tr "repo.settings.collaboration.admin"}}{{else if eq .AccessMode 4}}{{ctx.Locale.Tr "repo.settings.collaboration.owner"}}{{else}}{{ctx.Locale.Tr "repo.settings.collaboration.undefined"}}{{end}} +
    + {{if or (eq .AccessMode 1) (eq .AccessMode 2)}} + {{$first := true}} +
    + 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}} +
    + {{end}} +
    + {{if $allowedToChangeTeams}} +
    + +
    + {{end}} +
    + {{end}} +
    +
    + {{end}} +
    + {{if $allowedToChangeTeams}} +
    + {{.CsrfTokenHtml}} + + +
    + {{else}} +
    + {{ctx.Locale.Tr "repo.settings.change_team_access_not_allowed"}} +
    + {{end}} +
    + {{end}} +
    + + + +{{template "repo/settings/layout_footer" .}} diff --git a/templates/repo/settings/deploy_keys.tmpl b/templates/repo/settings/deploy_keys.tmpl new file mode 100644 index 0000000..4bc3abf --- /dev/null +++ b/templates/repo/settings/deploy_keys.tmpl @@ -0,0 +1,86 @@ +{{template "repo/settings/layout_head" (dict "ctxData" . "pageClass" "repository settings")}} +
    +

    + {{ctx.Locale.Tr "repo.settings.deploy_keys"}} +
    + {{if not .DisableSSH}} + + {{else}} + + {{end}} +
    +

    +
    +
    +
    + {{.CsrfTokenHtml}} +
    + {{ctx.Locale.Tr "repo.settings.deploy_key_desc"}} +
    +
    + + +
    +
    + + +
    +
    +
    + + + {{ctx.Locale.Tr "repo.settings.is_writable_info"}} +
    +
    + + +
    +
    + {{if .Deploykeys}} +
    + {{range .Deploykeys}} +
    +
    + {{svg "octicon-key" 32}} +
    +
    +
    {{.Name}}
    +
    + {{.Fingerprint}} +
    +
    +

    {{ctx.Locale.Tr "settings.added_on" (DateTime "short" .CreatedUnix)}} — {{svg "octicon-info"}} {{if .HasUsed}}{{ctx.Locale.Tr "settings.last_used"}} {{DateTime "short" .UpdatedUnix}}{{else}}{{ctx.Locale.Tr "settings.no_activity"}}{{end}} - {{ctx.Locale.Tr "settings.can_read_info"}}{{if not .IsReadOnly}} / {{ctx.Locale.Tr "settings.can_write_info"}} {{end}}

    +
    +
    +
    + +
    +
    + {{end}} +
    + {{else}} + {{ctx.Locale.Tr "repo.settings.no_deploy_keys"}} + {{end}} +
    +
    + + + +{{template "repo/settings/layout_footer" .}} diff --git a/templates/repo/settings/githook_edit.tmpl b/templates/repo/settings/githook_edit.tmpl new file mode 100644 index 0000000..e20f51b --- /dev/null +++ b/templates/repo/settings/githook_edit.tmpl @@ -0,0 +1,27 @@ +{{template "repo/settings/layout_head" (dict "ctxData" . "pageClass" "repository settings edit githook")}} +
    +

    + {{ctx.Locale.Tr "repo.settings.githooks"}} +

    +
    +

    {{ctx.Locale.Tr "repo.settings.githook_edit_desc"}}

    +
    + {{.CsrfTokenHtml}} + {{with .Hook}} +
    + + {{.Name}} +
    +
    + + +
    +
    +
    + +
    + {{end}} +
    +
    +
    +{{template "repo/settings/layout_footer" .}} diff --git a/templates/repo/settings/githooks.tmpl b/templates/repo/settings/githooks.tmpl new file mode 100644 index 0000000..1a603f9 --- /dev/null +++ b/templates/repo/settings/githooks.tmpl @@ -0,0 +1,23 @@ +{{template "repo/settings/layout_head" (dict "ctxData" . "pageClass" "repository settings githooks")}} +
    +

    + {{ctx.Locale.Tr "repo.settings.githooks"}} +

    +
    +
    +
    + {{ctx.Locale.Tr "repo.settings.githooks_desc"}} +
    + {{range .Hooks}} +
    + {{svg "octicon-dot-fill" 22}} + {{.Name}} + + {{svg "octicon-pencil"}} + +
    + {{end}} +
    +
    +
    +{{template "repo/settings/layout_footer" .}} diff --git a/templates/repo/settings/layout_footer.tmpl b/templates/repo/settings/layout_footer.tmpl new file mode 100644 index 0000000..60cad3f --- /dev/null +++ b/templates/repo/settings/layout_footer.tmpl @@ -0,0 +1,11 @@ +{{if false}}{{/* to make html structure "likely" complete to prevent IDE warnings */}} +
    +
    +
    + {{/* block: repo-setting-content */}} +{{end}} + +
    +
    +
    +{{template "base/footer" .}} diff --git a/templates/repo/settings/layout_head.tmpl b/templates/repo/settings/layout_head.tmpl new file mode 100644 index 0000000..efec9bf --- /dev/null +++ b/templates/repo/settings/layout_head.tmpl @@ -0,0 +1,14 @@ +{{template "base/head" .ctxData}} +
    + {{template "repo/header" .ctxData}} +
    + {{template "repo/settings/navbar" .ctxData}} +
    + {{template "base/alert" .ctxData}} + {{/* block: repo-setting-content */}} + +{{if false}}{{/* to make html structure "likely" complete to prevent IDE warnings */}} +
    +
    +
    +{{end}} diff --git a/templates/repo/settings/lfs.tmpl b/templates/repo/settings/lfs.tmpl new file mode 100644 index 0000000..6d7aac2 --- /dev/null +++ b/templates/repo/settings/lfs.tmpl @@ -0,0 +1,53 @@ +{{template "repo/settings/layout_head" (dict "ctxData" . "pageClass" "repository settings lfs")}} +
    +

    + {{ctx.Locale.Tr "repo.settings.lfs_filelist"}} ({{ctx.Locale.Tr "admin.total" .Total}}) + +

    + + + {{range .LFSFiles}} + + + + + + + {{else}} + + + + {{end}} + +
    + + {{ShortSha .Oid}} + + {{ctx.Locale.TrSize .Size}}{{TimeSince .CreatedUnix.AsTime ctx.Locale}} + {{ctx.Locale.Tr "repo.settings.lfs_findcommits"}} + +
    {{ctx.Locale.Tr "repo.settings.lfs_no_lfs_files"}}
    + {{template "base/paginate" .}} + {{range .LFSFiles}} + + {{end}} +
    +{{template "repo/settings/layout_footer" .}} diff --git a/templates/repo/settings/lfs_file.tmpl b/templates/repo/settings/lfs_file.tmpl new file mode 100644 index 0000000..5bcd2af --- /dev/null +++ b/templates/repo/settings/lfs_file.tmpl @@ -0,0 +1,57 @@ +{{template "repo/settings/layout_head" (dict "ctxData" . "pageClass" "repository settings lfs")}} +
    +
    +

    + {{ctx.Locale.Tr "repo.settings.lfs"}} / {{.LFSFile.Oid}} + +

    +
    + {{template "repo/unicode_escape_prompt" dict "EscapeStatus" .EscapeStatus "root" $}} +
    + {{if .IsMarkup}} + {{if .FileContent}}{{.FileContent | SafeHTML}}{{end}} + {{else if .IsPlainText}} +
    {{if .FileContent}}{{.FileContent | SafeHTML}}{{end}}
    + {{else if not .IsTextFile}} +
    + {{if .IsImageFile}} + + {{else if .IsVideoFile}} + + {{else if .IsAudioFile}} + + {{else if .IsPDFFile}} +
    + {{else}} + {{ctx.Locale.Tr "repo.file_view_raw"}} + {{end}} +
    + {{else if .FileSize}} + + + + {{if .IsFileTooLarge}} + + {{else}} + + + {{end}} + + +
    {{ctx.Locale.Tr "repo.file_too_large"}}{{.LineNums}}
      {{.FileContent}}
    + {{end}} +
    +
    +
    +
    +{{template "repo/settings/layout_footer" .}} diff --git a/templates/repo/settings/lfs_file_find.tmpl b/templates/repo/settings/lfs_file_find.tmpl new file mode 100644 index 0000000..809a028 --- /dev/null +++ b/templates/repo/settings/lfs_file_find.tmpl @@ -0,0 +1,46 @@ +{{template "repo/settings/layout_head" (dict "ctxData" . "pageClass" "repository settings lfs")}} +
    +
    +

    + {{ctx.Locale.Tr "repo.settings.lfs"}} / {{.Oid}} +

    + + + {{range .Results}} + + + + + + + + {{else}} + + + + {{end}} + +
    + {{svg "octicon-file"}} + {{.Name}} + + + + {{.Summary | RenderEmoji $.Context}} + + + + {{svg "octicon-git-branch"}}{{.BranchName}} + + {{if .ParentHashes}} + {{ctx.Locale.Tr "repo.diff.parent"}} + {{range .ParentHashes}} + {{ShortSha .String}} + {{end}} + {{end}} + {{ctx.Locale.Tr "repo.diff.commit"}} + {{ShortSha .SHA}} + {{TimeSince .When ctx.Locale}}
    {{ctx.Locale.Tr "repo.settings.lfs_lfs_file_no_commits"}}
    +
    +
    +{{template "repo/settings/layout_footer" .}} diff --git a/templates/repo/settings/lfs_locks.tmpl b/templates/repo/settings/lfs_locks.tmpl new file mode 100644 index 0000000..9a18f52 --- /dev/null +++ b/templates/repo/settings/lfs_locks.tmpl @@ -0,0 +1,56 @@ +{{template "repo/settings/layout_head" (dict "ctxData" . "pageClass" "repository settings lfs")}} +
    +
    +

    + {{ctx.Locale.Tr "repo.settings.lfs"}} / {{ctx.Locale.Tr "repo.settings.lfs_locks"}} ({{ctx.Locale.Tr "admin.total" .Total}}) +

    +
    +
    + {{$.CsrfTokenHtml}} +
    + + +
    +
    +
    + + + {{range $index, $lock := .LFSLocks}} + + + + + + + {{else}} + + + + {{end}} + +
    + {{if index $.Linkable $index}} + {{svg "octicon-file"}} + {{$lock.Path}} + {{else}} + {{svg "octicon-diff"}} + {{$lock.Path}} + {{end}} + {{if not (index $.Lockables $index)}} + {{svg "octicon-alert"}} + {{end}} + + + {{ctx.AvatarUtils.Avatar $lock.Owner}} + {{$lock.Owner.DisplayName}} + + {{TimeSince .Created ctx.Locale}} +
    + {{$.CsrfTokenHtml}} + +
    +
    {{ctx.Locale.Tr "repo.settings.lfs_locks_no_locks"}}
    + {{template "base/paginate" .}} +
    +
    +{{template "repo/settings/layout_footer" .}} diff --git a/templates/repo/settings/lfs_pointers.tmpl b/templates/repo/settings/lfs_pointers.tmpl new file mode 100644 index 0000000..a0bb8c4 --- /dev/null +++ b/templates/repo/settings/lfs_pointers.tmpl @@ -0,0 +1,56 @@ +{{template "repo/settings/layout_head" (dict "ctxData" . "pageClass" "repository settings lfs")}} +
    +

    + {{ctx.Locale.Tr "repo.settings.lfs_pointers.found" .NumPointers .NumAssociated .NumNotAssociated .NumNoExist}} + {{if gt .NumAssociatable 0}} +
    +
    + {{.CsrfTokenHtml}} + {{range .Pointers}} + {{if .Associatable}} + + {{end}} + {{end}} + +
    +
    + {{end}} +

    +
    + + + + + + + + + + + + + {{range .Pointers}} + + + + + + + + + {{end}} + +
    {{ctx.Locale.Tr "repo.settings.lfs_pointers.sha"}}{{ctx.Locale.Tr "repo.settings.lfs_pointers.oid"}}{{ctx.Locale.Tr "repo.settings.lfs_pointers.inRepo"}}{{ctx.Locale.Tr "repo.settings.lfs_pointers.exists"}}{{ctx.Locale.Tr "repo.settings.lfs_pointers.accessible"}}
    + + {{ShortSha .SHA}} + + + + {{ShortSha .Oid}} + + {{if .InRepo}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}{{if .Exists}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}{{if .Accessible}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}} + {{ctx.Locale.Tr "repo.settings.lfs_findcommits"}} +
    +
    +
    +{{template "repo/settings/layout_footer" .}} diff --git a/templates/repo/settings/navbar.tmpl b/templates/repo/settings/navbar.tmpl new file mode 100644 index 0000000..df5ba3a --- /dev/null +++ b/templates/repo/settings/navbar.tmpl @@ -0,0 +1,72 @@ +
    + +
    diff --git a/templates/repo/settings/options.tmpl b/templates/repo/settings/options.tmpl new file mode 100644 index 0000000..09f80ca --- /dev/null +++ b/templates/repo/settings/options.tmpl @@ -0,0 +1,794 @@ +{{template "repo/settings/layout_head" (dict "ctxData" . "pageClass" "repository settings options")}} +
    +

    + {{ctx.Locale.Tr "repo.settings.basic_settings"}} +

    +
    +
    + {{template "base/disable_form_autofill"}} + {{.CsrfTokenHtml}} + +
    + + +
    +
    + + {{ctx.Locale.TrSize .Repository.Size}} +
    +
    + +
    + + +
    +
    + {{if not .Repository.IsFork}} +
    + +
    + {{if .IsAdmin}} + + {{else}} + + {{if and .Repository.IsPrivate $.ForcePrivate}}{{end}} + {{end}} + +
    +
    + {{end}} +
    + + +
    +
    + + +
    +
    + +
    +
    + +
    +
    + {{.CsrfTokenHtml}} +
    + + +
    +
    + + +
    +
    +
    + + {{if FederationEnabled}} +

    + {{ctx.Locale.Tr "repo.settings.federation_settings"}} +

    +
    +
    + {{.CsrfTokenHtml}} + +
    +

    {{ctx.Locale.Tr "repo.settings.federation_apapiurl"}}

    +

    {{.RepositoryAPActorID}}

    +
    + + +
    +
    + +
    +
    +
    + {{end}} + + {{/* These variables exist to make the logic in the Settings window easier to comprehend and are not used later on. */}} + {{$newMirrorsPartiallyEnabled := or (not .DisableNewPullMirrors) (not .DisableNewPushMirrors)}} + {{/* .Repository.IsMirror is not always reliable if the repository is not actively acting as a mirror because of errors. */}} + {{$showMirrorSettings := and (.Repository.UnitEnabled $.Context $.UnitTypeCode) (or $newMirrorsPartiallyEnabled .Repository.IsMirror .PullMirror .PushMirrors)}} + {{$newMirrorsEntirelyEnabled := and (not .DisableNewPullMirrors) (not .DisableNewPushMirrors)}} + {{$onlyNewPushMirrorsEnabled := and (not .DisableNewPushMirrors) .DisableNewPullMirrors}} + {{$onlyNewPullMirrorsEnabled := and .DisableNewPushMirrors (not .DisableNewPullMirrors)}} + {{$existingPushMirror := or .Repository.IsMirror .PushMirrors}} + {{$modifyBrokenPullMirror := and .Repository.IsMirror (not .PullMirror)}} + {{$isWorkingPullMirror := .PullMirror}} + + {{if $showMirrorSettings}} +

    + {{ctx.Locale.Tr "repo.settings.mirror_settings"}} +

    +
    + {{if .Repository.IsArchived}} +
    + {{ctx.Locale.Tr "repo.settings.archive.mirrors_unavailable"}} +
    + {{else}} + {{if $newMirrorsEntirelyEnabled}} + {{ctx.Locale.Tr "repo.settings.mirror_settings.docs"}} + {{ctx.Locale.Tr "repo.settings.mirror_settings.docs.doc_link_title"}}

    + {{ctx.Locale.Tr "repo.settings.mirror_settings.docs.pull_mirror_instructions"}} + {{ctx.Locale.Tr "repo.settings.mirror_settings.docs.doc_link_pull_section"}}
    + {{else if $onlyNewPushMirrorsEnabled}} + {{ctx.Locale.Tr "repo.settings.mirror_settings.docs.disabled_pull_mirror.instructions"}} + {{ctx.Locale.Tr "repo.settings.mirror_settings.docs.more_information_if_disabled"}} + {{ctx.Locale.Tr "repo.settings.mirror_settings.docs.doc_link_title"}}
    + {{else if $onlyNewPullMirrorsEnabled}} + {{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"}} + {{ctx.Locale.Tr "repo.settings.mirror_settings.docs.doc_link_title"}}

    + {{ctx.Locale.Tr "repo.settings.mirror_settings.docs.disabled_push_mirror.info"}} + {{if $existingPushMirror}} + {{ctx.Locale.Tr "repo.settings.mirror_settings.docs.can_still_use"}} + {{end}} + {{else}} + {{ctx.Locale.Tr "repo.settings.mirror_settings.docs.no_new_mirrors"}} {{ctx.Locale.Tr "repo.settings.mirror_settings.docs.can_still_use"}}
    + {{end}} + + {{if .Repository.IsMirror}} + + + + + + + + + + + {{if $modifyBrokenPullMirror}} + {{/* even if a repo is a pull mirror (IsMirror=true), the PullMirror might still be nil if the mirror migration is broken */}} + + + + + + {{else if $isWorkingPullMirror}} + + + + + + + + + + + + {{end}}{{/* end if: $modifyBrokenPullMirror / $isWorkingPullMirror */}} +
    {{ctx.Locale.Tr "repo.settings.mirror_settings.mirrored_repository"}}{{ctx.Locale.Tr "repo.settings.mirror_settings.direction"}}{{ctx.Locale.Tr "repo.settings.mirror_settings.last_update"}}{{ctx.Locale.Tr "repo.mirror_public_key"}}
    +
    {{ctx.Locale.Tr "repo.settings.mirror_settings.direction.pull"}}: {{ctx.Locale.Tr "error.occurred"}}
    +
    {{.PullMirror.RemoteAddress}}{{ctx.Locale.Tr "repo.settings.mirror_settings.direction.pull"}}{{DateTime "full" .PullMirror.UpdatedUnix}} +
    + {{.CsrfTokenHtml}} + + +
    +
    +
    + {{template "base/disable_form_autofill"}} + {{.CsrfTokenHtml}} + +
    + +
    + + +
    +
    +
    + + +
    + {{$address := MirrorRemoteAddress $.Context .Repository .PullMirror.GetRemoteName}} +
    + + +

    {{ctx.Locale.Tr "repo.mirror_address_desc"}}

    +
    +
    + + {{ctx.Locale.Tr "repo.need_auth"}} + +
    +
    + + +
    +
    + + +
    +

    {{ctx.Locale.Tr "repo.mirror_password_help"}}

    +
    +
    + + {{if .LFSStartServer}} +
    + +
    + + +
    +
    +
    + + +

    {{ctx.Locale.Tr "repo.mirror_lfs_endpoint_desc" "https://github.com/git-lfs/git-lfs/blob/main/docs/api/server-discovery.md#server-discovery"}}

    +
    + {{end}} +
    + +
    +
    +
    + {{end}}{{/* end if .Repository.IsMirror */}} + + + + + + + + + + + + + {{range .PushMirrors}} + + + + + + + + {{else}} + + + + {{end}} + {{if (not .DisableNewPushMirrors)}} + + + + {{end}} + +
    {{ctx.Locale.Tr "repo.settings.mirror_settings.pushed_repository"}}{{ctx.Locale.Tr "repo.settings.mirror_settings.direction"}}{{ctx.Locale.Tr "repo.settings.mirror_settings.last_update"}}{{ctx.Locale.Tr "repo.mirror_public_key"}}
    {{.RemoteAddress}}{{ctx.Locale.Tr "repo.settings.mirror_settings.direction.push"}}{{if .LastUpdateUnix}}{{DateTime "full" .LastUpdateUnix}}{{else}}{{ctx.Locale.Tr "never"}}{{end}} {{if .LastError}}
    {{ctx.Locale.Tr "error"}}
    {{end}}
    {{if not (eq (len .GetPublicKey) 0)}}{{ctx.Locale.Tr "repo.settings.mirror_settings.push_mirror.copy_public_key"}}{{else}}{{ctx.Locale.Tr "repo.settings.mirror_settings.push_mirror.none_ssh"}}{{end}} + +
    + {{$.CsrfTokenHtml}} + + + +
    +
    + {{$.CsrfTokenHtml}} + + + +
    +
    {{ctx.Locale.Tr "repo.settings.mirror_settings.push_mirror.none"}}
    +
    + {{template "base/disable_form_autofill"}} + {{.CsrfTokenHtml}} + +
    + + +

    {{ctx.Locale.Tr "repo.mirror_address_desc"}}

    +
    +
    + + {{ctx.Locale.Tr "repo.need_auth"}} + +
    +
    + + +
    +
    + + +
    + {{if .CanUseSSHMirroring}} +
    +
    + + + {{ctx.Locale.Tr "repo.mirror_use_ssh.helper"}} +
    +
    + {{end}} +
    +
    +
    +
    + + +
    +
    +
    + + +
    +
    + +
    +
    +
    + {{end}} +
    + {{end}} + +

    + {{ctx.Locale.Tr "repo.settings.signing_settings"}} +

    +
    +
    + {{.CsrfTokenHtml}} + +
    +
    +
    +
    + + +

    {{ctx.Locale.Tr "repo.settings.trust_model.default.desc"}}

    +
    +
    +
    +
    + + +

    {{ctx.Locale.Tr "repo.settings.trust_model.collaborator.desc"}}

    +
    +
    +
    +
    + + +

    {{ctx.Locale.Tr "repo.settings.trust_model.committer.desc"}}

    +
    +
    +
    +
    + + +

    {{ctx.Locale.Tr "repo.settings.trust_model.collaboratorcommitter.desc"}}

    +
    +
    +
    + +
    +
    + +
    +
    +
    + + {{if .IsAdmin}} +

    + {{ctx.Locale.Tr "repo.settings.admin_settings"}} +

    +
    +
    + {{.CsrfTokenHtml}} + +
    +
    + + +
    +
    + +
    + +
    +
    + +
    +
    + {{.CsrfTokenHtml}} + + {{if .CodeIndexerEnabled}} +

    {{ctx.Locale.Tr "repo.settings.admin_code_indexer"}}

    +
    + + + {{if .CodeIndexerStatus}} + + {{ShortSha .CodeIndexerStatus.CommitSha}} + + {{else}} + {{ctx.Locale.Tr "repo.settings.admin_indexer_unindexed"}} + {{end}} + +
    + +
    +
    + {{end}} +

    {{ctx.Locale.Tr "repo.settings.admin_stats_indexer"}}

    +
    + {{if and .StatsIndexerStatus .StatsIndexerStatus.CommitSha}} + + {{end}} + + {{if and .StatsIndexerStatus .StatsIndexerStatus.CommitSha}} + + {{ShortSha .StatsIndexerStatus.CommitSha}} + + {{else}} + {{ctx.Locale.Tr "repo.settings.admin_indexer_unindexed"}} + {{end}} + +
    + +
    +
    +
    +
    + {{end}} + + {{if .Permission.IsOwner}} +

    + {{ctx.Locale.Tr "repo.settings.danger_zone"}} +

    +
    +
    + {{if .Repository.IsMirror}} +
    +
    +
    {{ctx.Locale.Tr "repo.settings.convert"}}
    +
    {{ctx.Locale.Tr "repo.settings.convert_desc"}}
    +
    +
    + +
    +
    + {{end}} + {{if and .Repository.IsFork .Repository.Owner.CanCreateRepo}} +
    +
    +
    {{ctx.Locale.Tr "repo.settings.convert_fork"}}
    +
    {{ctx.Locale.Tr "repo.settings.convert_fork_desc"}}
    +
    +
    + +
    +
    + {{end}} +
    +
    +
    {{ctx.Locale.Tr "repo.settings.transfer.title"}}
    +
    + {{if .RepoTransfer}} + {{ctx.Locale.Tr "repo.settings.transfer_started" .RepoTransfer.Recipient.DisplayName}} + {{else}} + {{ctx.Locale.Tr "repo.settings.transfer_desc"}} + {{end}} +
    +
    +
    + {{if .RepoTransfer}} +
    + {{.CsrfTokenHtml}} + + +
    + {{else}} + + {{end}} +
    +
    + {{if .Permission.CanRead $.UnitTypeWiki}} + {{if ne $.Repository.GetWikiBranchName .DefaultWikiBranchName}} +
    +
    +
    {{ctx.Locale.Tr "repo.settings.wiki_rename_branch_main"}}
    +
    {{ctx.Locale.Tr "repo.settings.wiki_rename_branch_main_desc" .DefaultWikiBranchName}}
    +
    +
    + +
    +
    + {{end}} +
    +
    +
    {{ctx.Locale.Tr "repo.settings.wiki_delete"}}
    +
    {{ctx.Locale.Tr "repo.settings.wiki_delete_desc"}}
    +
    +
    + +
    +
    + {{end}} +
    +
    +
    {{ctx.Locale.Tr "repo.settings.delete"}}
    +
    {{ctx.Locale.Tr "repo.settings.delete_desc"}}
    +
    +
    + +
    +
    + {{if not .Repository.IsMirror}} +
    +
    + {{if .Repository.IsArchived}} +
    {{ctx.Locale.Tr "repo.settings.unarchive.header"}}
    +
    {{ctx.Locale.Tr "repo.settings.unarchive.text"}}
    + {{else}} +
    {{ctx.Locale.Tr "repo.settings.archive.header"}}
    +
    {{ctx.Locale.Tr "repo.settings.archive.text"}}
    + {{end}} +
    +
    + +
    +
    + {{end}} +
    +
    + {{end}} +
    +{{template "repo/settings/layout_footer" .}} + +{{if .Permission.IsOwner}} + {{if .Repository.IsMirror}} + + {{end}} + {{if and .Repository.IsFork .Repository.Owner.CanCreateRepo}} + + {{end}} + + + + + {{if .Repository.UnitEnabled $.Context $.UnitTypeWiki}} + + {{if ne $.Repository.GetWikiBranchName .DefaultWikiBranchName}} + + {{end}} + {{end}} + + {{if not .Repository.IsMirror}} + + {{end}} +{{end}} + +{{template "repo/settings/push_mirror_sync_modal" .}} diff --git a/templates/repo/settings/protected_branch.tmpl b/templates/repo/settings/protected_branch.tmpl new file mode 100644 index 0000000..ce7016e --- /dev/null +++ b/templates/repo/settings/protected_branch.tmpl @@ -0,0 +1,262 @@ +{{template "repo/settings/layout_head" (dict "ctxData" . "pageClass" "repository settings branches")}} +
    +

    + {{if .Rule.RuleName}} + {{ctx.Locale.Tr "repo.settings.branch_protection" .Rule.RuleName}} + {{else}} + {{ctx.Locale.Tr "repo.settings.protect_new_rule"}} + {{end}} +

    +
    + {{.CsrfTokenHtml}} + +
    + {{ctx.Locale.Tr "repo.settings.protect_patterns"}} + + + +
    + +
    + {{ctx.Locale.Tr "repo.settings.event_push"}} + + + +
    +
    + + +
    + {{if .Owner.IsOrganization}} +
    + + +
    + {{end}} +
    +
    + + +
    +
    +
    + +
    +
    + {{ctx.Locale.Tr "repo.settings.event_pull_request_approvals"}} + +
    + +
    +
    + + +
    + {{if .Owner.IsOrganization}} +
    + + +
    + {{end}} +
    +
    + +
    +
    + + +

    {{ctx.Locale.Tr "repo.settings.ignore_stale_approvals_desc"}}

    +
    +
    +
    +
    +
    + + +

    {{ctx.Locale.Tr "repo.settings.protect_check_status_contexts_desc"}}

    +
    +
    +
    + + +

    {{ctx.Locale.Tr "repo.settings.protect_status_check_patterns_desc"}}

    + + + + + + + + {{range $.recent_status_checks}} + + + + {{else}} + + {{end}} + +
    {{ctx.Locale.Tr "repo.settings.protect_check_status_contexts_list"}}
    + {{.}} + {{ctx.Locale.Tr "repo.settings.protect_status_check_matched"}} +
    -
    +
    +
    +
    +
    + {{ctx.Locale.Tr "repo.settings.event_pull_request_merge"}} +
    +
    +
    + + +

    {{ctx.Locale.Tr "repo.settings.protect_enable_merge_desc"}}

    +
    +
    +
    +
    + + +

    {{ctx.Locale.Tr "repo.settings.protect_merge_whitelist_committers_desc"}}

    +
    +
    +
    +
    + + +
    + {{if .Owner.IsOrganization}} +
    + + +
    + {{end}} +
    +
    + + + +
    +
    + {{ctx.Locale.Tr "repo.settings.event_pull_request_enforcement"}} + +
    + +
    +
    +{{template "repo/settings/layout_footer" .}} diff --git a/templates/repo/settings/push_mirror_sync_modal.tmpl b/templates/repo/settings/push_mirror_sync_modal.tmpl new file mode 100644 index 0000000..e8dad61 --- /dev/null +++ b/templates/repo/settings/push_mirror_sync_modal.tmpl @@ -0,0 +1,32 @@ + diff --git a/templates/repo/settings/runner_edit.tmpl b/templates/repo/settings/runner_edit.tmpl new file mode 100644 index 0000000..8b76aea --- /dev/null +++ b/templates/repo/settings/runner_edit.tmpl @@ -0,0 +1,5 @@ +{{template "repo/settings/layout_head" (dict "ctxData" . "pageClass" "repository settings runners")}} +
    + {{template "shared/actions/runner_edit" .}} +
    +{{template "repo/settings/layout_footer" .}} diff --git a/templates/repo/settings/secrets.tmpl b/templates/repo/settings/secrets.tmpl new file mode 100644 index 0000000..0b89639 --- /dev/null +++ b/templates/repo/settings/secrets.tmpl @@ -0,0 +1,5 @@ +{{template "repo/settings/layout_head" (dict "ctxData" . "pageClass" "repository settings")}} +
    + {{template "shared/secrets/add_list" .}} +
    +{{template "repo/settings/layout_footer" .}} diff --git a/templates/repo/settings/tags.tmpl b/templates/repo/settings/tags.tmpl new file mode 100644 index 0000000..e7a7aaa --- /dev/null +++ b/templates/repo/settings/tags.tmpl @@ -0,0 +1,126 @@ +{{template "repo/settings/layout_head" (dict "ctxData" . "pageClass" "repository settings edit")}} +
    + {{if .Repository.IsArchived}} +
    + {{ctx.Locale.Tr "repo.settings.archive.tagsettings_unavailable"}} +
    + {{else}} +

    + {{ctx.Locale.Tr "repo.settings.tags.protection"}} +

    + +
    +
    +
    +
    +
    + {{.CsrfTokenHtml}} +
    + + +
    +
    + + +
    + {{if .Owner.IsOrganization}} +
    + + +
    + {{end}} +
    + {{if .PageIsEditProtectedTag}} + + + {{ctx.Locale.Tr "cancel"}} + + {{else}} + + {{end}} +
    +
    +
    +
    + +
    + + + + + + + + {{range .ProtectedTags}} + + + + + + {{else}} + + {{end}} + +
    {{ctx.Locale.Tr "repo.settings.tags.protection.pattern"}}{{ctx.Locale.Tr "repo.settings.tags.protection.allowed"}}
    {{.NamePattern}}
    + {{if or .AllowlistUserIDs (and $.Owner.IsOrganization .AllowlistTeamIDs)}} + {{$userIDs := .AllowlistUserIDs}} + {{range $.Users}} + {{if SliceUtils.Contains $userIDs .ID}} + {{ctx.AvatarUtils.Avatar . 26}} {{.GetDisplayName}} + {{end}} + {{end}} + {{if $.Owner.IsOrganization}} + {{$teamIDs := .AllowlistTeamIDs}} + {{range $.Teams}} + {{if SliceUtils.Contains $teamIDs .ID}} + {{.Name}} + {{end}} + {{end}} + {{end}} + {{else}} + {{ctx.Locale.Tr "repo.settings.tags.protection.allowed.noone"}} + {{end}} + + {{ctx.Locale.Tr "edit"}} +
    + {{$.CsrfTokenHtml}} + + +
    +
    {{ctx.Locale.Tr "repo.settings.tags.protection.none"}}
    +
    +
    +
    + {{end}} +
    +{{template "repo/settings/layout_footer" .}} diff --git a/templates/repo/settings/units.tmpl b/templates/repo/settings/units.tmpl new file mode 100644 index 0000000..66ed035 --- /dev/null +++ b/templates/repo/settings/units.tmpl @@ -0,0 +1,13 @@ +{{template "repo/settings/layout_head" (dict "ctxData" . "pageClass" "repository settings options")}} +
    +
    + {{.CsrfTokenHtml}} + {{template "repo/settings/units/overview" .}} + {{template "repo/settings/units/issues" .}} + {{if not .IsMirror}} + {{template "repo/settings/units/pulls" .}} + {{end}} + {{template "repo/settings/units/wiki" .}} +
    +
    +{{template "repo/settings/layout_footer" .}} diff --git a/templates/repo/settings/units/issues.tmpl b/templates/repo/settings/units/issues.tmpl new file mode 100644 index 0000000..b4217dd --- /dev/null +++ b/templates/repo/settings/units/issues.tmpl @@ -0,0 +1,102 @@ +

    + {{ctx.Locale.Tr "repo.issues"}} +

    +
    + {{$isIssuesEnabled := or (.Repository.UnitEnabled $.Context $.UnitTypeIssues) (.Repository.UnitEnabled $.Context $.UnitTypeExternalTracker)}} + {{$isIssuesGlobalDisabled := .UnitTypeIssues.UnitGlobalDisabled}} + {{$isExternalTrackerGlobalDisabled := .UnitTypeExternalTracker.UnitGlobalDisabled}} + {{$isIssuesAndExternalGlobalDisabled := and $isIssuesGlobalDisabled $isExternalTrackerGlobalDisabled}} +
    + +
    + + +
    +
    +
    +
    +
    + + +
    +
    +
    + {{if .Repository.CanEnableTimetracker}} +
    +
    + + +
    +
    +
    +
    + + +
    +
    + {{end}} +
    +
    + + +
    +
    +
    + + +
    +
    +
    +
    + + +
    +
    +
    +
    + + +

    {{ctx.Locale.Tr "repo.settings.external_tracker_url_desc"}}

    +
    +
    + + +

    {{ctx.Locale.Tr "repo.settings.tracker_url_format_desc"}}

    +
    +
    + +
    +
    + {{$externalTracker := (.Repository.MustGetUnit $.Context $.UnitTypeExternalTracker)}} + {{$externalTrackerStyle := $externalTracker.ExternalTrackerConfig.ExternalTrackerStyle}} + + +
    +
    +
    +
    + + +
    +
    +
    +
    + + +
    +
    +
    +
    + + +

    {{ctx.Locale.Tr "repo.settings.tracker_issue_style.regexp_pattern_desc"}}

    +
    +
    +
    + +
    + +
    + +
    +
    diff --git a/templates/repo/settings/units/overview.tmpl b/templates/repo/settings/units/overview.tmpl new file mode 100644 index 0000000..a851c66 --- /dev/null +++ b/templates/repo/settings/units/overview.tmpl @@ -0,0 +1,62 @@ +

    + {{ctx.Locale.Tr "repo.settings.units.overview"}} +

    +
    + {{$isCodeEnabled := .Repository.UnitEnabled $.Context $.UnitTypeCode}} + {{$isCodeGlobalDisabled := .UnitTypeCode.UnitGlobalDisabled}} +
    + +
    + + +
    +
    + + {{$isProjectsEnabled := .Repository.UnitEnabled $.Context $.UnitTypeProjects}} + {{$isProjectsGlobalDisabled := .UnitTypeProjects.UnitGlobalDisabled}} +
    + +
    + + +
    +
    + + {{$isReleasesEnabled := .Repository.UnitEnabled $.Context $.UnitTypeReleases}} + {{$isReleasesGlobalDisabled := .UnitTypeReleases.UnitGlobalDisabled}} +
    + +
    + + +
    +
    + + {{$isPackagesEnabled := .Repository.UnitEnabled $.Context $.UnitTypePackages}} + {{$isPackagesGlobalDisabled := .UnitTypePackages.UnitGlobalDisabled}} +
    + +
    + + +
    +
    + + {{if .EnableActions}} + {{$isActionsEnabled := .Repository.UnitEnabled $.Context $.UnitTypeActions}} + {{$isActionsGlobalDisabled := .UnitTypeActions.UnitGlobalDisabled}} +
    + +
    + + +
    +
    + {{end}} + +
    + +
    + +
    +
    diff --git a/templates/repo/settings/units/pulls.tmpl b/templates/repo/settings/units/pulls.tmpl new file mode 100644 index 0000000..4e9c53e --- /dev/null +++ b/templates/repo/settings/units/pulls.tmpl @@ -0,0 +1,132 @@ +

    + {{ctx.Locale.Tr "repo.pulls"}} +

    +
    + {{$pullRequestEnabled := .Repository.UnitEnabled $.Context $.UnitTypePullRequests}} + {{$pullRequestGlobalDisabled := .UnitTypePullRequests.UnitGlobalDisabled}} + {{$prUnit := .Repository.MustGetUnit $.Context $.UnitTypePullRequests}} +
    + +
    + + +
    +
    +
    +
    +

    + {{ctx.Locale.Tr "repo.settings.merge_style_desc"}} +

    +
    +
    +
    + + +
    +
    +
    +
    + + +
    +
    +
    +
    + + +
    +
    +
    +
    + + +
    +
    +
    +
    + + +
    +
    +
    +
    + + +
    +
    + +
    +

    + {{ctx.Locale.Tr "repo.settings.default_merge_style_desc"}} +

    + +
    +
    +
    + + +
    +
    +
    +
    + + +
    +
    +
    +
    + + +
    +
    +
    +
    + + +
    +
    +
    +
    + + +
    +
    +
    + +
    +
    + +
    +
    diff --git a/templates/repo/settings/units/wiki.tmpl b/templates/repo/settings/units/wiki.tmpl new file mode 100644 index 0000000..23df294 --- /dev/null +++ b/templates/repo/settings/units/wiki.tmpl @@ -0,0 +1,51 @@ +

    + {{ctx.Locale.Tr "repo.wiki"}} +

    +
    + {{$isWikiEnabled := or (.Repository.UnitEnabled $.Context $.UnitTypeWiki) (.Repository.UnitEnabled $.Context $.UnitTypeExternalWiki)}} + {{$isWikiGlobalDisabled := .UnitTypeWiki.UnitGlobalDisabled}} + {{$isExternalWikiGlobalDisabled := .UnitTypeExternalWiki.UnitGlobalDisabled}} + {{$isBothWikiGlobalDisabled := and $isWikiGlobalDisabled $isExternalWikiGlobalDisabled}} +
    + +
    + + +
    +
    +
    +
    +
    + + +
    +
    + {{if (not .Repository.IsPrivate)}} +
    +
    +
    + + +
    +
    +
    + {{end}} +
    +
    + + +
    +
    +
    + + +

    {{ctx.Locale.Tr "repo.settings.external_wiki_url_desc"}}

    +
    +
    + +
    + +
    + +
    +
    diff --git a/templates/repo/settings/webhook/base.tmpl b/templates/repo/settings/webhook/base.tmpl new file mode 100644 index 0000000..d524722 --- /dev/null +++ b/templates/repo/settings/webhook/base.tmpl @@ -0,0 +1,5 @@ +{{template "repo/settings/layout_head" (dict "ctxData" . "pageClass" "repository settings webhooks")}} +
    + {{template "repo/settings/webhook/list" .}} +
    +{{template "repo/settings/layout_footer" .}} diff --git a/templates/repo/settings/webhook/base_list.tmpl b/templates/repo/settings/webhook/base_list.tmpl new file mode 100644 index 0000000..36e75a7 --- /dev/null +++ b/templates/repo/settings/webhook/base_list.tmpl @@ -0,0 +1,26 @@ +

    + {{.Title}} +
    + +
    +

    +
    +
    +
    + {{.Description}} +
    + {{range .Webhooks}} +
    + {{svg "octicon-dot-fill" 22}} +
    + {{.URL}} +
    + {{svg "octicon-pencil"}} + {{svg "octicon-trash"}} +
    + {{end}} +
    +
    diff --git a/templates/repo/settings/webhook/delete_modal.tmpl b/templates/repo/settings/webhook/delete_modal.tmpl new file mode 100644 index 0000000..9955ed3 --- /dev/null +++ b/templates/repo/settings/webhook/delete_modal.tmpl @@ -0,0 +1,10 @@ + diff --git a/templates/repo/settings/webhook/history.tmpl b/templates/repo/settings/webhook/history.tmpl new file mode 100644 index 0000000..8ee1446 --- /dev/null +++ b/templates/repo/settings/webhook/history.tmpl @@ -0,0 +1,90 @@ +{{$isNew:=or .PageIsSettingsHooksNew .PageIsAdminDefaultHooksNew .PageIsAdminSystemHooksNew}} +{{if .PageIsSettingsHooksEdit}} +

    + {{ctx.Locale.Tr "repo.settings.recent_deliveries"}} + {{if .Permission.IsAdmin}} +
    + + + + +
    + {{end}} +

    +
    +
    + {{range .History}} +
    +
    +
    + {{if .IsSucceed}} + {{svg "octicon-check"}} + {{else if not .IsDelivered}} + {{svg "octicon-stopwatch"}} + {{else}} + {{svg "octicon-alert"}} + {{end}} + {{.UUID}} +
    + + {{TimeSince .Delivered.AsTime ctx.Locale}} + +
    +
    + +
    + {{if .RequestInfo}} +
    {{ctx.Locale.Tr "repo.settings.webhook.headers"}}
    +
    Request URL: {{.RequestInfo.URL}}
    +Request method: {{if .RequestInfo.HTTPMethod}}{{.RequestInfo.HTTPMethod}}{{else}}POST{{end}}
    +{{range $key, $val := .RequestInfo.Headers}}{{$key}}: {{$val}}
    +{{end}}
    +
    {{ctx.Locale.Tr "repo.settings.webhook.payload"}}
    +
    {{or .RequestInfo.Body .PayloadContent}}
    + {{else}} + - + {{end}} +
    +
    + {{if .ResponseInfo}} +
    {{ctx.Locale.Tr "repo.settings.webhook.headers"}}
    +
    {{range $key, $val := .ResponseInfo.Headers}}{{$key}}: {{$val}}
    +{{end}}
    +
    {{ctx.Locale.Tr "repo.settings.webhook.body"}}
    +
    {{.ResponseInfo.Body}}
    + {{else}} + - + {{end}} +
    +
    +
    + {{end}} +
    +
    +{{end}} diff --git a/templates/repo/settings/webhook/link_menu.tmpl b/templates/repo/settings/webhook/link_menu.tmpl new file mode 100644 index 0000000..2edc5af --- /dev/null +++ b/templates/repo/settings/webhook/link_menu.tmpl @@ -0,0 +1,12 @@ +{{$size := 20}} +{{if .Size}} + {{$size = .Size}} +{{end}} + diff --git a/templates/repo/settings/webhook/list.tmpl b/templates/repo/settings/webhook/list.tmpl new file mode 100644 index 0000000..b24159f --- /dev/null +++ b/templates/repo/settings/webhook/list.tmpl @@ -0,0 +1,4 @@ + +{{template "repo/settings/webhook/base_list" .}} + +{{template "repo/settings/webhook/delete_modal" .}} diff --git a/templates/repo/settings/webhook/new.tmpl b/templates/repo/settings/webhook/new.tmpl new file mode 100644 index 0000000..b04a442 --- /dev/null +++ b/templates/repo/settings/webhook/new.tmpl @@ -0,0 +1,7 @@ +{{template "repo/settings/layout_head" (dict "ctxData" . "pageClass" "repository settings new webhook")}} +
    + {{$CustomHeaderTitle := ctx.Locale.Tr "repo.settings.update_webhook"}} + {{if .PageIsSettingsHooksNew}}{{$CustomHeaderTitle = ctx.Locale.Tr "repo.settings.add_webhook"}}{{end}} + {{template "webhook/new" (dict "ctxData" . "CustomHeaderTitle" $CustomHeaderTitle)}} +
    +{{template "repo/settings/layout_footer" .}} diff --git a/templates/repo/shabox_badge.tmpl b/templates/repo/shabox_badge.tmpl new file mode 100644 index 0000000..939292b --- /dev/null +++ b/templates/repo/shabox_badge.tmpl @@ -0,0 +1,15 @@ +
    + {{if .verification.Verified}} +
    + {{if ne .verification.SigningUser.ID 0}} + {{svg "gitea-lock"}} + {{ctx.AvatarUtils.Avatar .verification.SigningUser 28 "signature"}} + {{else}} + {{svg "gitea-lock-cog"}} + {{ctx.AvatarUtils.AvatarByEmail .verification.SigningEmail "" 28 "signature"}} + {{end}} +
    + {{else}} + {{svg "gitea-unlock"}} + {{end}} +
    diff --git a/templates/repo/star_unstar.tmpl b/templates/repo/star_unstar.tmpl new file mode 100644 index 0000000..a407aa6 --- /dev/null +++ b/templates/repo/star_unstar.tmpl @@ -0,0 +1,14 @@ +
    +
    + + + {{CountFmt .Repository.NumStars}} + +
    +
    diff --git a/templates/repo/sub_menu.tmpl b/templates/repo/sub_menu.tmpl new file mode 100644 index 0000000..ddf01b3 --- /dev/null +++ b/templates/repo/sub_menu.tmpl @@ -0,0 +1,45 @@ +{{if and (not .HideRepoInfo) (not .IsBlame)}} +
    + + {{if and (.Permission.CanRead $.UnitTypeCode) (not .IsEmptyRepo) .LanguageStats}} + + + {{range .LanguageStats}} +
    + {{end}} +
    + {{end}} +
    +{{end}} diff --git a/templates/repo/tag/list.tmpl b/templates/repo/tag/list.tmpl new file mode 100644 index 0000000..82f3dc0 --- /dev/null +++ b/templates/repo/tag/list.tmpl @@ -0,0 +1,79 @@ +{{template "base/head" .}} +
    + {{template "repo/header" .}} +
    + {{template "base/alert" .}} + {{template "repo/release_tag_header" .}} +

    +
    + {{svg "octicon-tag" 16 "tw-mr-1"}}{{ctx.Locale.Tr "repo.release.tags"}} +
    +

    + {{$canReadReleases := $.Permission.CanRead $.UnitTypeReleases}} +
    + + + {{range $idx, $release := .Releases}} + + + + {{end}} + +
    +

    + {{if $canReadReleases}} + {{.TagName}} + {{else}} + {{.TagName}} + {{end}} + {{template "repo/tag/verification_box" (dict "ctxData" $ "release" $release)}} +

    +
    + {{if $.Permission.CanRead $.UnitTypeCode}} + {{if .CreatedUnix}} + {{svg "octicon-clock" 16 "tw-mr-1"}}{{TimeSinceUnix .CreatedUnix ctx.Locale}} + {{end}} + + {{svg "octicon-git-commit" 16 "tw-mr-1"}}{{ShortSha .Sha1}} + + {{if not $.DisableDownloadSourceArchives}} + {{svg "octicon-file-zip" 16 "tw-mr-1"}}ZIP + {{svg "octicon-file-zip" 16 "tw-mr-1"}}TAR.GZ + {{end}} + + {{if (and $canReadReleases $.CanCreateRelease $release.IsTag)}} + {{svg "octicon-tag" 16 "tw-mr-1"}}{{ctx.Locale.Tr "repo.release.new_release"}} + {{end}} + + {{if (and ($.Permission.CanWrite $.UnitTypeCode) $release.IsTag)}} + + {{svg "octicon-trash" 16 "tw-mr-1"}}{{ctx.Locale.Tr "repo.release.delete_tag"}} + + {{end}} + + {{if and $canReadReleases (not $release.IsTag)}} + {{svg "octicon-tag" 16 "tw-mr-1"}}{{ctx.Locale.Tr "repo.release.detail"}} + {{end}} + {{end}} +
    +
    +
    + + {{template "base/paginate" .}} +
    +
    + +{{if $.Permission.CanWrite $.UnitTypeCode}} + +{{end}} + +{{template "base/footer" .}} diff --git a/templates/repo/tag/verification_box.tmpl b/templates/repo/tag/verification_box.tmpl new file mode 100644 index 0000000..3cf88ac --- /dev/null +++ b/templates/repo/tag/verification_box.tmpl @@ -0,0 +1,27 @@ +{{$v := call .ctxData.VerifyTag .release}} +{{if call .ctxData.HasSignature $v}} + {{$class := "isSigned"}} + {{$href := ""}} + {{if $v.Verified}} + {{$href = $v.SigningUser.HomeLink}} + {{$class = (print $class " isVerified")}} + {{else}} + {{$class = (print $class " isWarning")}} + {{end}} + + + {{if $v.Verified}} +
    + {{if ne $v.SigningUser.ID 0}} + {{svg "gitea-lock"}} + {{ctx.AvatarUtils.Avatar $v.SigningUser 28 "signature"}} + {{else}} + {{svg "gitea-lock-cog"}} + {{ctx.AvatarUtils.AvatarByEmail $v.Verification.SigningEmail "" 28 "signature"}} + {{end}} +
    + {{else}} + {{svg "gitea-unlock"}} + {{end}} +
    +{{end}} diff --git a/templates/repo/tag/verification_line.tmpl b/templates/repo/tag/verification_line.tmpl new file mode 100644 index 0000000..5f8335a --- /dev/null +++ b/templates/repo/tag/verification_line.tmpl @@ -0,0 +1,80 @@ +{{$v := call .ctxData.VerifyTag .release}} +{{if call .ctxData.HasSignature $v}} + {{$class := "isSigned"}} + {{$href := ""}} + {{if $v.Verified}} + {{$href = $v.SigningUser.HomeLink}} + {{$class = (print $class " isVerified")}} + {{else}} + {{$class = (print $class " isWarning")}} + {{end}} + +
    +
    + {{if $v.Verified}} + {{if ne $v.SigningUser.ID 0}} + {{svg "gitea-lock" 16 "tw-mr-2"}} + {{ctx.Locale.Tr "repo.commits.signed_by"}} + {{ctx.AvatarUtils.Avatar $v.SigningUser 28 "tw-mr-2"}} + {{$v.SigningUser.GetDisplayName}} + {{else}} + {{svg "gitea-lock-cog" 16 "tw-mr-2"}} + {{ctx.Locale.Tr "repo.commits.signed_by"}}: + {{ctx.AvatarUtils.AvatarByEmail $v.SigningEmail "" 28 "tw-mr-2"}} + {{$v.SigningUser.GetDisplayName}} + {{end}} + {{else}} + {{svg "gitea-unlock" 16 "tw-mr-2"}} + {{ctx.Locale.Tr $v.Reason}} + {{end}} +
    + +
    + {{if $v.Verified}} + {{if ne $v.SigningUser.ID 0}} + {{svg "octicon-verified" 16 "tw-mr-2"}} + {{if $v.SigningSSHKey}} + {{ctx.Locale.Tr "repo.commits.ssh_key_fingerprint"}}: + {{$v.SigningSSHKey.Fingerprint}} + {{else}} + {{ctx.Locale.Tr "repo.commits.gpg_key_id"}}: + {{$v.SigningKey.PaddedKeyID}} + {{end}} + {{else}} + {{svg "octicon-unverified" 16 "tw-mr-2"}} + {{if $v.SigningSSHKey}} + {{ctx.Locale.Tr "repo.commits.ssh_key_fingerprint"}}: + {{$v.SigningSSHKey.Fingerprint}} + {{else}} + {{ctx.Locale.Tr "repo.commits.gpg_key_id"}}: + {{$v.SigningKey.PaddedKeyID}} + {{end}} + {{end}} + {{else if $v.Warning}} + {{svg "octicon-unverified" 16 "tw-mr-2"}} + {{if $v.SigningSSHKey}} + {{ctx.Locale.Tr "repo.commits.ssh_key_fingerprint"}}: + {{$v.SigningSSHKey.Fingerprint}} + {{else}} + {{ctx.Locale.Tr "repo.commits.gpg_key_id"}}: + {{$v.SigningKey.PaddedKeyID}} + {{end}} + {{else}} + {{if $v.SigningKey}} + {{if ne $v.SigningKey.KeyID ""}} + {{svg "octicon-verified" 16 "tw-mr-2"}} + {{ctx.Locale.Tr "repo.commits.gpg_key_id"}}: + {{$v.SigningKey.PaddedKeyID}} + {{end}} + {{end}} + {{if $v.SigningSSHKey}} + {{if ne $v.SigningSSHKey.Fingerprint ""}} + {{svg "octicon-verified" 16 "tw-mr-2"}} + {{ctx.Locale.Tr "repo.commits.ssh_key_fingerprint"}}: + {{$v.SigningSSHKey.Fingerprint}} + {{end}} + {{end}} + {{end}} +
    +
    +{{end}} diff --git a/templates/repo/unicode_escape_prompt.tmpl b/templates/repo/unicode_escape_prompt.tmpl new file mode 100644 index 0000000..8bceafa --- /dev/null +++ b/templates/repo/unicode_escape_prompt.tmpl @@ -0,0 +1,22 @@ +{{if .EscapeStatus}} + {{if .EscapeStatus.HasInvisible}} +
    + +
    + {{ctx.Locale.Tr "repo.invisible_runes_header"}} +
    +

    {{ctx.Locale.Tr "repo.invisible_runes_description"}}

    + {{if .EscapeStatus.HasAmbiguous}} +

    {{ctx.Locale.Tr "repo.ambiguous_runes_description"}}

    + {{end}} +
    + {{else if .EscapeStatus.HasAmbiguous}} +
    + +
    + {{ctx.Locale.Tr "repo.ambiguous_runes_header"}} +
    +

    {{ctx.Locale.Tr "repo.ambiguous_runes_description"}}

    +
    + {{end}} +{{end}} diff --git a/templates/repo/upload.tmpl b/templates/repo/upload.tmpl new file mode 100644 index 0000000..eef5199 --- /dev/null +++ b/templates/repo/upload.tmpl @@ -0,0 +1,15 @@ +
    +
    +
    diff --git a/templates/repo/user_cards.tmpl b/templates/repo/user_cards.tmpl new file mode 100644 index 0000000..88178db --- /dev/null +++ b/templates/repo/user_cards.tmpl @@ -0,0 +1,32 @@ +
    + {{if .CardsTitle}} +

    + {{.CardsTitle}} +

    + {{end}} +
      + {{range .Cards}} +
    • + + {{ctx.AvatarUtils.Avatar .}} + +
      +

      + {{.DisplayName}} +

      +
      + {{if .Website}} + {{svg "octicon-link"}} {{.Website}} + {{else if .Location}} + {{svg "octicon-location"}} {{.Location}} + {{else}} + {{svg "octicon-calendar"}} {{ctx.Locale.Tr "user.joined_on" (DateTime "short" .CreatedUnix)}} + {{end}} +
      +
      +
    • + {{end}} +
    + + {{template "base/paginate" .}} +
    diff --git a/templates/repo/view_file.tmpl b/templates/repo/view_file.tmpl new file mode 100644 index 0000000..d127c2e --- /dev/null +++ b/templates/repo/view_file.tmpl @@ -0,0 +1,158 @@ +
    + {{- if .FileError}} +
    +
    {{.FileError}}
    +
    + {{end}} + {{- if .FileWarning}} +
    +
    {{.FileWarning}}
    +
    + {{end}} + + {{if not .ReadmeInList}} +
    +
    + {{template "repo/latest_commit" .}} +
    + {{if .LatestCommit}} + {{if .LatestCommit.Committer}} +
    + {{TimeSince .LatestCommit.Committer.When ctx.Locale}} +
    + {{end}} + {{end}} +
    + {{end}} + +

    +
    + {{if .ReadmeInList}} + {{svg "octicon-book" 16 "tw-mr-2"}} + {{.FileName}} + {{else}} + {{template "repo/file_info" .}} + {{end}} +
    +
    + {{if .HasSourceRenderedToggle}} + + {{end}} + {{if not .ReadmeInList}} +
    + {{if .SymlinkURL}} + {{ctx.Locale.Tr "repo.file_follow"}} + {{end}} + {{ctx.Locale.Tr "repo.file_raw"}} + {{if not .IsViewCommit}} + {{ctx.Locale.Tr "repo.file_permalink"}} + {{end}} + {{if .IsRepresentableAsText}} + {{ctx.Locale.Tr "repo.blame"}} + {{end}} + {{ctx.Locale.Tr "repo.file_history"}} + {{if .EscapeStatus.Escaped}} + + + {{end}} +
    + {{svg "octicon-download"}} + {{svg "octicon-copy" 14}} + {{if .EnableFeed}} + {{if .IsViewBranch}} + + {{svg "octicon-rss" 14}} + + {{else}} + + {{svg "octicon-rss" 14}} + + {{end}} + {{end}} + {{if .Repository.CanEnableEditor}} + {{if .CanEditFile}} + {{svg "octicon-pencil"}} + {{else}} + {{svg "octicon-pencil"}} + {{end}} + {{if .CanDeleteFile}} + {{svg "octicon-trash"}} + {{else}} + {{svg "octicon-trash"}} + {{end}} + {{end}} + {{else if .EscapeStatus.Escaped}} + + + {{end}} + {{if and .ReadmeInList .CanEditReadmeFile}} + {{svg "octicon-pencil"}} + {{end}} +
    +

    +
    + {{if not (or .IsMarkup .IsRenderedHTML)}} + {{template "repo/unicode_escape_prompt" dict "EscapeStatus" .EscapeStatus "root" $}} + {{end}} +
    + {{if .IsMarkup}} + {{if .FileContent}}{{.FileContent}}{{end}} + {{else if .IsPlainText}} +
    {{if .FileContent}}{{.FileContent}}{{end}}
    + {{else if not .IsTextSource}} +
    + {{if .IsImageFile}} + + {{else if .IsVideoFile}} + + {{else if .IsAudioFile}} + + {{else if .IsPDFFile}} +
    + {{else}} + {{ctx.Locale.Tr "repo.file_view_raw"}} + {{end}} +
    + {{else if .FileSize}} + {{if .IsFileTooLarge}} + + + + + + +
    {{ctx.Locale.Tr "repo.file_too_large"}}
    + {{else}} + + + {{range $idx, $code := .FileContent}} + {{$line := Eval $idx "+" 1}} + + + {{if $.EscapeStatus.Escaped}} + + {{end}} + + + {{end}} + +
    {{if (index $.LineEscapeStatus $idx).Escaped}}{{end}}{{$code}}
    + + {{end}} + {{end}} +
    +
    +
    diff --git a/templates/repo/view_list.tmpl b/templates/repo/view_list.tmpl new file mode 100644 index 0000000..b750e91 --- /dev/null +++ b/templates/repo/view_list.tmpl @@ -0,0 +1,72 @@ + + + + + + + + + {{if .HasParentPath}} + + + + {{end}} + {{range $item := .Files}} + {{$entry := $item.Entry}} + {{$commit := $item.Commit}} + {{$subModuleFile := $item.SubModuleFile}} + + + + + + {{end}} + +
    +
    +
    + {{template "repo/latest_commit" .}} +
    +
    +
    {{if .LatestCommit}}{{if .LatestCommit.Committer}}{{TimeSince .LatestCommit.Committer.When ctx.Locale}}{{end}}{{end}}
    {{svg "octicon-reply" 16 "tw-mr-2"}}..
    + + {{if $entry.IsSubModule}} + {{$refURL := $subModuleFile.RefURL AppUrl $.Repository.FullName $.SSHDomain}} {{/* FIXME: the usage of AppUrl seems incorrect, it would be fixed in the future, use AppSubUrl instead */}} + {{$icon := (svg "octicon-file-submodule" 16 "tw-mr-2")}} + {{if $refURL}} + {{$icon}}{{$entry.Name}}@{{ShortSha $subModuleFile.RefID}} + {{else}} + {{$icon}}{{$entry.Name}}@{{ShortSha $subModuleFile.RefID}} + {{end}} + {{else}} + {{if $entry.IsDir}} + {{$subJumpablePathName := $entry.GetSubJumpablePathName}} + + {{$subJumpablePathFields := StringUtils.Split $subJumpablePathName "/"}} + {{$subJumpablePathFieldLast := (Eval (len $subJumpablePathFields) "-" 1)}} + {{svg "octicon-file-directory-fill" 16 "tw-mr-2" -}} + {{if eq $subJumpablePathFieldLast 0 -}} + {{$subJumpablePathName}} + {{else -}} + {{$subJumpablePathPrefixes := slice $subJumpablePathFields 0 $subJumpablePathFieldLast -}} + {{StringUtils.Join $subJumpablePathPrefixes "/"}}/{{index $subJumpablePathFields $subJumpablePathFieldLast}} + {{end}} + + {{else}} + {{svg (printf "octicon-%s" (EntryIcon $entry)) 16 "tw-mr-2"}}{{$entry.Name}} + {{end}} + {{end}} + + + + {{if $commit}} + {{$commitLink := printf "%s/commit/%s" $.RepoLink (PathEscape $commit.ID.String)}} + {{RenderCommitMessageLinkSubject $.Context $commit.Message $commitLink ($.Repository.ComposeMetas ctx)}} + {{else}} +
    + {{end}} +
    +
    {{if $commit}}{{TimeSince $commit.Committer.When ctx.Locale}}{{end}}
    +{{if and .ReadmeExist (or .IsMarkup .IsPlainText)}} + {{template "repo/view_file" .}} +{{end}} diff --git a/templates/repo/watch_unwatch.tmpl b/templates/repo/watch_unwatch.tmpl new file mode 100644 index 0000000..3fea509 --- /dev/null +++ b/templates/repo/watch_unwatch.tmpl @@ -0,0 +1,14 @@ +
    +
    + + + {{CountFmt .Repository.NumWatches}} + +
    +
    diff --git a/templates/repo/watchers.tmpl b/templates/repo/watchers.tmpl new file mode 100644 index 0000000..1828544 --- /dev/null +++ b/templates/repo/watchers.tmpl @@ -0,0 +1,8 @@ +{{template "base/head" .}} +
    + {{template "repo/header" .}} +
    + {{template "repo/user_cards" .}} +
    +
    +{{template "base/footer" .}} diff --git a/templates/repo/wiki/new.tmpl b/templates/repo/wiki/new.tmpl new file mode 100644 index 0000000..81433db --- /dev/null +++ b/templates/repo/wiki/new.tmpl @@ -0,0 +1,48 @@ +{{template "base/head" .}} +
    + {{template "repo/header" .}} +
    + {{template "base/alert" .}} +
    + {{ctx.Locale.Tr "repo.wiki.new_page"}} + {{if .PageIsWikiEdit}} + {{ctx.Locale.Tr "repo.wiki.new_page_button"}} + {{end}} +
    +
    + {{.CsrfTokenHtml}} +
    + +
    +
    + {{ctx.Locale.Tr "repo.wiki.page_name_desc"}} +
    + + {{$content := .content}} + {{if not .PageIsWikiEdit}} + {{$content = ctx.Locale.Tr "repo.wiki.welcome"}} + {{end}} + {{template "shared/combomarkdowneditor" (dict + "MarkdownPreviewUrl" (print .Repository.Link "/markup") + "MarkdownPreviewContext" .RepoLink + "TextareaName" "content" + "TextareaPlaceholder" (ctx.Locale.Tr "repo.wiki.page_content") + "TextareaAriaLabel" (ctx.Locale.Tr "repo.wiki.page_content") + "TextareaContent" $content + "EasyMDE" true + )}} + +
    + +
    +
    +
    + + {{ctx.Locale.Tr "repo.wiki.cancel"}} +
    +
    +
    +
    +{{template "base/footer" .}} diff --git a/templates/repo/wiki/pages.tmpl b/templates/repo/wiki/pages.tmpl new file mode 100644 index 0000000..42c36a9 --- /dev/null +++ b/templates/repo/wiki/pages.tmpl @@ -0,0 +1,30 @@ +{{template "base/head" .}} +
    + {{template "repo/header" .}} +
    +

    + {{ctx.Locale.Tr "repo.wiki.pages"}} + + {{if and .CanWriteWiki (not .Repository.IsMirror)}} + {{ctx.Locale.Tr "repo.wiki.new_page_button"}} + {{end}} + +

    + + + {{range .Pages}} + + + {{$timeSince := TimeSinceUnix .UpdatedUnix ctx.Locale}} + + + {{end}} + +
    + {{svg "octicon-file"}} + {{.Name}} + {{svg "octicon-chevron-right"}} + {{ctx.Locale.Tr "repo.wiki.last_updated" $timeSince}}
    +
    +
    +{{template "base/footer" .}} diff --git a/templates/repo/wiki/revision.tmpl b/templates/repo/wiki/revision.tmpl new file mode 100644 index 0000000..7fca703 --- /dev/null +++ b/templates/repo/wiki/revision.tmpl @@ -0,0 +1,40 @@ +{{template "base/head" .}} +
    + {{template "repo/header" .}} + {{$title := .title}} +
    +
    +
    +
    + {{.revision}} {{svg "octicon-home"}} + {{$title}} +
    + {{$timeSince := TimeSince .Author.When ctx.Locale}} + {{ctx.Locale.Tr "repo.wiki.last_commit_info" .Author.Name $timeSince}} +
    +
    +
    +
    +
    + {{template "repo/clone_buttons" .}} + {{template "repo/clone_script" .}} +
    +
    +
    +

    {{ctx.Locale.Tr "repo.wiki.wiki_page_revisions"}}

    +
    +

    +
    +
    + {{.CommitCount}} {{ctx.Locale.Tr "repo.commits.commits"}} +
    +
    +

    + {{if and .Commits (gt .CommitCount 0)}} + {{template "repo/commits_list" .}} + {{end}} + {{template "base/paginate" .}} +
    +
    +
    +{{template "base/footer" .}} diff --git a/templates/repo/wiki/search.tmpl b/templates/repo/wiki/search.tmpl new file mode 100644 index 0000000..0bccd40 --- /dev/null +++ b/templates/repo/wiki/search.tmpl @@ -0,0 +1,12 @@ +{{if .Results}} + {{range .Results}} + + {{.Filename}} + {{range .LineCodes}} +

    {{.}}

    + {{end}} +
    + {{end}} +{{else}} +
    {{ctx.Locale.Tr "repo.wiki.no_search_results"}}
    +{{end}} diff --git a/templates/repo/wiki/start.tmpl b/templates/repo/wiki/start.tmpl new file mode 100644 index 0000000..1b3c3d5 --- /dev/null +++ b/templates/repo/wiki/start.tmpl @@ -0,0 +1,15 @@ +{{template "base/head" .}} +
    + {{template "repo/header" .}} +
    +
    + {{svg "octicon-book" 48}} +

    {{ctx.Locale.Tr "repo.wiki.welcome"}}

    +

    {{ctx.Locale.Tr "repo.wiki.welcome_desc"}}

    + {{if and .CanWriteWiki (not .Repository.IsMirror)}} + {{ctx.Locale.Tr "repo.wiki.create_first_page"}} + {{end}} +
    +
    +
    +{{template "base/footer" .}} diff --git a/templates/repo/wiki/view.tmpl b/templates/repo/wiki/view.tmpl new file mode 100644 index 0000000..40af307 --- /dev/null +++ b/templates/repo/wiki/view.tmpl @@ -0,0 +1,124 @@ +{{template "base/head" .}} +
    + {{template "repo/header" .}} + {{$title := .title}} +
    +
    +
    + +
    +
    + {{template "repo/clone_buttons" .}} + {{template "repo/clone_script" .}} +
    + +
    +
    +
    +
    + {{.CommitCount}} {{svg "octicon-history"}} + {{$title}} +
    + {{$timeSince := TimeSince .Author.When ctx.Locale}} + {{ctx.Locale.Tr "repo.wiki.last_commit_info" .Author.Name $timeSince}} +
    +
    + +
    +
    + {{if .FormatWarning}} +
    +

    {{.FormatWarning}}

    +
    + {{end}} + +
    + {{if .sidebarTocContent}} + + {{end}} + +
    + {{template "repo/unicode_escape_prompt" dict "EscapeStatus" .EscapeStatus "root" $}} + {{.content | SafeHTML}} +
    + + {{if .sidebarPresent}} + + {{end}} + +
    + + {{if .footerPresent}} + + {{end}} +
    +
    +
    + + + +{{template "base/footer" .}} -- cgit v1.2.3