diff --git a/src/db/post.rs b/src/db/post.rs index d91d82a..6af2746 100755 --- a/src/db/post.rs +++ b/src/db/post.rs @@ -355,7 +355,15 @@ impl Post { .execute(ctx.db()) .await?; - if self.thread.is_none() { + if let Some(thread) = self.thread { + query(&format!( + "UPDATE posts_{} SET replies = replies - 1 WHERE id = $1", + self.board + )) + .bind(thread) + .execute(ctx.db()) + .await?; + } else { ctx.cache().decr("total_threads", 1).await?; ctx.cache() .decr(format!("board_threads:{}", self.board), 1) diff --git a/src/filters.rs b/src/filters.rs index ddcd167..9c71e94 100644 --- a/src/filters.rs +++ b/src/filters.rs @@ -84,7 +84,7 @@ pub fn czech_plural(plurals: &str, count: impl Display) -> askama::Result -
-
Výsledek
-
+ + + + + +
Výsledek
{% if !response.is_empty() %} - {{ response|linebreaksbr|safe }} + {{ response|linebreaksbr|safe }} {% else %} Nic se nezměnilo. {% endif %} - - +
{% endblock %} diff --git a/templates/banned.html b/templates/banned.html index 3b3c419..51a0691 100644 --- a/templates/banned.html +++ b/templates/banned.html @@ -5,9 +5,10 @@ {% block content %}

Jsi trans, btw.

-
-
Máš ban!
-
+ + + + + {% endblock %} diff --git a/templates/error.html b/templates/error.html index db6e299..d2ae333 100755 --- a/templates/error.html +++ b/templates/error.html @@ -12,16 +12,12 @@

Je konec...

-
-
- Chyba {{ error_code }} -
+
Máš ban!
Byl jsi zabanován @@ -59,7 +60,8 @@ {% endif %} {% endif %} - +
+ {% if !error_message.is_empty() %} -
- {{ error_message }} -
+ {% endif %} - +
Chyba {{ error_code }}
{{ error_message }}
diff --git a/templates/index.html b/templates/index.html index f33012b..8466a4b 100755 --- a/templates/index.html +++ b/templates/index.html @@ -40,7 +40,7 @@ -