Skip to content

Commit ee3e07d

Browse files
committed
Repo file list enhancements
1 parent bed563e commit ee3e07d

File tree

2 files changed

+47
-12
lines changed

2 files changed

+47
-12
lines changed

templates/repo/view_list.tmpl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
<div>{{if and .LatestCommit .LatestCommit.Committer}}{{DateUtils.TimeSince .LatestCommit.Committer.When}}{{end}}</div>
66
</div>
77
{{if .HasParentPath}}
8-
<div class="repo-file-line">
9-
{{svg "octicon-reply"}} <a class="muted" href="{{.BranchLink}}{{if .ParentPath}}{{PathEscapeSegments .ParentPath}}{{end}}">..</a>
10-
</div>
8+
<a class="repo-file-line parent-link muted" href="{{.BranchLink}}{{if .ParentPath}}{{PathEscapeSegments .ParentPath}}{{end}}">
9+
{{svg "octicon-file-directory-fill"}} ..
10+
</a>
1111
{{end}}
1212
{{range $item := .Files}}
1313
<div class="repo-file-item">

web_src/css/repo/home-file-list.css

Lines changed: 44 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,23 @@
11
#repo-files-table {
22
width: 100%;
33
display: grid;
4-
grid-template-columns: auto 1fr auto;
4+
grid-template-columns: 2fr 3fr auto;
55
border: 1px solid var(--color-light-border);
6+
background: var(--color-box-body);
67
border-radius: var(--border-radius);
78
margin: 10px 0; /* match the "clone-panel-popup" margin to avoid "visual double-border" */
89
}
910

11+
@media (max-width: 767.98px) {
12+
#repo-files-table {
13+
grid-template-columns: 1fr 1fr auto;
14+
}
15+
}
16+
17+
#repo-files-table .repo-file-cell.name .svg {
18+
margin-right: 2px;
19+
}
20+
1021
#repo-files-table .svg.octicon-file-directory-fill,
1122
#repo-files-table .svg.octicon-file-submodule {
1223
color: var(--color-primary);
@@ -22,18 +33,38 @@
2233
display: contents;
2334
}
2435

25-
#repo-files-table .repo-file-item:hover > .repo-file-cell {
36+
#repo-files-table .repo-file-item:hover > .repo-file-cell,
37+
#repo-files-table .parent-link:hover {
2638
background: var(--color-hover);
2739
}
2840

2941
#repo-files-table .repo-file-line,
3042
#repo-files-table .repo-file-cell {
31-
border-top: 1px solid var(--color-light-border);
32-
padding: 6px 10px;
43+
border-top: .5px solid var(--color-light-border);
44+
border-bottom: .5px solid var(--color-light-border);
45+
padding: 8px 10px;
3346
}
3447

3548
#repo-files-table .repo-file-line:first-child {
3649
border-top: none;
50+
border-radius: var(--border-radius) var(--border-radius) 0 0;
51+
}
52+
53+
#repo-files-table .repo-file-item:last-child .repo-file-line,
54+
#repo-files-table .repo-file-item:last-child .repo-file-cell {
55+
border-bottom: none;
56+
}
57+
58+
#repo-files-table .repo-file-item:last-child {
59+
border-bottom: none;
60+
}
61+
62+
#repo-files-table .repo-file-item:last-child .repo-file-cell:first-child {
63+
border-bottom-left-radius: calc(var(--border-radius) - 1px);
64+
}
65+
66+
#repo-files-table .repo-file-item:last-child .repo-file-cell:last-child {
67+
border-bottom-right-radius: calc(var(--border-radius) - 1px);
3768
}
3869

3970
#repo-files-table .repo-file-line {
@@ -49,12 +80,17 @@
4980
}
5081

5182
#repo-files-table .repo-file-cell.name {
52-
max-width: 300px;
5383
white-space: nowrap;
5484
overflow: hidden;
5585
text-overflow: ellipsis;
5686
}
5787

88+
@media (max-width: 767.98px) {
89+
#repo-files-table .repo-file-cell.name {
90+
max-width: 35vw;
91+
}
92+
}
93+
5894
#repo-files-table .repo-file-cell.message {
5995
white-space: nowrap;
6096
overflow: hidden;
@@ -68,8 +104,7 @@
68104
color: var(--color-text-light-1);
69105
}
70106

71-
@media (max-width: 767.98px) {
72-
#repo-files-table .repo-file-cell.name {
73-
max-width: 150px;
74-
}
107+
#repo-files-table .parent-link {
108+
width: 100%;
109+
text-decoration-line: none;
75110
}

0 commit comments

Comments
 (0)