feat(messages): show messageTo icon link in torrent list, torrent detail and ranking page

This commit is contained in:
OldHawk
2017-06-21 15:17:11 +08:00
parent 395e47e624
commit e0637dad30
7 changed files with 35 additions and 12 deletions

View File

@@ -73,7 +73,7 @@
INFO: 'Torrent info',
SIZE: 'Size',
SEEDS_LEECHERS_FINISHED: 'S/L/F',
PUBLISHER: 'Publisher',
PUBLISHER: 'Uploader',
ADMIN_TOOLS: 'Admin Tools',
LIFETIME: 'Life',
VOTES: 'Votes',
@@ -514,6 +514,8 @@
MESSAGE_DELETE_CONFIRM_BODY_TEXT_MANY: 'Are you sure want to delete these messages?',
MESSAGE_DELETE_CONFIRM_BODY_TEXT: 'Are you sure want to delete this message?',
MESSAGE_TO_ICON_TITLE: 'Send a message to',
//chat view
CHAT_USERS_LIST: 'Users List',
CHAT_WELCOME: 'Welcome to join the chat room, please follow the chat rules, and have a good time!',

View File

@@ -514,6 +514,8 @@
MESSAGE_DELETE_CONFIRM_BODY_TEXT_MANY: '您确定要删除选中的这些消息?',
MESSAGE_DELETE_CONFIRM_BODY_TEXT: '您确定要删除该消息?',
MESSAGE_TO_ICON_TITLE: '发送站内消息',
//chat view
CHAT_USERS_LIST: '用户列表',
CHAT_WELCOME: '欢迎进入聊天室,请注意自已的言行,共同维护良好的聊天环境!',

View File

@@ -46,7 +46,7 @@
.message-title {
font-weight: bold;
font-size: 14px;
word-break:break-all;
word-break: break-all;
}
.message-info {
font-size: 12px;
@@ -76,7 +76,7 @@
margin-top: 10px;
}
.message-content {
word-break:break-all;
word-break: break-all;
}
}
@@ -133,3 +133,14 @@
margin-bottom: 8px;
}
.message-to-icon {
margin-left: 5px;
font-size: 12px;
color: #aaa;
&:hover {
color: @brand-primary;
}
i {
top: 2px;
}
}

View File

@@ -40,6 +40,7 @@
<span class="vip-flag" ng-if="user.isVip">
<kbd>VIP</kbd>
</span>
<span message-to="user" to-class="message-to-icon"></span>
</td>
<td class="text-center ranking-active-col">{{user.uploaded | bytes:2}}</td>
<td class="text-center">{{user.downloaded | bytes:2}}</td>
@@ -84,6 +85,7 @@
<span class="vip-flag" ng-if="user.isVip">
<kbd>VIP</kbd>
</span>
<span message-to="user" to-class="message-to-icon"></span>
</td>
<td class="text-center ranking-active-col">{{user.downloaded | bytes:2}}</td>
<td class="text-center">{{user.uploaded | bytes:2}}</td>
@@ -128,6 +130,7 @@
<span class="vip-flag" ng-if="user.isVip">
<kbd>VIP</kbd>
</span>
<span message-to="user" to-class="message-to-icon"></span>
</td>
<td class="text-center ranking-active-col">{{user.ratio}}</td>
<td class="text-center">{{user.uploaded | bytes:2}}</td>
@@ -172,6 +175,7 @@
<span class="vip-flag" ng-if="user.isVip">
<kbd>VIP</kbd>
</span>
<span message-to="user" to-class="message-to-icon"></span>
</td>
<td class="text-center ranking-active-col">{{user.score}}</td>
<td class="text-center">{{user.uploaded | bytes:2}}</td>

View File

@@ -256,13 +256,13 @@
{{item.torrent_finished}}
</p>
</td>
<td class="col-md-1 td-v-middle text-center">{{item.user.displayName}}</td>
<td class="col-md-1 td-v-middle text-center" message-to="item.user" to-class="message-to-icon">{{item.user.displayName}}</td>
</tr>
</tbody>
</table>
</div>
<div class="pagination-div-bottom">
<div class="pa tion-div-bottom">
<ul uib-pagination boundary-links="true" max-size="8" items-per-page="vm.torrentItemsPerPage" total-items="vm.torrentFilterLength"
ng-model="vm.torrentCurrentPage" ng-change="vm.torrentPageChanged()"
first-text="{{ 'PAGE_TEXT_FIRST' | translate}}" previous-text="{{ 'PAGE_TEXT_PREVIOUS' | translate}}"

View File

@@ -215,6 +215,7 @@
<span class="glyphicon glyphicon-arrow-down torrent-down"></span>{{item.user.downloaded | bytes}}
)
</span>
<span message-to="item.user" to-class="message-to-icon"></span>
</div>
<span class="timeline-comment-header-time-text">{{item.createdat | date:'yyyy-MM-dd HH:mm:ss'}}</span>
</div>
@@ -324,6 +325,9 @@
<script type="text/ng-template" id="videoInfo.html">
<div class="padding-top-30">
<dl class="dl-horizontal" style="margin-bottom: 0;">
<dt class="h-line">{{ 'TABLE_FIELDS.PUBLISHER' | translate}}</dt>
<dd class="h-line" message-to="vm.torrentLocalInfo.user" to-class="message-to-icon">{{vm.torrentLocalInfo.user.displayName}}</dd>
<dt class="h-line">{{ 'TRANCKER_URL' | translate}}</dt>
<dd class="h-line">{{vm.torrentLocalInfo.torrent_announce}}</dd>

View File

@@ -564,7 +564,7 @@ exports.list = function (req, res) {
var findQuery = function (callback) {
Torrent.find(condition)
.sort(sort)
.populate('user', 'displayName')
.populate('user', 'username displayName')
.skip(skip)
.limit(limit)
.exec(function (err, torrents) {
@@ -598,29 +598,29 @@ exports.torrentByID = function (req, res, next, id) {
var findTorrents = function (callback) {
Torrent.findById(id)
.populate('user', 'displayName profileImageURL')
.populate('user', 'username displayName profileImageURL')
.populate({
path: '_replies.user',
select: 'displayName profileImageURL uploaded downloaded',
select: 'username displayName profileImageURL uploaded downloaded',
model: 'User'
})
.populate({
path: '_replies._replies.user',
select: 'displayName profileImageURL uploaded downloaded',
select: 'username displayName profileImageURL uploaded downloaded',
model: 'User'
})
.populate({
path: '_subtitles',
populate: {
path: 'user',
select: 'displayName profileImageURL'
select: 'username displayName profileImageURL'
}
})
.populate({
path: '_peers',
populate: {
path: 'user',
select: 'displayName profileImageURL'
select: 'username displayName profileImageURL'
}
})
.exec(function (err, torrent) {
@@ -645,7 +645,7 @@ exports.torrentByID = function (req, res, next, id) {
Torrent.find(condition, fields)
.sort('-createdat')
.populate('user', 'displayName')
.populate('user', 'username displayName')
.exec(function (err, torrents) {
if (err) {
callback(err);