Create Shot workflow
Still needs update on the list
This commit is contained in:
@@ -105,4 +105,4 @@ def create_shot(project):
|
|||||||
project_url=project['url'],
|
project_url=project['url'],
|
||||||
shot_id=shot['_id'])
|
shot_id=shot['_id'])
|
||||||
resp.status_code = 201
|
resp.status_code = 201
|
||||||
return resp
|
return flask.make_response(flask.jsonify({'shot_id': shot['_id']}), 201)
|
||||||
|
@@ -132,6 +132,32 @@ window.onpopstate = function(event)
|
|||||||
item_open(state.itemId, state.itemType, false);
|
item_open(state.itemId, state.itemType, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a task and show it in the #item-details div.
|
||||||
|
*/
|
||||||
|
function shot_create(project_url)
|
||||||
|
{
|
||||||
|
if (project_url === undefined) {
|
||||||
|
throw new ReferenceError("shot_create(" + project_url+ ") called.");
|
||||||
|
}
|
||||||
|
var url = '/attract/' + project_url + '/shots/create';
|
||||||
|
|
||||||
|
data = {
|
||||||
|
project_url: project_url
|
||||||
|
};
|
||||||
|
|
||||||
|
$.post(url, data, function(shot_data) {
|
||||||
|
shot_open(shot_data.shot_id);
|
||||||
|
})
|
||||||
|
.fail(function(xhr) {
|
||||||
|
if (console) {
|
||||||
|
console.log('Error creating task');
|
||||||
|
console.log('XHR:', xhr);
|
||||||
|
}
|
||||||
|
$('#item-details').html(xhr.responseText);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a task and show it in the #item-details div.
|
* Create a task and show it in the #item-details div.
|
||||||
*/
|
*/
|
||||||
|
@@ -7,7 +7,7 @@
|
|||||||
a(href="") Shots ({{ shots | count }})
|
a(href="") Shots ({{ shots | count }})
|
||||||
a.task-project(href="{{url_for('projects.view', project_url=project.url)}}") {{ project.name }}
|
a.task-project(href="{{url_for('projects.view', project_url=project.url)}}") {{ project.name }}
|
||||||
|
|
||||||
a#task-add(href="javascript:task_create('{{ project.url }}');") + Create Shot
|
a#task-add(href="javascript:shot_create('{{ project.url }}');") + Create Shot
|
||||||
|
|
||||||
.table#shot-list
|
.table#shot-list
|
||||||
.table-head
|
.table-head
|
||||||
|
Reference in New Issue
Block a user