| {#- |
| Licensed to the Apache Software Foundation (ASF) under one |
| or more contributor license agreements. See the NOTICE file |
| distributed with this work for additional information |
| regarding copyright ownership. The ASF licenses this file |
| to you under the Apache License, Version 2.0 (the |
| "License"); you may not use this file except in compliance |
| with the License. You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, |
| software distributed under the License is distributed on an |
| "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| KIND, either express or implied. See the License for the |
| specific language governing permissions and limitations |
| under the License. |
| -#} |
| |
| {% macro activity_obj(o) %} |
| {% if o.activity_url %} |
| <a href="{{o.activity_url}}" |
| {% if 'noindex' in o and o.noindex %} rel="nofollow" {% endif %} |
| >{{o.activity_name}}</a> |
| {% else %} |
| {{o.activity_name}} |
| {% endif %} |
| {% endmacro %} |
| |
| {% macro icon(o, size, className) -%} |
| {% if o.activity_extras.get('icon_url') %} |
| <img src="{{ o.activity_extras.get('icon_url') }}" |
| alt="{{ o.activity_name }}" |
| title="{{ o.activity_name }}" |
| class="emboss{% if size %} x{{size}}{% endif %}{% if className %} {{className}}{% endif %}"> |
| {% else %} |
| {{ g.icons['user'].render( |
| tag='span', |
| style='text-align:center;', |
| extra_css='emboss {} x{}'.format(className or '', size or '')) }} |
| {% endif %} |
| {%- endmacro %} |
| |
| {% macro timeline_section(timeline, activity_app) -%} |
| {% if not timeline %} |
| <p class="empty">No activity to display.</p> |
| {% else %} |
| <ul class="timeline"> |
| {% for a in timeline %} |
| <li> |
| <b> |
| {{ a.verb.capitalize() }} {{ activity_obj(a.obj) }} |
| {% if a.target.activity_name %}on {{ activity_obj(a.target) }}{% endif %} |
| {% if a.obj.project %}on |
| <a href="{{ a.obj.project.url() }}">{{ a.obj.project.name }}</a>{% endif %} |
| </b> |
| {% if a.obj.activity_extras.get('summary') %} |
| <p> |
| {{ a.obj.activity_extras.get('summary') }} |
| </p> |
| {% endif %} |
| <time datetime="{{ a.published|datetimeformat }}" |
| title="{{ a.published|datetimeformat }}">{{ h.ago(a.published, show_date_after=None) }}</time> |
| </li> |
| {% endfor %} |
| </ul> |
| <a class="view-all" href="{{activity_app.url}}">View All</a> |
| {% endif %} |
| {%- endmacro %} |