Raid anmeldung 2.0

master
sephger 2024-04-22 15:46:40 +02:00
parent 6bb27671fd
commit db6b0eff95
3 changed files with 10 additions and 3 deletions

View File

@ -7,12 +7,14 @@ use WoWPress\Models\Signup;
$id = "raidSignup_" . uniqid(); $id = "raidSignup_" . uniqid();
global $user; global $user;
$chars = [];
if(!empty($this->character->user->ID)){ if(!empty($this->character->user->ID)){
$chars = $this->character->user->characters; $chars = $this->character->user->characters()->where('raidchar',true)->get();
}else{
$chars = [$this->character];
} }
if(empty($chars) || empty($chars->first())){
$chars = [$this->character];
}
?> ?>
<div class="flex <?= $vertical ? "flex-col" : "flex-row" ?> border border-<?= $this->character->color ?> shadow" x-data="{open : false}"> <div class="flex <?= $vertical ? "flex-col" : "flex-row" ?> border border-<?= $this->character->color ?> shadow" x-data="{open : false}">

View File

@ -31,6 +31,8 @@ get_header();
<td class="p-auto hidden lg:table-cell">Rang</td> <td class="p-auto hidden lg:table-cell">Rang</td>
<td class="p-auto hidden lg:table-cell">Server</td> <td class="p-auto hidden lg:table-cell">Server</td>
<td class="p-auto hidden lg:table-cell">Gilde</td> <td class="p-auto hidden lg:table-cell">Gilde</td>
<td class="p-auto hidden lg:table-cell">Raider</td>
<?php if (current_user_can('wowpress_edit_characters')) : ?> <?php if (current_user_can('wowpress_edit_characters')) : ?>
<td class="p-auto hidden lg:table-cell"> <td class="p-auto hidden lg:table-cell">
User User
@ -59,6 +61,8 @@ get_header();
<td class="p-auto hidden lg:table-cell"><?= $char->rank ?></td> <td class="p-auto hidden lg:table-cell"><?= $char->rank ?></td>
<td class="p-auto hidden lg:table-cell"><?= $char->realm ?></td> <td class="p-auto hidden lg:table-cell"><?= $char->realm ?></td>
<td class="p-auto hidden lg:table-cell"><?= $char->guild ?></td> <td class="p-auto hidden lg:table-cell"><?= $char->guild ?></td>
<td class="p-auto hidden lg:table-cell"><?= $char->raidchar?"Ja":"Nein" ?></td>
<?php if (current_user_can('wowpress_edit_characters')) : ?> <?php if (current_user_can('wowpress_edit_characters')) : ?>
<td class="p-auto hidden lg:table-cell"> <td class="p-auto hidden lg:table-cell">
<form action="/request" method="POST"> <form action="/request" method="POST">

View File

@ -13,6 +13,7 @@ class CreateCharacterTable extends CreateTable
'spec' => "text DEFAULT Brave", 'spec' => "text DEFAULT Brave",
'id_blizz' => 'mediumint', 'id_blizz' => 'mediumint',
'id_wowaudit' => 'mediumint', 'id_wowaudit' => 'mediumint',
'raidchar' => 'boolean DEFAULT 0',
'guild' => "text", 'guild' => "text",
'rank' => 'tinyint DEFAULT 99', 'rank' => 'tinyint DEFAULT 99',
'user_id' => 'mediumint', 'user_id' => 'mediumint',