From 243ab5e53aa9f2a62659d295d4cf66a307eb0db5 Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Mon, 5 Nov 2018 02:24:57 +0100 Subject: [PATCH] [enh] link to the app page of a job on the job page --- run.py | 7 ++++++- templates/job.html | 5 +++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/run.py b/run.py index 39e5e6d..acc284c 100644 --- a/run.py +++ b/run.py @@ -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/') diff --git a/templates/job.html b/templates/job.html index b222d0b..18a8aba 100644 --- a/templates/job.html +++ b/templates/job.html @@ -4,8 +4,9 @@

- Job '{{job.name}}' - Job '{{job.name}}' DELETED + Job '{{job.name}}' #{{job.id}} + Job '{{job.name}}' #{{job.id}} DELETED + <% if app %>for <{ app.name }> <% endif %>