Skip to content

Commit 9b95b41

Browse files
gary-kimlafriks
authored andcommitted
Prevent Commit Status and Message From Overflowing On Branch Page (#7800) (#7808)
Signed-off-by: Gary Kim <[email protected]>
1 parent 38e7997 commit 9b95b41

File tree

3 files changed

+19
-12
lines changed

3 files changed

+19
-12
lines changed

public/css/index.css

+3-2
Original file line numberDiff line numberDiff line change
@@ -623,6 +623,7 @@ footer .ui.left,footer .ui.right{line-height:40px}
623623
.repository #commits-table thead .sha{width:140px}
624624
.repository #commits-table thead .shatd{text-align:center}
625625
.repository #commits-table td.sha .sha.label{margin:0}
626+
.repository #commits-table td.message{text-overflow:unset}
626627
.repository #commits-table.ui.basic.striped.table tbody tr:nth-child(2n){background-color:rgba(0,0,0,.02)!important}
627628
.repository #commits-table td.sha .sha.label.isSigned,.repository #repo-files-table .sha.label.isSigned{border:1px solid #bbb}
628629
.repository #commits-table td.sha .sha.label.isSigned .detail.icon,.repository #repo-files-table .sha.label.isSigned .detail.icon{background:#fafafa;margin:-6px -10px -4px 0;padding:5px 3px 5px 6px;border-left:1px solid #bbb;border-top-left-radius:0;border-bottom-left-radius:0}
@@ -817,8 +818,8 @@ footer .ui.left,footer .ui.right{line-height:40px}
817818
.stats-table .table-cell{display:table-cell}
818819
.stats-table .table-cell.tiny{height:.5em}
819820
tbody.commit-list{vertical-align:baseline}
820-
.commit-list .message-wrapper{overflow:hidden;text-overflow:ellipsis;max-width:calc(100% - 24px);display:inline-block;vertical-align:middle}
821-
.commit-list .message-wrapper .commit-status-link{display:inline-block;vertical-align:middle}
821+
.commit-list .message-wrapper{overflow:hidden;text-overflow:ellipsis;max-width:calc(100% - 50px);display:inline-block;vertical-align:middle}
822+
.commit-list .commit-status-link{display:inline-block;vertical-align:middle}
822823
.commit-body{white-space:pre-wrap}
823824
.git-notes.top{text-align:left}
824825
.git-notes .commit-body{margin:0}

public/less/_repository.less

+6-2
Original file line numberDiff line numberDiff line change
@@ -1265,6 +1265,10 @@
12651265
margin: 0;
12661266
}
12671267

1268+
td.message {
1269+
text-overflow: unset;
1270+
}
1271+
12681272
&.ui.basic.striped.table tbody tr:nth-child(2n) {
12691273
background-color: rgba(0, 0, 0, 0.02) !important;
12701274
}
@@ -2302,12 +2306,12 @@ tbody.commit-list {
23022306
.commit-list .message-wrapper {
23032307
overflow: hidden;
23042308
text-overflow: ellipsis;
2305-
max-width: calc(100% - 24px);
2309+
max-width: calc(100% - 50px);
23062310
display: inline-block;
23072311
vertical-align: middle;
23082312
}
23092313

2310-
.commit-list .message-wrapper .commit-status-link {
2314+
.commit-list .commit-status-link {
23112315
display: inline-block;
23122316
vertical-align: middle;
23132317
}

templates/repo/commits_table.tmpl

+10-8
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,11 @@
4646
<tr>
4747
<td class="author">
4848
{{if .User}}
49-
{{if .User.FullName}}
49+
{{if .User.FullName}}
5050
<img class="ui avatar image" src="{{.User.RelAvatarLink}}" alt=""/>&nbsp;&nbsp;<a href="{{AppSubUrl}}/{{.User.Name}}">{{.User.FullName}}</a>
51-
{{else}}
51+
{{else}}
5252
<img class="ui avatar image" src="{{.User.RelAvatarLink}}" alt=""/>&nbsp;&nbsp;<a href="{{AppSubUrl}}/{{.User.Name}}">{{.Author.Name}}</a>
53-
{{end}}
53+
{{end}}
5454
{{else}}
5555
<img class="ui avatar image" src="{{AvatarLink .Author.Email}}" alt=""/>&nbsp;&nbsp;{{.Author.Name}}
5656
{{end}}
@@ -71,13 +71,15 @@
7171
</td>
7272
<td class="message">
7373
<span class="message-wrapper">
74-
<span class="commit-summary has-emoji{{if gt .ParentCount 1}} grey text{{end}}" title="{{.Summary}}">{{.Summary}}</span>
75-
{{if IsMultilineCommitMessage .Message}}
76-
<button class="basic compact mini ui icon button commit-button"><i class="ellipsis horizontal icon"></i></button>
77-
<pre class="commit-body" style="display: none;">{{RenderCommitBody .Message $.RepoLink $.Repository.ComposeMetas}}</pre>
78-
{{end}}
74+
<span class="commit-summary has-emoji{{if gt .ParentCount 1}} grey text{{end}}" title="{{.Summary}}">{{.Summary}}</span>
7975
</span>
76+
{{if IsMultilineCommitMessage .Message}}
77+
<button class="basic compact mini ui icon button commit-button"><i class="ellipsis horizontal icon"></i></button>
78+
{{end}}
8079
{{template "repo/commit_status" .Status}}
80+
{{if IsMultilineCommitMessage .Message}}
81+
<pre class="commit-body" style="display: none;">{{RenderCommitBody .Message $.RepoLink $.Repository.ComposeMetas}}</pre>
82+
{{end}}
8183
</td>
8284
<td class="grey text right aligned">{{TimeSince .Author.When $.Lang}}</td>
8385
</tr>

0 commit comments

Comments
 (0)