Просмотр исходного кода

Added the Board Statistics on the index page

sh4nks 9 лет назад
Родитель
Сommit
97e1f08d8c

+ 25 - 10
flaskbb/themes/aurora/src/flaskbb.scss

@@ -63,7 +63,6 @@ body {
         padding-left: 1em;
     }
 
-
     .navbar-nav > li > a:hover, .navbar-default .navbar-nav > li > a:focus {
         color: #555;
         background-color: #e7e7e7;
@@ -76,34 +75,45 @@ body {
     border-radius: 0;
 }
 
+
 .index-view .row {
     margin: 0;
 }
 
-.category-panel {
+// default values for the panels
+.category-panel, .forum-panel, .topic-panel, .widget-panel {
     border: 1px solid #cad7e1;
     border-radius: 0;
+    .category-head, .forum-head, .topic-head, .widget-head {
+        font-weight: bold;
+    }
 }
 
-// forum-body,..?
-.category-body {
+.category-body, .forum-body, .topic-body, .widget-body {
     padding: 0;
-    .category-meta {
+    .category-meta, .forum-meta, .topic-meta, .widget-meta {
         padding-top: 0.5em;
         height: 2.5em;
         background-color: #e8ecf1;
         border-bottom: 1px solid #cad7e1;
-
-        .forum-name, .forum-stats, .forum-last-post {
-            font-weight: bold;
-        }
     }
-    .category-content {
+    .category-row, .forum-row, .topic-row, .widget-row {
         margin-top: 1em;
         padding-bottom: 1em;
         &:not(:last-child) {
             border-bottom: 1px solid #cad7e1;
         }
+    }
+}
+
+// category specific values
+.category-body {
+    .category-meta, {
+        .forum-name, .forum-stats, .forum-last-post {
+            font-weight: bold;
+        }
+    }
+    .category-row {
         .forum-info {
             position: relative;
             float: left;
@@ -126,3 +136,8 @@ body {
 
     }
 }
+
+p.stats {
+    margin: 0;
+    padding: 0;
+}

+ 26 - 19
flaskbb/themes/aurora/static/css/flaskbb.css

@@ -56,35 +56,42 @@ body {
 .index-view .row {
   margin: 0; }
 
-.category-panel {
+.category-panel, .forum-panel, .topic-panel, .widget-panel {
   border: 1px solid #cad7e1;
   border-radius: 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; }
 
-.category-body {
+.category-body, .forum-body, .topic-body, .widget-body {
   padding: 0; }
-  .category-body .category-meta {
+  .category-body .category-meta, .category-body .forum-meta, .category-body .topic-meta, .category-body .widget-meta, .forum-body .category-meta, .forum-body .forum-meta, .forum-body .topic-meta, .forum-body .widget-meta, .topic-body .category-meta, .topic-body .forum-meta, .topic-body .topic-meta, .topic-body .widget-meta, .widget-body .category-meta, .widget-body .forum-meta, .widget-body .topic-meta, .widget-body .widget-meta {
     padding-top: 0.5em;
     height: 2.5em;
     background-color: #e8ecf1;
     border-bottom: 1px solid #cad7e1; }
-    .category-body .category-meta .forum-name, .category-body .category-meta .forum-stats, .category-body .category-meta .forum-last-post {
-      font-weight: bold; }
-  .category-body .category-content {
+  .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-content:not(:last-child) {
+    .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) {
       border-bottom: 1px solid #cad7e1; }
-    .category-body .category-content .forum-info {
-      position: relative;
-      float: left; }
-      .category-body .category-content .forum-info .forum-status {
-        font-size: 2em;
-        padding-right: 0.5em; }
-      .category-body .category-content .forum-info .forum-name {
-        font-weight: bold; }
-      .category-body .category-content .forum-info .forum-moderators {
-        font-style: italic; }
-    .category-body .category-content .forum-last-post .last-post-title {
-      font-weight: bold; }
+
+.category-body .category-meta .forum-name, .category-body .category-meta .forum-stats, .category-body .category-meta .forum-last-post {
+  font-weight: bold; }
+.category-body .category-row .forum-info {
+  position: relative;
+  float: left; }
+  .category-body .category-row .forum-info .forum-status {
+    font-size: 2em;
+    padding-right: 0.5em; }
+  .category-body .category-row .forum-info .forum-name {
+    font-weight: bold; }
+  .category-body .category-row .forum-info .forum-moderators {
+    font-style: italic; }
+.category-body .category-row .forum-last-post .last-post-title {
+  font-weight: bold; }
+
+p.stats {
+  margin: 0;
+  padding: 0; }
 
 /*# sourceMappingURL=flaskbb.css.map */

+ 2 - 0
flaskbb/themes/aurora/templates/forum/category.html

@@ -9,6 +9,8 @@
     <li class="active">{{ category.title }}</li>
 </ol>
 
+<div class="index-view">
 {% include theme("forum/category_layout.html") %}
+</div>
 
 {% endblock %}

+ 4 - 2
flaskbb/themes/aurora/templates/forum/category_layout.html

@@ -1,6 +1,6 @@
 <div class="panel panel-default category-panel">
     <div class="panel-heading category-head">
-        <strong><a href="{{ category.url }}">{{ category.title }}</a></strong>
+        <a href="{{ category.url }}">{{ category.title }}</a>
     </div>
 
     <div class="panel-body category-body">
@@ -11,7 +11,8 @@
             <div class="col-md-3 col-sm-3 col-xs-4 forum-last-post">Last Post</div>
         </div>
         {% for forum, forumsread in forums %}
-        <div class="row category-content">
+        <div class="row category-row">
+
             {% if forum.external %}
             <div class="col-md-5 col-sm-5 col-xs-8 forum-info">
                 <!-- Icon -->
@@ -45,6 +46,7 @@
                 ---
             </div>
             {% else %}
+
             <div class="col-md-5 col-sm-5 col-xs-8 forum-info">
                 <!-- Icon -->
                 <div class="forum-status pull-left">

+ 19 - 32
flaskbb/themes/aurora/templates/forum/index.html

@@ -11,39 +11,26 @@
 {% endfor %}
 </div>
 
-<div class="panel panel-default">
-<div class="panel-heading">
-    {% trans %}Board Statistics{% endtrans %}
-    [<a href="{{ url_for('forum.who_is_online') }}" onclick="window.open(this.href, 'wio_window','width=500,height=500'); return false;">{% trans %}Who is online?{% endtrans %}</a>]
-</div>
-<div class="panel-body">
-<!-- Forum Stats -->
-<table class="table table-bordered">
-    <thead>
-        <tr>
-            <td colspan="2">
-
-            </td>
-        </tr>
-    </thead>
-    <tbody>
-        <tr>
-            <td>
-                {% trans %}Total number of registered users{% endtrans %}: <strong>{{ user_count }}</strong> <br />
-                {% trans %}Total number of topics{% endtrans %}: <strong>{{ topic_count }}</strong> <br />
-                {% trans %}Total number of posts{% endtrans %}: <strong>{{ post_count }}</strong> <br />
-            </td>
-            <td>
-                {% trans %}Newest registered user{% endtrans %}: {% if newest_user %}<a href="{{ newest_user.url }}">{{ newest_user.username }}</a>{% else %}{% trans %}No users{% endtrans %}{% endif %}<br />
-                {% trans %}Registered users online{% endtrans %}: <strong>{{ online_users }}</strong> <br />
+<div class="panel panel-default widget-panel">
+    <div class="panel-heading widget-head">
+        {% trans %}Board Statistics{% endtrans %}
+        [<a href="{{ url_for('forum.who_is_online') }}" onclick="window.open(this.href, 'wio_window','width=500,height=500'); return false;">{% trans %}Who is online?{% endtrans %}</a>]
+    </div>
+    <div class="panel-body">
+        <div class="row widget-row">
+            <div class="col-md-6">
+                <p class="stats">{% trans %}Total number of registered users{% endtrans %}: <strong>{{ user_count }}</strong></p>
+                <p class="stats">{% trans %}Total number of topics{% endtrans %}: <strong>{{ topic_count }}</strong></p>
+                <p class="stats">{% trans %}Total number of posts{% endtrans %}: <strong>{{ post_count }}</strong></p>
+            </div>
+            <div class="col-md-6 pull-right">
+                <p class="stats">{% trans %}Newest registered user{% endtrans %}: {% if newest_user %}<a href="{{ newest_user.url }}">{{ newest_user.username }}</a>{% else %}{% trans %}No users{% endtrans %}{% endif %}</p>
+                <p class="stats">{% trans %}Registered users online{% endtrans %}: <strong>{{ online_users }}</strong></p>
                 {% if config["REDIS_ENABLED"] %}
-                {% trans %}Guests online{% endtrans %}: <strong>{{ online_guests }}</strong> <br />
+                <p class="stats">{% trans %}Guests online{% endtrans %}: <strong>{{ online_guests }}</strong></p>
                 {% endif %}
-            </td>
-        </tr>
-
-    </tbody>
-</table>
-</div>
+            </div>
+        </div>
+    </div>
 </div>
 {% endblock %}