feat: start adding listing functions
This commit is contained in:
parent
156ac6e829
commit
51f80101bf
|
@ -148,6 +148,26 @@ impl PartyFinderListing {
|
|||
crate::ffxiv::WORLDS.get(&u32::from(self.created_world))
|
||||
.map(|w| w.data_center().name())
|
||||
}
|
||||
|
||||
pub fn high_end(&self) -> bool {
|
||||
if self.duty_type != DutyType::Normal {
|
||||
return false;
|
||||
}
|
||||
|
||||
crate::ffxiv::DUTIES.get(&u32::from(self.duty))
|
||||
.map(|info| info.high_end)
|
||||
.unwrap_or_default()
|
||||
}
|
||||
|
||||
pub fn content_kind(&self) -> u32 {
|
||||
if self.duty_type != DutyType::Normal {
|
||||
return 0;
|
||||
}
|
||||
|
||||
crate::ffxiv::DUTIES.get(&u32::from(self.duty))
|
||||
.map(|info| info.content_kind.as_u32())
|
||||
.unwrap_or_default()
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize, PartialEq)]
|
||||
|
|
|
@ -63,11 +63,13 @@ Remote Party Finder
|
|||
{%- for container in containers %}
|
||||
{%- let listing = container.listing.borrow() %}
|
||||
<div
|
||||
class="listing"
|
||||
data-id="{{ listing.id }}"
|
||||
data-centre="{{ listing.data_centre_name().unwrap_or_default() }}"
|
||||
data-type="{{ listing.duty_type.as_u8() }}"
|
||||
data-category="{{ listing.category.as_u32() }}">
|
||||
class="listing"
|
||||
data-id="{{ listing.id }}"
|
||||
data-centre="{{ listing.data_centre_name().unwrap_or_default() }}"
|
||||
data-type="{{ listing.duty_type.as_u8() }}"
|
||||
data-category="{{ listing.category.as_u32() }}"
|
||||
data-high-end="{{ listing.high_end() }}"
|
||||
data-content-kind={{ listing.content_kind() }}>
|
||||
<div class="left">
|
||||
{%- let duty_class %}
|
||||
{%- if listing.is_cross_world() %}
|
||||
|
|
Loading…
Reference in New Issue