Skip to content

Commit 4a722c9

Browse files
Make Issue/PR/projects more compact, misc CSS tweaks (#24459)
- Remove various horizontal dividers on repo pages that didn't provide visual benefit - Remove label/milestone pills on single issue/pr page - Remove issue-related pill buttons on projects page - Increase contrast of color-secondary on arc-green - Improve notifications icon, make circle bigger - Remove some inline styles - Fix focus in issue/pr title edit and select all text on button click ### Issue and PR before and after <img width="1249" alt="Screenshot 2023-05-01 at 11 44 22" src="https://user-images.githubusercontent.com/115237/235436662-a708288e-84fb-4b2e-a5a2-3a1c17d28f6c.png"> <img width="1248" alt="Screenshot 2023-05-01 at 11 58 51" src="https://user-images.githubusercontent.com/115237/235437992-f863e483-f3cc-4cc1-8204-fd223647a0c9.png"> ### Projects before and after <img width="1255" alt="Screenshot 2023-05-01 at 11 41 02" src="https://user-images.githubusercontent.com/115237/235436433-0deb85d6-4e7d-4e74-847f-254cc70a0cf9.png"> <img width="1267" alt="Screenshot 2023-05-01 at 11 40 03" src="https://user-images.githubusercontent.com/115237/235436431-715b13cb-f78c-4d86-b27a-9229f9738c5b.png"> ### Releases before and after <img width="1243" alt="Screenshot 2023-05-01 at 11 41 12" src="https://user-images.githubusercontent.com/115237/235436457-b655ee6f-03b8-4595-8d8c-b15ea469e988.png"> <img width="1240" alt="Screenshot 2023-05-01 at 11 40 10" src="https://user-images.githubusercontent.com/115237/235436456-05a2a0dd-7cbb-4f26-b0d3-4f667df4bb95.png"> ### Misc <img width="58" alt="Screenshot 2023-05-01 at 10 49 13" src="https://user-images.githubusercontent.com/115237/235432494-936ce995-6e22-47bc-ab2d-c9e93d31987d.png"> <img width="57" alt="Screenshot 2023-05-01 at 18 57 08" src="https://user-images.githubusercontent.com/115237/235492430-1d32cfe0-0f2c-467c-b2fa-925b27e30e0e.png"> Issue title edit and wrap: <img width="1238" alt="Screenshot 2023-05-01 at 12 34 40" src="https://user-images.githubusercontent.com/115237/235441407-d5067a57-e586-4865-a652-282e5944abb4.png"> <img width="1232" alt="Screenshot 2023-05-01 at 12 06 24" src="https://user-images.githubusercontent.com/115237/235438710-1a543dda-220f-4d87-8f93-f1710c0695f0.png"> --------- Co-authored-by: wxiaoguang <[email protected]>
1 parent 723598b commit 4a722c9

34 files changed

+255
-320
lines changed

templates/org/member/members.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<div class="list">
88
{{range .Members}}
99
<div class="item ui grid">
10-
<div class="ui four wide column" style="display: flex;">
10+
<div class="ui four wide column gt-df">
1111
<a href="{{.HomeLink}}">{{avatar $.Context . 48}}</a>
1212
<div>
1313
<div class="meta"><a href="{{.HomeLink}}">{{.Name}}</a></div>

templates/projects/list.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
{{end}}
1111

1212
{{template "base/alert" .}}
13-
<div class="small-pill-buttons ui compact tiny menu">
13+
<div class="small-menu-items ui compact tiny menu">
1414
<a class="item{{if not .IsShowClosed}} active{{end}}" href="{{$.Link}}?state=open">
1515
{{svg "octicon-project-symlink" 16 "gt-mr-3"}}
1616
{{.locale.PrettyNumber .OpenCount}}&nbsp;{{.locale.Tr "repo.issues.open_title"}}

templates/repo/actions/openclose.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div class="small-pill-buttons ui compact tiny menu">
1+
<div class="small-menu-items ui compact tiny menu">
22
<a class="{{if not .IsShowClosed}}active {{end}}item" href="{{$.Link}}?workflow={{.CurWorkflow}}&state=open">
33
{{svg "octicon-issue-opened" 16 "gt-mr-3"}}
44
{{.locale.Tr "actions.runs.open_tab" $.NumOpenActionRuns}}

templates/repo/branch_dropdown.tmpl

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
{{/* Attributes:
2+
* root
3+
* ContainerClasses
4+
* (TODO: search "branch_dropdown" in the template direcotry)
5+
*/}}
16
{{$defaultBranch := $.root.BranchName}}
27
{{if and .root.IsViewTag (not .noTag)}}
38
{{$defaultBranch = .root.TagName}}
@@ -62,10 +67,10 @@
6267
window.config.pageData.branchDropdownDataList.push(data);
6368
</script>
6469

65-
<div class="fitted item js-branch-tag-selector">
70+
<div class="js-branch-tag-selector {{if .ContainerClasses}}{{.ContainerClasses}}{{end}}">
6671
{{/* show dummy elements before Vue componment is mounted, this code must match the code in BranchTagSelector.vue */}}
6772
<div class="ui floating filter dropdown custom">
68-
<button class="branch-dropdown-button gt-ellipsis ui basic small compact button gt-df">
73+
<button class="branch-dropdown-button gt-ellipsis ui basic small compact button gt-df gt-m-0">
6974
<span class="text gt-df gt-ac gt-mr-2">
7075
{{if .release}}
7176
{{.root.locale.Tr "repo.release.compare"}}

templates/repo/commits.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
{{template "repo/sub_menu" .}}
66
<div class="repo-button-row gt-df gt-ac gt-sb gt-fw gt-mb-4 gt-mt-3">
77
<div class="gt-df gt-ac">
8-
{{template "repo/branch_dropdown" dict "root" .}}
8+
{{template "repo/branch_dropdown" dict "root" . "ContainerClasses" "gt-mr-2"}}
99
<a href="{{.RepoLink}}/graph" class="ui basic small compact button">
1010
<span class="text">
1111
{{svg "octicon-git-branch"}}

templates/repo/home.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
{{template "repo/sub_menu" .}}
6464
<div class="repo-button-row gt-df gt-ac gt-sb gt-fw">
6565
<div class="gt-df gt-ac gt-fw gt-gap-y-3">
66-
{{template "repo/branch_dropdown" dict "root" .}}
66+
{{template "repo/branch_dropdown" dict "root" . "ContainerClasses" "gt-mr-2"}}
6767
{{$n := len .TreeNames}}
6868
{{$l := Eval $n "-" 1}}
6969
<!-- If home page, show new pr. If not, show breadcrumb -->

templates/repo/issue/labels.tmpl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,14 @@
22
<div role="main" aria-label="{{.Title}}" class="page-content repository labels">
33
{{template "repo/header" .}}
44
<div class="ui container">
5-
<div class="navbar">
5+
<div class="navbar gt-mb-4">
66
{{template "repo/issue/navbar" .}}
77
{{if and (or .CanWriteIssues .CanWritePulls) (not .Repository.IsArchived)}}
88
<div class="ui right">
99
<button class="ui green new-label button">{{.locale.Tr "repo.issues.new_label"}}</button>
1010
</div>
1111
{{end}}
1212
</div>
13-
<div class="ui divider"></div>
1413
{{if and (or .CanWriteIssues .CanWritePulls) (not .Repository.IsArchived)}}
1514
{{template "repo/issue/labels/label_new" .}}
1615
{{end}}

templates/repo/issue/list.tmpl

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@
1717
{{end}}
1818
{{end}}
1919
</div>
20-
21-
<div class="ui divider"></div>
22-
2320
<div id="issue-filters" class="issue-list-toolbar">
2421
<div class="issue-list-toolbar-left">
2522
{{if $.CanWriteIssuesOrPulls}}

templates/repo/issue/milestones.tmpl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,18 @@
22
<div role="main" aria-label="{{.Title}}" class="page-content repository milestones">
33
{{template "repo/header" .}}
44
<div class="ui container">
5-
<div class="navbar">
5+
<div class="navbar gt-mb-4">
66
{{template "repo/issue/navbar" .}}
77
{{if and (or .CanWriteIssues .CanWritePulls) (not .Repository.IsArchived)}}
88
<div class="ui right">
99
<a class="ui small green button" href="{{$.Link}}/new">{{.locale.Tr "repo.milestones.new"}}</a>
1010
</div>
1111
{{end}}
1212
</div>
13-
<div class="ui divider"></div>
1413
{{template "base/alert" .}}
1514

1615
<div class="list-header">
17-
<div class="small-pill-buttons ui compact tiny menu">
16+
<div class="small-menu-items ui compact tiny menu">
1817
<a class="item{{if not .IsShowClosed}} active{{end}}" href="{{.RepoLink}}/milestones?state=open&q={{$.Keyword}}">
1918
{{svg "octicon-milestone" 16 "gt-mr-3"}}
2019
{{.locale.PrettyNumber .OpenCount}}&nbsp;{{.locale.Tr "repo.issues.open_title"}}

templates/repo/issue/navbar.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<h2 class="ui compact small menu header small-pill-buttons">
1+
<h2 class="ui compact small menu header small-menu-items">
22
<a class="{{if .PageIsLabels}}active {{end}}item" href="{{.RepoLink}}/labels">{{.locale.Tr "repo.labels"}}</a>
33
<a class="{{if .PageIsMilestones}}active {{end}}item" href="{{.RepoLink}}/milestones">{{.locale.Tr "repo.milestones"}}</a>
44
</h2>

templates/repo/issue/new.tmpl

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22
<div role="main" aria-label="{{.Title}}" class="page-content repository new issue">
33
{{template "repo/header" .}}
44
<div class="ui container">
5-
<div class="navbar">
6-
{{template "repo/issue/navbar" .}}
7-
</div>
8-
<div class="ui divider"></div>
95
{{if .Flash.WarningMsg}}
106
{{/*
117
There's already an importing of alert.tmpl in new_form.tmpl,

templates/repo/issue/openclose.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div class="small-pill-buttons ui compact tiny menu">
1+
<div class="small-menu-items ui compact tiny menu">
22
<a class="{{if not .IsShowClosed}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state=open&labels={{.SelectLabels}}&milestone={{.MilestoneID}}&project={{.ProjectID}}&assignee={{.AssigneeID}}&poster={{.PosterID}}">
33
{{if .PageIsPullList}}
44
{{svg "octicon-git-pull-request" 16 "gt-mr-3"}}

templates/repo/issue/view.tmpl

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,11 @@
22
<div role="main" aria-label="{{.Title}}" class="page-content repository view issue pull">
33
{{template "repo/header" .}}
44
<div class="ui container">
5-
<div class="ui two column grid">
6-
<div class="column">
7-
{{template "repo/issue/navbar" .}}
8-
</div>
9-
{{if and (not .Repository.IsArchived) (not .Issue.IsPull)}}
10-
<div class="column right aligned">
11-
{{if .PageIsIssueList}}
12-
<a class="ui green button" href="{{.RepoLink}}/issues/new{{if .NewIssueChooseTemplate}}/choose{{end}}">{{.locale.Tr "repo.issues.new"}}</a>
13-
{{else}}
14-
<a class="ui green button {{if not .PullRequestCtx.Allowed}}disabled{{end}}" href="{{.RepoLink}}/compare/{{.BranchName | PathEscapeSegments}}...{{.PullRequestCtx.HeadInfoSubURL}}">{{.locale.Tr "repo.pulls.new"}}</a>
15-
{{end}}
16-
</div>
17-
{{end}}
18-
</div>
19-
<div class="ui divider"></div>
5+
{{template "repo/issue/view_title" .}}
206
{{if .Issue.IsPull}}
21-
{{template "repo/issue/view_title" .}}
227
{{template "repo/pulls/tab_menu" .}}
23-
<div class="ui bottom attached tab pull active" data-tab="request-{{.ID}}">
24-
{{template "repo/issue/view_content" .}}
25-
</div>
26-
{{else}}
27-
<div>
28-
{{template "repo/issue/view_content" .}}
29-
</div>
308
{{end}}
9+
{{template "repo/issue/view_content" .}}
3110
</div>
3211
</div>
3312
{{template "base/footer" .}}

templates/repo/issue/view_content.tmpl

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,4 @@
11
<div class="ui stackable grid">
2-
{{if .Flash}}
3-
<div class="sixteen wide column">
4-
{{template "base/alert" .}}
5-
</div>
6-
{{end}}
7-
{{if not .Issue.IsPull}}
8-
{{template "repo/issue/view_title" .}}
9-
{{end}}
10-
112
<!-- I know, there is probably a better way to do this (moved from sidebar.tmpl, original author: 6543 @ 2021-02-28) -->
123
<!-- Agree, there should be a better way, eg: introduce window.config.pageData (original author: wxiaoguang @ 2021-09-05) -->
134
<input type="hidden" id="repolink" value="{{$.RepoRelPath}}">

templates/repo/issue/view_title.tmpl

Lines changed: 102 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -1,107 +1,119 @@
1-
<div class="sixteen wide column title">
1+
{{if .Flash}}
2+
<div class="sixteen wide column gt-mb-3">
3+
{{template "base/alert" .}}
4+
</div>
5+
{{end}}
6+
<div class="issue-title-header">
27
<div class="issue-title" id="issue-title-wrapper">
3-
{{if and (or .HasIssuesOrPullsWritePermission .IsIssuePoster) (not .Repository.IsArchived)}}
4-
<button id="edit-title" class="ui basic button secondary edit-button not-in-edit">{{.locale.Tr "repo.issues.edit"}}</button>
5-
{{end}}
6-
<h1>
7-
<span id="issue-title">{{RenderIssueTitle $.Context .Issue.Title $.RepoLink $.Repository.ComposeMetas | RenderCodeBlock}}</span>
8-
<span class="index">#{{.Issue.Index}}</span>
9-
<div id="edit-title-input" class="ui input gt-ml-4 gt-hidden">
8+
<h1 class="gt-word-break">
9+
<span id="issue-title">{{RenderIssueTitle $.Context .Issue.Title $.RepoLink $.Repository.ComposeMetas | RenderCodeBlock}} <span class="index">#{{.Issue.Index}}</span>
10+
</span>
11+
<div id="edit-title-input" class="ui input gt-f1 gt-hidden">
1012
<input value="{{.Issue.Title}}" maxlength="255" autocomplete="off">
1113
</div>
1214
</h1>
15+
<div class="issue-title-buttons">
16+
{{if and (or .HasIssuesOrPullsWritePermission .IsIssuePoster) (not .Repository.IsArchived)}}
17+
<button id="edit-title" class="ui small basic button secondary edit-button not-in-edit{{if .Issue.IsPull}} gt-mr-0{{end}}">{{.locale.Tr "repo.issues.edit"}}</button>
18+
{{end}}
19+
{{if not .Issue.IsPull}}
20+
<a role="button" class="ui small green button new-issue-button gt-mr-0" href="{{.RepoLink}}/issues/new{{if .NewIssueChooseTemplate}}/choose{{end}}">{{.locale.Tr "repo.issues.new"}}</a>
21+
{{end}}
22+
</div>
1323
{{if and (or .HasIssuesOrPullsWritePermission .IsIssuePoster) (not .Repository.IsArchived)}}
1424
<div class="edit-buttons">
15-
<button id="cancel-edit-title" class="ui basic button secondary in-edit gt-hidden">{{.locale.Tr "repo.issues.cancel"}}</button>
16-
<button id="save-edit-title" class="ui primary button in-edit gt-hidden" data-update-url="{{$.RepoLink}}/issues/{{.Issue.Index}}/title" {{if .Issue.IsPull}}data-target-update-url="{{$.RepoLink}}/pull/{{.Issue.Index}}/target_branch"{{end}}>{{.locale.Tr "repo.issues.save"}}</button>
25+
<button id="cancel-edit-title" class="ui small basic button secondary in-edit gt-hidden">{{.locale.Tr "repo.issues.cancel"}}</button>
26+
<button id="save-edit-title" class="ui small primary button in-edit gt-hidden gt-mr-0" data-update-url="{{$.RepoLink}}/issues/{{.Issue.Index}}/title" {{if .Issue.IsPull}}data-target-update-url="{{$.RepoLink}}/pull/{{.Issue.Index}}/target_branch"{{end}}>{{.locale.Tr "repo.issues.save"}}</button>
1727
</div>
1828
{{end}}
1929
</div>
20-
{{if .HasMerged}}
21-
<div class="ui purple large label">{{svg "octicon-git-merge" 16}} {{if eq .Issue.PullRequest.Status 3}}{{.locale.Tr "repo.pulls.manually_merged"}}{{else}}{{.locale.Tr "repo.pulls.merged"}}{{end}}</div>
22-
{{else if .Issue.IsClosed}}
23-
<div class="ui red large label">{{if .Issue.IsPull}}{{svg "octicon-git-pull-request"}}{{else}}{{svg "octicon-issue-closed"}}{{end}} {{.locale.Tr "repo.issues.closed_title"}}</div>
24-
{{else if .Issue.IsPull}}
25-
{{if .IsPullWorkInProgress}}
26-
<div class="ui grey large label">{{svg "octicon-git-pull-request-draft"}} {{.locale.Tr "repo.issues.draft_title"}}</div>
27-
{{else}}
28-
<div class="ui green large label">{{svg "octicon-git-pull-request"}} {{.locale.Tr "repo.issues.open_title"}}</div>
29-
{{end}}
30-
{{else}}
31-
<div class="ui green large label">{{svg "octicon-issue-opened"}} {{.locale.Tr "repo.issues.open_title"}}</div>
32-
{{end}}
33-
34-
{{if .Issue.IsPull}}
35-
{{$headHref := .HeadTarget|Escape}}
36-
{{if .HeadBranchLink}}
37-
{{$headHref = printf "<a href=\"%s\">%s</a>" (.HeadBranchLink | Escape) $headHref}}
38-
{{end}}
39-
{{$headHref = printf "%s <a data-tooltip-content=\"%s\" data-clipboard-text=\"%s\">%s</a>" $headHref (.locale.Tr "copy_branch") (.HeadTarget | Escape) (svg "octicon-copy" 14)}}
40-
{{$baseHref := .BaseTarget|Escape}}
41-
{{if .BaseBranchLink}}
42-
{{$baseHref = printf "<a href=\"%s\">%s</a>" (.BaseBranchLink | Escape) $baseHref}}
43-
{{end}}
44-
{{if .Issue.PullRequest.HasMerged}}
45-
{{$mergedStr:= TimeSinceUnix .Issue.PullRequest.MergedUnix $.locale}}
46-
{{if .Issue.OriginalAuthor}}
47-
{{.Issue.OriginalAuthor}}
48-
<span class="pull-desc">{{$.locale.Tr "repo.pulls.merged_title_desc" .NumCommits $headHref $baseHref $mergedStr | Safe}}</span>
30+
<div class="issue-title-meta">
31+
{{if .HasMerged}}
32+
<div class="ui purple label issue-state-label">{{svg "octicon-git-merge" 16 "gt-mr-2"}} {{if eq .Issue.PullRequest.Status 3}}{{.locale.Tr "repo.pulls.manually_merged"}}{{else}}{{.locale.Tr "repo.pulls.merged"}}{{end}}</div>
33+
{{else if .Issue.IsClosed}}
34+
<div class="ui red label issue-state-label">{{if .Issue.IsPull}}{{svg "octicon-git-pull-request"}}{{else}}{{svg "octicon-issue-closed"}}{{end}} {{.locale.Tr "repo.issues.closed_title"}}</div>
35+
{{else if .Issue.IsPull}}
36+
{{if .IsPullWorkInProgress}}
37+
<div class="ui grey label issue-state-label">{{svg "octicon-git-pull-request-draft"}} {{.locale.Tr "repo.issues.draft_title"}}</div>
4938
{{else}}
50-
<a {{if gt .Issue.PullRequest.Merger.ID 0}}href="{{.Issue.PullRequest.Merger.HomeLink}}"{{end}}>{{.Issue.PullRequest.Merger.GetDisplayName}}</a>
51-
<span class="pull-desc">{{$.locale.Tr "repo.pulls.merged_title_desc" .NumCommits $headHref $baseHref $mergedStr | Safe}}</span>
39+
<div class="ui green label issue-state-label">{{svg "octicon-git-pull-request"}} {{.locale.Tr "repo.issues.open_title"}}</div>
5240
{{end}}
5341
{{else}}
54-
{{if .Issue.OriginalAuthor}}
55-
<span id="pull-desc" class="pull-desc">{{.Issue.OriginalAuthor}} {{$.locale.Tr "repo.pulls.title_desc" .NumCommits $headHref $baseHref | Safe}}</span>
56-
{{else}}
57-
<span id="pull-desc" class="pull-desc">
58-
<a {{if gt .Issue.Poster.ID 0}}href="{{.Issue.Poster.HomeLink}}"{{end}}>{{.Issue.Poster.GetDisplayName}}</a>
59-
{{$.locale.Tr "repo.pulls.title_desc" .NumCommits $headHref $baseHref | Safe}}
60-
</span>
61-
{{end}}
62-
<span id="pull-desc-edit" class="gt-hidden">
63-
<div class="ui floating filter dropdown">
64-
<div class="ui basic small button">
65-
<span class="text">{{.locale.Tr "repo.pulls.compare_compare"}}: {{$.HeadTarget}}</span>
66-
</div>
67-
</div>
68-
{{svg "octicon-arrow-right"}}
69-
<div class="ui floating filter dropdown" data-no-results="{{.locale.Tr "repo.pulls.no_results"}}">
70-
<div class="ui basic small button">
71-
<span class="text" id="pull-target-branch" data-basename="{{$.BaseName}}" data-branch="{{$.BaseBranch}}">{{.locale.Tr "repo.pulls.compare_base"}}: {{$.BaseName}}:{{$.BaseBranch}}</span>
72-
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
73-
</div>
74-
<div class="menu">
75-
<div class="ui icon search input">
76-
<i class="icon gt-df gt-ac gt-jc gt-m-0">{{svg "octicon-filter" 16}}</i>
77-
<input name="search" placeholder="{{.locale.Tr "repo.pulls.filter_branch"}}...">
42+
<div class="ui green label issue-state-label">{{svg "octicon-issue-opened"}} {{.locale.Tr "repo.issues.open_title"}}</div>
43+
{{end}}
44+
<div class="gt-ml-3">
45+
{{if .Issue.IsPull}}
46+
{{$headHref := .HeadTarget|Escape}}
47+
{{if .HeadBranchLink}}
48+
{{$headHref = printf "<a href=\"%s\">%s</a>" (.HeadBranchLink | Escape) $headHref}}
49+
{{end}}
50+
{{$headHref = printf "%s <a data-tooltip-content=\"%s\" data-clipboard-text=\"%s\">%s</a>" $headHref (.locale.Tr "copy_branch") (.HeadTarget | Escape) (svg "octicon-copy" 14)}}
51+
{{$baseHref := .BaseTarget|Escape}}
52+
{{if .BaseBranchLink}}
53+
{{$baseHref = printf "<a href=\"%s\">%s</a>" (.BaseBranchLink | Escape) $baseHref}}
54+
{{end}}
55+
{{if .Issue.PullRequest.HasMerged}}
56+
{{$mergedStr:= TimeSinceUnix .Issue.PullRequest.MergedUnix $.locale}}
57+
{{if .Issue.OriginalAuthor}}
58+
{{.Issue.OriginalAuthor}}
59+
<span class="pull-desc">{{$.locale.Tr "repo.pulls.merged_title_desc" .NumCommits $headHref $baseHref $mergedStr | Safe}}</span>
60+
{{else}}
61+
<a {{if gt .Issue.PullRequest.Merger.ID 0}}href="{{.Issue.PullRequest.Merger.HomeLink}}"{{end}}>{{.Issue.PullRequest.Merger.GetDisplayName}}</a>
62+
<span class="pull-desc">{{$.locale.Tr "repo.pulls.merged_title_desc" .NumCommits $headHref $baseHref $mergedStr | Safe}}</span>
63+
{{end}}
64+
{{else}}
65+
{{if .Issue.OriginalAuthor}}
66+
<span id="pull-desc" class="pull-desc">{{.Issue.OriginalAuthor}} {{$.locale.Tr "repo.pulls.title_desc" .NumCommits $headHref $baseHref | Safe}}</span>
67+
{{else}}
68+
<span id="pull-desc" class="pull-desc">
69+
<a {{if gt .Issue.Poster.ID 0}}href="{{.Issue.Poster.HomeLink}}"{{end}}>{{.Issue.Poster.GetDisplayName}}</a>
70+
{{$.locale.Tr "repo.pulls.title_desc" .NumCommits $headHref $baseHref | Safe}}
71+
</span>
72+
{{end}}
73+
<span id="pull-desc-edit" class="gt-hidden">
74+
<div class="ui floating filter dropdown">
75+
<div class="ui basic small button">
76+
<span class="text">{{.locale.Tr "repo.pulls.compare_compare"}}: {{$.HeadTarget}}</span>
77+
</div>
7878
</div>
79-
<div class="scrolling menu" id="branch-select">
80-
{{range .Branches}}
81-
{{$sameBase := ne $.BaseName $.HeadUserName}}
82-
{{$differentBranch := ne . $.HeadBranch}}
83-
{{if or $sameBase $differentBranch}}
84-
<div class="item {{if eq $.BaseBranch .}}selected{{end}}" data-branch="{{.}}">{{$.BaseName}}{{if $.HeadRepo}}/{{$.HeadRepo}}{{end}}:{{.}}</div>
85-
{{end}}
86-
{{end}}
79+
{{svg "octicon-arrow-right"}}
80+
<div class="ui floating filter dropdown" data-no-results="{{.locale.Tr "repo.pulls.no_results"}}">
81+
<div class="ui basic small button">
82+
<span class="text" id="pull-target-branch" data-basename="{{$.BaseName}}" data-branch="{{$.BaseBranch}}">{{.locale.Tr "repo.pulls.compare_base"}}: {{$.BaseName}}:{{$.BaseBranch}}</span>
83+
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
84+
</div>
85+
<div class="menu">
86+
<div class="ui icon search input">
87+
<i class="icon gt-df gt-ac gt-jc gt-m-0">{{svg "octicon-filter" 16}}</i>
88+
<input name="search" placeholder="{{.locale.Tr "repo.pulls.filter_branch"}}...">
89+
</div>
90+
<div class="scrolling menu" id="branch-select">
91+
{{range .Branches}}
92+
{{$sameBase := ne $.BaseName $.HeadUserName}}
93+
{{$differentBranch := ne . $.HeadBranch}}
94+
{{if or $sameBase $differentBranch}}
95+
<div class="item {{if eq $.BaseBranch .}}selected{{end}}" data-branch="{{.}}">{{$.BaseName}}{{if $.HeadRepo}}/{{$.HeadRepo}}{{end}}:{{.}}</div>
96+
{{end}}
97+
{{end}}
98+
</div>
99+
</div>
87100
</div>
88-
</div>
89-
</div>
90-
</span>
91-
{{end}}
92-
{{else}}
93-
{{$createdStr:= TimeSinceUnix .Issue.CreatedUnix $.locale}}
94-
<span class="time-desc">
95-
{{if .Issue.OriginalAuthor}}
96-
{{$.locale.Tr "repo.issues.opened_by_fake" $createdStr (.Issue.OriginalAuthor|Escape) | Safe}}
97-
{{else if gt .Issue.Poster.ID 0}}
98-
{{$.locale.Tr "repo.issues.opened_by" $createdStr (.Issue.Poster.HomeLink|Escape) (.Issue.Poster.GetDisplayName|Escape) | Safe}}
101+
</span>
102+
{{end}}
99103
{{else}}
100-
{{$.locale.Tr "repo.issues.opened_by_fake" $createdStr (.Issue.Poster.GetDisplayName|Escape) | Safe}}
104+
{{$createdStr:= TimeSinceUnix .Issue.CreatedUnix $.locale}}
105+
<span class="time-desc">
106+
{{if .Issue.OriginalAuthor}}
107+
{{$.locale.Tr "repo.issues.opened_by_fake" $createdStr (.Issue.OriginalAuthor|Escape) | Safe}}
108+
{{else if gt .Issue.Poster.ID 0}}
109+
{{$.locale.Tr "repo.issues.opened_by" $createdStr (.Issue.Poster.HomeLink|Escape) (.Issue.Poster.GetDisplayName|Escape) | Safe}}
110+
{{else}}
111+
{{$.locale.Tr "repo.issues.opened_by_fake" $createdStr (.Issue.Poster.GetDisplayName|Escape) | Safe}}
112+
{{end}}
113+
·
114+
{{$.locale.Tr "repo.issues.num_comments" .Issue.NumComments}}
115+
</span>
101116
{{end}}
102-
·
103-
{{$.locale.Tr "repo.issues.num_comments" .Issue.NumComments}}
104-
</span>
105-
{{end}}
106-
<div class="ui divider"></div>
117+
</div>
118+
</div>
107119
</div>

0 commit comments

Comments
 (0)