From fe49ca869913b019c85884e90d44ecd193f18d04 Mon Sep 17 00:00:00 2001 From: ro Date: Mon, 5 Feb 2024 14:02:27 -0600 Subject: [PATCH] Working Appeals form Still need to style the email form, but the Appeal Form is working with a bit of protection from bots to cut down on spam. --- app/Http/Controllers/AppealMailController.php | 15 ++++-- app/Mail/LocationAppeal.php | 3 +- resources/views/email/appeal.blade.php | 4 +- resources/views/frame.blade.php | 3 ++ resources/views/front/appeals.blade.php | 54 +++++++++++++++++-- routes/web.php | 2 +- 6 files changed, 70 insertions(+), 11 deletions(-) diff --git a/app/Http/Controllers/AppealMailController.php b/app/Http/Controllers/AppealMailController.php index f63a063..504e0d6 100644 --- a/app/Http/Controllers/AppealMailController.php +++ b/app/Http/Controllers/AppealMailController.php @@ -3,7 +3,6 @@ namespace App\Http\Controllers; use App\Mail\LocationAppeal; -use Illuminate\Http\RedirectResponse; use Illuminate\Http\Request; use Illuminate\Support\Facades\Mail; @@ -12,12 +11,20 @@ class AppealMailController extends Controller /** * Send appeal request */ - public function sendAppeal(Request $request): RedirectResponse + public function sendAppeal(Request $request) { //$order = Order::findOrFail($request->order_id); + $token = csrf_token(); - Mail::to('ro@h-i.works')->send(new LocationAppeal()); + if ($request->h1 != '' || $request->question != 2) { + return back()->withErrors([ + 'error' => 'Invalid Request', + ]); + } else { + Mail::to('ro@h-i.works')->send(new LocationAppeal($request->location, $request->sponsor)); - return redirect('/appeals'); + //return redirect('/appeals'); + return back()->with('message', "Appeal Filed"); + }; } } diff --git a/app/Mail/LocationAppeal.php b/app/Mail/LocationAppeal.php index bf31209..d61f2fb 100644 --- a/app/Mail/LocationAppeal.php +++ b/app/Mail/LocationAppeal.php @@ -17,9 +17,8 @@ class LocationAppeal extends Mailable /** * Create a new message instance. */ - public function __construct() + public function __construct(public $location, public $sponsor) { - // } /** diff --git a/resources/views/email/appeal.blade.php b/resources/views/email/appeal.blade.php index b3600f6..eb5b3ac 100644 --- a/resources/views/email/appeal.blade.php +++ b/resources/views/email/appeal.blade.php @@ -1,3 +1,5 @@
- A quick test to see if it works. + A quick test to see if it works.
+ Appeal for: {{$location}}
+ Appeal Sponsor: {{$sponsor}}
\ No newline at end of file diff --git a/resources/views/frame.blade.php b/resources/views/frame.blade.php index a24854e..b39c6f2 100644 --- a/resources/views/frame.blade.php +++ b/resources/views/frame.blade.php @@ -45,6 +45,9 @@ Exports
+ + Appeals +
@if(Auth::check()) Den diff --git a/resources/views/front/appeals.blade.php b/resources/views/front/appeals.blade.php index c9ea612..ae8f716 100644 --- a/resources/views/front/appeals.blade.php +++ b/resources/views/front/appeals.blade.php @@ -1,11 +1,59 @@ @extends('frame') -@section('title', 'The Bad Space|Exports') +@section('title', 'The Bad Space|Appeals') @section('main-content') @parent
-

Appeal Process

-
Send Appeal Request +

Appeals

+ + Locations listed in The Bad Space have the right to appeal their inclusion if they feel they have been added unfairly. + +

Starting the Appeals Process

+ +

This process can be initiated by sending an Official Appeal to The Bad Space using the Appeal Form (link coming soon) stating why they should not be included. All appeal requests must be sponsored by at least one Current Source, and their name(s) must be included in the submission.

+ +

The Bad Space will validate the appeal request by contacting a moderator or administrator of the respective instance. If no moderator or administrator is detailed in the appeal request, it will be immediately disqualified.

+ +

If the Appeal contains any threats, hate speech, microaggressions, taunts, or slurs, the Appeal will be automatically disqualified.

+ + An Appeal can only be made once every three (3) months. + +

Process Description

+ +

After an appeal request is validated, it will be reviewed by all Current Sources. Each Current Source will vote on whether to approve the requesting instance's appeal request.

+ +

80% of Current Sources must vote in favor of the request to proceed to the next step. Appeals that do not meet this threshold will be rejected, and the administrator or moderator who petitioned for the appeal will be notified. +

+ +

If an appeal is approved to proceed, a chat room will be created on the h.i. cloud community for the petitioner to be interviewed by Current Sources. Here, they will explain why they feel their instance should be removed from the database.

+ + The petitioner must include the following: +
    +
  • Verification of problematic content and members have been removed.
  • +
  • A public explanation of steps to recognize and remove problematic content and members.
  • +
  • A working plan to keep said location as free as possible from problematic members and content finding a home there.
  • +
+ +

The petitioner also must be available to answer any questions from a member of Current Sources concerning the information provided.

+ +

Failure to provide any of this information or refusing to be interviewed by Current Sources will result in an automatic disqualification.

+ +

Upon completing the interview process, each Current Source will choose to remove or maintain their current block or silence action. The result of each choice will be reflected in the database itself, which can be publicly reviewed at any time.

+ +

Appeals Form

+ +
+ @csrf +
+ +
+
+
+
+
+
+ +
@endsection \ No newline at end of file diff --git a/routes/web.php b/routes/web.php index 769f6db..2eca38f 100644 --- a/routes/web.php +++ b/routes/web.php @@ -26,7 +26,7 @@ Route::get("/about", [FrontIndexController::class, 'about']); Route::get("/location/{uuid}", [FrontIndexController::class, 'location']); Route::get("/appeals", [FrontIndexController::class, 'appeals']); Route::post("/search", [FrontIndexController::class, 'indexSearch']); -Route::get("/appeal", [AppealMailController::class, 'sendAppeal']); +Route::post("/appeal", [AppealMailController::class, 'sendAppeal']); //exports Route::get("/exports", [ExportController::class, 'exportIndex']);