Skip to content

Commit

Permalink
Fix claim tables on front page & cleanup (#1291)
Browse files Browse the repository at this point in the history
* Fix claim tables on front page

* Clean docblocks

* Only keep the last release

* Remove redundant docblock altogether

* Decrease padding between icons and titles in claim, achievement, and game tables
  • Loading branch information
luchaos authored Jan 6, 2023
1 parent 924b072 commit 0df183a
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 19 deletions.
11 changes: 9 additions & 2 deletions deploy/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,15 @@ ${PHP_BIN} artisan config:cache

### Cleanup ###

# cleanup releases - keep the last five (pass +6 to tail)
# cleanup releases

# keep the last five (pass +1 to tail)
#cd "${BASEDIR}/${RELEASES_DIR}"
#ls -1t | tail -n +6 | xargs -d '\n' rm -rf --

# keep the last
cd "${BASEDIR}/${RELEASES_DIR}"
ls -1t | tail -n +6 | xargs -d '\n' rm -rf --
ls -1t | tail -n +2 | xargs -d '\n' rm -rf --

# negative -n value not allowed on all systems
#ls -1tr | head -n -5 | xargs -d '\n' rm -rf --
7 changes: 0 additions & 7 deletions lib/render/game.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@ function gameAvatar(

/**
* Render game title, wrapping categories for styling
* @param string $title Raw game title
* @return string The resulting HTML code
*/
function renderGameTitle(?string $title): string
{
Expand Down Expand Up @@ -328,11 +326,6 @@ function RenderGameProgress(int $numAchievements, int $numEarnedCasual, int $num

/**
* Render completion icon, given that player achieved 100% set progress
* @param $awardedCount How many cheevos player has gotten in set
* @param $totalCount How many cheevos set has in total
* @param $hardcoreRatio Percentage of total cheevos earned on hardcore
* @param $tooltip Whether to show hover tooltip or not
* @return string The resulting HTML code
*/
function renderCompletionIcon(
int $awardedCount,
Expand Down
20 changes: 14 additions & 6 deletions lib/render/set-claim.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ function renderNewClaimsComponent(int $count): void
echo "<table class='mb-1'>";
echo "<thead>";
echo "<tr>";
echo "<th></th>";
echo "<th class='pr-0'></th>";
echo "<th>User</th>";
echo "<th class='pr-0'></th>";
echo "<th>Game</th>";
echo "<th class='whitespace-nowrap'>Started</th>";
echo "</tr>";
Expand All @@ -27,14 +28,17 @@ function renderNewClaimsComponent(int $count): void
foreach ($claimData as $claim) {
$claimUser = $claim['User'];
echo "<tr>";
echo "<td>";
echo "<td class='pr-0'>";
echo userAvatar($claimUser, label: false);
echo "</td>";
echo "<td>";
echo userAvatar($claimUser, label: true);
echo "</td>";
echo "<td class='pr-0'>";
echo gameAvatar($claim, label: false);
echo "</td>";
echo "<td class='w-full'>";
echo gameAvatar($claim);
echo gameAvatar($claim, icon: false);
echo "</td>";
echo "<td class='smalldate'>" . getNiceDate(strtotime($claim['Created'])) . "</td>";
echo "</tr>";
Expand All @@ -58,8 +62,9 @@ function renderFinishedClaimsComponent(int $count): void
echo "<table class='mb-1'>";
echo "<thead>";
echo "<tr>";
echo "<th></th>";
echo "<th class='pr-0'></th>";
echo "<th>User</th>";
echo "<th class='pr-0'></th>";
echo "<th>Game</th>";
echo "<th>Type</th>";
echo "<th>Finished</th>";
Expand All @@ -68,14 +73,17 @@ function renderFinishedClaimsComponent(int $count): void
foreach ($claimData as $claim) {
$claimUser = $claim['User'];
echo "<tr>";
echo "<td>";
echo "<td class='pr-0'>";
echo userAvatar($claimUser, label: false);
echo "</td>";
echo "<td>";
echo userAvatar($claimUser, icon: false);
echo "</td>";
echo "<td class='pr-0'>";
echo gameAvatar($claim, label: false);
echo "</td>";
echo "<td class='w-full'>";
echo gameAvatar($claim);
echo gameAvatar($claim, icon: false);
echo "</td>";
echo "<td>" . ($claim['SetType'] == ClaimSetType::NewSet ? ClaimSetType::toString(ClaimSetType::NewSet) : ClaimSetType::toString(ClaimSetType::Revision)) . "</td>";
echo "<td class='smalldate'>" . getNiceDate(strtotime($claim['DoneTime'])) . "</td>";
Expand Down
4 changes: 2 additions & 2 deletions public/achievementList.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
$mark7 = ($sortBy % 10 == 7) ? '&nbsp;*' : '';
$mark8 = ($sortBy % 10 == 8) ? '&nbsp;*' : '';

echo "<th></th>";
echo "<th class='pr-0'></th>";
echo "<th>";
echo "<a href='/achievementList.php?s=$sort1&p=$params$dev_param'>Title</a>$mark1";
echo " / ";
Expand Down Expand Up @@ -168,7 +168,7 @@

echo "<tr>";

echo "<td>";
echo "<td class='pr-0'>";
echo achievementAvatar($achEntry, label: false);
echo "</td>";
echo "<td class='w-full'>";
Expand Down
4 changes: 2 additions & 2 deletions public/gameList.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function ListGames($gamesList, $dev, $queryParams, $sortBy, $showTickets, $showC
$sort6 = ($sortBy == 6) ? 16 : 6;

echo "<tr>";
echo "<th></th>";
echo "<th class='pr-0'></th>";
if ($dev == null) {
echo "<th><a href='/gameList.php?s=$sort1&$queryParams'>Title</a></th>";
echo "<th><a href='/gameList.php?s=$sort2&$queryParams'>Achievements</a></th>";
Expand Down Expand Up @@ -87,7 +87,7 @@ function ListGames($gamesList, $dev, $queryParams, $sortBy, $showTickets, $showC

echo "<tr>";

echo "<td>";
echo "<td class='pr-0'>";
echo gameAvatar($gameEntry, label: false);
echo "</td>";
echo "<td class='w-full'>";
Expand Down

0 comments on commit 0df183a

Please sign in to comment.