From 53810746178a2109cc0813cc43e8bc4918fbf764 Mon Sep 17 00:00:00 2001 From: justcool393 Date: Sun, 27 Nov 2022 12:15:33 -0600 Subject: [PATCH] sigs: limit to 250px (configurable by variable) --- files/assets/css/main.css | 13 +++++++++++++ files/classes/comment.py | 2 +- files/classes/submission.py | 2 +- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/files/assets/css/main.css b/files/assets/css/main.css index 954746a51..aa76fbb0e 100644 --- a/files/assets/css/main.css +++ b/files/assets/css/main.css @@ -6399,3 +6399,16 @@ div.markdown { .modlog-action:not(:first-of-type) { border-top: 1px solid var(--gray-400) !important; } + +:root { + --signature-max-height: 250px; +} + +.user-signature { + max-height: var(--signature-max-height); + overflow: clip; +} + +.user-signature video { + height: var(--signature-max-height); +} diff --git a/files/classes/comment.py b/files/classes/comment.py index b1cfa23bd..7ef6afc64 100644 --- a/files/classes/comment.py +++ b/files/classes/comment.py @@ -292,7 +292,7 @@ class Comment(Base): body += f'"> - {o.upvotes} votes''' if not self.ghost and self.author.show_sig(v): - body += f"
{self.author.sig_html}" + body += f'

{self.author.sig_html}
' if v: body = body.replace("!YOU!", v.username) diff --git a/files/classes/submission.py b/files/classes/submission.py index 526f8112f..c5e463a5b 100644 --- a/files/classes/submission.py +++ b/files/classes/submission.py @@ -322,7 +322,7 @@ class Submission(Base): if not listing and not self.ghost and self.author.show_sig(v): - body += f"
{self.author.sig_html}" + body += f'

{self.author.sig_html}
' if v: body = body.replace("!YOU!", v.username)