changeset cbc926745fc4 in trypod:default
details: https://hg.tryton.org/trypod?cmd=changeset;node=cbc926745fc4
description:
Add documentation status
diffstat:
templates/home.html | 20 +++++++++++++-------
trypod.py | 17 +++++++++++++++++
2 files changed, 30 insertions(+), 7 deletions(-)
diffs (59 lines):
diff -r 3ed5223daaf9 -r cbc926745fc4 templates/home.html
--- a/templates/home.html Thu Mar 12 12:56:16 2020 +0100
+++ b/templates/home.html Thu May 07 18:47:34 2020 +0200
@@ -9,15 +9,21 @@
<div class="row">
{% for branch in branches[repo] %}
<div class="col-md-2">
+ <div>{{ branch }}</div>
<a
- href="{{ url(repo, paths[repo], branch) }}">
- <div class="row">
- <div class="col-xs-4">{{ branch }}</div>
- <div class="col-xs-8">
- <img
- data-src="{{ badge(repo, paths[repo], branch)
}}"
+ href="{{ url(repo, paths[repo], branch) }}">
+ <div>
+ <img
+ data-src="{{ badge(repo, paths[repo], branch)
}}"
alt="Built Status">
- </div>
+ </div>
+ </a>
+ <a
+ href="https://docs.tryton.org/projects/{{
repo|repotodoc }}/en/{{ branch|branchtodoc }}/?badge={{ branch|branchtodoc }}">
+ <div>
+ <img
+
src="https://readthedocs.org/projects/{{repo|repotodoc }}/badge/?version={{
branch|branchtodoc }}"
+ alt="Documentation Status">
</div>
</a>
</div>
diff -r 3ed5223daaf9 -r cbc926745fc4 trypod.py
--- a/trypod.py Thu Mar 12 12:56:16 2020 +0100
+++ b/trypod.py Thu May 07 18:47:34 2020 +0200
@@ -52,6 +52,23 @@
return optionstr
[email protected]_filter('branchtodoc')
+def branchtodoc(branch):
+ if branch == 'default':
+ return 'latest'
+ return branch
+
+
[email protected]_filter('repotodoc')
+def repotodoc(repo):
+ repo = repo.replace('_', '-')
+ if repo.startswith('modules/'):
+ repo = 'trytond-' + repo[len('modules/'):]
+ if repo == 'proteus':
+ repo = 'tryton-' + repo
+ return repo
+
+
@app.route('/')
@cache.cached(timeout=24 * 60 * 60)
def home():