fix(home): optimization torrents sale status showed issues

This commit is contained in:
OldHawk
2017-11-23 17:12:10 +08:00
parent c1e1eb3be6
commit 4776f2fce9
18 changed files with 34 additions and 59 deletions

View File

@@ -195,7 +195,7 @@
{{ 'TORRENT_RECOMMEND_LEVEL_ITEM.' + item.torrent_recommended.toUpperCase() | translate}}
</span>
<span class="label label-sale" ng-if="item.isSaling"
title="{{vm.getSaleTypeDesc(item);}} | {{ 'SALE_EXPIRES_TIME' | translate}}: {{item.torrent_sale_expires | date: 'MM-dd HH:mm'}}"
title="{{vm.TGI.getTorrentSaleTypeDesc(item);}} | {{ 'SALE_EXPIRES_TIME' | translate}}: {{item.torrent_sale_expires | date: 'MM-dd HH:mm'}}"
ng-click="$event.stopPropagation();"
ng-class="{'label-default': !item.isSaling, 'label-success': item.isSaling}">
{{item.torrent_sale_status}} {{item.torrent_sale_expires | unlife}}

View File

@@ -137,7 +137,7 @@
{{ 'TORRENT_RECOMMEND_LEVEL_ITEM.' + item.torrent_recommended.toUpperCase() | translate}}
</span>
<span class="label label-sale" ng-if="item.isSaling"
title="{{vm.getSaleTypeDesc(item);}} | {{ 'SALE_EXPIRES_TIME' | translate}}: {{item.torrent_sale_expires | date: 'MM-dd HH:mm'}}"
title="{{vm.TGI.getTorrentSaleTypeDesc(item);}} | {{ 'SALE_EXPIRES_TIME' | translate}}: {{item.torrent_sale_expires | date: 'MM-dd HH:mm'}}"
ng-click="$event.stopPropagation();"
ng-class="{'label-default': !item.isSaling, 'label-success': item.isSaling}">
{{item.torrent_sale_status}} {{item.torrent_sale_expires | unlife}}

View File

@@ -272,20 +272,6 @@
vm.torrentBuildPager();
};
/**
* getSaleTypeDesc
*/
vm.getSaleTypeDesc = function (item) {
var desc = '';
angular.forEach(vm.torrentSalesType.value, function (st) {
if (st.name === item.torrent_sale_status) {
desc = st.desc;
}
});
return desc;
};
/**
* onMoreTagsClicked
*/

View File

@@ -868,20 +868,6 @@
});
};
/**
* getSaleTypeDesc
*/
vm.getSaleTypeDesc = function () {
var desc = '';
angular.forEach(vm.torrentSalesType.value, function (st) {
if (st.name === vm.torrentLocalInfo.torrent_sale_status) {
desc = st.desc;
}
});
return desc;
};
/**
* deleteTorrent
*/

View File

@@ -319,20 +319,6 @@
vm.torrentBuildPager();
};
/**
* getSaleTypeDesc
*/
vm.getSaleTypeDesc = function (item) {
var desc = '';
angular.forEach(vm.torrentSalesType.value, function (st) {
if (st.name === item.torrent_sale_status) {
desc = st.desc;
}
});
return desc;
};
/**
* onMoreTagsClicked
*/

View File

@@ -12,6 +12,7 @@
function TorrentGetInfoServices(MeanTorrentConfig, $state) {
var voteTitleConfig = MeanTorrentConfig.meanTorrentConfig.voteTitle;
var tmdbConfig = MeanTorrentConfig.meanTorrentConfig.tmdbConfig;
var torrentSalesType = MeanTorrentConfig.meanTorrentConfig.torrentSalesType;
var service = {
getTorrentTitle: getTorrentTitle,
@@ -26,7 +27,8 @@
getTorrentLanguage: getTorrentLanguage,
getTorrentOverview: getTorrentOverview,
openTorrentDetailInfo: openTorrentDetailInfo
openTorrentDetailInfo: openTorrentDetailInfo,
getTorrentSaleTypeDesc: getTorrentSaleTypeDesc
};
return service;
@@ -258,5 +260,20 @@
function openTorrentDetailInfo(id) {
$state.go('torrents.view', {torrentId: id});
}
/**
* getTorrentSaleTypeDesc
*/
function getTorrentSaleTypeDesc(item) {
var desc = '';
angular.forEach(torrentSalesType.value, function (st) {
if (st.name === item.torrent_sale_status) {
desc = st.desc;
}
});
return desc;
}
}
}());

View File

@@ -197,7 +197,7 @@
{{ 'TORRENT_RECOMMEND_LEVEL_ITEM.' + item.torrent_recommended.toUpperCase() | translate}}
</span>
<span class="label label-sale" ng-if="item.isSaling"
title="{{vm.getSaleTypeDesc(item);}} | {{ 'SALE_EXPIRES_TIME' | translate}}: {{item.torrent_sale_expires | date: 'MM-dd HH:mm'}}"
title="{{vm.TGI.getTorrentSaleTypeDesc(item);}} | {{ 'SALE_EXPIRES_TIME' | translate}}: {{item.torrent_sale_expires | date: 'MM-dd HH:mm'}}"
ng-click="$event.stopPropagation();"
ng-class="{'label-default': !item.isSaling, 'label-success': item.isSaling}">
{{item.torrent_sale_status}} {{item.torrent_sale_expires | unlife}}

View File

@@ -208,7 +208,7 @@
{{ 'TORRENT_RECOMMEND_LEVEL_ITEM.' + item.torrent_recommended.toUpperCase() | translate}}
</span>
<span class="label label-sale" ng-if="item.isSaling"
title="{{vm.getSaleTypeDesc(item);}} | {{ 'SALE_EXPIRES_TIME' | translate}}: {{item.torrent_sale_expires | date: 'MM-dd HH:mm'}}"
title="{{vm.TGI.getTorrentSaleTypeDesc(item);}} | {{ 'SALE_EXPIRES_TIME' | translate}}: {{item.torrent_sale_expires | date: 'MM-dd HH:mm'}}"
ng-click="$event.stopPropagation();"
ng-class="{'label-default': !item.isSaling, 'label-success': item.isSaling}">
{{item.torrent_sale_status}} {{item.torrent_sale_expires | unlife}}

View File

@@ -587,7 +587,7 @@
<dt class="h-line">{{ 'VIDEO_SALE_INFO' | translate}}</dt>
<dd class="h-line">
<span class="label label-sale"
title="{{vm.getSaleTypeDesc();}} | {{ 'SALE_EXPIRES_TIME' | translate}}: {{vm.torrentLocalInfo.isSaling ? (vm.torrentLocalInfo.torrent_sale_expires | date: 'MM-dd HH:mm') : 'NO'}}"
title="{{vm.TGI.getTorrentSaleTypeDesc(torrentLocalInfo);}} | {{ 'SALE_EXPIRES_TIME' | translate}}: {{vm.torrentLocalInfo.isSaling ? (vm.torrentLocalInfo.torrent_sale_expires | date: 'MM-dd HH:mm') : 'NO'}}"
ng-class="{'label-default': !vm.torrentLocalInfo.isSaling, 'label-success': vm.torrentLocalInfo.isSaling}">
{{vm.torrentLocalInfo.torrent_sale_status}} {{vm.torrentLocalInfo.isSaling ? (vm.torrentLocalInfo.torrent_sale_expires | unlife) : ''}}
</span>
@@ -847,7 +847,7 @@
</span>
</span>
<span class="label label-sale" ng-if="item.isSaling"
title="{{vm.getSaleTypeDesc(item);}} | {{ 'SALE_EXPIRES_TIME' | translate}}: {{item.torrent_sale_expires | date: 'MM-dd HH:mm'}}"
title="{{vm.TGI.getTorrentSaleTypeDesc(item);}} | {{ 'SALE_EXPIRES_TIME' | translate}}: {{item.torrent_sale_expires | date: 'MM-dd HH:mm'}}"
ng-click="$event.stopPropagation();"
ng-class="{'label-default': !item.isSaling, 'label-success': item.isSaling}">
{{item.torrent_sale_status}} {{item.torrent_sale_expires | unlife}}
@@ -1008,7 +1008,7 @@
<div class="margin-top-20" ng-if="vm.announce.privateTorrentCmsMode">
<dt class="h-line">{{ 'ADMIN_SALE_TYPE_SET' | translate}}:</dt>
<dd class="h-line">
<mark>{{vm.getSaleTypeDesc();}}</mark>
<mark>{{vm.TGI.getTorrentSaleTypeDesc(vm.torrentLocalInfo);}}</mark>
</dd>
<div class="padding-top-10 margin-left-50">

View File

@@ -94,7 +94,7 @@
{{ 'TORRENT_RECOMMEND_LEVEL_ITEM.' + item.torrent.torrent_recommended.toUpperCase() | translate}}
</span>
<span class="label label-sale" ng-if="item.torrent.isSaling"
title="{{vm.getSaleTypeDesc(item);}} | {{ 'SALE_EXPIRES_TIME' | translate}}: {{item.torrent.torrent_sale_expires | date: 'MM-dd HH:mm'}}"
title="{{vm.TGI.getTorrentSaleTypeDesc(item.torrent);}} | {{ 'SALE_EXPIRES_TIME' | translate}}: {{item.torrent.torrent_sale_expires | date: 'MM-dd HH:mm'}}"
ng-click="$event.stopPropagation();"
ng-class="{'label-default': !item.torrent.isSaling, 'label-success': item.torrent.isSaling}">
{{item.torrent.torrent_sale_status}} {{item.torrent.torrent_sale_expires | unlife}}

View File

@@ -95,7 +95,7 @@
{{ 'TORRENT_RECOMMEND_LEVEL_ITEM.' + item.torrent.torrent_recommended.toUpperCase() | translate}}
</span>
<span class="label label-sale" ng-if="item.torrent.isSaling"
title="{{vm.getSaleTypeDesc(item);}} | {{ 'SALE_EXPIRES_TIME' | translate}}: {{item.torrent.torrent_sale_expires | date: 'MM-dd HH:mm'}}"
title="{{vm.TGI.getTorrentSaleTypeDesc(item.torrent);}} | {{ 'SALE_EXPIRES_TIME' | translate}}: {{item.torrent.torrent_sale_expires | date: 'MM-dd HH:mm'}}"
ng-click="$event.stopPropagation();"
ng-class="{'label-default': !item.torrent.isSaling, 'label-success': item.torrent.isSaling}">
{{item.torrent.torrent_sale_status}} {{item.torrent.torrent_sale_expires | unlife}}

View File

@@ -90,7 +90,7 @@
{{ 'TORRENT_RECOMMEND_LEVEL_ITEM.' + item.torrent_recommended.toUpperCase() | translate}}
</span>
<span class="label label-sale" ng-if="item.isSaling"
title="{{vm.getSaleTypeDesc(item);}} | {{ 'SALE_EXPIRES_TIME' | translate}}: {{item.torrent_sale_expires | date: 'MM-dd HH:mm'}}"
title="{{vm.TGI.getTorrentSaleTypeDesc(item);}} | {{ 'SALE_EXPIRES_TIME' | translate}}: {{item.torrent_sale_expires | date: 'MM-dd HH:mm'}}"
ng-click="$event.stopPropagation();"
ng-class="{'label-default': !item.isSaling, 'label-success': item.isSaling}">
{{item.torrent_sale_status}} {{item.torrent_sale_expires | unlife}}

View File

@@ -92,7 +92,7 @@
{{ 'TORRENT_RECOMMEND_LEVEL_ITEM.' + item.torrent.torrent_recommended.toUpperCase() | translate}}
</span>
<span class="label label-sale" ng-if="item.torrent.isSaling"
title="{{vm.getSaleTypeDesc(item);}} | {{ 'SALE_EXPIRES_TIME' | translate}}: {{item.torrent.torrent_sale_expires | date: 'MM-dd HH:mm'}}"
title="{{vm.TGI.getTorrentSaleTypeDesc(item.torrent);}} | {{ 'SALE_EXPIRES_TIME' | translate}}: {{item.torrent.torrent_sale_expires | date: 'MM-dd HH:mm'}}"
ng-click="$event.stopPropagation();"
ng-class="{'label-default': !item.torrent.isSaling, 'label-success': item.torrent.isSaling}">
{{item.torrent.torrent_sale_status}} {{item.torrent.torrent_sale_expires | unlife}}

View File

@@ -94,7 +94,7 @@
{{ 'TORRENT_RECOMMEND_LEVEL_ITEM.' + item.torrent.torrent_recommended.toUpperCase() | translate}}
</span>
<span class="label label-sale" ng-if="item.torrent.isSaling"
title="{{vm.getSaleTypeDesc(item);}} | {{ 'SALE_EXPIRES_TIME' | translate}}: {{item.torrent.torrent_sale_expires | date: 'MM-dd HH:mm'}}"
title="{{vm.TGI.getTorrentSaleTypeDesc(item.torrent);}} | {{ 'SALE_EXPIRES_TIME' | translate}}: {{item.torrent.torrent_sale_expires | date: 'MM-dd HH:mm'}}"
ng-click="$event.stopPropagation();"
ng-class="{'label-default': !item.torrent.isSaling, 'label-success': item.torrent.isSaling}">
{{item.torrent.torrent_sale_status}} {{item.torrent.torrent_sale_expires | unlife}}

View File

@@ -94,7 +94,7 @@
{{ 'TORRENT_RECOMMEND_LEVEL_ITEM.' + item.torrent.torrent_recommended.toUpperCase() | translate}}
</span>
<span class="label label-sale" ng-if="item.torrent.isSaling"
title="{{vm.getSaleTypeDesc(item);}} | {{ 'SALE_EXPIRES_TIME' | translate}}: {{item.torrent.torrent_sale_expires | date: 'MM-dd HH:mm'}}"
title="{{vm.TGI.getTorrentSaleTypeDesc(item.torrent);}} | {{ 'SALE_EXPIRES_TIME' | translate}}: {{item.torrent.torrent_sale_expires | date: 'MM-dd HH:mm'}}"
ng-click="$event.stopPropagation();"
ng-class="{'label-default': !item.torrent.isSaling, 'label-success': item.torrent.isSaling}">
{{item.torrent.torrent_sale_status}} {{item.torrent.torrent_sale_expires | unlife}}

View File

@@ -90,7 +90,7 @@
{{ 'TORRENT_RECOMMEND_LEVEL_ITEM.' + item.torrent_recommended.toUpperCase() | translate}}
</span>
<span class="label label-sale" ng-if="item.isSaling"
title="{{vm.getSaleTypeDesc(item);}} | {{ 'SALE_EXPIRES_TIME' | translate}}: {{item.torrent_sale_expires | date: 'MM-dd HH:mm'}}"
title="{{vm.TGI.getTorrentSaleTypeDesc(item);}} | {{ 'SALE_EXPIRES_TIME' | translate}}: {{item.torrent_sale_expires | date: 'MM-dd HH:mm'}}"
ng-click="$event.stopPropagation();"
ng-class="{'label-default': !item.isSaling, 'label-success': item.isSaling}">
{{item.torrent_sale_status}} {{item.torrent_sale_expires | unlife}}

View File

@@ -86,7 +86,7 @@
{{ 'TORRENT_RECOMMEND_LEVEL_ITEM.' + item.torrent.torrent_recommended.toUpperCase() | translate}}
</span>
<span class="label label-sale" ng-if="item.torrent.isSaling"
title="{{vm.getSaleTypeDesc(item);}} | {{ 'SALE_EXPIRES_TIME' | translate}}: {{item.torrent.torrent_sale_expires | date: 'MM-dd HH:mm'}}"
title="{{vm.TGI.getTorrentSaleTypeDesc(item.torrent);}} | {{ 'SALE_EXPIRES_TIME' | translate}}: {{item.torrent.torrent_sale_expires | date: 'MM-dd HH:mm'}}"
ng-click="$event.stopPropagation();"
ng-class="{'label-default': !item.torrent.isSaling, 'label-success': item.torrent.isSaling}">
{{item.torrent.torrent_sale_status}} {{item.torrent.torrent_sale_expires | unlife}}

View File

@@ -135,7 +135,7 @@
{{ 'TORRENT_RECOMMEND_LEVEL_ITEM.' + item.torrent_recommended.toUpperCase() | translate}}
</span>
<span class="label label-sale" ng-if="item.isSaling"
title="{{vm.getSaleTypeDesc(item);}} | {{ 'SALE_EXPIRES_TIME' | translate}}: {{item.torrent_sale_expires | date: 'MM-dd HH:mm'}}"
title="{{vm.TGI.getTorrentSaleTypeDesc(item);}} | {{ 'SALE_EXPIRES_TIME' | translate}}: {{item.torrent_sale_expires | date: 'MM-dd HH:mm'}}"
ng-click="$event.stopPropagation();"
ng-class="{'label-default': !item.isSaling, 'label-success': item.isSaling}">
{{item.torrent_sale_status}} {{item.torrent_sale_expires | unlife}}