aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--apioforum/static/style.css5
-rw-r--r--apioforum/templates/common.html10
-rw-r--r--apioforum/templates/view_user.html2
3 files changed, 13 insertions, 4 deletions
diff --git a/apioforum/static/style.css b/apioforum/static/style.css
index 8a30355..ba6543d 100644
--- a/apioforum/static/style.css
+++ b/apioforum/static/style.css
@@ -81,6 +81,11 @@ div.deleted-post {
color: hsl(0,0%,80%);
}
+.preview-post {
+ overflow: hidden;
+ max-height: 303px;
+}
+
@media (prefers-color-scheme: dark) {
.deleted-post > .post-heading > * {
color: hsl(0,0%,45%);
diff --git a/apioforum/templates/common.html b/apioforum/templates/common.html
index cac27ec..44c9036 100644
--- a/apioforum/templates/common.html
+++ b/apioforum/templates/common.html
@@ -2,7 +2,7 @@
<a href="{{url_for('user.view_user',username=username)}}" class="username">{{username}}</a>
{%- endmacro %}
-{% macro disp_post(post, buttons=False, forum=None, footer=None) %}
+{% macro disp_post(post, buttons=False, forum=None, footer=None, preview = False) %}
{% if not forum %}
{% if post.forum %}
{% set forum = post.forum %}
@@ -15,7 +15,7 @@
{% elif post.deleted %}
{{ hidden_post("this post never existed.", post) }}
{% else %}
-<div class="post {% if post.deleted %}deleted-post{% endif %}" id="post_{{post.id}}">
+<div class="post {% if post.deleted %}deleted-post{% endif %} {% if preview %}preview-post{% endif %}" id="post_{{post.id}}">
<div class="post-heading">
<span class="post-heading-a">
{{disp_user(post.author)}}
@@ -60,7 +60,11 @@
</span>
</div>
<div class="post-content md">
- {{ post.content|md|safe }}
+ {% if not preview %}
+ {{ post.content|md|safe }}
+ {% else %}
+ {{ post.content[:2500]|md|safe }}
+ {% endif %}
</div>
{% if footer %}
<div class="post-footer">
diff --git a/apioforum/templates/view_user.html b/apioforum/templates/view_user.html
index 2235b5e..582f051 100644
--- a/apioforum/templates/view_user.html
+++ b/apioforum/templates/view_user.html
@@ -34,7 +34,7 @@
{{ pagination_nav(page,max_pageno,'user.view_user', username=user.username) }}
<div class="user_posts">
{% for post in posts %}
- {{ disp_post(post, False) }}
+ {{ disp_post(post, False, preview = True) }}
{% endfor %}
</div>
{{ pagination_nav(page,max_pageno,'user.view_user', username=user.username,bottom=True) }}