mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
Merge branch 'master' of ssh://gitlab.archlinux.org:222/archlinux/aurweb
This commit is contained in:
commit
da0e74a648
2 changed files with 10 additions and 6 deletions
|
@ -2,6 +2,7 @@
|
|||
|
||||
import sys
|
||||
|
||||
from urllib.parse import quote_plus
|
||||
from xml.etree.ElementTree import Element
|
||||
|
||||
import bleach
|
||||
|
@ -72,13 +73,16 @@ class GitCommitsInlineProcessor(markdown.inlinepatterns.InlineProcessor):
|
|||
def handleMatch(self, m, data):
|
||||
oid = m.group(1)
|
||||
if oid not in self._repo:
|
||||
# Unkwown OID; preserve the orginal text.
|
||||
# Unknown OID; preserve the orginal text.
|
||||
return (None, None, None)
|
||||
|
||||
el = Element('a')
|
||||
commit_uri = aurweb.config.get("options", "commit_uri")
|
||||
prefixlen = util.git_search(self._repo, oid)
|
||||
el.set('href', commit_uri % (self._head, oid[:prefixlen]))
|
||||
el.set('href', commit_uri % (
|
||||
quote_plus(self._head),
|
||||
quote_plus(oid[:prefixlen])
|
||||
))
|
||||
el.text = markdown.util.AtomicString(oid[:prefixlen])
|
||||
return (el, m.start(0), m.end(0))
|
||||
|
||||
|
|
|
@ -6,21 +6,21 @@
|
|||
<h4>{{ "Package Actions" | tr }}</h4>
|
||||
<ul class="small">
|
||||
<li>
|
||||
<a href="/cgit/aur.git/tree/PKGBUILD?h={{ pkgbase.Name }}">
|
||||
<a href="{{ config.get('options', 'source_file_uri') | format("PKGBUILD", pkgbase.Name | quote_plus) }}">
|
||||
{{ "View PKGBUILD" | tr }}
|
||||
</a>
|
||||
/
|
||||
<a href="/cgit/aur.git/log/?h={{ pkgbase.Name }}">
|
||||
<a href="{{ config.get('options', 'log_uri') | format(pkgbase.Name | quote_plus) }}">
|
||||
{{ "View Changes" | tr }}
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="/cgit/aur.git/snapshot/{{ pkgbase.Name }}.tar.gz">
|
||||
<a href="{{ config.get('options', 'snapshot_uri') | format(pkgbase.Name | quote_plus) }}">
|
||||
{{ "Download snapshot" | tr }}
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="https://wiki.archlinux.org/title/Special:Search?search={{ pkgbase.Name }}">
|
||||
<a href="https://wiki.archlinux.org/title/Special:Search?{{ { 'search': pkgbase.Name } | urlencode }}">
|
||||
{{ "Search wiki" | tr }}
|
||||
</a>
|
||||
</li>
|
||||
|
|
Loading…
Add table
Reference in a new issue