Use correct aspect-ratio for shot thumbnails.

This commit is contained in:
2016-11-03 17:29:14 +01:00
parent 0b759c196f
commit 546de9bc65
2 changed files with 7 additions and 1 deletions

View File

@@ -45,6 +45,11 @@ def for_project(project, attract_props, task_id=None, shot_id=None):
else:
shot._thumbnail = thumb_placeholder
# The placeholder can be shown quite small, but otherwise the aspect ratio of
# the actual thumbnail should be taken into account. Since it's different for
# each project, we can't hard-code a proper height.
shot._thumbnail_height = '30px' if shot._thumbnail is thumb_placeholder else 'auto'
tasks_for_shots = current_attract.shot_manager.tasks_for_shots(
shots,
attract_props.task_types.attract_shot,

View File

@@ -36,7 +36,8 @@
href="{{ url_for('attract.shots.perproject.view_shot', project_url=project.url, shot_id=shot._id) }}",
class="status-{{ shot.properties.status }} shot-link")
img(src="{{ shot._thumbnail }}",
alt="Thumbnail",width="110",height='60')
alt="Thumbnail",
style='width: 110px; height: {{ shot._thumbnail_height }}')
.table-cell.shot-name
a(
data-shot-id="{{ shot._id }}",