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

brondsem pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/allura.git


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

commit 2c30b10ec7ee14bb90618692aea55be814ef8225
Author: Guillermo Cruz <[email protected]>
AuthorDate: Thu Nov 16 14:08:40 2023 -0700

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

diff --git a/Allura/allura/controllers/discuss.py 
b/Allura/allura/controllers/discuss.py
index 5756ec9c6..d0006c6e4 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,6 +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 = 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
@@ -216,7 +219,7 @@ class ThreadController(BaseController, FeedController, 
metaclass=h.ProxiedAttrMe
                     thread=self.thread,
                     page=int(page),
                     count=int(count),
-                    limit=int(limit),
+                    limit=int(limit), h1_text=h1_text,
                     show_moderate=kw.get('show_moderate'))
 
     def error_handler(self, *args, **kwargs):

Reply via email to