Use correct aspect-ratio for shot thumbnails.
This commit is contained in:
@@ -45,6 +45,11 @@ def for_project(project, attract_props, task_id=None, shot_id=None):
|
|||||||
else:
|
else:
|
||||||
shot._thumbnail = thumb_placeholder
|
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(
|
tasks_for_shots = current_attract.shot_manager.tasks_for_shots(
|
||||||
shots,
|
shots,
|
||||||
attract_props.task_types.attract_shot,
|
attract_props.task_types.attract_shot,
|
||||||
|
@@ -36,7 +36,8 @@
|
|||||||
href="{{ url_for('attract.shots.perproject.view_shot', project_url=project.url, shot_id=shot._id) }}",
|
href="{{ url_for('attract.shots.perproject.view_shot', project_url=project.url, shot_id=shot._id) }}",
|
||||||
class="status-{{ shot.properties.status }} shot-link")
|
class="status-{{ shot.properties.status }} shot-link")
|
||||||
img(src="{{ shot._thumbnail }}",
|
img(src="{{ shot._thumbnail }}",
|
||||||
alt="Thumbnail",width="110",height='60')
|
alt="Thumbnail",
|
||||||
|
style='width: 110px; height: {{ shot._thumbnail_height }}')
|
||||||
.table-cell.shot-name
|
.table-cell.shot-name
|
||||||
a(
|
a(
|
||||||
data-shot-id="{{ shot._id }}",
|
data-shot-id="{{ shot._id }}",
|
||||||
|
Reference in New Issue
Block a user