feat(torrents): load torrent thumbs-up data on detail page

This commit is contained in:
OldHawk
2017-07-21 16:52:04 +08:00
parent 74d9cf9173
commit 659d15bd45
7 changed files with 51 additions and 22 deletions

View File

@@ -198,10 +198,14 @@
TMDB_INFO_FAILED: 'Load TMDB movie info ERROR',
TAB_VIDEO_INFO: 'Video Info',
TAB_USER_SUBTITLE: 'Subtitle Info',
TAB_THUMBS_LIST: 'Thumbs-up',
TAB_USER_INFO: 'User Info',
TAB_OTHER_TORRENTS: 'Other Torrents',
TAB_MY_PANEL: 'My Pannel',
TAB_ADMIN_PANEL: 'Admin Panel',
THUMBS_UP_TORRENT: 'Thumbs-up for this torrent and donate score ({{number}}) to uploader',
TORRENT_THUMBS_SUCCESSFULLY: 'Thumbs-up for torrent successfully',
TORRENT_THUMBS_FAILED: 'Thumbs-up for torrent failed',
ANNOUNCE_URL: 'Announce Url',
ATTRIBUTE_TAGS: 'Video Attribute (tags)',

View File

@@ -198,10 +198,14 @@
TMDB_INFO_FAILED: '装载 TMDB 电影信息失败',
TAB_VIDEO_INFO: '视频信息',
TAB_USER_SUBTITLE: '字幕信息',
TAB_THUMBS_LIST: '点赞用户',
TAB_USER_INFO: '用户信息',
TAB_OTHER_TORRENTS: '其它种子',
TAB_MY_PANEL: '我的面板',
TAB_ADMIN_PANEL: '管理员面板',
THUMBS_UP_TORRENT: '我要为此种子点赞并赠送 {{number}} 积分给发布者',
TORRENT_THUMBS_SUCCESSFULLY: '为种子点赞成功',
TORRENT_THUMBS_FAILED: '为种子点赞失败',
ANNOUNCE_URL: 'Tracker 地址',
ATTRIBUTE_TAGS: '视频属性(标签)',

View File

@@ -707,7 +707,7 @@ body {
> li {
> a {
margin-right: 5px;
padding: 10px 30px;
padding: 10px 20px;
border-top: 3px solid transparent;
}
&.active {

View File

@@ -12,6 +12,7 @@
marked, ModalConfirmService, $stateParams, TopicsService, localStorageService, $compile, RepliesService, $filter, Upload, DownloadService) {
var vm = this;
vm.forumsConfig = MeanTorrentConfig.meanTorrentConfig.forumsConfig;
vm.scoreConfig = MeanTorrentConfig.meanTorrentConfig.score;
vm.itemsPerPageConfig = MeanTorrentConfig.meanTorrentConfig.itemsPerPage;
vm.appConfig = MeanTorrentConfig.meanTorrentConfig.app;
vm.user = Authentication.user;

View File

@@ -470,24 +470,6 @@
}
}
}
.thumbs-up-list {
margin-top: 20px;
.thumbs-header {
color: #777;
height: 40px;
padding: 15px 15px;
font-weight: 500;
}
.thumbs-users {
border-top: 1px dashed #ddd;
padding: 6px 15px;
width: auto;
.thumbs-item {
margin: 5px 10px;
font-size: 12px;
}
}
}
}
}
.reply-avatar {
@@ -503,6 +485,25 @@
}
}
.thumbs-up-list {
margin-top: 20px;
.thumbs-header {
color: #777;
height: 40px;
padding: 15px 15px;
font-weight: 500;
}
.thumbs-users {
border-top: 1px dashed #ddd;
padding: 6px 15px;
width: auto;
.thumbs-item {
margin: 5px 10px;
font-size: 12px;
}
}
}
.add-moderator-popover {
max-width: 250px;
max-height: 150px;

View File

@@ -104,7 +104,7 @@
<i id="thumbs_{{vm.topic._id}}" class="fa fa-thumbs-up" aria-hidden="true"
mt-scale-by-param="{scale: 3, duration: '.5s'}"
mt-scale-start="false"
title="{{'FORUMS.TITLES.TOPIC_THUMBS_UP' | translate: ({number: vm.forumsConfig.thumbs_up_score}) }}"
title="{{'FORUMS.TITLES.TOPIC_THUMBS_UP' | translate: ({number: vm.scoreConfig.thumbsUpScore.topic}) }}"
>({{vm.topic._thumbs.length}})</i>
</span>
</div>
@@ -177,7 +177,7 @@
<i id="thumbs_{{rep._id}}" class="fa fa-thumbs-up" aria-hidden="true"
mt-scale-by-param="{scale: 3, duration: '.5s'}"
mt-scale-start="false"
title="{{'FORUMS.TITLES.TOPIC_THUMBS_UP' | translate: ({number: vm.forumsConfig.thumbs_up_score}) }}"
title="{{'FORUMS.TITLES.TOPIC_THUMBS_UP' | translate: ({number: vm.scoreConfig.thumbsUpScore.topic}) }}"
>({{rep._thumbs.length}})</i>
</span>
</div>

View File

@@ -310,7 +310,9 @@
</div>
<div class="col-sm-6 text-right">
<button class="btn btn-warning" translate="SUBMIT_CANCEL" ng-click="vm.submitInit();"></button>
<button class="btn btn-success" translate="{{vm.reply_action == 'reply' ? 'SUBMIT_REPLY' : 'SUBMIT_COMMENT'}}" ng-click="vm.submitComment();"
<button class="btn btn-success"
translate="{{vm.reply_action == 'reply' ? 'SUBMIT_REPLY' : 'SUBMIT_COMMENT'}}"
ng-click="vm.submitComment();"
ng-disabled="!vm.new_comment_content"></button>
</div>
</div>
@@ -615,6 +617,23 @@
</div>
</script>
<script type="text/ng-template" id="thumbsInfo.html">
<div class="padding-top-20">
<div class="text-center"><a href="#" ng-click="vm.beginThumbsUp(vm.torrentLocalInfo);">{{'THUMBS_UP_TORRENT' | translate: ({number: vm.scoreConfig.thumbsUpScore.torrent}) }}</a></div>
</div>
<div class="padding-top-20">
<div class="thumbs-up-list" ng-if="vm.torrentLocalInfo._thumbs.length">
<div class="thumbs-header" translate="FORUMS.THUMBS_LIST_HEADER"
translate-values="{number: vm.torrentLocalInfo._thumbs.length}"></div>
<div class="thumbs-users panel-collapsed" id="thumbs-{{rep._id}}">
<span class="thumbs-item"
ng-repeat="sl in vm.torrentLocalInfo._thumbs track by $index"
user-info="sl.user" info-name></span>
</div>
</div>
</div>
</script>
<script type="text/ng-template" id="myPanel.html">
<div class="padding-top-30">
<dl class="dl-horizontal">