home » zplus/clif.git
Author zPlus <zplus@peers.community> 2022-08-05 05:15:00
Committer zPlus <zplus@peers.community> 2022-08-05 05:15:00
Commit 2071174 (patch)
Tree b5cbcc2
Parent(s)

Add diffstats to Log page. Show changed files and lines.


commits diff: 87759ce..2071174
3 files changed, 37 insertions, 3 deletionsdownload


Diffstat
-rw-r--r-- static/css/clif.css 28
-rw-r--r-- templates/repository/log.html 8
-rw-r--r-- web.py 4

Diff options
View
Side
Whitespace
Context lines
Inter-hunk lines
+26/-2 M   static/css/clif.css
index 0b4965d..3b51603
old size: 6K - new size: 6K
@@ -183,7 +183,15 @@ table.log {
183 183 padding-bottom: 1rem;
184 184 }
185 185
186 - table.log > thead td.time {
186 + table.log > thead .time {
187 + text-align: right;
188 + }
189 +
190 + table.log > thead .files {
191 + text-align: right;
192 + }
193 +
194 + table.log > thead .lines {
187 195 text-align: right;
188 196 }
189 197
@@ -203,9 +211,25 @@ table.log {
203 211 white-space: pre-wrap;
204 212 }
205 213
206 - table.log > tbody td.time {
214 + table.log > tbody .time {
215 + text-align: right;
216 + }
217 +
218 + table.log > tbody .files {
219 + text-align: right;
220 + }
221 +
222 + table.log > tbody .lines {
207 223 text-align: right;
208 224 }
225 +
226 + table.log > tbody .deletions {
227 + color: red;
228 + }
229 +
230 + table.log > tbody .insertions {
231 + color: green;
232 + }
209 233
210 234 div.threads {
211 235

+8/-0 M   templates/repository/log.html
index c0372e1..696fe32
old size: 3K - new size: 4K
@@ -40,6 +40,8 @@
40 40 <td class="id">ID</td>
41 41 <td class="message">Message</td>
42 42 <td class="time">Commit time</td>
43 + <td class="files">Files</td>
44 + <td class="lines">Lines</td>
43 45 </tr>
44 46 </thead>
45 47
@@ -69,6 +71,12 @@
69 71 <td class="time" title="{{ commit_time(commit.commit_time, commit.commit_time_offset) }}">
70 72 {{ commit_time(commit.commit_time, commit.commit_time_offset)|ago }}
71 73 </td>
74 + <td class="files">
75 + {{ diff[commit.short_id].stats.files_changed }}
76 + </td>
77 + <td class="lines">
78 + <span class="deletions">-{{ diff[commit.short_id].stats.deletions }}</span>/<span class="insertions">+{{ diff[commit.short_id].stats.insertions }}</span>
79 + </td>
72 80 </tr>
73 81 {% endfor %}
74 82 </tbody>

+3/-1 M   web.py
index 80c7971..b1331f9
old size: 24K - new size: 25K
@@ -492,6 +492,7 @@ def log(repository, revision):
492 492 except: commits_offset = 0
493 493
494 494 commits = []
495 + diff = {}
495 496 commit_ith = 0
496 497 for commit in repo.walk(git_object.id):
497 498 # Skip the first one (offset)
@@ -504,11 +505,12 @@ def log(repository, revision):
504 505 break
505 506
506 507 commits.append(commit)
508 + diff[commit.short_id] = commit.parents[0].tree.diff_to_tree(commit.tree)
507 509
508 510 return template(
509 511 'repository/log.html',
510 512 heads=heads, head_ref=HEAD, tags=tags,
511 - commits=commits,
513 + commits=commits, diff=diff,
512 514 log_pagination=LOG_PAGINATION, offset=commits_offset,
513 515 repository=repository, revision=revision)
514 516