Skip to content

Commit 2854c23

Browse files
committed
Scale seating plan container size based on background image
In some cases, if there isnt a seat placed at the bottom of the background image, it'll get cut off either to the bottom or the right.
1 parent 36b15d4 commit 2854c23

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

resources/views/admin/seatingplans/show.blade.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,8 @@ class="btn btn-primary">
123123
<div class="seating-plan" style="
124124
@if($plan->image_url)
125125
background-image:url('{{ $plan->image_url }}');
126+
background-size: contain;
127+
background-repeat: no-repeat;
126128
@endif
127129
min-height: {{ ($seats->max('y') * 2) + 4 }}em;"
128130
>

resources/views/seatingplans/_plan.blade.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
<div class="seating-plan" style="
33
@if($plan->image_url)
44
background-image:url('{{ $plan->image_url }}');
5+
background-size: contain;
6+
background-repeat: no-repeat;
57
@endif
68
min-height: {{ (collect($seats[$plan->id] ?? [])->max('y') * 2) + 4 }}em;"
79
>

0 commit comments

Comments
 (0)