diff --git a/attract/shots/routes.py b/attract/shots/routes.py index 3ca58ad..c0658ef 100644 --- a/attract/shots/routes.py +++ b/attract/shots/routes.py @@ -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('/') diff --git a/src/templates/attract/shots/for_project.jade b/src/templates/attract/shots/for_project.jade index df353a2..27223d5 100644 --- a/src/templates/attract/shots/for_project.jade +++ b/src/templates/attract/shots/for_project.jade @@ -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