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

Portal Plugin: Fix recent topics

sh4nks 10 лет назад
Родитель
Сommit
df4afb71fb
2 измененных файлов с 2 добавлено и 2 удалено
  1. 1 1
      flaskbb/plugins/portal/templates/index.html
  2. 1 1
      flaskbb/plugins/portal/views.py

+ 1 - 1
flaskbb/plugins/portal/templates/index.html

@@ -115,7 +115,7 @@
 
           <div class="portal-topic">
             <div class="portal-topic-name">
-              <a href="{{ topic.url }}">{{ topic.title }}</a>
+              <a href="{{ topic.url }}">{{ topic.title | truncate(length=45) }}</a>
             </div>
             <div class="portal-topic-updated-by">
               <a href="{{ url_for('user.profile', username=topic.user.username) }}">{{ topic.user.username }}</a>

+ 1 - 1
flaskbb/plugins/portal/views.py

@@ -28,7 +28,7 @@ def index():
         order_by(Topic.id.desc()).\
         paginate(page, flaskbb_config["TOPICS_PER_PAGE"], True)
 
-    recent_topics = Topic.query.order_by(Topic.date_created).limit(5).offset(0)
+    recent_topics = Topic.query.order_by(Topic.last_updated.desc()).limit(5)
 
     user_count = User.query.count()
     topic_count = Topic.query.count()