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
|
'text': info.year
|
||||||
}) : null
|
}) : 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);
|
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(){
|
getTitle: function(){
|
||||||
var self = this;
|
var self = this;
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -42,6 +42,8 @@
|
|||||||
line-height: 18px;
|
line-height: 18px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.suggestions .movie_result .data .info .rating,
|
||||||
|
.suggestions .movie_result .data .info .genres,
|
||||||
.suggestions .movie_result .data .info .year {
|
.suggestions .movie_result .data .info .year {
|
||||||
position: static;
|
position: static;
|
||||||
display: block;
|
display: block;
|
||||||
@@ -50,6 +52,11 @@
|
|||||||
opacity: .6;
|
opacity: .6;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.suggestions .movie_result .data .info .rating,
|
||||||
|
.suggestions .movie_result .data .info .genres {
|
||||||
|
font-size: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
.suggestions .movie_result .data {
|
.suggestions .movie_result .data {
|
||||||
cursor: default;
|
cursor: default;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user