Browse Source

Implemented the topic view

sh4nks 9 years ago
parent
commit
a387820de1

+ 23 - 2
flaskbb/templates/macros.html

@@ -380,13 +380,34 @@
 {% endmacro %}
 
 
+{# Generates a some kind of pagination for the posts in topic in the forum view. #}
 {%- macro topic_pages(topic_obj, per_page=10) -%}
 {% set topic_pages = (topic_obj.post_count / per_page)|round|int %}
 {%- if topic_pages >  1 -%}
 [
-    {% for page in range(0, topic_pages) %}
+    {%- for page in range(0, topic_pages) -%}
             <a href="{{ url_for('forum.view_topic', topic_id=topic_obj.id) }}?page={{ page+1 }}">{{ page+1 }} </a>
-    {% endfor %}
+    {%- endfor -%}
 ]
 {%- endif -%}
 {%- endmacro -%}
+
+
+{# Generates a topic url with an anchor to the post #}
+{%- macro generate_post_url(topic, post, page) -%}
+    {%- if page > 1 -%}
+        {{ topic.url }}?page={{ page }}#pid{{ post.id }}
+    {%- else -%}
+        {{ topic.url }}#pid{{ post.id }}
+    {%- endif -%}
+{%- endmacro -%}
+
+
+{# Generates the post id for the topic. Each topic starts with the post id 1 #}
+{%- macro generate_post_id(posts, page, per_page) -%}
+    {%- if posts.page == 1 -%}
+        {{ page }}
+    {%- else -%}
+        {{ page + (posts.page - 1) * per_page }}
+    {%- endif -%}
+{%- endmacro -%}

+ 82 - 29
flaskbb/themes/aurora/src/flaskbb.scss

@@ -17,6 +17,7 @@ body {
     height: 60px;
     // use the same width as container
     width: inherit;
+    padding-top: 1em;
 }
 
 .flaskbb-layout {
@@ -76,8 +77,8 @@ body {
 }
 
 
-.index-view, .forum-view {
-    .forum-row, .category-row {
+.index-view, .forum-view, .topic-view {
+    .forum-row, .category-row, .post-row {
         margin: 0;
     }
 }
@@ -86,6 +87,7 @@ body {
 .category-panel, .forum-panel, .topic-panel, .widget-panel {
     border: 1px solid #cad7e1;
     border-radius: 0;
+    margin-bottom: 0;
     .category-head, .forum-head, .topic-head, .widget-head {
         font-weight: bold;
     }
@@ -99,15 +101,62 @@ body {
         background-color: #e8ecf1;
         border-bottom: 1px solid #cad7e1;
     }
-    .category-row, .forum-row, .topic-row, .widget-row {
-        margin-top: 1em;
-        padding-bottom: 1em;
+    .category-row, .forum-row, .topic-row, .widget-row, .post-row {
+        margin-top: 0.5em;
+        padding-bottom: 0.5em;
         &:not(:last-child) {
             border-bottom: 1px solid #cad7e1;
         }
     }
 }
 
+// Topic
+.topic-body {
+    .post-row {
+        margin-top: 0;
+        padding-bottom: 0;
+        .post-author {
+            padding-left: 0.5em;
+            padding-bottom: 0.5em;
+            background-color: #e8ecf1;
+        }
+
+        .post-meta {
+            padding-top: 0.5em;
+            padding-left: 0.5em;
+            padding-right: 0.5em;
+            border-bottom: 1px solid #e8ecf1;
+        }
+
+        .post-box {
+            padding-left: 0;
+            padding-right: 0;
+            .post-content {
+                padding-top: 0.5em;
+                padding-left: 0.5em;
+                padding-right: 0.5em;
+            }
+        }
+
+        .post-footer {
+            width: 100%;
+            height: 100%;
+            border-top: 1px solid #e8ecf1;
+
+            .post-signature {
+                padding-left: 0.5em;
+            }
+
+            .post-controls {
+                padding-left: 0;
+
+                .inline-form {
+                    padding: 6px 12px;
+                }
+            }
+        }
+    }
+}
 
 // forum specific values
 .forum-body {
@@ -171,7 +220,7 @@ p.flaskbb-stats {
 }
 
 .controls-row {
-    padding: 1em 0;
+    padding: 0.5em 0;
     margin: 0;
 
     .pagination {
@@ -180,6 +229,11 @@ p.flaskbb-stats {
     }
 }
 
+.controls-col {
+    margin: 0;
+    padding: 0;
+}
+
 .inline-form {
     display: inline;
     padding: 0px;
@@ -199,34 +253,33 @@ p.flaskbb-stats {
     }
 }
 
-.post-quickreply {
+
+.editor {
     padding: 0;
     min-height: 0;
 }
 
-.post-quickreply > .md-editor {
-
-}
-
-.post-quickreply > .md-editor.active {
-    border-color: none;
-    box-shadow: none;
-}
+.editor > .md-editor {
+    &.active {
+        border-color: none;
+        box-shadow: none;
+    }
 
-.post-quickreply > .md-editor .md-footer, .md-editor>.md-header {
-    background: #F6F9FC;
-}
+    & > .md-footer, & >.md-header {
+        background: #F6F9FC;
+    }
 
-.post-quickreply > .md-editor>textarea {
-    border-top: 1px solid #cad7e1;
-    border-bottom: none;
-    background: #fff;
-    padding-left: 3px;
-}
+    & >textarea {
+        border-top: 1px solid #cad7e1;
+        border-bottom: none;
+        background: #fff;
+        padding-left: 3px;
+    }
 
-.post-quickreply > .md-editor>.md-preview {
-    border-top: 1px solid #cad7e1;
-    border-right: 1px solid #cad7e1;
-    border-bottom: none;
-    background: #eee;
+    & >.md-preview {
+        border-top: 1px solid #cad7e1;
+        border-right: 1px solid #cad7e1;
+        border-bottom: none;
+        background: #eee;
+    }
 }

+ 49 - 16
flaskbb/themes/aurora/static/css/flaskbb.css

@@ -10,7 +10,8 @@ body {
   position: absolute;
   bottom: 0;
   height: 60px;
-  width: inherit; }
+  width: inherit;
+  padding-top: 1em; }
 
 .flaskbb-layout {
   padding-top: 20px;
@@ -53,12 +54,13 @@ body {
   border: 1px solid #cad7e1;
   border-radius: 0; }
 
-.index-view .forum-row, .index-view .category-row, .forum-view .forum-row, .forum-view .category-row {
+.index-view .forum-row, .index-view .category-row, .index-view .post-row, .forum-view .forum-row, .forum-view .category-row, .forum-view .post-row, .topic-view .forum-row, .topic-view .category-row, .topic-view .post-row {
   margin: 0; }
 
 .category-panel, .forum-panel, .topic-panel, .widget-panel {
   border: 1px solid #cad7e1;
-  border-radius: 0; }
+  border-radius: 0;
+  margin-bottom: 0; }
   .category-panel .category-head, .category-panel .forum-head, .category-panel .topic-head, .category-panel .widget-head, .forum-panel .category-head, .forum-panel .forum-head, .forum-panel .topic-head, .forum-panel .widget-head, .topic-panel .category-head, .topic-panel .forum-head, .topic-panel .topic-head, .topic-panel .widget-head, .widget-panel .category-head, .widget-panel .forum-head, .widget-panel .topic-head, .widget-panel .widget-head {
     font-weight: bold; }
 
@@ -69,12 +71,42 @@ body {
     height: 2.5em;
     background-color: #e8ecf1;
     border-bottom: 1px solid #cad7e1; }
-  .category-body .category-row, .category-body .forum-row, .category-body .topic-row, .category-body .widget-row, .forum-body .category-row, .forum-body .forum-row, .forum-body .topic-row, .forum-body .widget-row, .topic-body .category-row, .topic-body .forum-row, .topic-body .topic-row, .topic-body .widget-row, .widget-body .category-row, .widget-body .forum-row, .widget-body .topic-row, .widget-body .widget-row {
-    margin-top: 1em;
-    padding-bottom: 1em; }
-    .category-body .category-row:not(:last-child), .category-body .forum-row:not(:last-child), .category-body .topic-row:not(:last-child), .category-body .widget-row:not(:last-child), .forum-body .category-row:not(:last-child), .forum-body .forum-row:not(:last-child), .forum-body .topic-row:not(:last-child), .forum-body .widget-row:not(:last-child), .topic-body .category-row:not(:last-child), .topic-body .forum-row:not(:last-child), .topic-body .topic-row:not(:last-child), .topic-body .widget-row:not(:last-child), .widget-body .category-row:not(:last-child), .widget-body .forum-row:not(:last-child), .widget-body .topic-row:not(:last-child), .widget-body .widget-row:not(:last-child) {
+  .category-body .category-row, .category-body .forum-row, .category-body .topic-row, .category-body .widget-row, .category-body .post-row, .forum-body .category-row, .forum-body .forum-row, .forum-body .topic-row, .forum-body .widget-row, .forum-body .post-row, .topic-body .category-row, .topic-body .forum-row, .topic-body .topic-row, .topic-body .widget-row, .topic-body .post-row, .widget-body .category-row, .widget-body .forum-row, .widget-body .topic-row, .widget-body .widget-row, .widget-body .post-row {
+    margin-top: 0.5em;
+    padding-bottom: 0.5em; }
+    .category-body .category-row:not(:last-child), .category-body .forum-row:not(:last-child), .category-body .topic-row:not(:last-child), .category-body .widget-row:not(:last-child), .category-body .post-row:not(:last-child), .forum-body .category-row:not(:last-child), .forum-body .forum-row:not(:last-child), .forum-body .topic-row:not(:last-child), .forum-body .widget-row:not(:last-child), .forum-body .post-row:not(:last-child), .topic-body .category-row:not(:last-child), .topic-body .forum-row:not(:last-child), .topic-body .topic-row:not(:last-child), .topic-body .widget-row:not(:last-child), .topic-body .post-row:not(:last-child), .widget-body .category-row:not(:last-child), .widget-body .forum-row:not(:last-child), .widget-body .topic-row:not(:last-child), .widget-body .widget-row:not(:last-child), .widget-body .post-row:not(:last-child) {
       border-bottom: 1px solid #cad7e1; }
 
+.topic-body .post-row {
+  margin-top: 0;
+  padding-bottom: 0; }
+  .topic-body .post-row .post-author {
+    padding-left: 0.5em;
+    padding-bottom: 0.5em;
+    background-color: #e8ecf1; }
+  .topic-body .post-row .post-meta {
+    padding-top: 0.5em;
+    padding-left: 0.5em;
+    padding-right: 0.5em;
+    border-bottom: 1px solid #e8ecf1; }
+  .topic-body .post-row .post-box {
+    padding-left: 0;
+    padding-right: 0; }
+    .topic-body .post-row .post-box .post-content {
+      padding-top: 0.5em;
+      padding-left: 0.5em;
+      padding-right: 0.5em; }
+  .topic-body .post-row .post-footer {
+    width: 100%;
+    height: 100%;
+    border-top: 1px solid #e8ecf1; }
+    .topic-body .post-row .post-footer .post-signature {
+      padding-left: 0.5em; }
+    .topic-body .post-row .post-footer .post-controls {
+      padding-left: 0; }
+      .topic-body .post-row .post-footer .post-controls .inline-form {
+        padding: 6px 12px; }
+
 .forum-body .forum-meta .topic-name, .forum-body .forum-meta .topic-stats, .forum-body .forum-meta .topic-last-post {
   font-weight: bold; }
 .forum-body .forum-row .topic-info {
@@ -108,12 +140,16 @@ p.flaskbb-stats {
   padding: 0; }
 
 .controls-row {
-  padding: 1em 0;
+  padding: 0.5em 0;
   margin: 0; }
   .controls-row .pagination {
     padding: 0;
     margin: 0; }
 
+.controls-col {
+  margin: 0;
+  padding: 0; }
+
 .inline-form {
   display: inline;
   padding: 0px; }
@@ -128,24 +164,21 @@ p.flaskbb-stats {
   .dropdown-messages .author-name {
     font-weight: bold; }
 
-.post-quickreply {
+.editor {
   padding: 0;
   min-height: 0; }
 
-.post-quickreply > .md-editor.active {
+.editor > .md-editor.active {
   border-color: none;
   box-shadow: none; }
-
-.post-quickreply > .md-editor .md-footer, .md-editor > .md-header {
+.editor > .md-editor > .md-footer, .editor > .md-editor > .md-header {
   background: #F6F9FC; }
-
-.post-quickreply > .md-editor > textarea {
+.editor > .md-editor > textarea {
   border-top: 1px solid #cad7e1;
   border-bottom: none;
   background: #fff;
   padding-left: 3px; }
-
-.post-quickreply > .md-editor > .md-preview {
+.editor > .md-editor > .md-preview {
   border-top: 1px solid #cad7e1;
   border-right: 1px solid #cad7e1;
   border-bottom: none;

+ 99 - 116
flaskbb/themes/aurora/templates/forum/topic.html

@@ -7,7 +7,7 @@
 {% endblock %}
 
 {% block content %}
-{% from theme('macros.html') import render_pagination, form_field %}
+{% from theme('macros.html') import render_pagination, form_field, generate_post_id, generate_post_url %}
 
 <ol class="breadcrumb flaskbb-breadcrumb">
     <li><a href="{{ url_for('forum.index') }}">{% trans %}Forum{% endtrans %}</a></li>
@@ -26,132 +26,114 @@
         </div>
         <div class="panel-body topic-body">
             {% for post, user in posts.items %}
-            <tr>
-                <td >
-                    <span class="pull-right">
-                        <strong>#{%- if posts.page == 1 -%} {{ loop.index }} {%- else -%} {{ loop.index + (posts.page - 1) * flaskbb_config["POSTS_PER_PAGE"] }} {%- endif -%}</strong>
-                    </span>
-                    <span class="pull-left">
-                        <a href="
-                        {%- if posts.page > 1 -%}
-                            {{ topic.url }}?page={{ posts.page }}#pid{{ post.id }}
-                        {%- else -%}
-                            {{ topic.url }}#pid{{ post.id }}
-                        {%- endif -%}
-                            ">{{ post.date_created|format_date('%d %B %Y') }}</a>
-                        {% if post.user_id and post.date_modified %}
-                        <small>
-                            ({% trans %}Last modified{% endtrans %}: {{ post.date_modified|format_date }} {% trans %}by{% endtrans %}
-                            <a href="{{ url_for('user.profile', username=post.modified_by) }}">
-                                {{ post.modified_by }}
-                            </a>.)
-                        </small>
-                        {% endif %}
-                    </span>
-                </td>
-            </tr>
-
-            <tr>
-            <td>
-                <table class="table table-borderless">
-                    <tr>
+            <div id="{{ post.id }}" class="row post-row clearfix">
+
+                <div class="post-author col-md-2 col-sm-2 col-xs-12">
+                    <!-- Registered User -->
                     {% if post.user_id %}
-                        {% if user.avatar %}
-                        <td width="1">
-                            <img src="{{ user.avatar }}" alt="Avatar" height="100" width="100">
-                        </td>
+                    <div class="author-name"><h4><a href="{{ user.url }}">{{ user.username }}</a></h4></div>
+                    <div class="author-{%- if user|is_online -%}online{%- else -%}offline{%- endif -%}"></div>
+
+                    <div class="author-title"><h5>{{ user.primary_group.name }}</h5></div>
+
+                    {% if user.avatar %}
+                        <div class="author-avatar"><img src="{{ user.avatar }}" width="100" height="100" alt=""></div>
+                    {% endif %}
+
+                    <div class="author-field author-registered">{% trans %}Joined{% endtrans %}: {{ user.date_joined|format_date('%b %d %Y') }}</div>
+                    <div class="author-field author-posts">{% trans %}Posts{% endtrans %}: {{ user.post_count }}</div>
+                    <div class="author-field author-email">
+                        {% if current_user.is_authenticated() and post.user_id %}
+                        <a href="{{ url_for('message.new_conversation') }}?to_user={{ user.username }}">{% trans %}PM{% endtrans %}</a>
                         {% endif %}
-                        <td>
-                            <a href="{{ user.url }}">
-                                <span style="font-weight:bold">{{ user.username }}</span> <!-- TODO: Implement userstyles -->
-                            </a>
-                                {%- if user|is_online %}
-                                <span class="label label-success">Online</span>
-                                {%- else %}
-                                <span class="label label-default">Offline</span>
-                                {%- endif %}
-                                <div class="profile primary-group">
-                                {{ user.primary_group.name }}
-                                </div>
-                        </td>
-
-                        <td class="pull-right">
-                            {% trans %}Posts{% endtrans %}: {{ user.post_count }}<br />
-                            {% trans %}Registered since{% endtrans %}: {{ user.date_joined|format_date('%b %d %Y') }}<br />
-                        </td>
+                    </div>
+                    {% if user.website %}
+                    <div class="author-field author-website"><a href="{{ user.website }}" rel="nofollow">{% trans %}Website{% endtrans %}</a></div>
+                    {% endif %}
+
                     {% else %}
-                        <td>
-                            <strong>{{ post.username }}</strong>
-                            <br />
-                            {% trans %}Guest{% endtrans %}
-                        </td>
+                    <div class="author-name"><h4><a href="{{ user.url }}">{{ post.username }}</a></h4></div>
+                    <div class="author-title"><h5>{% trans %}Guest{% endtrans %}</h5></div>
                     {% endif %}
-                    </tr>
-                </table>
-            </td>
-            </tr>
-
-            <tr>
-                <td>
-                    <div class="post_body" id="pid{{ post.id }}">
-                    {% autoescape false %}
-                        {{ post.content|markup }}
+                </div>
+
+                <div class="post-box col-md-10 col-sm-10 col-xs-12">
+                    <div class="post-meta clearfix">
+                        <div class="pull-left">
+                            <!-- Creation date / Date modified -->
+                            <a href="{{ generate_post_url(topic, post, posts.page) }}">
+                                {{ post.date_created|format_date('%d %B %Y') }}
+                            </a>
+                            {% if post.user_id and post.date_modified %}
+                            <small>
+                                (Last modified: {{ post.date_modified|format_date }} by
+                                <a href="{{ url_for('user.profile', username=post.modified_by) }}">{{ post.modified_by }}</a>.)
+                            </small>
+                            {% endif %}
+                        </div>
+
+                        <!-- Post number -->
+                        <div class="pull-right">
+                            #{{ generate_post_id(posts, loop.index, flaskbb_config["POSTS_PER_PAGE"]) }}
+                        </div>
+                    </div>
+
+                    <div class="post-content post_body clearfix" id="pid{{ post.id }}">
+                        {{ post.content|markup|safe }}
+                    </div>
+
+                    <div class="post-footer clearfix">
+
                         <!-- Signature Begin -->
                         {% if post.user_id and user.signature %}
-                        <div class="signature">
-                            <hr>
-                            {{ user.signature|markup }}
+                        <div class="post-signature col-md-12 col-md-12 col-xs-12">
+                            {{ user.signature|markup|safe }}
                         </div>
                         {% endif %}
                         <!-- Signature End -->
-                    {% endautoescape %}
-                    </div>
-                </td>
-            </tr>
-            <tr>
-                <td>
-                    <span class="pull-left">
-                        {% if current_user.is_authenticated() and post.user_id and post.user_id != current_user.id %}
-                        <a href="{{ url_for('message.new_conversation', to_user=post.user.username) }}">{% trans %}PM{% endtrans %}</a>
-                        {% endif %}
-                        {% if user.website %}
-                        {% if current_user.is_authenticated() %}| {% endif %}<a href="{{ user.website }}">{% trans %}Website{% endtrans %}</a>
-                        {% endif %}
-                    </span>
 
-                    <span class="pull-right">
-                        {% if current_user.is_authenticated() %}
-                        <a href="{{ url_for('forum.report_post', post_id=post.id) }}" onclick="window.open(this.href, 'wio_window','width=500,height=500'); return false;">
-                            {% trans %}Report{% endtrans %}
-                        </a> |
+                        <!-- Report/Edit/Delete/Quote Post-->
+                        <div class="post-controls col-md-12 col-sm-12 col-xs-12">
+
+                        {% if current_user|post_reply(topic) %}
+                        <!-- Quick quote -->
+                            <a href="#" class="btn btn-link fa fa-reply quote_btn" data-placement="top" data-post-id="{{ post.id }}" title="" data-original-title="Quote this post"></a>
+                        <!-- Full quote/reply -->
+                            <a href="{{ url_for('forum.reply_post', topic_id=topic.id, post_id=post.id) }}" class="btn btn-link fa fa-reply-all" data-placement="top" title="" data-original-title="Full Reply"></a>
                         {% endif %}
+
                         {% if current_user|edit_post(post) %}
-                        <a href="{{ url_for('forum.edit_post', post_id=post.id) }}">{% trans %}Edit{% endtrans %}</a> |
+                        <!-- Edit Post -->
+                        <a href="{{ url_for('forum.edit_post', post_id=post.id) }}" class="btn btn-link fa fa-pencil" data-placement="top" title="" data-original-title="Edit this post"></a>
                         {% endif %}
                         {% if topic.first_post_id == post.id %}
                             {% if current_user|delete_topic(topic) %}
                             <form class="inline-form" method="post" action="{{ url_for('forum.delete_topic', topic_id=topic.id, slug=topic.slug) }}">
                                 <input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
-                                <button class="btn btn-link">{% trans %}Delete{% endtrans %}</button> |
+                                <button class="btn btn-link fa fa-trash" data-placement="top" title="" data-original-title="Delete this topic"></button>
                             </form>
                             {% endif %}
                         {% else %}
                             {% if current_user|delete_post(post) %}
+                        <!-- Delete Post -->
                             <form class="inline-form" method="post" action="{{ url_for('forum.delete_post', post_id=post.id) }}">
                                 <input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
-                                <button class="btn btn-link">{% trans %}Delete{% endtrans %}</button> |
+                                <button  class="btn btn-link fa fa-trash post-delete" data-placement="top" title="" data-original-title="Delete this post"></button>
                             </form>
                             {% endif %}
+
                         {% endif %}
-                        {% if current_user|post_reply(topic) %}
-                            <!-- Quick quote -->
-                            <a href="#" class="quote_btn" data-post-id="{{ post.id }}">{% trans %}Quote{% endtrans %}</a> |
-                            <!-- Full quote/reply -->
-                            <a href="{{ url_for('forum.reply_post', topic_id=topic.id, post_id=post.id) }}">{% trans %}Reply{% endtrans %}</a>
+
+                        {% if current_user.is_authenticated() %}
+                        <!-- Report post -->
+                            <a href="{{ url_for('forum.report_post', post_id=post.id) }}" onclick="window.open(this.href, 'wio_window','width=500,height=500'); return false;" class="btn btn-link fa fa-flag" data-placement="top" title="Report this post" data-original-title="Report this post"></a>
                         {% endif %}
-                    </span>
-                </td>
-            </tr>
+
+                        </div>
+
+                    </div>
+                </div>
+            </div>
             {% endfor %}
 
         </div>
@@ -159,26 +141,27 @@
 
     {% include theme('forum/topic_controls.html') %}
     {% from theme("macros.html") import render_field, render_quickreply, render_submit_field %}
-{% if form %}
+    {% if form %}
 
-    <form class="form" action="#" method="post">
-        {{ form.hidden_tag() }}
+        <form class="form" action="#" method="post">
+            {{ form.hidden_tag() }}
 
-        <div id="quickpost" class="post post-bg">
-            <div class="post-quickreply col-md-12 col-sm-12 col-xs-12">
-                    {{ render_quickreply(form.content, div_class="new-message", rows=7, cols=75, placeholder="", **{'data-provide': 'markdown', 'data-autofocus': 'false', 'id': 'quickreply-editor'}) }}
-            </div>
-            <div class="new-post-submit">
-                <div class="post-options pull-left">
-                    <span class="label label-info">Markdown</span>
-                    <a class="label label-success" href="#">help</a> <!-- TODO: add markdown cheat sheet -->
-                    <a class="label label-success" href="#">emojis</a> <!-- TODO: add emoji cheat sheet -->
+            <div id="quickpost">
+                <div class="editor col-md-12 col-sm-12 col-xs-12">
+                        {{ render_quickreply(form.content, div_class="new-message", rows=7, cols=75, placeholder="", **{'data-provide': 'markdown', 'data-autofocus': 'false', 'id': 'quickreply-editor'}) }}
+                </div>
+                <div class="new-post-submit">
+                    <div class="post-options pull-left">
+                        <span class="label label-info">Markdown</span>
+                        <a class="label label-success" href="#">help</a> <!-- TODO: add markdown cheat sheet -->
+                        <a class="label label-success" href="#">emojis</a> <!-- TODO: add emoji cheat sheet -->
+                    </div>
+                    {{ render_submit_field(form.submit, input_class="btn btn-success pull-right") }}
                 </div>
-                {{ render_submit_field(form.submit, input_class="btn btn-success pull-right") }}
             </div>
-        </div>
-    </form>
-{% endif %}
+        </form>
+    {% endif %}
+
 </div>
 {% endblock %}
 

+ 40 - 40
flaskbb/themes/aurora/templates/forum/topic_controls.html

@@ -1,7 +1,7 @@
 <div class="row controls-row">
-<div class="pull-left">
-    {{ render_pagination(posts, topic.url) }}
-</div> <!-- end span pagination -->
+    <div class="pull-left">
+        {{ render_pagination(posts, topic.url) }}
+    </div> <!-- end span pagination -->
 
 {% if current_user.is_authenticated() %}
     <div class="pull-right">
@@ -29,47 +29,47 @@
     </div>
 {% endif %}
 
-<div class="pull-right">
-{% if current_user|delete_topic(topic) %}
-    <form class="inline-form" method="post" action="{{ url_for('forum.delete_topic', topic_id=topic.id, slug=topic.slug) }}">
-        <input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
-        <button class="btn btn-danger">
-            <span class="fa fa-trash-o"></span> {% trans %}Delete Topic{% endtrans %}
-        </button>
-    </form>
-{% endif %}
-{% if current_user|can_moderate(topic.forum) %}
-    {% if not topic.locked %}
-        <form class="inline-form" method="post" action="{{ url_for('forum.lock_topic', topic_id=topic.id, slug=topic.slug) }}">
-            <input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
-            <button class="btn btn-warning">
-                <span class="fa fa-lock"></span> {% trans %}Lock Topic{% endtrans %}
-            </button>
-        </form>
-    {% else %}
-        <form class="inline-form" method="post" action="{{ url_for('forum.unlock_topic', topic_id=topic.id, slug=topic.slug) }}">
+    <div class="pull-right">
+    {% if current_user|delete_topic(topic) %}
+        <form class="inline-form" method="post" action="{{ url_for('forum.delete_topic', topic_id=topic.id, slug=topic.slug) }}">
             <input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
-            <button class="btn btn-warning">
-                <span class="fa fa-unlock"></span> {% trans %}Unlock Topic{% endtrans %}
+            <button class="btn btn-danger">
+                <span class="fa fa-trash-o"></span> {% trans %}Delete Topic{% endtrans %}
             </button>
         </form>
     {% endif %}
+    {% if current_user|can_moderate(topic.forum) %}
+        {% if not topic.locked %}
+            <form class="inline-form" method="post" action="{{ url_for('forum.lock_topic', topic_id=topic.id, slug=topic.slug) }}">
+                <input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
+                <button class="btn btn-warning">
+                    <span class="fa fa-lock"></span> {% trans %}Lock Topic{% endtrans %}
+                </button>
+            </form>
+        {% else %}
+            <form class="inline-form" method="post" action="{{ url_for('forum.unlock_topic', topic_id=topic.id, slug=topic.slug) }}">
+                <input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
+                <button class="btn btn-warning">
+                    <span class="fa fa-unlock"></span> {% trans %}Unlock Topic{% endtrans %}
+                </button>
+            </form>
+        {% endif %}
 
-    {% if not topic.important %}
-        <form class="inline-form" method="post" action="{{ url_for('forum.highlight_topic', topic_id=topic.id, slug=topic.slug) }}">
-            <input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
-            <button class="btn btn-success">
-                <span class="fa fa-star"></span> {% trans %}Highlight Topic{% endtrans %}
-            </button>
-        </form>
-    {% else %}
-        <form class="inline-form" method="post" action="{{ url_for('forum.trivialize_topic', topic_id=topic.id, slug=topic.slug) }}">
-            <input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
-            <button class="btn btn-success">
-                <span class="fa fa-star-o"></span> {% trans %}Trivialize Topic{% endtrans %}
-            </button>
-        </form>
+        {% if not topic.important %}
+            <form class="inline-form" method="post" action="{{ url_for('forum.highlight_topic', topic_id=topic.id, slug=topic.slug) }}">
+                <input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
+                <button class="btn btn-success">
+                    <span class="fa fa-star"></span> {% trans %}Highlight Topic{% endtrans %}
+                </button>
+            </form>
+        {% else %}
+            <form class="inline-form" method="post" action="{{ url_for('forum.trivialize_topic', topic_id=topic.id, slug=topic.slug) }}">
+                <input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
+                <button class="btn btn-success">
+                    <span class="fa fa-star-o"></span> {% trans %}Trivialize Topic{% endtrans %}
+                </button>
+            </form>
+        {% endif %}
     {% endif %}
-{% endif %}
-</div>
+    </div>
 </div>