2023-08-16 08:04:48 +02:00
|
|
|
<section class="container mx-auto px-4">
|
|
|
|
<section class="flex space-x-4">
|
|
|
|
<h1 class="text-white font-semibold text-5xl">
|
|
|
|
{{"Parking spaces"}}
|
|
|
|
</h1>
|
|
|
|
<div class="">
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
</div>
|
2023-09-05 16:09:26 +02:00
|
|
|
{% if let Some(session) = session %}
|
2023-08-16 08:04:48 +02:00
|
|
|
<div>
|
2023-08-16 16:53:27 +02:00
|
|
|
<a
|
|
|
|
href="/parking-spaces/form"
|
|
|
|
x-get="/parking-spaces/form"
|
|
|
|
x-target="main"
|
|
|
|
class="text-emerald-500 background-transparent font-bold uppercase px-6 py-2 text-sm outline-none focus:outline-none mr-1 mb-1 ease-linear transition-all duration-150 border-2 rounded-full"
|
|
|
|
>
|
2023-08-16 08:04:48 +02:00
|
|
|
<i class="fas fa-plus"></i>
|
2023-08-16 16:53:27 +02:00
|
|
|
</a>
|
2023-08-16 08:04:48 +02:00
|
|
|
</div>
|
2023-09-05 16:09:26 +02:00
|
|
|
{% endif %}
|
2023-08-16 08:04:48 +02:00
|
|
|
</section>
|
2023-09-04 15:02:53 +02:00
|
|
|
|
2023-09-12 18:03:42 +02:00
|
|
|
{% if !parking_spaces.is_empty() %}
|
|
|
|
<section
|
|
|
|
id="own-parking-spaces"
|
|
|
|
class="w-full p-4 bg-white border border-white-200 rounded-lg shadow sm:p-8 dark:bg-white-800 dark:border-white-700 mt-6"
|
|
|
|
>
|
|
|
|
<div class="flex items-center justify-between mb-4">
|
|
|
|
<h5 class="text-xl font-bold leading-none text-gray-900 dark:text-black">Owned parking spaces</h5>
|
|
|
|
</div>
|
|
|
|
<div class="flow-root">
|
|
|
|
<ul role="list" class="divide-y divide-white-200 dark:divide-white-700">
|
|
|
|
{% for parking_space in parking_spaces -%}
|
|
|
|
<li class="py-3 sm:py-4">
|
|
|
|
<oswilno-parking-space
|
|
|
|
id="parking-space-{{ parking_space.id }}"
|
|
|
|
>
|
|
|
|
{% if let Some(location_id) = parking_space.location_id -%}
|
|
|
|
{% if let Some(location) = location_by_id.get(location_id) -%}
|
|
|
|
{% if let Some(spot) = parking_space.spot -%}
|
|
|
|
{% if let Some(account) = account_by_id.get(parking_space.account_id) -%}
|
|
|
|
<div class="flex items-center space-x-4">
|
|
|
|
<div class="flex-shrink-0">
|
|
|
|
<span class="text-sm font-medium text-white-900 truncate dark:text-black">{{location.name}}</span>
|
|
|
|
<span class="text-sm font-medium text-white-900 truncate dark:text-black">{{location.number}}</span>
|
|
|
|
<span class="text-sm font-medium text-white-900 truncate dark:text-black">Etap {{location.stage}}</span>
|
|
|
|
</div>
|
|
|
|
<div class="inline-flex items-center text-base font-semibold text-gray-900 dark:text-black">{{spot}}</div>
|
|
|
|
|
|
|
|
{% match parking_space.state %}
|
|
|
|
{% when ParkingSpaceState::Pending %}
|
|
|
|
<div class="inline-flex items-center text-base font-semibold text-yellow-900 dark:text-yellow">Pending</div>
|
|
|
|
{% when ParkingSpaceState::Verified %}
|
|
|
|
<div class="inline-flex items-center text-base font-semibold text-green-900 dark:text-green">Accepted</div>
|
|
|
|
{% when ParkingSpaceState::Banned %}
|
|
|
|
<div class="inline-flex items-center text-base font-semibold text-red-900 dark:text-red">Rejected</div>
|
|
|
|
{% endmatch %}
|
|
|
|
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
{% endif %}
|
|
|
|
{% endif %}
|
|
|
|
{% endif %}
|
|
|
|
</oswilno-parking-space>
|
|
|
|
</li>
|
|
|
|
{% endfor %}
|
|
|
|
</ul>
|
|
|
|
</div>
|
2023-09-04 15:02:53 +02:00
|
|
|
</section>
|
2023-09-12 18:03:42 +02:00
|
|
|
{% endif %}
|
2023-09-04 15:02:53 +02:00
|
|
|
|
2023-08-16 08:04:48 +02:00
|
|
|
<oswilno-parking-space-rents>
|
|
|
|
{% for parking_space_rent in parking_space_rents -%}
|
|
|
|
{% if let Some(parking_space) = parking_space_by_id.get(parking_space_rent.parking_space_id) %}
|
|
|
|
{% if let Some(account) = account_by_id.get(parking_space.account_id) %}
|
|
|
|
<oswilno-parking-space-rent id="parking-space-rent-{{ parking_space_rent.id }}">
|
|
|
|
<oswilno-parking-space id="parking-space-{{ parking_space.id }}">
|
|
|
|
<oswilno-account id="account-{{ account.id }}">
|
|
|
|
<div>{{ account.login }}</div>
|
|
|
|
</oswilno-account>
|
|
|
|
</oswilno-parking-space>
|
|
|
|
<oswilno-price id="parking-space-rent-{{ parking_space_rent.id }}-price" multiplier="100" currency="PLN" price="{{ parking_space_rent.price }}">
|
|
|
|
{{ parking_space_rent.price }}
|
|
|
|
</oswilno-price>
|
|
|
|
</oswilno-parking-space-rent>
|
|
|
|
{% endif %}
|
|
|
|
{% endif %}
|
|
|
|
{% endfor -%}
|
|
|
|
</oswilno-parking-space-rents>
|
|
|
|
</section>
|