Skip to content

Commit

Permalink
home view data load
Browse files Browse the repository at this point in the history
  • Loading branch information
taobataoma committed May 16, 2017
1 parent f091c36 commit 6c6bbb4
Show file tree
Hide file tree
Showing 7 changed files with 294 additions and 80 deletions.
1 change: 1 addition & 0 deletions config/env/torrents.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ module.exports = {
//please change it to your api key from themoviedb.org
key: '7888f0042a366f63289ff571b68b7ce0',
backdrop_img_base_url: 'http://image.tmdb.org/t/p/w1280',
backdrop_img_base_url_300: 'http://image.tmdb.org/t/p/w300',
poster_img_base_url: 'http://image.tmdb.org/t/p/w500',
poster_list_base_url: 'http://image.tmdb.org/t/p/w92',
cast_img_base_url: 'http://image.tmdb.org/t/p/w132_and_h132_bestv2'
Expand Down
20 changes: 19 additions & 1 deletion modules/core/client/controllers/home.client.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
function HomeController($scope, $state, $translate, Authentication, TorrentsService, Notification, MeanTorrentConfig, getStorageLangService) {
var vm = this;
vm.tmdbConfig = MeanTorrentConfig.meanTorrentConfig.tmdbConfig;

vm.movieTopList = undefined;
vm.movieNewList = undefined;

vm.info_is_ready = false;

Expand Down Expand Up @@ -57,14 +59,30 @@
*/
vm.getMovieTopInfo = function () {
vm.moviesInfo = TorrentsService.get({
limit: 16
torrent_status: 'reviewed',
torrent_type: 'movie',
limit: 8
}, function (items) {
vm.movieTopList = items.rows;
}, function (err) {
Notification.error({
message: '<i class="glyphicon glyphicon-remove"></i> ' + $translate.instant('TOP_MOVIE_INFO_ERROR')
});
});

vm.moviesInfo = TorrentsService.get({
torrent_status: 'reviewed',
torrent_type: 'movie',
newest: true,
limit: 10
}, function (items) {
vm.movieNewList = items.rows;
console.log(vm.movieNewList);
}, function (err) {
Notification.error({
message: '<i class="glyphicon glyphicon-remove"></i> ' + $translate.instant('TOP_MOVIE_INFO_ERROR')
});
});
};

/**
Expand Down
176 changes: 144 additions & 32 deletions modules/core/client/less/mt.less
Original file line number Diff line number Diff line change
Expand Up @@ -88,26 +88,27 @@ body {
&:hover {
background-color: #efefef;
background-color: rgba(224, 224, 224, .3);
.torrent-user-info {
opacity: 1;
color: #fff;
}
.torrent-tmdb-info {
opacity: 1;
color: #fff;
}
> img {
opacity: 1;
}
}
> img {
opacity: 0.8;
&:hover {
opacity: 1;
+ .torrent-user-info {
opacity: 1;
color: #fff;
}
}
}
.caption {
padding: 5px 3px;
padding: 5px 3px 2px;
ul {
margin-bottom: 0;
}
}
.release-date {
color: #000;
}
}

.torrent-votes {
Expand All @@ -125,45 +126,64 @@ body {
}
}

.torrent-user-info {
.col-small-padding {
padding: 0 5px;
}

.col-no-padding {
padding: 0;
}

.torrent-tmdb-info {
display: table-cell;
position: absolute;
top: 4px;
left: 20px;
right: 20px;
padding: 8px 0;
bottom: 52px;
left: 10px;
right: 10px;
padding: 6px 5px;

background-color: @mt-body-background-color;
background-color: rgba(0, 0, 0, .7);
color: #ddd;
opacity: 0.8;
&:hover {
opacity: 1;
color: #fff;
}
> ul {
margin-left: 0;
margin-bottom: 0;
}
.release-date {
color: #ccc;
}
}

.torrent-user-info {
font-size: 12px;
display: table-cell;
position: absolute;
top: 5px;
left: 10px;
right: 10px;
padding: 6px 5px;

background-color: @mt-body-background-color;
background-color: rgba(0, 0, 0, .7);
color: #ddd;
opacity: 0.8;
table {
width: 100%;
tr {
td {
width: auto;
}
}
}
.torrent-up {
color: #33CC00;
}
.torrent-down {
color: #FF3300;
}
.torrent-finished {
color: #33FFFF;
}

&.small-info {
@media (min-width: @screen-md-min) {
padding: 5px 0;
font-size: 12px;
.list-inline > li {
padding-left: 1px;
padding-right: 1px;
}
}
color: #0366d6;
}
}

Expand All @@ -179,6 +199,98 @@ body {
}
}

.panel-newest-list {
@media (max-width: @screen-md-min) {
display: none;
}
.h5,
h5 {
margin-top: 0;
margin-bottom: 0;
}
table {
width: 100%;
tr {
&.show-big {
.newest-item-big {
display: block;
}
.newest-item-small {
display: none;
}
}
&.hide-big {
.newest-item-big {
display: none;
}
.newest-item-small {
display: block;
}
}
td {
cursor: pointer;
max-width: 0;
&:hover {
.newest-info {
color: #fff;
opacity: 1;
}
.newest-user-info {
color: #fff;
opacity: 1;
}
}
}
}
}
.newest-item-small {
padding: 0 5px;
}
.newest-item-big {
position: relative;
img {
width: 100%;
}
.newest-info {
position: absolute;
bottom: 32px;
left: 0;
right: 0;
margin-bottom: -32px;
padding: 6px 5px;

background-color: @mt-body-background-color;
background-color: rgba(0, 0, 0, .7);
color: #ddd;
opacity: 0.8;
}
.newest-user-info {
font-size: 12px;
position: absolute;
top: 0;
left: 0;
right: 0;
margin-bottom: -32px;
padding: 6px 5px;

background-color: @mt-body-background-color;
background-color: rgba(0, 0, 0, .7);
color: #ddd;
opacity: 0.8;

.torrent-up {
color: #33CC00;
}
.torrent-down {
color: #FF3300;
}
.torrent-finished {
color: #0366d6;
}
}
}
}

.btn-tag {
width: 100px;
&,
Expand Down
Loading

0 comments on commit 6c6bbb4

Please sign in to comment.