Skip to content

Commit

Permalink
Created a template snippet for a activity item
Browse files Browse the repository at this point in the history
  • Loading branch information
johnmartin committed Sep 27, 2012
1 parent ac14fdb commit e02ff1f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
12 changes: 3 additions & 9 deletions ckan/templates/activity_streams/activity_stream_items.html
@@ -1,11 +1,5 @@
<ul class="activity">
{% for activity in activities %}
<li class="item {{ activity.type|lower }}">
<i class="icon-{{ activity.icon }}"></i>
<p>
{{ h.literal(activity.msg.format(**activity.data)) }}
<span class="date">{{ h.time_ago_in_words_from_str(activity.timestamp, 'hour') }} ago</span>
</p>
</li>
{% endfor %}
{% for activity in activities %}
{% snippet 'snippets/activity_item.html', activity=activity %}
{% endfor %}
</ul>
7 changes: 7 additions & 0 deletions ckan/templates/snippets/activity_item.html
@@ -0,0 +1,7 @@
<li class="item {{ activity.type|lower }}">
<i class="icon-{{ activity.icon }}"></i>
<p>
{{ h.literal(activity.msg.format(**activity.data)) }}
<span class="date">{{ h.time_ago_in_words_from_str(activity.timestamp, 'hour') }} ago</span>
</p>
</li>

0 comments on commit e02ff1f

Please sign in to comment.