Add Rating / Genre to Dashboard Suggestions
Add Rating and up to 3 Genres to movie suggestions, to avoid constantly jumping through to IMDB site.
This commit is contained in:
@@ -223,6 +223,14 @@ Block.Search.Item = new Class({
|
||||
'text': info.year
|
||||
}) : null
|
||||
)
|
||||
).adopt(
|
||||
self.rating = info.rating && info.rating.imdb.length > 0 && info.rating.imdb[0] != '0' ? new Element('span.rating', {
|
||||
'text': info.rating.imdb[0] + '/10'
|
||||
}) : null
|
||||
).adopt(
|
||||
self.genre = info.genres && info.genres.length > 0 ? new Element('span.genres', {
|
||||
'text': self.getGenres(info.genres)
|
||||
}) : null
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -241,6 +249,17 @@ Block.Search.Item = new Class({
|
||||
self.alternative_titles.include(alternative);
|
||||
},
|
||||
|
||||
getGenres: function(data){
|
||||
var self = this;
|
||||
var genres = [];
|
||||
|
||||
for (var i=0;i<data.length && i<3;i++) {
|
||||
genres[i] = data[i];
|
||||
}
|
||||
|
||||
return genres.join(' | ');
|
||||
},
|
||||
|
||||
getTitle: function(){
|
||||
var self = this;
|
||||
try {
|
||||
|
||||
@@ -42,6 +42,8 @@
|
||||
line-height: 18px;
|
||||
}
|
||||
|
||||
.suggestions .movie_result .data .info .rating,
|
||||
.suggestions .movie_result .data .info .genres,
|
||||
.suggestions .movie_result .data .info .year {
|
||||
position: static;
|
||||
display: block;
|
||||
@@ -50,6 +52,11 @@
|
||||
opacity: .6;
|
||||
}
|
||||
|
||||
.suggestions .movie_result .data .info .rating,
|
||||
.suggestions .movie_result .data .info .genres {
|
||||
font-size: 10px;
|
||||
}
|
||||
|
||||
.suggestions .movie_result .data {
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user