home » zplus/freepost.git
ID: 9aaca20e511c9b6183d2b3e492c357911a4c3573
59 lines — 2K — View raw


{% include 'header.twig' %}

<div class="post">

    <table class="posts">
        <tr>
            <td class="bump">
                {% if not votes[post.id] %}
                    <a href="vote?up&post={{ post.hashId }}" target="vote_sink" onclick="hide(this)"></a>
                {% endif %}
            </td>

            <td class="post">
                <div class="title">
                    {% if post.link|length > 0 %}
                        <a href="{{ post.link }}">
                            {{ post.title }}
                        </a>
                    {% else %}
                        {{ post.title }}
                    {% endif %}
                </div>

                <div class="info">
                    by <a href="{{ ('user/' ~ post.username)|docroot }}">{{ post.username }}</a> <em>{{ post.created|ago }}</em>
{{ post.vote }} votes, <a href="#comments">{{ post.commentsCount }} comments</a>
                
                    {% if user and post.userId == user.id %}
<a href="../edit?post={{ post.hashId }}">Edit</a>
                    {% endif %}
                </div>
            </td>
        </tr>
    </table>
    
    <div class="text">
        {{ post.text|markdown|raw }}
    </div>
    
    {# An anchor for where the comments section starts #}
    <a id="comments"></a>
    
    {% if user %}
        <form action="" method="post" class="new_comment">
            <textarea name="new_comment" class="form-control" placeholder="Write a comment"></textarea>
            <input type="submit" value="Add comment" class="btn btn-primary" />
        </form>
    {% endif %}

    <div class="comments">
        {% include 'comment.twig' with {
            'post': post,
            'comments': comments,
            'parent_id': 0,
            'depth': 0
        } %}
    </div>
</div>

{% include 'footer.twig' %}