From 4832fcc24acb9370f638a5eb375b363d77444345 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=BD=D0=B0=D0=B1?= Date: Fri, 28 Aug 2020 15:56:44 +0200 Subject: [PATCH] Link to diff logged file in log view Ref: ~sircmpwn/git.sr.ht#315 --- gitsrht/templates/log.html | 5 +++-- gitsrht/templates/utils.html | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/gitsrht/templates/log.html b/gitsrht/templates/log.html index 57aaf42..d559455 100644 --- a/gitsrht/templates/log.html +++ b/gitsrht/templates/log.html @@ -36,9 +36,10 @@
+ {% set full_path = path_join(*path) %} {% for c in commits %}
- {{ utils.commit_event(repo, c, True, refs) }} + {{ utils.commit_event(repo, c, True, refs, path=full_path) }}
{% else %}
@@ -53,7 +54,7 @@ owner=owner.canonical_name, repo=repo.name, ref=ref, - path=path_join(*path), + path=full_path, )}}?from={{commits[-1].id}}" >Next {{icon("caret-right")}} {% endif %} diff --git a/gitsrht/templates/utils.html b/gitsrht/templates/utils.html index 95c08df..a3f1f7a 100644 --- a/gitsrht/templates/utils.html +++ b/gitsrht/templates/utils.html @@ -72,7 +72,7 @@ endif %}{% endfor %} {% macro commit_event(repo, c, full_body=False, refs={}, full_id=False, diff=None, href=None, - parents=False, skip_body=False, target_blank=False) %} + parents=False, skip_body=False, target_blank=False, path=None) %}
{% if full_id %} {{c.id.hex}} @@ -82,7 +82,7 @@ endif %}{% endfor %} href="{{href}}" {% else %} href="{{url_for("repo.commit", owner=repo.owner.canonical_name, - repo=repo.name, ref=c.id.hex)}}" + repo=repo.name, ref=c.id.hex)}}{% if path %}#{{path}}{% endif %}" {% endif %} title="{{c.id.hex}}" {% if target_blank %} -- 2.38.4