Add logo, change date to english format for native pagination

This commit is contained in:
poka 2019-12-17 00:44:01 +01:00
parent 14d7567e15
commit d5f8a7f4ed
3 changed files with 33 additions and 11 deletions

View File

@ -5,6 +5,16 @@ body {
min-width: 1100px;
}
.footer img {
position: sticky;
bottom: 0;
width: 200px;
margin-top: 30px;
}
.header h1 {
}
pre {
font-family: "Gill Sans", sans-serif;
letter-spacing: 0.04em;
@ -60,8 +70,9 @@ a:hover {
margin: 15px;
margin-top: 30px;
min-width: 0px;
font-size: 1.4em;
font-size: 1em;
}
#mainbloc {
margin: 5px;
margin-top: 50px;

View File

@ -5,7 +5,7 @@ if [[ -e $SCRIPTPATH/.env ]]; then source $SCRIPTPATH/.env; else echo "Veuillez
### Initialisation des données ###
startTime=$(date +'%H:%M')
day=$(date +'%d-%m-%y')
day=$(date +'%y-%m-%d')
id=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
indexhtml="$WEBPATH/index.html"
echo -e "\n############# $day à $startTime #############\n"
@ -98,13 +98,9 @@ web() {
[ ! -d $WEBPATH/css ] && cp -r $SCRIPTPATH/css $WEBPATH/
cp $SCRIPTPATH/index-stats.html $indexhtml
datePrevious=$(echo $day | awk -F '-' '{ print $3 "-" $2 "-" $1 }')
datePrevious=$(date +'%y-%m-%d' -d "$datePrevious -1 day")
datePrevious=$(echo $datePrevious | awk -F '-' '{ print $3 "-" $2 "-" $1 }')
datePrevious=$(date +'%y-%m-%d' -d "$day -1 day")
[[ -z $(ls -l $WEBPATH/history/ | grep $datePrevious) && -z $(grep '"display:none;" class="previous"' $indexhtml) ]] && sed -i "s/class=\"previous\"/style=\"display:none;\" class=\"previous\"/g" $indexhtml
dateNext=$(echo $day | awk -F '-' '{ print $3 "-" $2 "-" $1 }')
dateNext=$(date +'%y-%m-%d' -d "$dateNext +1 day")
dateNext=$(echo $dateNext | awk -F '-' '{ print $3 "-" $2 "-" $1 }')
dateNext=$(date +'%y-%m-%d' -d "$day +1 day")
[[ -z $(ls -l $WEBPATH/history/ | grep $dateNext) && -z $(grep '"display:none;" class="next"' $indexhtml) ]] && sed -i "s/class=\"next\"/style=\"display:none;\" class=\"next\"/g" $indexhtml
sed -i "s/_nbrTotalWallets/$nbrTotalWallets/g" $indexhtml
@ -124,8 +120,8 @@ web() {
sed -i "s/_pourcentSimpleWallet/$pourcentSimpleWallet/g" $indexhtml
sed -i "s/_nonConsumedUDT/$nonConsumedUDT/g" $indexhtml
sed -i "s/_monetaryMass/$monetaryMass/g" $indexhtml
[[ -z $(grep '"display:none;" class="previous"' $indexhtml) ]] && sed -i "s/_datePrevious/$datePrevious/g" $indexhtml
[[ -z $(grep '"display:none;" class="next"' $indexhtml) ]] && sed -i "s/_dateNext/$dateNext/g" $indexhtml
[[ -z $(grep '"display:none;" class="previous"' $indexhtml) ]] && sed -i "s/_datePrevious/$datePrevious/g" $indexhtml && setPrevious="Oui"
[[ -z $(grep '"display:none;" class="next"' $indexhtml) ]] && sed -i "s/_dateNext/$dateNext/g" $indexhtml && setNext="Oui"
cat "$outFile" | grep . > $WEBPATH/wallets-g1.txt
echo -e "${MEMBERS[@]}" | sed 's/ /\n/g' > $WEBPATH/wallets-g1-membres.txt
@ -134,10 +130,18 @@ web() {
if [[ "$startTime" == "00:00" ]]; then
cp $indexhtml $WEBPATH/history/index_$day.html
sed -i "s/css\/style.css/..\/css\/style.css/g" $WEBPATH/history/index_$day.html
sed -i "s/logo-axiom-team2.svg/..\/logo-axiom-team2.svg/g" $WEBPATH/history/index_$day.html
sed -i "s/_dateNext/$day/g" $WEBPATH/history/index_$datePrevious.html
sed -i "s/style=\"display:none;\" class=\"next\"/class=\"next\"/g" $WEBPATH/history/index_$datePrevious.html
fi
chown -R www-data:www-data $WEBPATH
echo "--- DEBUG WEB DATE ---"
echo "date: $day"
echo "datePrevious: $datePrevious"
echo "dateNext: $dateNext"
echo "setPrevious: $setPrevious"
echo "setNext: $setNext"
}
### Affichage du nombre de wallets ###

View File

@ -6,7 +6,9 @@
<body>
<center><h1>La Ḡ1 en quelques chiffres</h1></center>
<div class="header">
<center><h1>La Ḡ1 en quelques chiffres</h1></center>
</div>
<div id=mainbloc>
<pre>
@ -42,6 +44,11 @@ Ces données sont mises à jours toutes les 3 heures.<br>
<a href="/history/index__datePrevious.html" class="previous">&#8249;</a>
<a href="/history/index__dateNext.html" class="next">&#8250;</a>
<div class="footer">
<center><img src="logo-axiom-team2.svg" alt="Ḡ1" /></center>
</div>
</body>
</html>