Some views

This commit is contained in:
eraden 2023-08-01 11:48:56 +02:00
parent 96c49299f6
commit e48e8ffc9b
2 changed files with 20 additions and 3 deletions

View File

@ -1,11 +1,11 @@
use actix_web::web::{Data, ServiceConfig};
use actix_web::web::{scope, Data, ServiceConfig};
use actix_web::{get, HttpResponse};
pub fn mount(config: &mut ServiceConfig) {
config.service(all_parking_spaces);
config.service(scope("/parking_spaces").service(all_parking_spaces));
}
#[get("/ps")]
#[get("/all")]
async fn all_parking_spaces(db: Data<sea_orm::DatabaseConnection>) -> HttpResponse {
use oswilno_contract::parking_spaces;
use sea_orm::prelude::*;

View File

@ -0,0 +1,17 @@
<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>
<div id="parking-space-rent-{{ parking_space_rent.id }}-price" class="price">
</div>
</oswilno-parking-space-rent>
{% endif %}
{% endif %}
{% endfor -%}
</oswilno-parking-space-rents>