Skip to content

Commit e4bd476

Browse files
committed
Make more progress
1 parent a8e2c1b commit e4bd476

File tree

5 files changed

+99
-50
lines changed

5 files changed

+99
-50
lines changed

templates/repo/branch/list.tmpl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,19 @@
88
{{.i18n.Tr "repo.default_branch"}}
99
</h4>
1010

11-
<div class="ui attached table segment">
11+
<div class="ui bottom attached table segment">
1212
<table class="ui very basic striped fixed single line unstackable table">
1313
<tbody>
1414
<tr>
1515
<td class="six wide">
1616
{{range .Branches}}
1717
{{if eq .Name $.DefaultBranch}}
18+
{{$renderedCommitMessage := RenderCommitMessage .Commit.CommitMessage $.RepoLink $.Repository.ComposeMetas}}
1819
{{if .IsProtected}}
1920
{{svg "octicon-shield-lock"}}
2021
{{end}}
2122
<a href="{{$.RepoLink}}/src/branch/{{$.DefaultBranch | EscapePound}}">{{$.DefaultBranch}}</a>
22-
<p class="info df ac my-2">{{svg "octicon-git-commit" 16 "mr-2"}}<a href="{{$.RepoLink}}/commit/{{.Commit.ID.String}}">{{ShortSha .Commit.ID.String}}</a>&nbsp;·&nbsp;<span class="commit-message">{{RenderCommitMessage .Commit.CommitMessage $.RepoLink $.Repository.ComposeMetas}}</span>&nbsp;·&nbsp;{{$.i18n.Tr "org.repo_updated"}}&nbsp;{{TimeSince .Commit.Committer.When $.i18n.Lang}}</p>
23+
<p class="info df ac my-2" title="{{$renderedCommitMessage}}">{{svg "octicon-git-commit" 16 "mr-2"}}<a href="{{$.RepoLink}}/commit/{{.Commit.ID.String}}">{{ShortSha .Commit.ID.String}}</a>&nbsp;·&nbsp;<span class="commit-message">{{$renderedCommitMessage}}</span>&nbsp;·&nbsp;{{$.i18n.Tr "org.repo_updated"}}&nbsp;{{TimeSince .Commit.Committer.When $.i18n.Lang}}</p>
2324
{{end}}
2425
{{end}}
2526
</td>
@@ -52,11 +53,12 @@
5253
<s><a href="{{$.RepoLink}}/src/branch/{{.Name | EscapePound}}">{{.Name}}</a></s>
5354
<p class="info">{{$.i18n.Tr "repo.branch.deleted_by" .DeletedBranch.DeletedBy.Name}}&nbsp;{{TimeSinceUnix .DeletedBranch.DeletedUnix $.i18n.Lang}}</p>
5455
{{else}}
56+
{{$renderedCommitMessage := RenderCommitMessage .Commit.CommitMessage $.RepoLink $.Repository.ComposeMetas}}
5557
{{if .IsProtected}}
5658
{{svg "octicon-shield-lock"}}
5759
{{end}}
5860
<a href="{{$.RepoLink}}/src/branch/{{.Name | EscapePound}}">{{.Name}}</a>
59-
<p class="info df ac my-2">{{svg "octicon-git-commit" 16 "mr-2"}}<a href="{{$.RepoLink}}/commit/{{.Commit.ID.String}}">{{ShortSha .Commit.ID.String}}</a>&nbsp;·&nbsp;<span class="commit-message">{{RenderCommitMessage .Commit.CommitMessage $.RepoLink $.Repository.ComposeMetas}}</span>&nbsp;·&nbsp;{{$.i18n.Tr "org.repo_updated"}}&nbsp;{{TimeSince .Commit.Committer.When $.i18n.Lang}}</p>
61+
<p class="info df ac my-2" title="{{$renderedCommitMessage}}">{{svg "octicon-git-commit" 16 "mr-2"}}<a href="{{$.RepoLink}}/commit/{{.Commit.ID.String}}">{{ShortSha .Commit.ID.String}}</a>&nbsp;·&nbsp;<span class="commit-message">{{$renderedCommitMessage}}</span>&nbsp;·&nbsp;{{$.i18n.Tr "org.repo_updated"}}&nbsp;{{TimeSince .Commit.Committer.When $.i18n.Lang}}</p>
6062
{{end}}
6163
</td>
6264
<td class="three wide ui">

templates/repo/commits_list.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div class="ui attached table segment">
1+
<div class="ui bottom attached table segment">
22
<table class="ui very basic striped fixed single line unstackable table" id="commits-table">
33
<thead>
44
<tr>

templates/repo/view_file.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
</div>
6464
{{end}}
6565
</h4>
66-
<div class="ui attached table unstackable segment">
66+
<div class="ui bottom attached table unstackable segment">
6767
<div class="file-view {{if .IsMarkup}}{{.MarkupType}} markdown{{else if .IsRenderedHTML}}plain-text{{else if .IsTextSource}}code-view{{end}}">
6868
{{if .IsMarkup}}
6969
{{if .FileContent}}{{.FileContent | Safe}}{{end}}

templates/repo/view_list.tmpl

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
1-
<table id="repo-files-table" class="ui single line unstackable table mt-0">
2-
<thead>
3-
<tr class="commit-list">
1+
<table id="repo-files-table" class="ui fixed single line unstackable table mt-0">
2+
<thead class="commit-list">
3+
<tr>
4+
<th class="name four wide"></th>
5+
<th class="message twelve wide"></th>
6+
<th rowspan="2" class="text grey right age">{{if .LatestCommit.Author}}{{TimeSince .LatestCommit.Author.When $.Lang}}{{end}}</th>
7+
</tr>
8+
<tr>
49
<th colspan="2">
5-
<div class="df ac">
10+
<div class="author"><div>
611
{{if .LatestCommitUser}}
7-
{{avatar .LatestCommitUser 28 "mr-3"}}
12+
{{avatar .LatestCommitUser 28}}
813
{{if .LatestCommitUser.FullName}}
914
<a href="{{AppSubUrl}}/{{.LatestCommitUser.Name}}"><strong>{{.LatestCommitUser.FullName}}</strong></a>
1015
{{else}}
@@ -16,15 +21,19 @@
1621
<strong>{{.LatestCommit.Author.Name}}</strong>
1722
{{end}}
1823
{{end}}
19-
<a rel="nofollow" class="ui sha label ml-3 mr-0{{if .LatestCommit.Signature}} isSigned {{if .LatestCommitVerification.Verified }} isVerified{{if eq .LatestCommitVerification.TrustStatus "trusted"}}{{else if eq .LatestCommitVerification.TrustStatus "untrusted"}}Untrusted{{else}}Unmatched{{end}}{{else if .LatestCommitVerification.Warning}} isWarning{{end}}{{end}}" href="{{.RepoLink}}/commit/{{.LatestCommit.ID}}">
24+
</div></div>
25+
<div class="sha">
26+
<a rel="nofollow" class="ui sha label{{if .LatestCommit.Signature}} isSigned {{if .LatestCommitVerification.Verified }} isVerified{{if eq .LatestCommitVerification.TrustStatus "trusted"}}{{else if eq .LatestCommitVerification.TrustStatus "untrusted"}}Untrusted{{else}}Unmatched{{end}}{{else if .LatestCommitVerification.Warning}} isWarning{{end}}{{end}}" href="{{.RepoLink}}/commit/{{.LatestCommit.ID}}">
2027
<span class="shortsha">{{ShortSha .LatestCommit.ID.String}}</span>
2128
{{if .LatestCommit.Signature}}
2229
{{template "repo/shabox_badge" dict "root" $ "verification" .LatestCommitVerification}}
2330
{{end}}
2431
</a>
32+
</div>
33+
<div class="message">
2534
{{template "repo/commit_statuses" dict "Status" .LatestCommitStatus "Statuses" .LatestCommitStatuses "root" $}}
2635
{{ $commitLink:= printf "%s/commit/%s" .RepoLink .LatestCommit.ID }}
27-
<span class="message-wrapper f1 ml-3">
36+
<span class="message-wrapper">
2837
<span class="grey commit-summary" title="{{.LatestCommit.Summary}}">
2938
{{RenderCommitMessageLinkSubject .LatestCommit.Message $.RepoLink $commitLink $.Repository.ComposeMetas}}
3039
</span>
@@ -35,7 +44,6 @@
3544
</span>
3645
</div>
3746
</th>
38-
<th class="text grey right age">{{if .LatestCommit.Author}}{{TimeSince .LatestCommit.Author.When $.Lang}}{{end}}</th>
3947
</tr>
4048
</thead>
4149
<tbody>
@@ -49,7 +57,7 @@
4957
{{$commit := $item.Commit}}
5058
{{$subModuleFile := $item.SubModuleFile}}
5159
<tr>
52-
<td class="name four wide">
60+
<td class="name">
5361
<span class="truncate">
5462
{{if $entry.IsSubModule}}
5563
{{svg "octicon-file-submodule"}}
@@ -78,12 +86,12 @@
7886
{{end}}
7987
</span>
8088
</td>
81-
<td class="message nine wide">
89+
<td class="message">
8290
<span class="truncate">
8391
<a href="{{$.RepoLink}}/commit/{{$commit.ID}}" title="{{$commit.Summary}}">{{$commit.Summary | RenderEmoji}}</a>
8492
</span>
8593
</td>
86-
<td class="text right age three wide">{{TimeSince $commit.Committer.When $.Lang}}</td>
94+
<td class="text right age">{{TimeSince $commit.Committer.When $.Lang}}</td>
8795
</tr>
8896
{{end}}
8997
</tbody>

web_src/less/_repository.less

Lines changed: 73 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,65 @@
275275
padding-top: 11px;
276276
padding-bottom: 11px;
277277
font-weight: normal;
278+
279+
> div {
280+
display: table-cell;
281+
overflow: hidden;
282+
283+
&.author > div {
284+
min-width: max-content;
285+
}
286+
}
287+
288+
&.name,
289+
&.message {
290+
padding: 0;
291+
border: 0;
292+
}
293+
294+
&.age {
295+
width: 120px;
296+
}
297+
298+
@media @mediaLg {
299+
&.name {
300+
width: 37.5%;
301+
}
302+
&.message {
303+
width: 62.5%;
304+
}
305+
}
306+
307+
@media @mediaMd {
308+
&.name {
309+
width: 43.75%;
310+
}
311+
&.message {
312+
width: 56.25%;
313+
}
314+
}
315+
316+
@media @mediaSm {
317+
&.name {
318+
width: 50%;
319+
}
320+
&.message {
321+
width: 50%;
322+
}
323+
}
324+
325+
@media (max-width: 480px) {
326+
&.name {
327+
width: 100%;
328+
}
329+
&.message {
330+
width: 0%;
331+
}
332+
333+
div.sha {
334+
max-width: 6px;
335+
}
336+
}
278337
}
279338

280339
tbody {
@@ -299,18 +358,6 @@
299358
padding-bottom: 0;
300359
overflow: initial;
301360

302-
&.name {
303-
max-width: 150px;
304-
}
305-
306-
&.message {
307-
max-width: 0;
308-
}
309-
310-
&.age {
311-
width: 120px;
312-
}
313-
314361
.truncate {
315362
display: inline-block;
316363
overflow: hidden;
@@ -1328,6 +1375,14 @@
13281375
}
13291376

13301377
#commits-table {
1378+
@media (max-width: 480px) {
1379+
.ui.avatar,
1380+
th.sha,
1381+
td.sha {
1382+
display: none;
1383+
}
1384+
}
1385+
13311386
thead {
13321387
th:first-of-type {
13331388
padding-left: 15px;
@@ -2709,16 +2764,18 @@
27092764
display: inline-block !important;
27102765
}
27112766

2712-
tbody.commit-list {
2713-
vertical-align: baseline;
2767+
.commit-list tr {
2768+
line-height: 2rem;
2769+
vertical-align: top;
27142770
}
27152771

27162772
.message-wrapper {
27172773
display: flex;
27182774
flex-wrap: wrap;
27192775
align-items: center;
2776+
text-align: left;
27202777

2721-
*:first-child {
2778+
> :first-child {
27222779
overflow: hidden;
27232780
text-overflow: ellipsis;
27242781
flex: 1;
@@ -2737,25 +2794,6 @@ tbody.commit-list {
27372794
padding: 1px 7px;
27382795
}
27392796

2740-
@media (max-width: 480px) {
2741-
#repo-files-table {
2742-
.message {
2743-
width: 0;
2744-
font-size: 0;
2745-
}
2746-
2747-
.name {
2748-
max-width: inherit;
2749-
}
2750-
}
2751-
2752-
td.author .ui.avatar,
2753-
th.sha,
2754-
.commit-list .sha {
2755-
display: none;
2756-
}
2757-
}
2758-
27592797
.commit-summary a {
27602798
&:hover {
27612799
text-decoration: underline solid;
@@ -2783,6 +2821,7 @@ tbody.commit-list {
27832821
.repository:not(.diff) {
27842822
.commit-body { // commit history list
27852823
margin: 0;
2824+
min-width: .5rem;
27862825
}
27872826

27882827
.timeline-item .commit-body { // PR-comment

0 commit comments

Comments
 (0)