Skip to content

Commit 52b4b98

Browse files
silverwindlafriks
andauthored
Comment Header fixes (#13356) (#13374)
Apply more flexboxes on comment header and remove float hacks. Needs 1.13 backport. Fixes: #13316 Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: Lauris BH <lauris@nix.lv>
1 parent 77a2d75 commit 52b4b98

File tree

5 files changed

+44
-62
lines changed

5 files changed

+44
-62
lines changed

templates/repo/issue/view_content.tmpl

+23-21
Original file line numberDiff line numberDiff line change
@@ -21,25 +21,27 @@
2121
{{end}}
2222
<div class="content">
2323
<div class="ui top attached header">
24-
{{if .Issue.OriginalAuthor }}
25-
<span class="text black">
26-
<i class="fa {{MigrationIcon .Repository.GetOriginalURLHostname}}" aria-hidden="true"></i>
27-
{{ .Issue.OriginalAuthor }}
28-
</span>
29-
<span class="text grey">
30-
{{ .i18n.Tr "repo.issues.commented_at" .Issue.HashTag $createdStr | Safe }}
31-
</span>
32-
<span class="text migrate">
33-
{{if .Repository.OriginalURL}} ({{$.i18n.Tr "repo.migrated_from" .Repository.OriginalURL .Repository.GetOriginalURLHostname | Safe }}){{end}}
34-
</span>
35-
{{else}}
36-
<span class="text grey">
37-
<a class="author"{{if gt .Issue.Poster.ID 0}} href="{{.Issue.Poster.HomeLink}}"{{end}}>{{.Issue.Poster.GetDisplayName}}</a>
38-
{{.i18n.Tr "repo.issues.commented_at" .Issue.HashTag $createdStr | Safe}}
39-
</span>
40-
{{end}}
41-
{{if not $.Repository.IsArchived}}
42-
<div class="ui right actions">
24+
<div class="header-left df ac">
25+
{{if .Issue.OriginalAuthor }}
26+
<span class="text black">
27+
<i class="fa {{MigrationIcon .Repository.GetOriginalURLHostname}}" aria-hidden="true"></i>
28+
{{ .Issue.OriginalAuthor }}
29+
</span>
30+
<span class="text grey">
31+
{{ .i18n.Tr "repo.issues.commented_at" .Issue.HashTag $createdStr | Safe }}
32+
</span>
33+
<span class="text migrate">
34+
{{if .Repository.OriginalURL}} ({{$.i18n.Tr "repo.migrated_from" .Repository.OriginalURL .Repository.GetOriginalURLHostname | Safe }}){{end}}
35+
</span>
36+
{{else}}
37+
<span class="text grey">
38+
<a class="author"{{if gt .Issue.Poster.ID 0}} href="{{.Issue.Poster.HomeLink}}"{{end}}>{{.Issue.Poster.GetDisplayName}}</a>
39+
{{.i18n.Tr "repo.issues.commented_at" .Issue.HashTag $createdStr | Safe}}
40+
</span>
41+
{{end}}
42+
</div>
43+
<div class="header-right actions df ac">
44+
{{if not $.Repository.IsArchived}}
4345
{{if gt .Issue.ShowTag 0}}
4446
<div class="item tag">
4547
{{if eq .Issue.ShowTag 2}}
@@ -51,8 +53,8 @@
5153
{{end}}
5254
{{template "repo/issue/view_content/add_reaction" Dict "ctx" $ "ActionURL" (Printf "%s/issues/%d/reactions" $.RepoLink .Issue.Index)}}
5355
{{template "repo/issue/view_content/context_menu" Dict "ctx" $ "item" .Issue "delete" false "diff" false "IsCommentPoster" $.IsIssuePoster}}
54-
</div>
55-
{{end}}
56+
{{end}}
57+
</div>
5658
</div>
5759
<div class="ui attached segment">
5860
<div class="render-content markdown">

templates/repo/issue/view_content/comments.tmpl

+11-9
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,15 @@
2020
{{end}}
2121
<div class="content">
2222
<div class="ui top attached header">
23-
{{if .OriginalAuthor }}
24-
<span class="text black"><i class="fa {{MigrationIcon $.Repository.GetOriginalURLHostname}}" aria-hidden="true"></i> {{ .OriginalAuthor }}</span><span class="text grey"> {{$.i18n.Tr "repo.issues.commented_at" .Issue.HashTag $createdStr | Safe}} {{if $.Repository.OriginalURL}}</span><span class="text migrate">({{$.i18n.Tr "repo.migrated_from" $.Repository.OriginalURL $.Repository.GetOriginalURLHostname | Safe }}){{end}}</span>
25-
{{else}}
26-
<span class="text grey"><a class="author"{{if gt .Poster.ID 0}} href="{{.Poster.HomeLink}}"{{end}}>{{.Poster.GetDisplayName}}</a> {{$.i18n.Tr "repo.issues.commented_at" .HashTag $createdStr | Safe}}</span>
27-
{{end}}
28-
{{if not $.Repository.IsArchived}}
29-
<div class="ui right actions">
23+
<div class="header-left df ac">
24+
{{if .OriginalAuthor }}
25+
<span class="text black"><i class="fa {{MigrationIcon $.Repository.GetOriginalURLHostname}}" aria-hidden="true"></i> {{ .OriginalAuthor }}</span><span class="text grey"> {{$.i18n.Tr "repo.issues.commented_at" .Issue.HashTag $createdStr | Safe}} {{if $.Repository.OriginalURL}}</span><span class="text migrate">({{$.i18n.Tr "repo.migrated_from" $.Repository.OriginalURL $.Repository.GetOriginalURLHostname | Safe }}){{end}}</span>
26+
{{else}}
27+
<span class="text grey"><a class="author"{{if gt .Poster.ID 0}} href="{{.Poster.HomeLink}}"{{end}}>{{.Poster.GetDisplayName}}</a> {{$.i18n.Tr "repo.issues.commented_at" .HashTag $createdStr | Safe}}</span>
28+
{{end}}
29+
</div>
30+
<div class="header-right actions df ac">
31+
{{if not $.Repository.IsArchived}}
3032
{{if eq .PosterID .Issue.PosterID }}
3133
<div class="item tag">
3234
{{$.i18n.Tr "repo.issues.poster"}}
@@ -43,8 +45,8 @@
4345
{{end}}
4446
{{template "repo/issue/view_content/add_reaction" Dict "ctx" $ "ActionURL" (Printf "%s/comments/%d/reactions" $.RepoLink .ID)}}
4547
{{template "repo/issue/view_content/context_menu" Dict "ctx" $ "item" . "delete" true "diff" false "IsCommentPoster" (and $.IsSigned (eq $.SignedUserID .PosterID))}}
46-
</div>
47-
{{end}}
48+
{{end}}
49+
</div>
4850
</div>
4951
<div class="ui attached segment">
5052
<div class="render-content markdown">

web_src/less/_form.less

+3-7
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,9 @@
1010
.ui.attached.header {
1111
background: #f0f0f0;
1212

13-
.right {
14-
margin-top: -5px;
15-
16-
.button {
17-
padding: 8px 10px;
18-
font-weight: normal;
19-
}
13+
.right .button {
14+
padding: 8px 10px;
15+
font-weight: normal;
2016
}
2117
}
2218

web_src/less/_repository.less

+6-24
Original file line numberDiff line numberDiff line change
@@ -955,7 +955,6 @@
955955

956956
.tag {
957957
color: #767676;
958-
margin-top: 3px;
959958
padding: 2px 5px;
960959
font-size: 12px;
961960
border: 1px solid rgba(0, 0, 0, .1);
@@ -969,26 +968,6 @@
969968
}
970969
}
971970

972-
.actions {
973-
.item {
974-
float: left;
975-
976-
&.context {
977-
float: none;
978-
}
979-
980-
&.tag {
981-
margin-right: 5px;
982-
}
983-
984-
&.action {
985-
margin-top: 6px;
986-
padding-left: 10px;
987-
padding-right: 3px;
988-
}
989-
}
990-
}
991-
992971
> .content {
993972
> div:first-child {
994973
border-top-left-radius: 4px;
@@ -1028,11 +1007,14 @@
10281007
left: 7px;
10291008
}
10301009

1031-
.actions {
1032-
display: flex;
1033-
padding: 0 .5rem;
1010+
.header-left > * + *,
1011+
.header-right > * + * {
1012+
margin-left: .25rem;
1013+
}
10341014

1015+
.actions {
10351016
a {
1017+
padding: .5rem;
10361018
color: rgba(0, 0, 0, .4);
10371019

10381020
&:hover {

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -1124,7 +1124,7 @@ a.ui.basic.green.label:hover {
11241124

11251125
.repository.view.issue .comment-list .comment .tag {
11261126
color: #dbdbdb;
1127-
border-color: rgb(152, 152, 152);
1127+
border-color: #505667;
11281128
}
11291129

11301130
.repository.view.issue .comment-list .timeline-item .badge.badge-commit {

0 commit comments

Comments
 (0)