This is an automated email from the ASF dual-hosted git repository.

gcruz pushed a commit to branch gc/8527
in repository https://gitbox.apache.org/repos/asf/allura.git


The following commit(s) were added to refs/heads/gc/8527 by this push:
     new c3c6aa760 fixup! [#8527] display thread subject instead of app name 
and tool label in header
c3c6aa760 is described below

commit c3c6aa76008f8a2960cecfd170131159c8180047
Author: Guillermo Cruz <[email protected]>
AuthorDate: Tue Nov 21 14:54:14 2023 -0700

    fixup! [#8527] display thread subject instead of app name and tool label in 
header
---
 Allura/allura/controllers/discuss.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/Allura/allura/controllers/discuss.py 
b/Allura/allura/controllers/discuss.py
index 18d0aaaa0..2bd9c9412 100644
--- a/Allura/allura/controllers/discuss.py
+++ b/Allura/allura/controllers/discuss.py
@@ -48,6 +48,7 @@ from allura.model.artifact import ArtifactReference
 from .attachments import AttachmentsController, AttachmentController
 from .feed import FeedArgs, FeedController
 import six
+from jinja2.filters import do_truncate as truncate
 
 log = logging.getLogger(__name__)
 
@@ -204,7 +205,8 @@ class ThreadController(BaseController, FeedController, 
metaclass=h.ProxiedAttrMe
         c.thread_header = self.W.thread_header
         limit, page, start = g.handle_paging(limit, page)
         self.thread.num_views += 1
-        h1_text = f'{(self.thread.subject or 
c.app.config.options.mount_label)[:100]}'
+        h1_text = f'{(self.thread.subject or 
c.app.config.options.mount_label)}'
+        h1_text = truncate(None, h1_text, 80, end="...", leeway=3)
         # the update to num_views shouldn't affect it
         M.session.artifact_orm_session._get().skip_mod_date = True
         M.session.artifact_orm_session._get().skip_last_updated = True

Reply via email to