Style rating and genres

This commit is contained in:
Ruud
2013-07-12 14:36:04 +02:00
parent 9be10f7b79
commit 1cea786d66
2 changed files with 45 additions and 37 deletions

View File

@@ -223,14 +223,15 @@ 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
).grab(
self.rating = info.rating && info.rating.imdb.length == 2 && parseFloat(info.rating.imdb[0]) > 0 ? new Element('span.rating', {
'text': parseFloat(info.rating.imdb[0]),
'title': parseInt(info.rating.imdb[1]) + ' votes'
}) : null
).grab(
self.genre = info.genres && info.genres.length > 0 ? new Element('span.genres', {
'text': info.genres.slice(0, 3).join(', ')
}) : null
)
)
)
@@ -249,17 +250,6 @@ 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 {

View File

@@ -16,59 +16,78 @@
width: 50%;
}
}
@media all and (max-width: 600px) {
.suggestions .movie_result {
width: 100%;
}
}
.suggestions .movie_result .data {
left: 100px;
background: #4e5969;
border: none;
}
.suggestions .movie_result .data .info {
top: 15px;
left: 15px;
right: 15px;
bottom: 15px;
}
.suggestions .movie_result .data .info h2 {
white-space: normal;
max-height: 120px;
font-size: 18px;
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;
margin: 5px 0 0;
padding: 0;
opacity: .6;
}
.suggestions .movie_result .data .info .rating,
.suggestions .movie_result .data .info .genres {
font-size: 10px;
.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 {
font-size: 11px;
font-style: italic;
text-align: right;
}
.suggestions .movie_result .data {
cursor: default;
cursor: default;
}
.suggestions .movie_result .options {
left: 100px;
}
.suggestions .movie_result .thumbnail {
width: 100px;
}
.suggestions .movie_result .actions {
position: absolute;
bottom: 10px;
@@ -82,10 +101,9 @@
.suggestions .movie_result .data.open .actions {
display: none;
}
.suggestions .movie_result .actions a {
margin-left: 10px;
vertical-align: middle;
}