My favorites | Sign in
Project Home Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions

Issue 36 attachment: jaikuengine_more_context_for_comments.diff (1.8 KB)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
Index: common/templatetags/format.py
===================================================================
--- common/templatetags/format.py (revision 1)
+++ common/templatetags/format.py (working copy)
@@ -23,7 +23,7 @@
from django.utils.safestring import mark_safe
from django.utils.html import escape
from django.utils.timesince import timesince
-from common.util import create_nonce, safe
+from common.util import create_nonce, safe, display_nick, url_nick

from common import clean
from common import models
@@ -149,4 +149,16 @@
else:
return timesince(d)

+@register.filter
+def is_channel(value, arg=None):
+ return value.startswith('#')

+@register.filter
+@safe
+def entry_actor_link(value, arg=None):
+ return '<a href="%s">%s</a>' % (models.actor_url(url_nick(value), 'user'),
+ display_nick(value))
+
+@register.filter
+def ends_with_s(value, arg=None):
+ return value.lower().endswith('s')
Index: common/templates/stream.html
===================================================================
--- common/templates/stream.html (revision 1)
+++ common/templates/stream.html (working copy)
@@ -17,7 +17,13 @@
{{entry|format_comment}}
</p>
<p class="meta">
- Comment from {{entry.actor_ref|actor_link}} on <a href="{{entry.url}}" title="{{entry.extra.entry_title}}">{{entry.extra.entry_title}}</a> {{entry.created_at|je_timesince}} ago.
+ Comment from {{entry.actor_ref|actor_link}} on
+ {{entry.extra.entry_actor|entry_actor_link}}'{% if not entry.extra.entry_actor|ends_with_s %}s{% endif %}
+ <a href="{{entry.url}}" title="{{entry.extra.entry_title}}">{{entry.extra.entry_title}}</a>
+ {% if entry.owner|is_channel %}
+ in channel {{entry.owner_ref|actor_link}}
+ {% endif %}
+ {{entry.created_at|je_timesince}} ago.
</p>
</div></div>
</li>
Powered by Google Project Hosting