Show the correct medal

This commit is contained in:
Vincent Riquer 2015-02-02 11:21:25 +01:00
parent 3ee152c31e
commit 1b67f9fd39
2 changed files with 10 additions and 9 deletions

16
index
View File

@ -179,7 +179,7 @@ then
&& maxtimestamp=$timestamp
for stat in ${nextsilver[timestamp]}
do
tableline+=( "$(print_medal $timestamp $stat ${upsilver[$stat]})" )
tableline+=( "$(print_medal $timestamp $stat ${upsilver[$stat]} silver)" )
tableline+=( '<br />' )
(( ++count == lvlsilver[level] - silvercount )) && break 2
done
@ -189,7 +189,7 @@ then
do
(( count >= lvlsilver[level] - silvercount )) && break 1
(( count < lvlsilver[level] - silvercount )) && never=1
tableline+=( "$(print_medal $timestamp $stat ${upsilver[$stat]})" )
tableline+=( "$(print_medal $timestamp $stat ${upsilver[$stat]} silver)" )
tableline+=( '<br />' )
(( count++ ))
done
@ -210,7 +210,7 @@ then
&& maxtimestamp=$timestamp
for stat in ${nextgold[timestamp]}
do
tableline+=( "$(print_medal $timestamp $stat ${upgold[$stat]})" )
tableline+=( "$(print_medal $timestamp $stat ${upgold[$stat]} gold)" )
tableline+=( '<br />' )
(( ++count == lvlgold[level] - goldcount )) && break 2
done
@ -220,7 +220,7 @@ then
do
(( count >= lvlgold[level] - goldcount )) && break 1
(( count < lvlgold[level] - goldcount )) && never=1
tableline+=( "$(print_medal $timestamp $stat ${upgold[$stat]})" )
tableline+=( "$(print_medal $timestamp $stat ${upgold[$stat]} gold)" )
tableline+=( '<br />' )
(( count++ ))
done
@ -241,7 +241,7 @@ then
&& maxtimestamp=$timestamp
for stat in ${nextplatinum[timestamp]}
do
tableline+=( "$(print_medal $timestamp $stat ${upplatinum[$stat]})" )
tableline+=( "$(print_medal $timestamp $stat ${upplatinum[$stat]} platinum)" )
tableline+=( '<br />' )
(( ++count == lvlplatinum[level] - platinumcount )) && break 2
done
@ -251,7 +251,7 @@ then
do
(( count >= lvlplatinum[level] - platinumcount )) && break 1
(( count < lvlplatinum[level] - platinumcount )) && never=1
tableline+=( "$(print_medal $timestamp $stat ${upplatinum[$stat]})" )
tableline+=( "$(print_medal $timestamp $stat ${upplatinum[$stat]} platinum)" )
tableline+=( '<br />' )
(( count++ ))
done
@ -272,7 +272,7 @@ then
&& maxtimestamp=$timestamp
for stat in ${nextblack[timestamp]}
do
tableline+=( "$(print_medal $timestamp $stat ${upblack[$stat]})" )
tableline+=( "$(print_medal $timestamp $stat ${upblack[$stat]} black)" )
tableline+=( '<br />' )
(( ++count == lvlblack[level] - blackcount )) && break 2
done
@ -282,7 +282,7 @@ then
do
(( count >= lvlblack[level] - blackcount )) && break 1
(( count < lvlblack[level] - blackcount )) && never=1
tableline+=( "$(print_medal $timestamp $stat ${upblack[$stat]})" )
tableline+=( "$(print_medal $timestamp $stat ${upblack[$stat]} black)" )
tableline+=( '<br />' )
(( count++ ))
done

View File

@ -5,6 +5,7 @@ print_medal() {
timestamp=$1 \
stat=$2 \
percent=$3 \
level=$4 \
if (( timestamp ))
then
@ -22,7 +23,7 @@ print_medal() {
href="?hist&amp;start=$start&amp;end=$end#$stat">
<img
class="badge"
src="/${img//_/-}-silver.png"
src="/${img//_/-}-$level.png"
title="$stat $percent%"
alt="$stat silver" />
</a>&nbsp;($thisdate)