{% extends "layout.html" %} {% import "macros.html" as macros %} {% macro make_title() %} {% if read_only %} Preview{% if feed %} for{% endif %} {% elif not request.args.q %} Entries{% if feed %} for{% endif %} {% else %} Search for {{ request.args.q }}{% if feed %} in{% endif %} {% endif %} {% if feed %} {{ macros.feed_title(feed) }} {% endif %} {% if request.args.tags %} in feeds tagged {{ request.args.tags }} {% endif %} {% endmacro %} {% block page_title %}{{ make_title() | striptags }}{% endblock %} {% block main_title %}{{ make_title() }}{% endblock %} {% block body %} {% if feed and feed.subtitle %} {# 24 words * 4.7 letters/word = 112.8 letters #}

{{ macros.abbr_truncate(feed.subtitle, 113) }}

{% endif %}
{% if counts %}

{{ macros.entry_counts(counts) }} {% endif %} {% set vars = namespace(entry_index=0) %} {% for entry, tags in entries_and_tags %} {% set vars.entry_index = loop.index %} {% set feed = entry.feed %} {% set content = entry.get_content(prefer_summary=False) %} {% set summary = entry.get_content(prefer_summary=True) %}

{%- if entry.title and entry.title.strip() -%} {{ entry.title | safe }} {%- else -%} untitled {%- endif -%}

{% if summary %}

{# TODO: maybe unify entry / search result content or something? #} {% if not request.args.q %} {{ summary.value | striptags | truncate }} {% else %} {{ summary.value }} {% endif %} {% if not read_only %} more {% endif %}

{% endif %} {{ macros.entry_enclosures(entry) }}
{% else %} {% if not error %} {% if not request.args.q and not request.args.tags %}

no {% if current_what != 'all' %}{{ current_what }} {% endif %}entries for this feed

{% else %}

no results for this query

{% endif %} {% endif %} {% endfor %} {% set limit = request.args.get('limit') | int %} {% if limit and vars.entry_index >= limit -%} {%- set args = request.args.copy() -%} {%- set _ = args.poplist('limit') -%}

showing only the first {{ vars.entry_index }} entries; show all entries

{%- endif %} {% endblock %}