{% extends "base.html" %} {% import "utils.html" as utils %} {% block title %} {% if sub.title != "" %}{{ sub.title }} {% else if sub.name != "" %}{{ sub.name }} {% else %}Libreddit{% endif %} {% endblock %} {% block search %} {% call utils::search(["/r/", sub.name.as_str()].concat(), "") %} {% endblock %} {% block body %}
{% if sub.name.is_empty() %} {% call utils::sort("", ["hot", "new", "top", "rising", "controversial"], sort.0) %} {% else %} {% call utils::sort(["/r/", sub.name.as_str()].concat(), ["hot", "new", "top", "rising", "controversial"], sort.0) %} {% endif %}
{% if sort.0 == "top" || sort.0 == "controversial" %} {% endif %}
{% for post in posts %} {% if !(post.flags.nsfw && prefs.hide_nsfw == "on") %}

{{ post.score }}

{% if post.flags.nsfw %}
NSFW
{% endif %}

r/{{ post.community }} {{ post.time }}

{% if post.flair.0 != "" %} {{ post.flair.0 }} {% endif %} {{ post.title }}

{% if prefs.layout == "card" && post.post_type == "image" %} {% else if prefs.layout != "card" %} {% endif %}
{% endif %} {% endfor %}
{% if ends.0 != "" %} PREV {% endif %} {% if ends.1 != "" %} NEXT {% endif %}
{% if sub.name != "" && !sub.name.contains("+") %} {% endif %}
{% endblock %}