<span class="title">
: if ( $rss ) {
<a title="RSS" class="rss" href="<: $route :>?format=rss"></a>
<: $category :>:
: }
</span>
: if ( $about_header ) {
    <: $about_header | mark_raw :>
: }
<hr class="divider" />
: for $posts -> $post {
    : if ( $post.aclname && $in_series ) {
    : next;
    : }
    : if ( $post.is_profile && $post.user == 'Nobody' ) {
    : next;
    : }
    :if ( $tiled ) {
        <a href="<: $route :>/<: $post.id :>" class="tile">
        : if ($post.is_video) {
            <video class="responsive" controls poster="<: $post.preview :>" >
                <source src="<: $post.href :>" type="<: $post.content_type :>" />
                Your browser does not support the video tag.
            </video>
        : } else {
            <div class="responsive preview" style="background-image:url(<: $post.preview :>)"></div>
        : }
            <p class="midtitle"><: $post.title :></p>
        </a>
    : } else {
        <div class="post">
            <h3 class='blogtitles'>
                <a href='/posts/<: $post.id :>'><: $post.title :></a>
                <a class="undecorated" href='<: $post.href :>'>🔗</a>
                : if ( $post.version_max ) {
                <form method="GET" action="/posts/<: $post.id :>" style="float:right;">
                    <select id="<: $post.id :>-<: $post.version :>-version" name="version" class="coolbutton">
                        : for [0..$post.version_max] -> $version {
                            <option value="<: $version :>" <: if ($post.version == $version ) { :>selected<: } :> >v<: $version :></option>
                        : }
                    </select>
                </form>
                : }
                <span id="<: $post.id :>-<: $post.version :>-time" style="float:right;"><: $post.created :></span>
                <a class='usericon <: $post.user :>' title='Posted by <: $post.user :>'></a>
            </h3>
            : if ( !$post.video_href && !$post.is_image && !$post.is_video && !$post.is_profile && $post.preview ) {
                <div style="background-image:url(<: $post.preview :>);" class="responsive preview"></div>
            : }
            : if ( $post.video_href ) {
                <video class="responsive" controls poster="<: $post.preview :>" >
                    <source src="<: $post.video_href :>" type="<: $post.video_content_type :>" />
                    Your browser does not support the video tag.
                </video>
            : }
            : if ( $post.audio_href ) {
                <audio controls>
                    <source src="<: $post.audio_href :>" type="<: $post.audio_content_type :>" />
                    Your browser does not support the audio tag.
                </audio>
            : }
            : if ( $post.is_video ) {
                <video class="responsive" controls poster="<: $post.preview :>" >
                    <source src="<: $post.href :>" type="<: $post.content_type :>" />
                    Your browser does not support the video tag.
                </video>
            : }
            : if ( $post.is_audio ) {
                <audio controls>
                    <source src="<: $post.href :>" type="<: $post.content_type :>" />
                    Your browser does not support the audio tag.
                </audio>
            : }
            : if ( $post.is_image ) {
                <div style="background-image:url(<: $post.href :>);" class="responsive preview"></div>
            : }
            : if ( $post.wallpaper ) {
                <div style="background-image:url(<: $post.wallpaper :>);">
                    <div style="background-image:url(<: $post.preview :>);" class="responsive preview usericon"></div>
                </div>
            : }
            : $post.data | mark_raw;
            : if ( $can_edit ) {
            <br />
            <a style="display: inline-block;" onclick="switchMenu('<: $post.id :>-<: $post.version :>');">[Edit]</a>
            <div id="<: $post.id :>-<: $post.version :>" style="display:none;">
                : include $post.type ~ ".tx" { post => $post };
                <form class="Submissions" action="/post/delete" method="POST" class="inline">
                    <input type="hidden" name="id" value="<: $post.id :>"></input>
                    <input type="hidden" name="to" value="<: $route :>"></input>
                    <input class="coolbutton" type="submit" value="Delete"></input>
                </form>
            </div>
            : }
            <script type="text/javascript">
                document.addEventListener("DOMContentLoaded", function(event) {

                    // Fix post dates to be localized
                    var e = document.getElementById("<: $post.id :>-<: $post.version :>-time");
                    var d = new Date(Date(e.innerText));
                    e.innerHTML = "&nbsp;" + d.toDateString();

                    //Make the version switcher do things
                    var swit = document.getElementById("<: $post.id :>-<: $post.version :>-version"); // I am an elder scrolls fan
                    swit.onchange = function (evt) {
                        this.form.submit();
                    };
                });
            </script>
        </div>
        <hr class="divider" />
    : }
: }
: if ( $rss ) {
: include "paginator.tx";
: }
: if ( $about_footer ) {
    <: $about_footer | mark_raw :>
: }

