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

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; return -1;
}); });
games.forEach(function(game, index) {
game.querySelector(".nGameNum").innerHTML = (index + 1);
});
list.empty(); list.empty();
list.append(games); list.append(games);
}); });

View file

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

View file

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