Compare commits
2 commits
8d32e2ab67
...
73823e84ec
| Author | SHA1 | Date | |
|---|---|---|---|
| 73823e84ec | |||
| e7cf98ae17 |
4 changed files with 11 additions and 10 deletions
12
Cargo.lock
generated
12
Cargo.lock
generated
|
|
@ -452,7 +452,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "guestbook"
|
name = "guestbook"
|
||||||
version = "0.2.0"
|
version = "0.2.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"axum",
|
"axum",
|
||||||
"chrono",
|
"chrono",
|
||||||
|
|
@ -499,9 +499,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "hashbrown"
|
name = "hashbrown"
|
||||||
version = "0.16.1"
|
version = "0.17.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100"
|
checksum = "4f467dd6dccf739c208452f8014c75c18bb8301b050ad1cfb27153803edb0f51"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "heck"
|
name = "heck"
|
||||||
|
|
@ -814,12 +814,12 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "indexmap"
|
name = "indexmap"
|
||||||
version = "2.13.1"
|
version = "2.14.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "45a8a2b9cb3e0b0c1803dbb0758ffac5de2f425b23c28f518faabd9d805342ff"
|
checksum = "d466e9454f08e4a911e14806c24e16fba1b4c121d1ea474396f396069cf949d9"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"equivalent",
|
"equivalent",
|
||||||
"hashbrown 0.16.1",
|
"hashbrown 0.17.0",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_core",
|
"serde_core",
|
||||||
]
|
]
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "guestbook"
|
name = "guestbook"
|
||||||
version = "0.2.0"
|
version = "0.2.1"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
description = "A configurable web guestbook made to be easy to use, with entries in plain text files, options for honeypots and captchas to deter spam, and moderation via Telegram bot."
|
description = "A configurable web guestbook made to be easy to use, with entries in plain text files, options for honeypots and captchas to deter spam, and moderation via Telegram bot."
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
|
|
|
||||||
|
|
@ -85,7 +85,7 @@ fn render_entry(entry: &Entry, config: &Config) -> String {
|
||||||
};
|
};
|
||||||
let mut header = format!(
|
let mut header = format!(
|
||||||
"<span class=\"entry-header\">{} - <span class=\"entry-name\">{}</span>",
|
"<span class=\"entry-header\">{} - <span class=\"entry-name\">{}</span>",
|
||||||
entry.meta.date, name
|
&entry.meta.date[..10], name
|
||||||
);
|
);
|
||||||
if config.enable_website_links && !entry.meta.website.is_empty() {
|
if config.enable_website_links && !entry.meta.website.is_empty() {
|
||||||
let website = escape_html(&entry.meta.website);
|
let website = escape_html(&entry.meta.website);
|
||||||
|
|
|
||||||
|
|
@ -117,8 +117,9 @@ async fn submit(
|
||||||
}
|
}
|
||||||
|
|
||||||
let short_id = &Uuid::new_v4().to_string()[..8];
|
let short_id = &Uuid::new_v4().to_string()[..8];
|
||||||
let date = chrono::Utc::now().format("%Y-%m-%d").to_string();
|
let date = chrono::Utc::now().format("%Y-%m-%dT%H:%M:%S").to_string();
|
||||||
let filename = format!("{date}-{short_id}.txt");
|
let date_short = &date[..10];
|
||||||
|
let filename = format!("{date_short}-{short_id}.txt");
|
||||||
|
|
||||||
let entry = Entry {
|
let entry = Entry {
|
||||||
id: filename.trim_end_matches(".txt").to_string(),
|
id: filename.trim_end_matches(".txt").to_string(),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue