feat(forums): load topic list data

This commit is contained in:
OldHawk
2017-07-07 18:17:01 +08:00
parent ffd2ff406a
commit 09f2e4af4d
5 changed files with 125 additions and 13 deletions

View File

@@ -669,7 +669,11 @@
VIEWS: 'Views',
LAST_REPLY: 'Last Reply',
TITLE: 'Title',
CONTENT: 'Content'
CONTENT: 'Content',
POST_BY: 'by {{user}} post at {{createdAt}}',
REPLY_BY_1: 'by {{user}}',
REPLY_BY_2: 'reply at {{createdAt}}',
REPLY_BY_3: 'post at {{createdAt}}'
}
},

View File

@@ -669,7 +669,11 @@
VIEWS: '查看数',
LAST_REPLY: '最近回复',
TITLE: '标题',
CONTENT: '内容'
CONTENT: '内容',
POST_BY: '由 {{user}} 发表于 {{createdAt}}',
REPLY_BY_1: '由 {{user}}',
REPLY_BY_2: '回复于 at {{createdAt}}',
REPLY_BY_3: '发表于 at {{createdAt}}'
}
},

View File

@@ -25,10 +25,6 @@
}
.forum-list {
.pagination {
margin-bottom: 5px;
margin-top: 10px;
}
.table-category {
border-radius: 6px;
}
@@ -51,6 +47,9 @@
th {
border: solid 2px @brand-primary;
padding: 13px 10px;
&:first-child {
width: 60%;
}
}
}
}
@@ -77,6 +76,10 @@
}
.forum-info {
margin-left: 60px;
h4 {
font-size: 16px;
margin-top: 2px;
}
}
.moderators-title {
color: #666;
@@ -108,6 +111,81 @@
}
}
.post-list {
.pagination {
margin-bottom: 5px;
margin-top: 10px;
}
.table-category {
border-radius: 6px;
}
table {
border-spacing: 0;
border-collapse: inherit;
border: solid 3px @brand-primary;
@media (max-width: @screen-xs-max) {
max-width: 800px;
}
thead {
background-color: @brand-primary;
border: solid 1px @brand-primary;
color: #efefef;
tr {
th {
border: solid 2px @brand-primary;
padding: 13px 10px;
&:first-child {
width: 60%;
}
}
}
}
tbody {
tr {
td {
border-top: none;
white-space: normal !important;
border-bottom: solid 2px lighten(@brand-primary, 45%);
p {
margin-bottom: 5px;
&:last-child {
margin-bottom: 0;
}
}
.post-icon {
float: left;
font-size: 18px;
margin: 8px 8px;
color: #ccc;
&.has-new-reply {
color: @brand-primary;
}
}
.post-info {
margin-left: 40px;
h4 {
font-size: 16px;
margin-top: 2px;
margin-bottom: 5px;
}
.topic-by {
color: #999;
}
}
}
&:hover {
background-color: #f1f6fb;
}
}
tr:last-child {
td {
border-bottom: none;
}
}
}
}
}
.add-moderator-popover {
max-width: 250px;
max-height: 150px;
@@ -140,5 +218,5 @@
}
.post-view {
margin-bottom: 100px;
margin-bottom: 30px;
}

View File

@@ -65,7 +65,7 @@
</label>
</div>
<li class="status-divider"></li>
<li class="status-divider" style="margin-top: 30px !important;"></li>
<div class="margin-top-5" style="display: table;">
<a class="message-extra" href="https://guides.github.com/features/mastering-markdown/" target="_blank"

View File

@@ -24,7 +24,7 @@
</div>
</div>
<div class="container forum-list">
<div class="container post-list">
<div class="path margin-top-20">
<ol class="breadcrumb">
<li><a ui-sref="forums.list"><span class="small glyphicon glyphicon-home"></span> {{'FORUMS.HOME_INDEX' | translate}}</a></li>
@@ -62,10 +62,36 @@
</tr>
</thead>
<tbody>
<td></td>
<td class="text-center xs-hide"></td>
<td class="text-center xs-hide"></td>
<td class="text-center xs-hide sm-hide"></td>
<tr ng-repeat="t in vm.topics">
<td>
<span class="post-icon glyphicon glyphicon-eye-open" ng-class="{'has-new-reply': $index%2==0}"></span>
<div class="post-info">
<h4><a ui-sref="topics.view({ forumId: f._id, topicId: t._id })">{{t.title}}</a>
<small class="badge badge_mt" ng-show="t.readOnly">R</small>
</h4>
<p class="topic-by small"
translate="FORUMS.FIELDS.POST_BY"
translate-values="{user: t.user.displayName, createdAt: '{{t.createdAt | date: 'yyyy-MM-dd HH:mm:ss'}}' }">
</p>
</div>
</td>
<td class="text-center xs-hide">{{t.replyCount}}</td>
<td class="text-center xs-hide">{{t.viewCount}}</td>
<td class="xs-hide sm-hide">
<div class="small"
translate="FORUMS.FIELDS.REPLY_BY_1"
translate-values="{user: t.user.displayName}"></div>
<div class="small"
ng-if="t._replies.length > 0"
translate="FORUMS.FIELDS.REPLY_BY_2"
translate-values="{createdAt: '{{t.lastReplyAt | date: 'yyyy-MM-dd HH:mm:ss'}}'}"></div>
<div class="small"
ng-if="t._replies.length == 0"
translate="FORUMS.FIELDS.REPLY_BY_3"
translate-values="{createdAt: '{{t.createdAt | date: 'yyyy-MM-dd HH:mm:ss'}}'}"></div>
</td>
</tr>
</tbody>
</table>