[enh] link to the app page of a job on the job page

This commit is contained in:
Laurent Peuch 2018-11-05 02:24:57 +01:00
parent 43f6b31fda
commit 243ab5e53a
2 changed files with 9 additions and 3 deletions

7
run.py
View file

@ -719,7 +719,12 @@ async def html_job(request, job_id):
if job.count == 0:
raise NotFound()
return {"job": job[0], 'relative_path_to_root': '../', 'path': request.path}
job = job[0]
app = Repo.select().where(Repo.url == job.url_or_path)
app = app[0] if app else None
return {"job": job, 'app': app, 'relative_path_to_root': '../', 'path': request.path}
@app.route('/apps/')

View file

@ -4,8 +4,9 @@
<section class="section" id="job">
<div class="container" v-bind:class="{deleted: job.deleted}">
<h1 class="title">
<span v-if="!job.deleted">Job '{{job.name}}'</span>
<span v-if="job.deleted"><s>Job '{{job.name}}'</s> DELETED</span>
<span v-if="!job.deleted">Job '{{job.name}}' #{{job.id}}</span>
<span v-if="job.deleted"><s>Job '{{job.name}}' #{{job.id}}</s> DELETED</span>
<% if app %>for <a href="<{ relative_path_to_root }>apps/<{ app.name }>/"><{ app.name }> </a><% endif %>
<a target="_blank" v-bind:href="job.url_or_path"></a>
</h1>