ID: 527a76de2bb048d229bca92d230a1686863398f4
94 lines
โ
4K โ
View raw
| {% from 'vote.html' import vote %}
{% extends 'layout.html' %}
{# Set variables for base layour #}
{% set active_page = sorting %}
{% set title = '' %}
{% block content %}
<div class="posts">
{# include 'banner.html' #}
{% for post in posts %}
{% set topics = split_topics (post.topics) %}
<div class="post">
{# Print the item position number #}
<div class="position">
{{ page_number * settings ('defaults', 'items_per_page') + loop.index }}.
</div>
<div class="info">
<div class="title">
<a href="{{ post.link if post.link and post.link|length > 0 else url ('post', hash_id=post.hashId) }}">
{{ post.title }}
{# Post content preview #}
{% if post.text %}
<img
alt=""
title="{{ post.text|md2txt }}"
src="{{ url ('static', filename='images/text.svg') }}"
class="text_preview" />
{% endif %}
</a>
{# URL hostname #}
{% if post.link %}
<span class="netloc">
{{ post.link|netloc }}
</span>
{% endif %}
</div>
<div class="topics">
{% for topic in topics %}
<a href="{{ url ('topic', name=topic) }}" class="topic">{{ topic }}</a>
{% endfor %}
</div>
<div class="about">
{{ vote ('post', post, user) }}
<em class="username">
<a href="post/{{ post.hashId }}">
<time title="{{ post.created|title }}" datetime="{{ post.created|datetime }}">
{{ post.created|ago }}
</time>
</a>
</em>
by
<a href="{{ url ('user_public', username=post.username) }}">
{{ post.username }}
</a>
โ
<a href="post/{{ post.hashId }}#comments">
{% if post.commentsCount > 0 %}
{{ post.commentsCount }} comments
{% else %}
discuss
{% endif %}
</a>
</div>
</div>
</div>
{% endfor %}
<div class="more">
{% if page_number > 0 %}
<a href="{{ request.urlparts.path if page_number == 1 else '?page=' ~ (page_number - 1) }}" class="button button_default1">
Previous
</a>
{% endif %}
<a href="?page={{ page_number + 1 }}{{ '&sort=' ~ request.query.sort }}" class="button button_default1">
Next
</a>
</div>
</div>
{% endblock %}
|