bring back modern look for achievement cards

This commit is contained in:
marko
2021-12-25 17:25:55 +01:00
parent b9e1a8fd63
commit a3d8b212bb
5 changed files with 39 additions and 33 deletions

View File

@@ -75,30 +75,26 @@ processPostData($dbConnection, $_POST);
<?php <?php
if( hasUserAttribute($dbConnection, $_SESSION['user']['userId'], "inTraining" ) ){ if( hasUserAttribute($dbConnection, $_SESSION['user']['userId'], "inTraining" ) ){
echo( "<h2>Eigene Achievements</h2>" ); echo( "<h2>Eigene Achievements</h2>" );
// echo( htmlUsersUploadBox($dbConnection, $_SESSION['user']['userId']) ); echo( "<div style=\"display:flex; flex-wrap:wrap; align-items:stretch;\" class=\"row\">");
echo(htmlAchievementListForUser( foreach($achievementGroups as $g){
$dbConnection, echo($g->asHtmlCard($_SESSION['user']['userId']));
$achievementGroups, }
$_SESSION['user']['userId'], echo("</div>" );
getUsersAchievements($dbConnection, $_SESSION['user']['userId'])
));
} }
?> ?>
<?php <?php // show the achievements of each kid
$usersKids = getUsersKids($dbConnection, $_SESSION['user']['userId']); $usersKids = getUsersKids($dbConnection, $_SESSION['user']['userId']);
foreach($usersKids as $k){ foreach($usersKids as $k){
if( hasUserAttribute($dbConnection, $k['kidId'], "inTraining" ) and ($k['kidId']!=$_SESSION['user']['userId']) ){ if( hasUserAttribute($dbConnection, $k['kidId'], "inTraining" ) ){
echo( "<h2>".$k['vorname']." ".$k['name']."</h2>" ); echo( "<h2>".$k['vorname']." ".$k['name']."</h2>" );
// echo( htmlUsersUploadBox($dbConnection, $k['kidId']) ); echo( "<div style=\"display:flex; flex-wrap:wrap; align-items:stretch;\" class=\"row\">");
echo(htmlAchievementListForUser( foreach($achievementGroups as $g){
$dbConnection, echo($g->asHtmlCard($k['kidId'], ['noForm'=>false]));
$achievementGroups,
$k['id'],
getUsersAchievements($dbConnection, $k['id'])
));
} }
} }
echo("</div>" );
}
?> ?>
<?php <?php

View File

@@ -197,7 +197,18 @@ SQL;
// image + title // image + title
if($this->imageUrl != null){ if($this->imageUrl != null){
$retHtml .= "<div class=\"card-image\"><img src=\"".$this->imageUrl."\">"; $retHtml .= "<div class=\"card-image\">";
$ext = pathinfo($this->imageUrl, PATHINFO_EXTENSION);
$ret."<div>".$this->imageUrl."</div>";
$ret."<div>".$ext."</div>";
switch($ext){
case "webm":
$retHtml .= "<video controls><source src=\"".$this->imageUrl."\" type=\"video/webm\">Video tag is not supported in this browser.</video>";
break;
default:
$retHtml .= "<img src=\"".$this->imageUrl."\">";
break;
};
$retHtml .= "<span class=\"card-title\">".$this->name."</span>"; $retHtml .= "<span class=\"card-title\">".$this->name."</span>";
$retHtml .= "</div>"; $retHtml .= "</div>";
} }

View File

@@ -41,7 +41,7 @@ class record{
"ON `wkParticipo_Users`.`id` = `achievements<=>user`.`userId` ". "ON `wkParticipo_Users`.`id` = `achievements<=>user`.`userId` ".
( (
($from!=null&&$to!=null)? ($from!=null&&$to!=null)?
("BETWEEN CONVERT(\"".$from."\", datetime) AND CONVERT(\"".$to."\", datetime) "): (" WHERE `achievements<=>user`.`timestamp` BETWEEN CONVERT(\"".$from."\", datetime) AND CONVERT(\"".$to."\", datetime) "):
("") ("")
). ).
"GROUP BY `wkParticipo_Users`.`id` ". "GROUP BY `wkParticipo_Users`.`id` ".

View File

@@ -13,4 +13,3 @@
.parsedownCard img{ .parsedownCard img{
max-width: 100%; max-width: 100%;
} }