Made shot and task links real links with JS click handlers.

This allows "open in new window", while still using XHR for regular clicks.
This commit is contained in:
2016-09-23 10:28:47 +02:00
parent 78111968ab
commit e6e03125f7
6 changed files with 55 additions and 22 deletions

View File

@@ -24,7 +24,7 @@ def index():
@perproject_blueprint.route('/', endpoint='index')
@attract_project_view()
def for_project(project):
def for_project(project, task_id=None):
api = pillar_api()
tasks = pillarsdk.Node.all({
@@ -35,12 +35,16 @@ def for_project(project):
return render_template('attract/tasks/for_project.html',
tasks=tasks['_items'],
open_task_id=task_id,
project=project)
@perproject_blueprint.route('/<task_id>')
@attract_project_view(extension_props=True)
def view_embed_task(project, attract_props, task_id):
def view_task(project, attract_props, task_id):
if not request.is_xhr:
return for_project(project, task_id=task_id)
api = pillar_api()
task = pillarsdk.Node.find(task_id, api=api)
node_type = project.get_node_type(node_type_task['name'])