allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kentontay...@apache.org
Subject allura git commit: Allow for a lot more text in discussion activity entries; do real truncation client-side
Date Fri, 14 Apr 2017 18:00:43 GMT
Repository: allura
Updated Branches:
  refs/heads/master a2dfcb2c0 -> 74d583ee8


Allow for a lot more text in discussion activity entries; do real truncation client-side


Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/74d583ee
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/74d583ee
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/74d583ee

Branch: refs/heads/master
Commit: 74d583ee8689529266655af46b611007f0db63b1
Parents: a2dfcb2
Author: Dave Brondsema <dave@brondsema.net>
Authored: Wed Apr 5 13:52:00 2017 -0400
Committer: Kenton Taylor <ktaylor@slashdotmedia.com>
Committed: Fri Apr 14 17:56:54 2017 +0000

----------------------------------------------------------------------
 Allura/allura/model/discuss.py                           | 4 ++--
 Allura/allura/tests/unit/test_post_model.py              | 8 ++++----
 ForgeActivity/forgeactivity/nf/activity/css/activity.css | 3 +++
 3 files changed, 9 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/74d583ee/Allura/allura/model/discuss.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/discuss.py b/Allura/allura/model/discuss.py
index f4ddd7d..7c6150c 100644
--- a/Allura/allura/model/discuss.py
+++ b/Allura/allura/model/discuss.py
@@ -549,8 +549,8 @@ class Post(Message, VersionedArtifact, ActivityObject):
     def activity_extras(self):
         d = ActivityObject.activity_extras.fget(self)
         # For activity summary, convert Post text to html,
-        # strip all tags, and truncate near the 80 char mark
-        LEN = 80
+        # strip all tags, and truncate
+        LEN = 500
         summary = jinja2.Markup.escape(
             g.markdown.cached_convert(self, 'text')).striptags()
         if len(summary) > LEN:

http://git-wip-us.apache.org/repos/asf/allura/blob/74d583ee/Allura/allura/tests/unit/test_post_model.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/unit/test_post_model.py b/Allura/allura/tests/unit/test_post_model.py
index ed33ecb..f972688 100644
--- a/Allura/allura/tests/unit/test_post_model.py
+++ b/Allura/allura/tests/unit/test_post_model.py
@@ -44,9 +44,9 @@ class TestPostModel(WithDatabase):
         self.post.text = """\
 This is a **bold thing**, 40 chars here.
 * Here's the first item in our list.
-* And here's the second item."""
+* And here's the second item.""" + ','.join(map(str, range(200)))
         assert 'allura_id' in self.post.activity_extras
         summary = self.post.activity_extras['summary']
-        assert summary == "This is a bold thing, 40 chars here. " + \
-                          "Here's the first item in our list. " + \
-                          "And here's..."
+        assert summary.startswith("This is a bold thing, 40 chars here. Here's the first
item in our list. "
+                                  "And here's the second item.")
+        assert summary.endswith('125,126,127...')

http://git-wip-us.apache.org/repos/asf/allura/blob/74d583ee/ForgeActivity/forgeactivity/nf/activity/css/activity.css
----------------------------------------------------------------------
diff --git a/ForgeActivity/forgeactivity/nf/activity/css/activity.css b/ForgeActivity/forgeactivity/nf/activity/css/activity.css
index f3a5324..55551de 100644
--- a/ForgeActivity/forgeactivity/nf/activity/css/activity.css
+++ b/ForgeActivity/forgeactivity/nf/activity/css/activity.css
@@ -41,6 +41,9 @@
   padding: 0;
   vertical-align: top;
   font-size: 14px;
+  white-space: nowrap;
+  overflow: hidden;
+  text-overflow: ellipsis;
 }
 .activity ul.timeline li .avatar {
   float: left;


Mime
View raw message