diff options
Diffstat (limited to 'templates/repo/pulls')
-rw-r--r-- | templates/repo/pulls/commits.tmpl | 10 | ||||
-rw-r--r-- | templates/repo/pulls/files.tmpl | 14 | ||||
-rw-r--r-- | templates/repo/pulls/fork.tmpl | 90 | ||||
-rw-r--r-- | templates/repo/pulls/status.tmpl | 59 | ||||
-rw-r--r-- | templates/repo/pulls/tab_menu.tmpl | 28 |
5 files changed, 201 insertions, 0 deletions
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" .}} +<div role="main" aria-label="{{.Title}}" class="page-content repository view issue pull commits"> + {{template "repo/header" .}} + <div class="ui container"> + {{template "repo/issue/view_title" .}} + {{template "repo/pulls/tab_menu" .}} + {{template "repo/commits_table" .}} + </div> +</div> +{{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" .}} + +<input type="hidden" id="repolink" value="{{$.RepoRelPath}}"> +<input type="hidden" id="issueIndex" value="{{.Issue.Index}}"> + +<div role="main" aria-label="{{.Title}}" class="page-content repository view issue pull files diff"> + {{template "repo/header" .}} + <div class="ui container fluid padded"> + {{template "repo/issue/view_title" .}} + {{template "repo/pulls/tab_menu" .}} + {{template "repo/diff/box" .}} + </div> +</div> +{{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" .}} +<div role="main" aria-label="{{.Title}}" class="page-content repository new fork"> + <div class="ui middle very relaxed page grid"> + <div class="column"> + <form class="ui form" action="{{.Link}}" method="post"> + {{.CsrfTokenHtml}} + <h3 class="ui top attached header"> + {{ctx.Locale.Tr "new_fork"}} + </h3> + <div class="ui attached segment"> + {{template "base/alert" .}} + <div class="inline required field {{if .Err_Owner}}error{{end}}"> + <label>{{ctx.Locale.Tr "repo.owner"}}</label> + <div class="ui selection owner dropdown"> + <input type="hidden" id="uid" name="uid" value="{{.ContextUser.ID}}" required> + <span class="text truncated-item-container" title="{{.ContextUser.Name}}"> + {{ctx.AvatarUtils.Avatar .ContextUser 28 "mini"}} + <span class="truncated-item-name">{{.ContextUser.ShortName 40}}</span> + </span> + {{svg "octicon-triangle-down" 14 "dropdown icon"}} + <div class="menu"> + {{if .CanForkToUser}} + <div class="item truncated-item-container" data-value="{{.SignedUser.ID}}" title="{{.SignedUser.Name}}"> + {{ctx.AvatarUtils.Avatar .SignedUser 28 "mini"}} + <span class="truncated-item-name">{{.SignedUser.ShortName 40}}</span> + </div> + {{end}} + {{range .Orgs}} + <div class="item truncated-item-container" data-value="{{.ID}}" title="{{.Name}}"> + {{ctx.AvatarUtils.Avatar . 28 "mini"}} + <span class="truncated-item-name">{{.ShortName 40}}</span> + </div> + {{end}} + </div> + </div> + </div> + + <div class="inline field"> + <label>{{ctx.Locale.Tr "repo.fork_from"}}</label> + <a href="{{.ForkRepo.Link}}" class="tw-inline-block">{{.ForkRepo.FullName}}</a> + </div> + <div class="inline required field {{if .Err_RepoName}}error{{end}}"> + <label for="repo_name">{{ctx.Locale.Tr "repo.repo_name"}}</label> + <input id="repo_name" name="repo_name" value="{{.repo_name}}" required> + </div> + <div class="inline field"> + <label>{{ctx.Locale.Tr "repo.visibility"}}</label> + <div class="ui disabled checkbox"> + <input type="checkbox" disabled {{if .IsPrivate}}checked{{end}}> + <label>{{ctx.Locale.Tr "repo.visibility_helper"}}</label> + </div> + <span class="help">{{ctx.Locale.Tr "repo.fork_visibility_helper"}}</span> + </div> + <div class="inline field"> + <label>{{ctx.Locale.Tr "repo.fork_branch"}}</label> + <div class="ui selection dropdown"> + <input type="hidden" id="fork_single_branch" name="fork_single_branch" value="" required> + <span class="text truncated-item-container" data-value="" title="{{ctx.Locale.Tr "repo.all_branches"}}"> + <span class="truncated-item-name">{{ctx.Locale.Tr "repo.all_branches"}}</span> + </span> + {{svg "octicon-triangle-down" 14 "dropdown icon"}} + <div class="menu"> + <div class="item truncated-item-container" data-value="" title="{{ctx.Locale.Tr "repo.all_branches"}}"> + <span class="truncated-item-name">{{ctx.Locale.Tr "repo.all_branches"}}</span> + </div> + {{range .Branches}} + <div class="item truncated-item-container" data-value="{{.}}" title="{{.}}"> + <span class="truncated-item-name">{{.}}</span> + </div> + {{end}} + </div> + </div> + </div> + <div class="inline field {{if .Err_Description}}error{{end}}"> + <label for="description">{{ctx.Locale.Tr "repo.repo_desc"}}</label> + <textarea id="description" name="description">{{.description}}</textarea> + </div> + + <div class="inline field"> + <label></label> + <button class="ui primary button{{if not .CanForkRepo}} disabled{{end}}"> + {{ctx.Locale.Tr "repo.fork_repo"}} + </button> + </div> + </div> + </form> + </div> + </div> +</div> +{{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}} +<div class="commit-status-panel"> + <div class="ui top attached header commit-status-header"> + {{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}} + <div class="ui right"> + <button class="commit-status-hide-checks btn interact-fg" + data-show-all="{{ctx.Locale.Tr "repo.pulls.status_checks_show_all"}}" + data-hide-all="{{ctx.Locale.Tr "repo.pulls.status_checks_hide_all"}}"> + {{ctx.Locale.Tr "repo.pulls.status_checks_hide_all"}}</button> + </div> + {{end}} + </div> + + <div class="commit-status-list"> + {{range .CommitStatuses}} + <div class="commit-status-item"> + {{template "repo/commit_status" .}} + <div class="status-context gt-ellipsis">{{.Context}} <span class="text light-2">{{.Description}}</span></div> + <div class="ui status-details"> + {{if $.is_context_required}} + {{if (call $.is_context_required .Context)}}<div class="ui label">{{ctx.Locale.Tr "repo.pulls.status_checks_requested"}}</div>{{end}} + {{end}} + <span>{{if .TargetURL}}<a href="{{.TargetURL}}">{{ctx.Locale.Tr "repo.pulls.status_checks_details"}}</a>{{end}}</span> + </div> + </div> + {{end}} + {{range .MissingRequiredChecks}} + <div class="commit-status-item"> + {{svg "octicon-dot-fill" 18 "commit-status icon text yellow"}} + <div class="status-context gt-ellipsis">{{.}}</div> + <div class="ui label">{{ctx.Locale.Tr "repo.pulls.status_checks_requested"}}</div> + </div> + {{end}} + </div> +</div> +{{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 @@ +<div class="ui pull tabs container"> + <div class="ui top attached pull tabular menu"> + <a class="item {{if .PageIsPullConversation}}active{{end}}" href="{{.Issue.Link}}"> + {{svg "octicon-comment-discussion"}} + {{ctx.Locale.Tr "repo.pulls.tab_conversation"}} + <span class="ui small label">{{.Issue.NumComments}}</span> + </a> + <a class="item {{if .PageIsPullCommits}}active{{end}}" {{if .NumCommits}}href="{{.Issue.Link}}/commits"{{end}}> + {{svg "octicon-git-commit"}} + {{ctx.Locale.Tr "repo.pulls.tab_commits"}} + <span class="ui small label">{{if .NumCommits}}{{.NumCommits}}{{else}}-{{end}}</span> + </a> + <a class="item {{if .PageIsPullFiles}}active{{end}}" href="{{.Issue.Link}}/files"> + {{svg "octicon-diff"}} + {{ctx.Locale.Tr "repo.pulls.tab_files"}} + <span class="ui small label">{{if .NumFiles}}{{.NumFiles}}{{else}}-{{end}}</span> + </a> + {{if or .Diff.TotalAddition .Diff.TotalDeletion}} + <span class="tw-ml-auto tw-pl-3 tw-whitespace-nowrap tw-pr-0 tw-font-bold tw-flex tw-items-center tw-gap-2"> + <span><span class="text green">{{if .Diff.TotalAddition}}+{{.Diff.TotalAddition}}{{end}}</span> <span class="text red">{{if .Diff.TotalDeletion}}-{{.Diff.TotalDeletion}}{{end}}</span></span> + <span class="diff-stats-bar"> + <div class="diff-stats-add-bar" style="width: {{Eval 100 "*" .Diff.TotalAddition "/" "(" .Diff.TotalAddition "+" .Diff.TotalDeletion "+" 0.0 ")"}}%"></div> + </span> + </span> + {{end}} + </div> + <div class="ui tabs divider"></div> +</div> |