mirror of
https://github.com/nelsbrock/disbahn.git
synced 2026-08-14 22:26:49 +02:00
Compare commits
2
Commits
4256aaad1d
...
d1842d8d92
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d1842d8d92
|
||
|
|
ec0840bf53
|
+7
-4
@@ -57,18 +57,21 @@ impl Item<'_> {
|
||||
|
||||
fn tag(&self) -> Cow<'static, str> {
|
||||
match self.icon {
|
||||
"HIM0" => "\u{2139}\u{FE0F} Information".into(),
|
||||
"HIM1" => "\u{1F6A7} Bauarbeiten".into(),
|
||||
"HIM2" => "\u{26A0}\u{FE0F} Störung".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 {
|
||||
match self.icon {
|
||||
"HIM0" => 0x154889,
|
||||
"HIM1" => 0xf5c211,
|
||||
"HIM2" | "HIM3" => 0xc1121c,
|
||||
_ => 0x154889,
|
||||
"HIM2" => 0xc1121c,
|
||||
"HIM3" => 0xff6a00,
|
||||
_ => 0xffffff,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -251,7 +254,7 @@ impl DisbahnClient {
|
||||
|
||||
let previous_posts = post_versions::dsl::post_versions
|
||||
.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())
|
||||
.with_context(|| "Error loading previous posts from database")?;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user