Skip to content

Commit b8d141d

Browse files
authored
Merge pull request #6 from silverwind/fix-10327-commit-graph-options
Fix 10327 commit graph options
2 parents 4fe9aaf + f633478 commit b8d141d

File tree

3 files changed

+39
-66
lines changed

3 files changed

+39
-66
lines changed

templates/repo/graph/commits.tmpl

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -28,40 +28,40 @@
2828
{{- end -}}
2929
</a>
3030
</span>
31-
{{range $commit.Refs}}
32-
{{$refGroup := .RefGroup}}
33-
{{if eq $refGroup "pull"}}
34-
{{if $.HidePRRefs}}
35-
{{if (containGeneric $.SelectedBranches .Name) }}
31+
<span class="message df ac mr-2">{{RenderCommitMessage $commit.Subject $.RepoLink $.Repository.ComposeMetas}}</span>
32+
<span class="tags df ac">
33+
{{range $commit.Refs}}
34+
{{$refGroup := .RefGroup}}
35+
{{if eq $refGroup "pull"}}
36+
{{if $.HidePRRefs}}
37+
{{if (containGeneric $.SelectedBranches .Name) }}
38+
<a class="ui labelled icon button basic tiny" href="{{$.RepoLink}}/pulls/{{.ShortName|PathEscape}}">
39+
{{svg "octicon-git-pull-request" 16 "mr-2"}}#{{.ShortName}}
40+
</a>
41+
{{end}}
42+
{{else}}
3643
<a class="ui labelled icon button basic tiny" href="{{$.RepoLink}}/pulls/{{.ShortName|PathEscape}}">
3744
{{svg "octicon-git-pull-request" 16 "mr-2"}}#{{.ShortName}}
3845
</a>
3946
{{end}}
40-
{{else}}
41-
<a class="ui labelled icon button basic tiny" href="{{$.RepoLink}}/pulls/{{.ShortName|PathEscape}}">
42-
{{svg "octicon-git-pull-request" 16 "mr-2"}}#{{.ShortName}}
47+
{{else if eq $refGroup "tags"}}
48+
<a class="ui labelled icon button basic tiny" href="{{$.RepoLink}}/src/tag/{{.ShortName|PathEscape}}">
49+
{{svg "octicon-tag" 16 "mr-2"}}{{.ShortName}}
50+
</a>
51+
{{else if eq $refGroup "remotes"}}
52+
<a class="ui labelled icon button basic tiny" href="{{$.RepoLink}}/src/commit/{{$commit.Rev}}">
53+
{{svg "octicon-cross-reference" 16 "mr-2"}}{{.ShortName}}
54+
</a>
55+
{{else if eq $refGroup "heads"}}
56+
<a class="ui labelled icon button basic tiny" href="{{$.RepoLink}}/src/branch/{{.ShortName|PathEscape}}">
57+
{{svg "octicon-git-branch" 16 "mr-2"}}{{.ShortName}}
4358
</a>
59+
{{else}}
60+
<!-- Unknown ref type {{.Name}} -->
4461
{{end}}
45-
{{else if eq $refGroup "tags"}}
46-
<a class="ui labelled icon button basic tiny" href="{{$.RepoLink}}/src/tag/{{.ShortName|PathEscape}}">
47-
{{svg "octicon-tag" 16 "mr-2"}}{{.ShortName}}
48-
</a>
49-
{{else if eq $refGroup "remotes"}}
50-
<a class="ui labelled icon button basic tiny" href="{{$.RepoLink}}/src/commit/{{$commit.Rev}}">
51-
{{svg "octicon-cross-reference" 16 "mr-2"}}{{.ShortName}}
52-
</a>
53-
{{else if eq $refGroup "heads"}}
54-
<a class="ui labelled icon button basic tiny" href="{{$.RepoLink}}/src/branch/{{.ShortName|PathEscape}}">
55-
{{svg "octicon-git-branch" 16 "mr-2"}}{{.ShortName}}
56-
</a>
57-
{{else}}
58-
<!-- Unknown ref type {{.Name}} -->
5962
{{end}}
60-
{{end}}
61-
62-
<span>{{RenderCommitMessage $commit.Subject $.RepoLink $.Repository.ComposeMetas}}</span>
63-
64-
<span class="author">
63+
</span>
64+
<span class="author df ac mr-2">
6565
{{$userName := $commit.Commit.Author.Name}}
6666
{{if $commit.User}}
6767
{{if $commit.User.FullName}}
@@ -72,7 +72,7 @@
7272
<img class="ui avatar image" src="{{AvatarLink $commit.Commit.Author.Email}}" alt=""/>{{$userName}}
7373
{{end}}
7474
</span>
75-
<span class="time">{{$commit.Date}}</span>
75+
<span class="time df ac">{{$commit.Date}}</span>
7676
{{ end }}
7777
</li>
7878
{{ end }}

web_src/less/features/gitgraph.less

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@
6464
height: 24px;
6565
line-height: 24px;
6666
white-space: nowrap;
67+
display: flex;
68+
align-items: center;
6769

6870
.node-relation {
6971
font-family: "Bitstream Vera Sans Mono", "Courier", monospace;
@@ -78,10 +80,6 @@
7880
font-size: 80%;
7981
}
8082

81-
a {
82-
color: #000000;
83-
}
84-
8583
a:hover {
8684
text-decoration: underline;
8785
}
@@ -106,23 +104,15 @@
106104

107105
#rev-list {
108106
margin: 0;
109-
padding: 0 5px;
110-
min-width: 95%;
111-
112-
li.highlight,
113-
li.hover {
114-
background-color: rgba(0, 0, 0, .05);
115-
}
107+
padding: 0;
108+
width: 100%;
116109

117110
li.highlight.hover {
118-
background-color: rgba(0, 0, 0, .1);
111+
background-color: rgba(0, 0, 0, .05);
119112
}
120113

121-
li a.button {
122-
padding-top: 2px;
123-
padding-bottom: 2px;
124-
vertical-align: top;
125-
margin-top: 2px;
114+
.tags a.button {
115+
padding: 2px 4px;
126116
}
127117

128118
.sha.label {

web_src/less/themes/theme-arc-green.less

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1782,22 +1782,6 @@ a.ui.labels .label:hover {
17821782
background-color: #a27558;
17831783
}
17841784

1785-
#git-graph-container li a.sha {
1786-
color: #dbdbdb;
1787-
}
1788-
1789-
#git-graph-container li a {
1790-
color: #c79575;
1791-
}
1792-
1793-
#git-graph-container li.highlight a.ui.labelled {
1794-
border: 1px solid #999999;
1795-
}
1796-
1797-
#git-graph-container li .author {
1798-
color: #c79575;
1799-
}
1800-
18011785
.ui.header .sub.header {
18021786
color: #9e9e9e;
18031787
}
@@ -2142,6 +2126,10 @@ img[src$="/img/matrix.svg"] {
21422126
filter: invert(80%);
21432127
}
21442128

2129+
#git-graph-container li .time {
2130+
color: #6a737d;
2131+
}
2132+
21452133
#git-graph-container.monochrome #rel-container .flow-group {
21462134
stroke: dimgrey;
21472135
fill: dimgrey;
@@ -2166,11 +2154,6 @@ img[src$="/img/matrix.svg"] {
21662154
}
21672155
}
21682156

2169-
#git-graph-container #rev-list li.highlight,
2170-
#git-graph-container #rev-list li.hover {
2171-
background-color: rgba(255, 255, 255, .05);
2172-
}
2173-
21742157
#git-graph-container #rev-list li.highlight.hover {
21752158
background-color: rgba(255, 255, 255, .1);
21762159
}

0 commit comments

Comments
 (0)