use rinja::Template;
use serde::Deserialize;

use crate::models::{Area, Location, Role, User};
use crate::filters;

pub mod get_new;
pub mod get_overview;
pub mod post_new;
pub mod get_edit;
pub mod post_edit;
pub mod delete;

#[derive(Template)]
#[template(path = "location/new_or_edit.html")]
pub struct LocationTemplate {
    user: User,
    areas: Option<Vec<Area>>,
    location: Option<Location>,
}

#[derive(Deserialize)]
pub struct LocationForm {
    name: String,
    area: Option<i32>,
}
