Style rating and genres
This commit is contained in:
@@ -223,14 +223,15 @@ Block.Search.Item = new Class({
|
|||||||
'text': info.year
|
'text': info.year
|
||||||
}) : null
|
}) : null
|
||||||
)
|
)
|
||||||
).adopt(
|
).grab(
|
||||||
self.rating = info.rating && info.rating.imdb.length > 0 && info.rating.imdb[0] != '0' ? new Element('span.rating', {
|
self.rating = info.rating && info.rating.imdb.length == 2 && parseFloat(info.rating.imdb[0]) > 0 ? new Element('span.rating', {
|
||||||
'text': info.rating.imdb[0] + '/10'
|
'text': parseFloat(info.rating.imdb[0]),
|
||||||
}) : null
|
'title': parseInt(info.rating.imdb[1]) + ' votes'
|
||||||
).adopt(
|
}) : null
|
||||||
self.genre = info.genres && info.genres.length > 0 ? new Element('span.genres', {
|
).grab(
|
||||||
'text': self.getGenres(info.genres)
|
self.genre = info.genres && info.genres.length > 0 ? new Element('span.genres', {
|
||||||
}) : null
|
'text': info.genres.slice(0, 3).join(', ')
|
||||||
|
}) : null
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -249,17 +250,6 @@ 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 {
|
||||||
|
|||||||
@@ -33,6 +33,7 @@
|
|||||||
top: 15px;
|
top: 15px;
|
||||||
left: 15px;
|
left: 15px;
|
||||||
right: 15px;
|
right: 15px;
|
||||||
|
bottom: 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.suggestions .movie_result .data .info h2 {
|
.suggestions .movie_result .data .info h2 {
|
||||||
@@ -47,14 +48,32 @@
|
|||||||
.suggestions .movie_result .data .info .year {
|
.suggestions .movie_result .data .info .year {
|
||||||
position: static;
|
position: static;
|
||||||
display: block;
|
display: block;
|
||||||
margin: 5px 0 0;
|
|
||||||
padding: 0;
|
padding: 0;
|
||||||
opacity: .6;
|
opacity: .6;
|
||||||
}
|
}
|
||||||
|
|
||||||
.suggestions .movie_result .data .info .rating,
|
.suggestions .movie_result .data .info .year {
|
||||||
|
margin: 10px 0 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.suggestions .movie_result .data .info .rating {
|
||||||
|
font-size: 20px;
|
||||||
|
float: right;
|
||||||
|
margin-top: -20px;
|
||||||
|
}
|
||||||
|
.suggestions .movie_result .data .info .rating:before {
|
||||||
|
content: "\e031";
|
||||||
|
font-family: 'Elusive-Icons';
|
||||||
|
font-size: 14px;
|
||||||
|
margin: 0 5px 0 0;
|
||||||
|
vertical-align: bottom;
|
||||||
|
}
|
||||||
|
|
||||||
.suggestions .movie_result .data .info .genres {
|
.suggestions .movie_result .data .info .genres {
|
||||||
font-size: 10px;
|
font-size: 11px;
|
||||||
|
font-style: italic;
|
||||||
|
text-align: right;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.suggestions .movie_result .data {
|
.suggestions .movie_result .data {
|
||||||
@@ -88,4 +107,3 @@
|
|||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user