home ยป zplus/freepost.git
ID: 543685a626368119fceff69b17d8b0f6901c99ed
98 lines โ€” 3K โ€” 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">
        
        {# banner
            <div class="bg-green" style="margin: 0 0 2em 0; padding: .5em;">
                <img alt="" title="" src="images/pulse.gif" style="height: 1em;" />
                <a href="https://fosdem.org/2018/schedule/streaming/">FOSDEM 2018</a>
            </div>
        #}
        
        {# Welcome New Year.
        # To maintain alignment, keep al lines below of the same length
        # and with no padding.
        <pre class="new_year">
                        .''.    
    .        *''*    :_\/_:   
    _\(/_  .:.*_\/_*   : /\ :   
    ./)\   ':'* /\ * :  '..'.   
    ' *''*    * '.\'/.' _\(/_'
    *_\/_*     -= o =-  /)\  
    * /\ *     .'/.\'.   '   
        *..*         :          
        ___   ___  __  ___      
    |__ \ / _ \/_ |/ _ \     
        ) | | | || | (_) |    
        / /| | | || |> _ <     
        / /_| |_| || | (_) |    
    |____|\___/ |_|\___/     
        </pre>
        #}
        
        {% for post in posts %}
            
            <div class="post">
                <div class="title">
                    {% if post.link|length > 0 %}
                        <a href="{{ post.link }}">{{ post.title }}</a>
                    {% else %}
                        <a href="post/{{ post.hashId }}">{{ post.title }}</a>
                    {% endif %}
                </div>
                
                {% if post.link %}
                    <div class="netloc">
                        {{ post.link|netloc }}
                    </div>
                {% endif %}
                 
                <div class="info">
                    {{ 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>
            
        {% endfor %}
        
        <div class="more">
            {% if page_number > 0 %}
                <a href="{{ url ('homepage') if page_number == 1 else '?page=' ~ (page_number - 1) }}" class="button button_default1">
                    Previous
                </a>
            {% endif %}
            
            <a href="?page={{ page_number + 1 }}" class="button button_default1">
                Next
            </a>
        </div>
    </div>


{% endblock %}