Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 29 additions & 3 deletions ebpub/ebpub/templates/db/snippets/newsitem_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,34 @@

{% for newsitem in newsitem_list %}
<li id="newsitem-{{ newsitem.id }}" class="newsitem">
{% if location_url != "" %}<a href="{{ location_url }}">{% endif %}<span class="location">{{ newsitem.location_name }}</span>{% if location_url != "" %}</a>{% endif %}
<strong class="title"><a href="{{ newsitem.item_url}}" class="url">{{ newsitem.title|truncatewords_html:20 }}</a></strong>
<p class="info"><span class="date">{{ newsitem.item_date|date:"F j, Y" }}</span> {% if newsitem.description %}{{ newsitem.description|truncatewords_html:20}}{% endif %}</p>
<div class="date">
<img src="{{ newsitem.schema.map_icon_url }}" />
<span class="month">{{ newsitem.item_date|date:"M" }}</span>
<span class="day">{{ newsitem.item_date|date:"d" }}</span>
</div>
<div class="title_place">
<span class="title">
<a href="{{ newsitem.item_url}}" class="url">
{{ newsitem.title|truncatewords_html:20|default:"Unknown" }}
</a>
</span>
<span class="location">
{% if location_url != "x" %}<a href="{{ location_url }}">{% endif %}@{{ newsitem.location_name }}{% if location_url != "x" %}</a>{% endif %}
</span>
</div>
<span class="info">
{% if newsitem.description %}
<!-- If newsitem is from trusted schema source, has links/HTML markup, the following allows Django "safe" display. "Safe" Django is not recommended. -
{% if newsitem.schema.slug == "local-news" %}
{{ newsitem.description|safe|truncatewords_html:20}}
<a href="{{ newsitem.item_url }}" class="more_info">More</a>
{% else %}

Include another {% endif %} before the last {% endif %} for each custom schema/if statement
-->
{{ newsitem.description|truncatewords_html:20}}
<a href="{{ newsitem.item_url }}" class="more_info">More</a>
{% endif %}
</span>
</li>
{% endfor %}