commit
message
Using grid on other pages
author
Ben Vogt <[email protected]>
date
2023-04-06 17:36:47
stats
4 file(s) changed,
96 insertions(+),
45 deletions(-)
files
gshr.css
template.files.html
template.index.html
template.log.html
1diff --git a/gshr.css b/gshr.css
2index 7e1c850..5a39ca4 100644
3--- a/gshr.css
4+++ b/gshr.css
5@@ -164,6 +164,17 @@ h6>a:hover {
6 }
7 }
8
9+.mono {
10+ font-family: var(--mono-font);
11+}
12+
13+.ellipsis {
14+ overflow: hidden;
15+ white-space: nowrap;
16+ text-overflow: ellipsis;
17+ padding-right: 4px;
18+}
19+
20 div.content {
21 margin: 0 auto;
22 padding: 20px;
23diff --git a/template.files.html b/template.files.html
24index 222af75..8f1f951 100644
25--- a/template.files.html
26+++ b/template.files.html
27@@ -8,30 +8,34 @@
28 <body>
29 <div class="content">
30 {{ template "metadata" .RepoData }}
31- <div class="files">
32- <table>
33- <thead>
34- <tr>
35- <td><b>Mode</b></td>
36- <td><b>Name</b></td>
37- <td><b>Size</b></td>
38- </tr>
39- </thead>
40- <tbody>
41- {{ range .Files }}
42- <tr>
43- <td>{{ .Mode }}</td>
44- <td>
45- <a
46- href="{{ $.RepoData.HeadData.BaseURL }}{{ $.RepoData.Name }}/files/{{ .Name }}/index.html">
47- {{ .Name }}
48- </a>
49- </td>
50- <td>{{ .Size }}</td>
51- </tr>
52- {{ end }}
53- </tbody>
54- </table>
55+ <div class="files mono">
56+ <r-grid columns="16">
57+ <r-cell span="11">
58+ <div class="ellipsis"><b>Name</b></div>
59+ </r-cell>
60+ <r-cell span="3">
61+ <div align="right" class="ellipsis"><b>Mode</b></div>
62+ </r-cell>
63+ <r-cell span="2">
64+ <div align="right" class="ellipsis"><b>Size</b></div>
65+ </r-cell>
66+ {{ range .Files }}
67+ <r-cell span="11">
68+ <div class="ellipsis">
69+ <a
70+ href="{{ $.RepoData.HeadData.BaseURL }}{{ $.RepoData.Name }}/files/{{ .Name }}/index.html">
71+ {{ .Name }}
72+ </a>
73+ </div>
74+ </r-cell>
75+ <r-cell span="3">
76+ <div align="right" class="ellipsis">{{ .Mode }}</div>
77+ </r-cell>
78+ <r-cell span="2">
79+ <div align="right" class="ellipsis">{{ .Size }}</div>
80+ </r-cell>
81+ {{ end }}
82+ </r-grid>
83 </div>
84 </div>
85 </body>
86diff --git a/template.index.html b/template.index.html
87index d591780..3f10752 100644
88--- a/template.index.html
89+++ b/template.index.html
90@@ -57,7 +57,6 @@
91 </r-cell>
92 {{ end }}
93 </r-grid>
94-
95 </div>
96 </div>
97 </div>
98diff --git a/template.log.html b/template.log.html
99index b97023b..19c0ac9 100644
100--- a/template.log.html
101+++ b/template.log.html
102@@ -8,35 +8,64 @@
103 <body>
104 <div class="content">
105 {{ template "metadata" .RepoData }}
106- <div class="log">
107- <table>
108- <thead>
109- <tr>
110- <td><b>Date</b></td>
111- <td><b>Commit message</b></td>
112- <td><b>Author</b></td>
113- <td align="right"><b>Files</b></td>
114- <td align="right"><b>+</b></td>
115- <td align="right"><b>-</b></td>
116- </tr>
117- </thead>
118- <tbody>
119- {{ range .Commits }}
120- <tr>
121- <td>{{ .Date }}</td>
122- <td class="commit">
123- <a href="{{ $.RepoData.BaseURL }}{{ $.RepoData.Name }}/commit/{{ .Hash }}">
124- {{ .Message }}
125- </a>
126- </td>
127- <td>{{ .Author }}</td>
128- <td align="right">{{ .FileChangeCount }}</td>
129- <td align="right">+{{ .LinesAdded }}</td>
130- <td align="right">-{{ .LinesDeleted }}</td>
131- </tr>
132- {{ end }}
133- </tbody>
134- </table>
135+ <div class="log mono">
136+ <r-grid columns="16">
137+ <r-cell span="3">
138+ <div class="ellipsis"><b>Date</b></div>
139+ </r-cell>
140+ <r-cell span="8">
141+ <div class="ellipsis"><b>Commit</b></div>
142+ </r-cell>
143+ <r-cell span="2">
144+ <div class="ellipsis"><b>Author</b></div>
145+ </r-cell>
146+ <r-cell span="1">
147+ <div align="right">
148+ <div class="ellipsis"><b>Files</b></div>
149+ </div>
150+ </r-cell>
151+ <r-cell span="1">
152+ <div align="right">
153+ <b>-</b>
154+ </div>
155+ </r-cell>
156+ <r-cell span="1">
157+ <div align="right">
158+ <b>-</b>
159+ </div>
160+ </r-cell>
161+
162+ {{ range .Commits }}
163+ <r-cell span="3">
164+ <div class="ellipsis">{{ .Date }}</div>
165+ </r-cell>
166+ <r-cell span="8">
167+ <div class="ellipsis">
168+ <a href="{{ $.RepoData.BaseURL }}{{ $.RepoData.Name }}/commit/{{ .Hash }}">
169+ {{ .Message }}
170+ </a>
171+ </div>
172+ </r-cell>
173+ <r-cell span="2">
174+ <div class="ellipsis">{{ .Author }}</div>
175+ </r-cell>
176+ <r-cell span="1">
177+ <div align="right" class="ellipsis">
178+ {{ .FileChangeCount }}
179+ </div>
180+ </r-cell>
181+ <r-cell span="1">
182+ <div align="right" class="ellipsis">
183+ {{ .LinesAdded }}
184+ </div>
185+ </r-cell>
186+ <r-cell span="1">
187+ <div align="right" class="ellipsis">
188+ {{ .LinesDeleted }}
189+ </div>
190+ </r-cell>
191+ {{ end }}
192+ </r-grid>
193 </div>
194 </div>
195 </body>