Improve news style
[vchess.git] / client / src / views / News.vue
index 0e3c3c7..e7fabe3 100644 (file)
@@ -26,10 +26,10 @@ main
         :class="{margintop:idx>0}"
       )
         span.ndt {{ formatDatetime(n.added) }}
-        div(v-if="devs.includes(st.user.id)")
+        .dev-buttons(v-if="devs.includes(st.user.id)")
           button(@click="editNews(n)") {{ st.tr["Edit"] }}
           button(@click="deleteNews(n)") {{ st.tr["Delete"] }}
-        p(v-html="parseHtml(n.content)")
+        .news-content(v-html="parseHtml(n.content)")
       button#loadMoreBtn(
         v-if="hasMore"
         @click="loadMore()"
@@ -68,6 +68,7 @@ export default {
           this.newsList = res.newsList;
           const L = res.newsList.length;
           if (L > 0) this.cursor = res.newsList[L - 1].added;
+          else this.hasMore = false;
         }
       }
     );
@@ -169,10 +170,10 @@ export default {
         {
           data: { cursor: this.cursor },
           success: (res) => {
-            if (res.newsList.length > 0) {
+            const L = res.newsList.length;
+            if (L > 0) {
               this.newsList = this.newsList.concat(res.newsList);
-              const L = res.newsList.length;
-              if (L > 0) this.cursor = res.newsList[L - 1].added;
+              this.cursor = res.newsList[L - 1].added;
             } else this.hasMore = false;
           }
         }
@@ -210,8 +211,10 @@ span.ndt
 
 .news
   padding-top: 10px
-  & > div
+  & > .dev-buttons
     display: inline-block
+  & > .news-content
+    margin: 0
 
 .margintop
   margin-top: 25px