remove uriencode and use tera filter instead

This commit is contained in:
glyph 2022-09-09 11:06:54 +01:00
parent 125211cabc
commit ec2da076c0
4 changed files with 2 additions and 10 deletions

7
Cargo.lock generated
View File

@ -1384,7 +1384,6 @@ dependencies = [
"serde",
"serde_json",
"sled",
"uri_encode",
"xdg",
]
@ -2614,12 +2613,6 @@ dependencies = [
"subtle",
]
[[package]]
name = "uri_encode"
version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "34acb51c736f8784bdbca2692c3cc57213bfc1b329fd6eb7668d5e4af8f87ceb"
[[package]]
name = "valuable"
version = "0.1.0"

View File

@ -13,7 +13,6 @@ license = "MIT"
async-std = "1.10"
bincode = "1.3"
chrono = "0.4"
uri_encode = "1"
env_logger = "0.9"
futures = "0.3"
golgi = { git = "https://git.coopcloud.tech/golgi-ssb/golgi.git" }

View File

@ -89,9 +89,7 @@ pub async fn post(db: &State<Database>, public_key: &str, msg_id: &str) -> Templ
let context = context! {
peers: &peers_unread,
selected_peer: &public_key,
selected_peer_encoded: &uri_encode::encode_uri_component(public_key),
selected_post: &msg_id,
selected_post_encoded: &uri_encode::encode_uri_component(msg_id),
posts: &posts,
post: &post,
post_is_selected: &true

View File

@ -4,6 +4,8 @@
<img src="/icons/download.png">
</a>
{% if post_is_selected %}
{% set selected_peer_encoded = selected_peer | urlencode_strict %}
{% set selected_post_encoded = selected_post | urlencode_strict %}
{% if post.read %}
{% set mark_unread_url = "/posts/" ~ selected_peer_encoded ~ "/" ~ selected_post_encoded ~ "/unread" %}
<a class="disabled icon" title="Mark as read">