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
|
import sys
|
||||||
|
|
||||||
|
from urllib.parse import quote_plus
|
||||||
from xml.etree.ElementTree import Element
|
from xml.etree.ElementTree import Element
|
||||||
|
|
||||||
import bleach
|
import bleach
|
||||||
|
@ -72,13 +73,16 @@ class GitCommitsInlineProcessor(markdown.inlinepatterns.InlineProcessor):
|
||||||
def handleMatch(self, m, data):
|
def handleMatch(self, m, data):
|
||||||
oid = m.group(1)
|
oid = m.group(1)
|
||||||
if oid not in self._repo:
|
if oid not in self._repo:
|
||||||
# Unkwown OID; preserve the orginal text.
|
# Unknown OID; preserve the orginal text.
|
||||||
return (None, None, None)
|
return (None, None, None)
|
||||||
|
|
||||||
el = Element('a')
|
el = Element('a')
|
||||||
commit_uri = aurweb.config.get("options", "commit_uri")
|
commit_uri = aurweb.config.get("options", "commit_uri")
|
||||||
prefixlen = util.git_search(self._repo, oid)
|
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])
|
el.text = markdown.util.AtomicString(oid[:prefixlen])
|
||||||
return (el, m.start(0), m.end(0))
|
return (el, m.start(0), m.end(0))
|
||||||
|
|
||||||
|
|
|
@ -6,21 +6,21 @@
|
||||||
<h4>{{ "Package Actions" | tr }}</h4>
|
<h4>{{ "Package Actions" | tr }}</h4>
|
||||||
<ul class="small">
|
<ul class="small">
|
||||||
<li>
|
<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 }}
|
{{ "View PKGBUILD" | tr }}
|
||||||
</a>
|
</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 }}
|
{{ "View Changes" | tr }}
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<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 }}
|
{{ "Download snapshot" | tr }}
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<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 }}
|
{{ "Search wiki" | tr }}
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
Loading…
Add table
Reference in a new issue