Compute some stats on shots if used in the edit.

This commit is contained in:
2016-11-04 16:42:36 +01:00
parent 5ee3c0d54f
commit e6e0733149
2 changed files with 11 additions and 2 deletions

View File

@@ -58,6 +58,14 @@ def for_project(project, attract_props, task_id=None, shot_id=None):
# Append the task type onto which 'other' tasks are mapped.
task_types = attract_props.task_types.attract_shot + [None]
# Some aggregated stats
stats = {
'nr_of_shots': sum(shot.properties.used_in_edit for shot in shots),
'total_frame_count': sum(shot.properties.duration_in_edit_in_frames or 0
for shot in shots
if shot.properties.used_in_edit),
}
return render_template('attract/shots/for_project.html',
shots=shots,
tasks_for_shots=tasks_for_shots,
@@ -65,7 +73,8 @@ def for_project(project, attract_props, task_id=None, shot_id=None):
open_task_id=task_id,
open_shot_id=shot_id,
project=project,
attract_props=attract_props)
attract_props=attract_props,
stats=stats)
@perproject_blueprint.route('/<shot_id>')

View File

@@ -4,7 +4,7 @@
| {% block body %}
#col_main
.col_header.task-list-header
| Shots ({{ shots | count }})
span(title='In the edit') {{ stats.nr_of_shots }} shots | {{ stats.total_frame_count }} frames
a.task-project(href="{{url_for('projects.view', project_url=project.url)}}") {{ project.name }}
| {# Not allowed for the moment. Shots are added via the Sequencer