construct rank classes with rank for current season
authorMischa POSLAWSKY <perl@shiar.org>
Wed, 24 Jul 2019 02:03:22 +0000 (04:03 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Wed, 24 Jul 2019 02:03:22 +0000 (04:03 +0200)
Code cleanup with fixed 'undefined' suffix for the current season.

widget.html

index 4424a53361c5662e240fb3787ad9093857a57f79..c070def7b3363db632c73eb244fa65e1f16a0984 100644 (file)
                        <h1>${clan.tag || clan.members[0].name}</h1>
                        <ul class=ladders>
                        ${clan.ladders.map(ladder => `
-                               <li class="rank ${ladder.league} tier${tiernum(ladder.rank)}${ladder.season && ' old'}"
+                               <li class="rank ${[
+                                       ladder.league,
+                                       ' tier' + tiernum(ladder.rank),
+                                       ladder.season ? ' old' : null,
+                               ].join('')}"
                                 title="Division ${ladder.division} (${ladder.wins}:${ladder.losses})">
                                        ${ladder.league} <small>#${ladder.rank}</small>
                                </li>