Comments
parent
4b9a73238c
commit
53062fbae1
|
@ -62,7 +62,7 @@ add_action('template_redirect', function () {
|
||||||
<div style="display:flex;flex-direction:column;gap:1em;">
|
<div style="display:flex;flex-direction:column;gap:1em;">
|
||||||
<div>Message: <?=$log->message?></div>
|
<div>Message: <?=$log->message?></div>
|
||||||
<div>Action: <?=$log->action?></div>
|
<div>Action: <?=$log->action?></div>
|
||||||
<div>Logged: <?=format_date($log->created_at,"dd.mm.YY HH:MM")?></div>
|
<div>Logged: <?=format_date($log->created_at,"dd.MM.YY HH:mm")?></div>
|
||||||
</div>
|
</div>
|
||||||
<hr style="width:100%">
|
<hr style="width:100%">
|
||||||
<?php
|
<?php
|
||||||
|
|
|
@ -42,6 +42,26 @@
|
||||||
"Shaman": "Schamane",
|
"Shaman": "Schamane",
|
||||||
"Elemental": "Elementar",
|
"Elemental": "Elementar",
|
||||||
"Enhancement": "Verstärkung",
|
"Enhancement": "Verstärkung",
|
||||||
"Restoration": "Wiederherstellung"
|
"Restoration": "Wiederherstellung",
|
||||||
|
|
||||||
|
"Death Knight": "Todesritter",
|
||||||
|
"Blood" : "Blut",
|
||||||
|
"Frost" : "Frost",
|
||||||
|
"Unholy": "Unheilig",
|
||||||
|
|
||||||
|
"Mage": "Magier",
|
||||||
|
"_Frost": "Frost",
|
||||||
|
"Fire": "Feuer",
|
||||||
|
"Arcane": "Arkan",
|
||||||
|
|
||||||
|
"Demon Hunter": "Dämonenjäger",
|
||||||
|
"Havoc": "Verwüstung",
|
||||||
|
"Vengeance": "Rachsucht",
|
||||||
|
|
||||||
|
"Druid": "Druide",
|
||||||
|
"Guardian": "Wächter",
|
||||||
|
"Balance":"Gleichgewicht",
|
||||||
|
"Feral":"Wildheit",
|
||||||
|
"_Restoration": "Wiederherstellung"
|
||||||
|
|
||||||
}
|
}
|
|
@ -15,8 +15,13 @@ set_sidebar_status('right', false);
|
||||||
global $user;
|
global $user;
|
||||||
|
|
||||||
if ($raid->id_wowaudit) {
|
if ($raid->id_wowaudit) {
|
||||||
$raid->sync(true);
|
if($raid->sync(true)){
|
||||||
$raid->save();
|
$raid->save();
|
||||||
|
}else{
|
||||||
|
$raid->status = "Cancelled";
|
||||||
|
$raid->save();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -36,6 +41,15 @@ get_header();
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</div>
|
</div>
|
||||||
<section id="primary">
|
<section id="primary">
|
||||||
|
<?php if($raid->status == "Cancelled"): ?>
|
||||||
|
<main id="main">
|
||||||
|
<div class="flex flex-col lg:flex-row gap-auto">
|
||||||
|
<div class="bg-glass shadow p-auto w-full text-center">
|
||||||
|
<h1 class="text-3xl font-bold text-red">Raid abgesagt!</h1>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
<?php else: ?>
|
||||||
<main id="main">
|
<main id="main">
|
||||||
<div class="flex flex-col lg:flex-row gap-auto" x-data="{encounter:<?= $raid->encounters[0]['id'] ?>}">
|
<div class="flex flex-col lg:flex-row gap-auto" x-data="{encounter:<?= $raid->encounters[0]['id'] ?>}">
|
||||||
<div class="bg-glass shadow p-auto w-full lg:w-1/5 order-2 lg:order-1">
|
<div class="bg-glass shadow p-auto w-full lg:w-1/5 order-2 lg:order-1">
|
||||||
|
@ -86,7 +100,7 @@ get_header();
|
||||||
<div class="bg-glass shadow p-auto flex flex-col gap-auto">
|
<div class="bg-glass shadow p-auto flex flex-col gap-auto">
|
||||||
<h3 class="text-xl font-bold text-center"><?= $role ?></h3>
|
<h3 class="text-xl font-bold text-center"><?= $role ?></h3>
|
||||||
<?php foreach ($signups as $signup) : ?>
|
<?php foreach ($signups as $signup) : ?>
|
||||||
<?= $signup->showForm(false, true, false, $encounter['id'] == 0) ?>
|
<?= $signup->showForm(false, true, false, $encounter['id'] == 0,true) ?>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</div>
|
</div>
|
||||||
<?php
|
<?php
|
||||||
|
@ -119,6 +133,7 @@ get_header();
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
</main>
|
</main>
|
||||||
</section>
|
</section>
|
||||||
<?php
|
<?php
|
||||||
|
|
|
@ -19,101 +19,113 @@ if (empty($chars) || empty($chars->first())) {
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<div class="flex <?= $vertical ? "flex-col" : "flex-row" ?> border border-<?= $this->character->color ?> shadow" x-data="{open : false}">
|
<div>
|
||||||
<button <?= ($doSignup && $this->character->can_edit) ? 'x-on:click="open = true"' : '' ?> class="btn btn-outline btn-<?= $this->character->color ?> w-full">
|
<div class="flex <?= $vertical ? "flex-col" : "flex-row" ?> border border-<?= $this->character->color ?> shadow" x-data="{open : false}">
|
||||||
<img src="<?= $this->character->classIcon ?>" class="h-8"><?= $this->character->name ?></button>
|
<button <?= ($doSignup && $this->character->can_edit) ? 'x-on:click="open = true"' : '' ?> class="btn btn-outline btn-<?= $this->character->color ?> w-full">
|
||||||
<?php if ($showStatus) : ?>
|
<img src="<?= $this->character->classIcon ?>" class="h-8"><?= $this->character->name ?></button>
|
||||||
<div class="border border-<?= $this->character->color ?> bg-<?= $this->getStatus()->color ?> bg-opacity-25 flex flex-row text-<?= $this->getStatus()->color ?> items-center justify-center p-auto gap-1"><?= Icon::get($this->getStatus()->icon) ?>
|
<?php if ($showStatus) : ?>
|
||||||
<?= $vertical ? $this->getStatus()->name : "" ?>
|
<div class="border border-<?= $this->character->color ?> bg-<?= $this->getStatus()->color ?> bg-opacity-25 flex flex-row text-<?= $this->getStatus()->color ?> items-center justify-center p-auto gap-1"><?= Icon::get($this->getStatus()->icon) ?>
|
||||||
</div>
|
<?= $vertical ? $this->getStatus()->name : "" ?>
|
||||||
<?php endif; ?>
|
</div>
|
||||||
<?php if ($showRole) : ?>
|
<?php endif; ?>
|
||||||
<div class="border border-<?= $this->character->color ?> bg-<?= $this->getRole()->color ?> bg-opacity-25 flex flex-row text-<?= $this->getRole()->color ?> items-center justify-center p-auto gap-1"><?= Icon::get($this->getRole()->icon) ?>
|
<?php if ($showRole) : ?>
|
||||||
<?= $vertical ? $this->getRole()->name : "" ?>
|
<div class="border border-<?= $this->character->color ?> bg-<?= $this->getRole()->color ?> bg-opacity-25 flex flex-row text-<?= $this->getRole()->color ?> items-center justify-center p-auto gap-1"><?= Icon::get($this->getRole()->icon) ?>
|
||||||
</div>
|
<?= $vertical ? $this->getRole()->name : "" ?>
|
||||||
<?php endif; ?>
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
<?php if ($doSignup && $this->character->can_edit) : ?>
|
<?php if ($doSignup && $this->character->can_edit) : ?>
|
||||||
<template x-teleport="body">
|
<template x-teleport="body">
|
||||||
<div x-show="open" class="fixed inset-0 px-2 z-10 overflow-hidden flex items-center justify-center">
|
<div x-show="open" class="fixed inset-0 px-2 z-10 overflow-hidden flex items-center justify-center">
|
||||||
<div x-show="open" x-on:click="open = false" x-transition:enter="transition-opacity ease-out duration-300" x-transition:enter-start="opacity-0" x-transition:enter-end="opacity-100" x-transition:leave="transition-opacity ease-in duration-300" x-transition:leave-start="opacity-100" x-transition:leave-end="opacity-0" class="absolute inset-0 bg-deepblue bg-opacity-75 transition-opacity"></div>
|
<div x-show="open" x-on:click="open = false" x-transition:enter="transition-opacity ease-out duration-300" x-transition:enter-start="opacity-0" x-transition:enter-end="opacity-100" x-transition:leave="transition-opacity ease-in duration-300" x-transition:leave-start="opacity-100" x-transition:leave-end="opacity-0" class="absolute inset-0 bg-deepblue bg-opacity-75 transition-opacity"></div>
|
||||||
<!-- Modal Content -->
|
<!-- Modal Content -->
|
||||||
<div x-show="open" x-transition:enter="transition-transform ease-out duration-300" x-transition:enter-start="transform scale-75" x-transition:enter-end="transform scale-100" x-transition:leave="transition-transform ease-in duration-300" x-transition:leave-start="transform scale-100" x-transition:leave-end="transform scale-75" class="bg-glass border shadow overflow-hidden max-w-md w-full sm:w-96 md:w-1/2 lg:w-2/3 xl:w-1/3 z-50">
|
<div x-show="open" x-transition:enter="transition-transform ease-out duration-300" x-transition:enter-start="transform scale-75" x-transition:enter-end="transform scale-100" x-transition:leave="transition-transform ease-in duration-300" x-transition:leave-start="transform scale-100" x-transition:leave-end="transform scale-75" class="bg-glass border shadow overflow-hidden max-w-md w-full sm:w-96 md:w-1/2 lg:w-2/3 xl:w-1/3 z-50">
|
||||||
<!-- Modal Body -->
|
<!-- Modal Body -->
|
||||||
<form id="<?= $id ?>" action="/request" method="POST">
|
<form id="<?= $id ?>" action="/request" method="POST">
|
||||||
<?php wp_nonce_field('signupRaid', 'signupRaid_nonce'); ?>
|
<?php wp_nonce_field('signupRaid', 'signupRaid_nonce'); ?>
|
||||||
<input type="hidden" name="action" value="signupRaid">
|
<input type="hidden" name="action" value="signupRaid">
|
||||||
<input type="hidden" name="raid_id" value="<?= $this->raid->ID ?>">
|
<input type="hidden" name="raid_id" value="<?= $this->raid->ID ?>">
|
||||||
|
|
||||||
<div class="grid p-auto gap-auto">
|
<div class="grid p-auto gap-auto">
|
||||||
|
|
||||||
<?php foreach ($chars as $key => $character) :
|
<?php foreach ($chars as $key => $character) :
|
||||||
?>
|
|
||||||
<div class="hidden lg:block">
|
|
||||||
<?php
|
|
||||||
(new ToggleButton([
|
|
||||||
'type' => 'radio',
|
|
||||||
'name' => 'raid_character',
|
|
||||||
'value' => $character->ID,
|
|
||||||
'text' => $character->name,
|
|
||||||
'color' => $character->color,
|
|
||||||
'icon_yes' => 'o-check',
|
|
||||||
'checked' => $character->ID == $this->character->ID,
|
|
||||||
'row' => false,
|
|
||||||
]))->render();
|
|
||||||
?>
|
?>
|
||||||
</div>
|
<div class="hidden lg:block">
|
||||||
|
<?php
|
||||||
|
(new ToggleButton([
|
||||||
|
'type' => 'radio',
|
||||||
|
'name' => 'raid_character',
|
||||||
|
'value' => $character->ID,
|
||||||
|
'text' => $character->name,
|
||||||
|
'color' => $character->color,
|
||||||
|
'icon_yes' => 'o-check',
|
||||||
|
'checked' => $character->ID == $this->character->ID,
|
||||||
|
'row' => false,
|
||||||
|
]))->render();
|
||||||
|
?>
|
||||||
|
</div>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
endforeach; ?>
|
|
||||||
</div>
|
|
||||||
<div class="grid grid-cols-2 gap-auto p-auto">
|
|
||||||
|
|
||||||
<div class="col-span-2 text-center hidden lg:block">Anwesenheit</div>
|
endforeach; ?>
|
||||||
<?php
|
|
||||||
foreach ($this->getStatusList(true) as $key => $status) {
|
|
||||||
(new ToggleButton([
|
|
||||||
'type' => 'radio',
|
|
||||||
'name' => 'raid_status',
|
|
||||||
'text' => $status->name,
|
|
||||||
'color' => $status->color,
|
|
||||||
'icon_yes' => $status->icon,
|
|
||||||
'value' => $key,
|
|
||||||
'checked' => $key == $this->status,
|
|
||||||
'row' => false,
|
|
||||||
]))->render();
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
<div class="col-span-2 text-center hidden lg:block">Rolle</div>
|
|
||||||
<?php
|
|
||||||
foreach ($this->getRoleList() as $key => $role) {
|
|
||||||
(new ToggleButton([
|
|
||||||
'type' => 'radio',
|
|
||||||
'name' => 'raid_role',
|
|
||||||
'text' => $role->name,
|
|
||||||
'color' => $role->color,
|
|
||||||
'icon_yes' => $role->icon,
|
|
||||||
'value' => $key,
|
|
||||||
'checked' => $key == $this->role,
|
|
||||||
'row' => false,
|
|
||||||
]))->render();
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
<div class="col-span-2 text-center">Kommentar</div>
|
|
||||||
<div class="flex flex-col gap-auto col-span-2">
|
|
||||||
<input type="text" name="comment" class="w-full bg-glass text-white border border-white" placeholder="Kommentar eingeben...">
|
|
||||||
<button type="submit" x-on:click="open = false" class="btn btn-outline btn-monk">
|
|
||||||
<?= Icon::get('o-paper-airplane') ?>
|
|
||||||
Speichern
|
|
||||||
</button>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div class="grid grid-cols-2 gap-auto p-auto">
|
||||||
<!-- Modal Footer -->
|
|
||||||
</form>
|
<div class="col-span-2 text-center hidden lg:block">Anwesenheit</div>
|
||||||
|
<?php
|
||||||
|
foreach ($this->getStatusList(true) as $key => $status) {
|
||||||
|
(new ToggleButton([
|
||||||
|
'type' => 'radio',
|
||||||
|
'name' => 'raid_status',
|
||||||
|
'text' => $status->name,
|
||||||
|
'color' => $status->color,
|
||||||
|
'icon_yes' => $status->icon,
|
||||||
|
'value' => $key,
|
||||||
|
'checked' => $key == $this->status,
|
||||||
|
'row' => false,
|
||||||
|
]))->render();
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<div class="col-span-2 text-center hidden lg:block">Rolle</div>
|
||||||
|
<?php
|
||||||
|
foreach ($this->getRoleList() as $key => $role) {
|
||||||
|
(new ToggleButton([
|
||||||
|
'type' => 'radio',
|
||||||
|
'name' => 'raid_role',
|
||||||
|
'text' => $role->name,
|
||||||
|
'color' => $role->color,
|
||||||
|
'icon_yes' => $role->icon,
|
||||||
|
'value' => $key,
|
||||||
|
'checked' => $key == $this->role,
|
||||||
|
'row' => false,
|
||||||
|
]))->render();
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<div class="col-span-2 text-center">Kommentar</div>
|
||||||
|
<div class="flex flex-col gap-auto col-span-2">
|
||||||
|
<input type="text" name="comment" class="w-full bg-glass text-white border border-white" placeholder="Kommentar eingeben...">
|
||||||
|
<button type="submit" x-on:click="open = false" class="btn btn-outline btn-monk">
|
||||||
|
<?= Icon::get('o-paper-airplane') ?>
|
||||||
|
Speichern
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- Modal Footer -->
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</template>
|
||||||
|
<?php endif; ?>
|
||||||
|
</div>
|
||||||
|
<?php if ($showComment) : ?>
|
||||||
|
<div class="p-auto bg-glass shadow flex flex-col xl:flex-row items-center gap-2">
|
||||||
|
<div>
|
||||||
|
<?= Icon::get('o-chat-bubble-bottom-center-text') ?>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
<div class="text-wrap">
|
||||||
|
<?= $this->comment ?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</div>
|
</div>
|
|
@ -0,0 +1,16 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace WoWPress\Models;
|
||||||
|
|
||||||
|
use Wenprise\Eloquent\Model;
|
||||||
|
use WoWPress\Api\BattleNet;
|
||||||
|
|
||||||
|
class Complaint extends Model{
|
||||||
|
|
||||||
|
protected $table = "wowpress_complaints";
|
||||||
|
public $timestamps = false;
|
||||||
|
protected $primaryKey = 'ID';
|
||||||
|
protected $guarded = ['ID'];
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -138,6 +138,7 @@ class Raid extends Model
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
$s->comment = $signup['comment'];
|
||||||
$s->status = $signup['selected'] ? "Selected" : $signup['status'];
|
$s->status = $signup['selected'] ? "Selected" : $signup['status'];
|
||||||
$s->role = $signup['status'] == "Unknown" ? "Unknown" : $signup['role'];
|
$s->role = $signup['status'] == "Unknown" ? "Unknown" : $signup['role'];
|
||||||
$signups[] = $s;
|
$signups[] = $s;
|
||||||
|
|
|
@ -120,10 +120,11 @@ class Signup extends Model
|
||||||
return $this->belongsTo(Raid::class);
|
return $this->belongsTo(Raid::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function showForm($showRole = false, $showStatus = false, $vertical = false, $doSignup = true)
|
public function showForm($showRole = false, $showStatus = false, $vertical = false, $doSignup = true, $showComment = false)
|
||||||
{
|
{
|
||||||
$tooLate = $this->raid->status == "Locked";
|
$tooLate = $this->raid->status == "Locked";
|
||||||
$doSignup = $doSignup && !$tooLate;
|
$doSignup = $doSignup && !$tooLate;
|
||||||
|
$showComment = $showComment && $this->comment;
|
||||||
|
|
||||||
if ($this->status == "Unknown" && $tooLate) {
|
if ($this->status == "Unknown" && $tooLate) {
|
||||||
$this->setStatus('Too Late');
|
$this->setStatus('Too Late');
|
||||||
|
@ -131,6 +132,7 @@ class Signup extends Model
|
||||||
$showRole = false;
|
$showRole = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
require(get_template_directory() . "/template-parts/components/raid-signup.php");
|
require(get_template_directory() . "/template-parts/components/raid-signup.php");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue