This commit is contained in:
Artemis 2025-01-23 18:13:19 +01:00
parent c2621bbc0f
commit 690d9b043d
2 changed files with 22 additions and 3 deletions

View file

@ -19,6 +19,7 @@ pub struct DollProfile {
pub pronouns: String,
pub handler_name: String,
pub handler_url: Option<String>,
pub microchipped: bool,
pub kind: Option<String>,
pub breed: Option<String>,
@ -27,7 +28,18 @@ pub struct DollProfile {
pub chassis_type: Option<String>,
pub chassis_id: Option<String>,
pub chassis_color: Option<String>,
pub microchipped: bool,
}
impl DollProfile {
pub fn has_identifying_info(&self) -> bool {
self.kind.is_some()
|| self.breed.is_some()
|| self.behaviour.is_some()
|| self.description.is_some()
|| self.chassis_type.is_some()
|| self.chassis_id.is_some()
|| self.chassis_color.is_some()
}
}
#[derive(Debug)]
@ -38,6 +50,7 @@ pub struct CreateDollProfile<'a> {
pub pronouns: &'a str,
pub handler_name: &'a str,
pub handler_url: Option<&'a str>,
pub microchipped: bool,
pub kind: Option<&'a str>,
pub breed: Option<&'a str>,
@ -46,5 +59,4 @@ pub struct CreateDollProfile<'a> {
pub chassis_type: Option<&'a str>,
pub chassis_id: Option<&'a str>,
pub chassis_color: Option<&'a str>,
pub microchipped: bool,
}

View file

@ -3,7 +3,14 @@
{% block main %}
<section class="raised profile">
<header>
<p class="ident">Tag ID <span class="id">{{profile.id}}</span></p>
<p class="ident">
Tag ID <span class="id">{{profile.id}}</span><br />
{% if profile.microchipped %}
Microchipped
{% else %}
Not microchipped
{% endif %}
</p>
<p class="pronouns">{{profile.pronouns}}</p>
</header>
<h2>{{profile.name}}</h2>