{% 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.rel_time }}

{% if post.flair.flair_parts.len() > 0 %} {% call utils::render_flair(post.flair.flair_parts) %} {% endif %} {{ post.title }}

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