Added /attract/<project_url>/shots/<shot-id> endpoint
This commit is contained in:
@@ -35,7 +35,7 @@ def index():
|
|||||||
@perproject_blueprint.route('/', endpoint='index')
|
@perproject_blueprint.route('/', endpoint='index')
|
||||||
@perproject_blueprint.route('/with-task/<task_id>', endpoint='with-task')
|
@perproject_blueprint.route('/with-task/<task_id>', endpoint='with-task')
|
||||||
@attract_project_view(extension_props=True)
|
@attract_project_view(extension_props=True)
|
||||||
def for_project(project, attract_props, task_id=None):
|
def for_project(project, attract_props, task_id=None, shot_id=None):
|
||||||
api = pillar_api()
|
api = pillar_api()
|
||||||
|
|
||||||
found = pillarsdk.Node.all({
|
found = pillarsdk.Node.all({
|
||||||
@@ -58,6 +58,7 @@ def for_project(project, attract_props, task_id=None):
|
|||||||
tasks_for_shots=tasks_for_shots,
|
tasks_for_shots=tasks_for_shots,
|
||||||
task_types=task_types,
|
task_types=task_types,
|
||||||
open_task_id=task_id,
|
open_task_id=task_id,
|
||||||
|
open_shot_id=shot_id,
|
||||||
project=project,
|
project=project,
|
||||||
attract_props=attract_props)
|
attract_props=attract_props)
|
||||||
|
|
||||||
@@ -65,17 +66,16 @@ def for_project(project, attract_props, task_id=None):
|
|||||||
@perproject_blueprint.route('/<shot_id>')
|
@perproject_blueprint.route('/<shot_id>')
|
||||||
@attract_project_view(extension_props=True)
|
@attract_project_view(extension_props=True)
|
||||||
def view_shot(project, attract_props, shot_id):
|
def view_shot(project, attract_props, shot_id):
|
||||||
|
|
||||||
|
if not request.is_xhr:
|
||||||
|
return for_project(project, attract_props, shot_id=shot_id)
|
||||||
|
|
||||||
api = pillar_api()
|
api = pillar_api()
|
||||||
|
|
||||||
shot = pillarsdk.Node.find(shot_id, api=api)
|
shot = pillarsdk.Node.find(shot_id, api=api)
|
||||||
node_type = project.get_node_type(node_type_shot['name'])
|
node_type = project.get_node_type(node_type_shot['name'])
|
||||||
|
|
||||||
if request.is_xhr:
|
return render_template('attract/shots/view_shot_embed.html',
|
||||||
template = 'attract/shots/view_shot_embed.html'
|
|
||||||
else:
|
|
||||||
template = 'attract/shots/view_shot.html'
|
|
||||||
|
|
||||||
return render_template(template,
|
|
||||||
shot=shot,
|
shot=shot,
|
||||||
project=project,
|
project=project,
|
||||||
shot_node_type=node_type,
|
shot_node_type=node_type,
|
||||||
|
@@ -41,6 +41,7 @@ function task_open(task_id, project_url) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$('[id^="task-"]').removeClass('active');
|
$('[id^="task-"]').removeClass('active');
|
||||||
|
|
||||||
$('#task-' + task_id).addClass('active');
|
$('#task-' + task_id).addClass('active');
|
||||||
|
|
||||||
var task_url = '/attract/' + project_url + '/tasks/' + task_id;
|
var task_url = '/attract/' + project_url + '/tasks/' + task_id;
|
||||||
@@ -65,6 +66,8 @@ function shot_open(shot_id, project_url) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$('#col_right .col_header').text('Shot details');
|
||||||
|
|
||||||
$('#shot-list').find('a').removeClass('active');
|
$('#shot-list').find('a').removeClass('active');
|
||||||
$('#shot-link' + shot_id).addClass('active');
|
$('#shot-link' + shot_id).addClass('active');
|
||||||
|
|
||||||
|
@@ -62,6 +62,9 @@ script.
|
|||||||
{% if open_task_id %}
|
{% if open_task_id %}
|
||||||
$(function() { task_open('{{ open_task_id }}', '{{ project.url }}'); });
|
$(function() { task_open('{{ open_task_id }}', '{{ project.url }}'); });
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% if open_shot_id %}
|
||||||
|
$(function() { shot_open('{{ open_shot_id }}', '{{ project.url }}'); });
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
$('.table-head .table-cell span').on('click', function(e){
|
$('.table-head .table-cell span').on('click', function(e){
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
|
Reference in New Issue
Block a user