[ckan-dev] Snippet update

Judith Moran Judith.Moran at nt.gov.au
Wed May 8 03:19:02 UTC 2019


Hi again,

We need to edit activity_streams.py.  Once the file is edited how do compile the new file.  Do you have to rebuild the catalog??


Judy

From: Judith Moran
Sent: Tuesday, 7 May 2019 10:55 AM
To: CKAN Development Discussions <ckan-dev at lists.okfn.org>
Subject: Snippet update

Hi,

I have found the snipped that renders the activity list.

Definitely Not an html - python person.

I want to edit the snippet to list only some of the activity objects (type and object).

So I commented out the line that presents the bulk of the activity data -    {# {{ h.literal(activity.msg.format(**activity.data)) }} #}.  I did read up on this as the extracting the activity data from activity, BUT user Id is not to be reported on at NTG.


Then I put some test render commands (it may be very creative, so please be gentle with the comments???).


Can someone update these two lines of code  just to show the activity object and type as I can see it is user render to get the activity timestamp and I want to do the same for the object and activity id.
It would greatly be appreciated.

<li class="item {{ activity.type|lower }}">
  {% if activity.is_new %}
    <span class="new" title="{{ _('New activity item') }}">{{ _('New activity item') }}</span>
  {% endif %}
  <i class="fa icon fa-{{ activity.icon }}"></i>
  <p>
   {# {{ h.literal(activity.msg.format(**activity.data)) }} #}
                <span class="item" title="{{h.render(activity.object_id) }} </span>
                <span class='item" title="{{h.render(activity.activity-type) }} </span>
    <span class="date" title="{{ h.render_datetime(activity.timestamp, with_hours=True) }}">{{ h.time_ago_from_timestamp(activity.timestamp) }}</span>
  </p>
</li>



Regards,



Judy Moran

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20190508/0bb03980/attachment-0002.html>


More information about the ckan-dev mailing list