Some views
This commit is contained in:
parent
96c49299f6
commit
e48e8ffc9b
@ -1,11 +1,11 @@
|
|||||||
use actix_web::web::{Data, ServiceConfig};
|
use actix_web::web::{scope, Data, ServiceConfig};
|
||||||
use actix_web::{get, HttpResponse};
|
use actix_web::{get, HttpResponse};
|
||||||
|
|
||||||
pub fn mount(config: &mut ServiceConfig) {
|
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 {
|
async fn all_parking_spaces(db: Data<sea_orm::DatabaseConnection>) -> HttpResponse {
|
||||||
use oswilno_contract::parking_spaces;
|
use oswilno_contract::parking_spaces;
|
||||||
use sea_orm::prelude::*;
|
use sea_orm::prelude::*;
|
||||||
|
17
crates/oswilno-parking-space/templates/all.html
Normal file
17
crates/oswilno-parking-space/templates/all.html
Normal 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>
|
Loading…
Reference in New Issue
Block a user