From 53062fbae10bf15740ffce4b90c70a66645aca5f Mon Sep 17 00:00:00 2001 From: Seph Date: Wed, 19 Jun 2024 21:10:42 +0200 Subject: [PATCH] Comments --- theme/inc/config-routing.php | 2 +- theme/lang/deu.json | 22 ++- theme/pages/complaints.php | 0 theme/pages/single_raid.php | 21 +- .../template-parts/components/raid-signup.php | 182 ++++++++++-------- theme/wowpress/Models/Complaint.php | 16 ++ theme/wowpress/Models/Raid.php | 1 + theme/wowpress/Models/Signup.php | 4 +- 8 files changed, 157 insertions(+), 91 deletions(-) create mode 100644 theme/pages/complaints.php create mode 100644 theme/wowpress/Models/Complaint.php diff --git a/theme/inc/config-routing.php b/theme/inc/config-routing.php index 441005f..df18492 100644 --- a/theme/inc/config-routing.php +++ b/theme/inc/config-routing.php @@ -62,7 +62,7 @@ add_action('template_redirect', function () {
Message: message?>
Action: action?>
-
Logged: created_at,"dd.mm.YY HH:MM")?>
+
Logged: created_at,"dd.MM.YY HH:mm")?>

id_wowaudit) { - $raid->sync(true); - $raid->save(); + if($raid->sync(true)){ + $raid->save(); + }else{ + $raid->status = "Cancelled"; + $raid->save(); + } + } @@ -36,6 +41,15 @@ get_header();
+status == "Cancelled"): ?> +
+
+
+

Raid abgesagt!

+
+
+
+
@@ -86,7 +100,7 @@ get_header();

- showForm(false, true, false, $encounter['id'] == 0) ?> + showForm(false, true, false, $encounter['id'] == 0,true) ?>
+
first())) { ?> -
border border-character->color ?> shadow" x-data="{open : false}"> - - -
getStatus()->icon) ?> - getStatus()->name : "" ?> -
- - -
getRole()->icon) ?> - getRole()->name : "" ?> -
- +
+
border border-character->color ?> shadow" x-data="{open : false}"> + + +
getStatus()->icon) ?> + getStatus()->name : "" ?> +
+ + +
getRole()->icon) ?> + getRole()->name : "" ?> +
+ - character->can_edit) : ?> - +
+ comment ?> +
+
\ No newline at end of file diff --git a/theme/wowpress/Models/Complaint.php b/theme/wowpress/Models/Complaint.php new file mode 100644 index 0000000..eabc467 --- /dev/null +++ b/theme/wowpress/Models/Complaint.php @@ -0,0 +1,16 @@ +comment = $signup['comment']; $s->status = $signup['selected'] ? "Selected" : $signup['status']; $s->role = $signup['status'] == "Unknown" ? "Unknown" : $signup['role']; $signups[] = $s; diff --git a/theme/wowpress/Models/Signup.php b/theme/wowpress/Models/Signup.php index 7d71f46..080d93c 100644 --- a/theme/wowpress/Models/Signup.php +++ b/theme/wowpress/Models/Signup.php @@ -120,10 +120,11 @@ class Signup extends Model 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"; $doSignup = $doSignup && !$tooLate; + $showComment = $showComment && $this->comment; if ($this->status == "Unknown" && $tooLate) { $this->setStatus('Too Late'); @@ -131,6 +132,7 @@ class Signup extends Model $showRole = false; } + require(get_template_directory() . "/template-parts/components/raid-signup.php"); }