WowPress-Tailwind/theme/pages/roster.php

54 lines
2.1 KiB
PHP
Raw Normal View History

2024-04-15 16:00:49 +02:00
<?php
use WoWPress\Api\BattleNet;
use WoWPress\Database\Cache;
use WoWPress\Models\Character;
global $widget_area;
$characters = Character::orderBy('rank')->get();
get_header();
?>
<section id="primary">
<main id="main">
<div class="bg-glass shadow p-auto">
<table class="table-auto w-full">
<thead class="bg-glass">
<tr>
<td class="p-auto">Name</td>
<td class="p-auto">Klasse</td>
<td class="p-auto">Rang</td>
<td class="p-auto">Server</td>
</tr>
</thead>
<tbody class="bg-slate-900">
<?php foreach($characters as $char): ?>
<tr class="text-<?=$char->color?>">
<td class="p-auto">
<div class="flex flex-row gap-2 items-center">
<img class="w-[42px] aspect-1 rounded-full" src="<?=$char->avatar?>" alt="">
<span><?=$char->name?></span>
</div>
</td>
<td class="p-auto">
<div class="flex flex-row gap-2 items-center">
<img class="w-[30px] aspect-1 rounded-full" src="<?=$char->class_icon?>" alt="">
<img class="w-[30px] aspect-1 rounded-full" src="<?=$char->spec_icon?>" alt="">
<span><?=translate_string($char->class)?> - <?=translate_string($char->spec)?></span>
</div>
</td>
<td class="p-auto"><?=$char->rank?></td>
<td class="p-auto"><?=$char->realm?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
</main><!-- #main -->
</section><!-- #primary -->
<?php
get_footer();