Нумерация игр в алфавитном порядке

This commit is contained in:
Alexander Yakovlev 2018-12-11 20:24:21 +07:00
parent be55530bd0
commit b37cd68daf
3 changed files with 12 additions and 1 deletions

View file

@ -35,6 +35,9 @@ jQuery(document).ready(function($){
}
return -1;
});
games.forEach(function(game, index) {
game.querySelector(".nGameNum").innerHTML = (index + 1);
});
list.empty();
list.append(games);
});

View file

@ -153,9 +153,16 @@ aside.widget {
.nGameHeader {
.nRating {
float: right;
font-weight: bold;
}
.nRating, .nGameNum {
font-size: $font-size-base * 1.2;
margin-top: $font-size-base * 0.25;
font-weight: bold;
}
.nGameNum {
float: left;
margin-right: $font-size-base;
color: grey;
}
.nGameName {
font-size: $h3-font-size;

View file

@ -102,6 +102,7 @@ function gamelist($atts){
if (isset($rating) && !empty($rating) && $rating !== '0+' && $rating !== '6+') {
$retval .= '<div class="nRating">'.$rating.'</div>';
}
$retval .= '<span class="nGameNum"></span>';
$retval .= '<div class="nGameName">'.
'<a target="_blank" href="'.$url.'">'.$title.'</a></div>';
$retval .= '<div class="nMeta">';