Skip to content

Commit

Permalink
edit the Torrent Model files, add torrent_status and torrent_recommen…
Browse files Browse the repository at this point in the history
…d fields
  • Loading branch information
taobataoma committed Apr 4, 2017
1 parent c51aa69 commit b1f2d53
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 13 deletions.
6 changes: 5 additions & 1 deletion modules/core/client/app/trans-string-cn.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,12 @@
],

//HomeController & home views
LOADING_TOP: '正在推荐资源,请稍候...',
TOP_MOVIE_INFO_ERROR: '获取电影Top列表失败',
TITLE_SEEDS: '做种用户数',
TITLE_LEECHERS: '正在下载数',
TITLE_FINISHED: '完成下载数',
TITLE_IMDB_VOTES: 'IMDB 评分',

//TorrentsUploadsController
TORRENTS_UPLOAD_SUCCESSFULLY: '文件上传成功',
Expand All @@ -79,7 +84,6 @@
CANCEL_BUTTON: '算了,以后再说',
AGREE_RULES: '我已阅读并同意站内所有协议条款,<a href="#">协议条款</a>',
DOWNLOAD_TORRENT: '下载种子',
LOADING_TOP: '正在推荐资源,请稍候...',

//footer view
MIT_PROTOCOL: '本项目源码受 <a href="https://github.com/twbs/bootstrap/blob/master/LICENSE" target="_blank">MIT</a> 开源协议保护',
Expand Down
2 changes: 1 addition & 1 deletion modules/core/client/app/trans-string-en.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
],

//HomeController & home views
LOADING_TOP: 'Loading recommended info, please waiting...',
TOP_MOVIE_INFO_ERROR: 'Get movie top info faild',
TITLE_SEEDS: 'Seeds users',
TITLE_LEECHERS: 'Leechers users',
Expand Down Expand Up @@ -83,7 +84,6 @@
CANCEL_BUTTON: 'NO, CANCEL IT',
AGREE_RULES: 'I agree and already read all the rules, <a href="#">read here</a>',
DOWNLOAD_TORRENT: 'Download Torrent',
LOADING_TOP: 'Loading recommended info, please waiting...',

//footer view
MIT_PROTOCOL: 'The source of this project is protected by <a href="https://github.com/twbs/bootstrap/blob/master/LICENSE" target="_blank">MIT</a> open source protocol',
Expand Down
54 changes: 46 additions & 8 deletions modules/core/client/less/mt.less
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,18 @@
}

.post-info-img {
cursor: pointer;
&:hover {
background-color: rgba(224, 224, 224, .3);
}
> img {
opacity: 0.8;
&:hover {
cursor: pointer;
opacity: 1;
+ .torrent-user-info {
opacity: 1;
color: #fff;
}
}
}
.caption {
Expand All @@ -73,14 +80,45 @@
margin-bottom: 0;
}
}
.star-votes {
color: #FF6600;
+ span {
color: #FF6600;
}
}
.release-date {
color: #FF6600;
color: #000;
}
}

.torrent-votes {
color: #FF6600;
> kbd {
background-color: #FF6600;
}
}

.torrent-user-info {
display: table-cell;
position: absolute;
top: 4px;
left: 20px;
right: 20px;
padding: 8px 0;

background-color: #2a2730;
background-color: rgba(0, 0, 0, .8);
color: #ddd;
opacity: 0.8;
&:hover {
opacity: 1;
color: #fff;
}
> ul {
margin-left: 0;
margin-bottom: 0;
}
.torrent-up {
color: #33CC00;
}
.torrent-down {
color: #FF3300;
}
.torrent-finished {
color: #33FFFF;
}
}
15 changes: 12 additions & 3 deletions modules/core/client/views/home.client.view.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ <h3 translate="LOADING_TOP" class="text-capitalize"></h3>
<!--<dd class="h-line">${{vm.movieinfo.revenue}}</dd>-->

<dt class="h-line">{{ 'TMDB_FIELDS.VOTE_AVERAGE' | translate}}:</dt>
<dd class="h-line">{{vm.movieinfo.vote_average}} / {{vm.movieinfo.vote_count}} {{ 'TMDB_FIELDS.VOTE_UNIT' | translate}}</dd>
<dd class="h-line"><span class="torrent-votes"><kbd>IMDB</kbd></span> {{vm.movieinfo.vote_average}} / {{vm.movieinfo.vote_count}} {{ 'TMDB_FIELDS.VOTE_UNIT' | translate}}</dd>

<!--<dt class="h-line">{{ 'TMDB_FIELDS.IMDB_LINK' | translate}}:</dt>-->
<!--<dd class="h-line"><a href="https://www.themoviedb.org/movie/{{vm.movieinfo.imdb_id}}"-->
Expand Down Expand Up @@ -137,12 +137,21 @@ <h3 translate="LOADING_TOP" class="text-capitalize"></h3>
<img ng-src="{{vm.tmdbConfig.poster_img_base_url}}{{item.torrent_img}}" alt="{{item.torrent_title}}"
class="img-responsive">

<div class="torrent-user-info">
<ul class="list-unstyled list-inline">
<li title="{{ 'TITLE_SEEDS' | translate}}"><span class="glyphicon glyphicon-arrow-up torrent-up"></span><span>356</span></li>
<li title="{{ 'TITLE_LEECHERS' | translate}}"><span class="glyphicon glyphicon-arrow-down torrent-down"></span><span>24</span></li>
<li title="{{ 'TITLE_FINISHED' | translate}}" class="pull-right"><span
class="glyphicon glyphicon-ok torrent-finished"></span><span>1622</span></li>
</ul>
</div>

<div class="caption">
<ul class="list-unstyled">
</li>
<li style="white-space: nowrap; overflow:hidden; text-overflow: ellipsis;">
<strong>{{item.torrent_title}}</strong>
<li><span class="glyphicon glyphicon-star star-votes"></span><span>{{item.torrent_imdb_votes}}</span><span class="pull-right release-date">{{item.torrent_release}}</span></li>
<li><span class="release-date">{{item.torrent_release}}</span><span title="{{ 'TITLE_IMDB_VOTES' | translate}}"
class="pull-right torrent-votes"><kbd>IMDB</kbd> {{item.torrent_imdb_votes}}</span></li>
</ul>
</div>
</div>
Expand Down
11 changes: 11 additions & 0 deletions modules/torrents/server/models/torrent.server.model.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,17 @@ var TorrentSchema = new Schema({
default: '2017',
trim: true
},
torrent_status: {
type: [{
type: String,
enum: ['new', 'reviewed', 'deleted']
}],
default: ['newer']
},
torrent_recommended: {
type: Number,
default: 0
},
last_scrape: {
type: Date,
default: Date.now
Expand Down

0 comments on commit b1f2d53

Please sign in to comment.