Compare commits

..
2 Commits
Author SHA1 Message Date
nelsbrock d1842d8d92 improve category tags 2026-07-31 23:39:33 +02:00
nelsbrock ec0840bf53 fix ordering of previous titles list 2026-07-31 22:14:22 +02:00
+7 -4
View File
@@ -57,18 +57,21 @@ impl Item<'_> {
fn tag(&self) -> Cow<'static, str> { fn tag(&self) -> Cow<'static, str> {
match self.icon { match self.icon {
"HIM0" => "\u{2139}\u{FE0F} Information".into(),
"HIM1" => "\u{1F6A7} Bauarbeiten".into(), "HIM1" => "\u{1F6A7} Bauarbeiten".into(),
"HIM2" => "\u{26A0}\u{FE0F} Störung".into(), "HIM2" => "\u{26A0}\u{FE0F} Störung".into(),
"HIM3" => "\u{270A} Streik".into(), "HIM3" => "\u{270A} Streik".into(),
other => format!("\u{2139}\u{FE0F} Information ({other})").into(), other => format!("\u{1F937} Unbekannte Kategorie {other:?}").into(),
} }
} }
fn colour(&self) -> u32 { fn colour(&self) -> u32 {
match self.icon { match self.icon {
"HIM0" => 0x154889,
"HIM1" => 0xf5c211, "HIM1" => 0xf5c211,
"HIM2" | "HIM3" => 0xc1121c, "HIM2" => 0xc1121c,
_ => 0x154889, "HIM3" => 0xff6a00,
_ => 0xffffff,
} }
} }
@@ -251,7 +254,7 @@ impl DisbahnClient {
let previous_posts = post_versions::dsl::post_versions let previous_posts = post_versions::dsl::post_versions
.filter(post_versions::dsl::announcement_id.eq(item.guid)) .filter(post_versions::dsl::announcement_id.eq(item.guid))
.order_by(post_versions::publish_date.desc()) .order_by(post_versions::publish_date)
.load::<PostVersion>(self.database.conn()) .load::<PostVersion>(self.database.conn())
.with_context(|| "Error loading previous posts from database")?; .with_context(|| "Error loading previous posts from database")?;