Added About, Listings, Location pages

Added additional pages About, Listings, and Location as well as
implementing the corresponding functionality for those pages to be able
to pull the data they need from the DB.

Also continued layout clean up and adjusted some gloabal font sizing
settings
This commit is contained in:
Ro 2023-08-18 14:34:53 -07:00
parent 25d51646ba
commit 7151314122
No known key found for this signature in database
GPG key ID: 29B551CDBD4D3B50
13 changed files with 181 additions and 39 deletions

View file

@ -13,7 +13,7 @@ class AuthController extends Controller
//$token = $request->session()->token(); //$token = $request->session()->token();
//$token = csrf_token(); //$token = csrf_token();
return view('back.login', ["title" => "The Den Login"]); return view('back.login', ["title" => "The Den"]);
} }
public function memberAuth(Request $request): Response public function memberAuth(Request $request): Response

View file

@ -13,17 +13,41 @@ class FrontIndexController extends Controller
{ {
$locations = Location::where("active", true)->get(); $locations = Location::where("active", true)->get();
$count = count($locations); $count = count($locations);
$terms = "no|agenda"; $terms = "no|agenda";
$recent = Location::where("active", true)
->limit(5)->orderByDesc('updated_at')->get();
//$result = DB::select("SELECT * FROM searchlocations('$terms')"); //$result = DB::select("SELECT * FROM searchlocations('$terms')");
return view('front.index', [ return view('front.index', [
'count' => $count, 'count' => $count,
'recent' => $recent,
'title' => "The Bad Space" 'title' => "The Bad Space"
]); ]);
} }
public function about()
{
return view('front.about', [
'title' => "ABOUT"
]);
}
public function location(string $uuid = "1")
{
$location = Location::where("uuid", $uuid)->first();
$name = "NO LOCATION FOUND";
if ($location) {
$name = $location->name;
}
return view('front.location', [
'title' => $name,
'location' => $location,
'images' => json_decode($location->images),
'updated' => $location->updated_at->format('Y M d'),
]);
}
public function listings(int $pageNum = 1) public function listings(int $pageNum = 1)
{ {
$range = $pageNum * $this->limit - $this->limit; $range = $pageNum * $this->limit - $this->limit;

View file

@ -35,3 +35,7 @@ form.index-search-form > button {
/* Chrome, Firefox, Opera, Safari 10.1+ */ /* Chrome, Firefox, Opera, Safari 10.1+ */
color: var(--highlight); color: var(--highlight);
} }
section.index-meta article {
margin-top: 20px;
}

View file

@ -6,5 +6,6 @@
--white: #efebe3; --white: #efebe3;
--grey: #abb7b7; --grey: #abb7b7;
--black: #32302f; --black: #32302f;
--error: #b62520;
--primary-rgb: 20 13 13; --primary-rgb: 20 13 13;
} }

View file

@ -2,7 +2,7 @@ html {
width: 100%; width: 100%;
height: 100%; height: 100%;
overflow: hidden; overflow: hidden;
font: 400 1.2em/1.4em var(--base-type); font: 400 1.6em/1.3em var(--base-type);
} }
html body { html body {
@ -71,20 +71,23 @@ header > div nav {
right: 0; right: 0;
} }
div.system-notice { div.system-notice-error {
background: var(--highlight); background: var(--error);
color: var(--primary); color: var(--white);
padding: 10px; padding: 10px;
} }
main { div.system-notice-message {
height: 100%; background: var(--highlight);
color: var(--black);
padding: 10px;
} }
main > section > article { main > section > article {
width: 80%; width: 80%;
max-width: 1000px; max-width: 1000px;
margin: 0 auto; margin: 0 auto;
min-height: 400px;
} }
/* GLOBALS */ /* GLOBALS */
@ -122,3 +125,31 @@ sup {
height: 90%; height: 90%;
padding-top: 3px; padding-top: 3px;
} }
.location-image {
height: 200px;
width: 200px;
display: inline-block;
border-radius: 3px;
}
/* GLOBALS */
footer {
width: 100%;
color: var(--primary);
background: var(--secondary);
height: 200px;
}
footer > div:nth-child(1) {
display: grid;
grid-template-columns: 50% 50%;
padding: 10px;
gap: 10px;
height: 200px;
width: 80%;
margin: 0 auto;
max-width: 1000px;
position: relative;
}

View file

@ -40,34 +40,28 @@
--mono-type: "Lucida Console", monaco, monospace; --mono-type: "Lucida Console", monaco, monospace;
} }
h1,
h2,
h3 {
color: var(--white);
font-family: var(--title-type);
}
h1 { h1 {
font-size: 4em; font-size: 3em;
font-weight: 500; font-weight: 600;
font-kerning: normal; font-kerning: normal;
letter-spacing: -5px; letter-spacing: -5px;
text-transform: uppercase; text-transform: uppercase;
line-height: 0.75em; line-height: 0.75em;
margin: 40px 0; margin: 0;
position: absolute;
bottom: 20px;
width: 70%;
} }
h2 { h2 {
font-size: 3em; font-size: 2em;
font-weight: 400; font-weight: 500;
line-height: 0.8em; line-height: 0.8em;
color: var(--white);
margin: 30px 0;
} }
h3 { h3 {
font-size: 2em; font-size: 2em;
font-weight: 300; font-weight: 300;
} }
main > article > h1 {
color: var(--primary);
}

View file

@ -4,11 +4,9 @@
@section('main-content') @section('main-content')
@parent @parent
@if($errors->any())
<h4>{{$errors->first()}}</h4>
@endif
<section> <section>
<article> <article>
<h2>Hey, Rando. </h2>
<form action="/login" method="post" enctype="multipart/form-data"> <form action="/login" method="post" enctype="multipart/form-data">
@csrf @csrf
<label>Handle</label><br /> <label>Handle</label><br />

View file

@ -20,7 +20,7 @@
</a> </a>
</div> </div>
<div> <div>
<span title="page-title">{{$title}}</span> <h1>{{$title}}</h1>
</div> </div>
<div> <div>
<nav> <nav>
@ -37,14 +37,15 @@
</div> </div>
</div> </div>
</header> </header>
@if($errors->any()) @if($errors->any())
<div class="system-notice"> <div class="system-notice-error" role="status">
<i class="ti ti-alert-circle"></i> {{$errors->first()}} {{$errors->first()}}
</div> </div>
@endif @endif
@if(session('message')) @if(session('message'))
<div class="system-notice"> <div class="system-notice-message" role="status">
<i class="ti ti-alert-circle"></i> {!! session('message') !!} {!! session('message') !!}
</div> </div>
@endif @endif
@ -52,6 +53,11 @@
@section('main-content') @section('main-content')
@show @show
</main> </main>
<footer>
<div>
<p>The Bad Space © 2023</p>
</div>
</footer>
</body> </body>
</body> </body>

View file

@ -0,0 +1,58 @@
@extends('frame')
@section('title', 'The Bad Space|About')
@section('main-content')
@parent
<section>
<article>
<h2>What is The Bad Space?</h2>
<p>The Bad Space project was born from a need to effectively identify instances that house bad actors and are poorly moderated, which puts marginalized communities at risk.
</p>
<p>
It is an extension of the
<strong>#fediblock</strong>
hashtag created by
<a href="https://www.artistmarciax.com/">Artist Marcia X</a>
with additional support from
<a href="https://digital.rooting.garden">Ginger</a>
to provide a catalog of instances that seek to cause harm and reduce the quality of experience in the fediverse.
</p>
<p>
Technical support provided by
<a href="https://roiskinda.cool/profile.html">Ro</a>.
</p>
<h2>How do I use it?</h2>
<p>
The Bad Space is meant to be a resource for anyone looking to improve the quality of their online experience by creating a tool that catalogs sources for harassment and abuse. There are several options for how it can be used.
<h3>Search</h3>
To see if a site is listed in the database, use the
<a href="/">search feature</a>
to search for that URL. If it is in the database, information for that instance will be returned and associated instances if applicable.
<h3>CSV Exports</h3>
For a list of the current locations being tracked, click on one of the links below to download a dynamically generated CSV file that can be consumed as a blocklist. More formats will be added over time.
<br />
<a href="/exports/mastodon">For Mastodon</a>
<h3>API</h3>
The Bad Space has a public api that can be used to search the database programatically and return results in the JSON format. The API can be accsess at<br />
<code>https://thebad.space/api/v1/search</code>
by posting a JSON object with the following format:
<code>{"url":"search.url"}</code><br />
Data from API request will be returned in the follow format:<br />
<pre>
<code>{
"listingCount":1,
"locations":
[
{
"url":"search.url",
"name":"Instance Name",
"description":"instance description",
"link":"bad-space-instance-link"
}
]
}</code>
</pre>
</p>
</article>
</section>
@endsection

View file

@ -10,9 +10,14 @@
</button> </button>
</form> </form>
</section> </section>
<section> <section class="index-meta">
<article> <article>
tracking {{$count}} sites; <strong>{{$count}}</strong>
sites tracked<br /><br />
<strong>Recent Updates</strong><br />
@foreach($recent as $item)
{{$item->name}}<br />
@endforeach
</article> </article>
</section> </section>
@endsection @endsection

View file

@ -4,13 +4,13 @@
@parent @parent
<section> <section>
<article> <article>
<h1>Page {{$pageNum}}</h1> <h2>Page {{$pageNum}}</h2>
<a href="/listings/{{$prev}}">PREV</a> <a href="/listings/{{$prev}}">PREV</a>
{{$pageNum}} of {{$totalPages}} {{$pageNum}} of {{$totalPages}}
<a href="/listings/{{$next}}">NEXT</a><br /> <a href="/listings/{{$next}}">NEXT</a><br />
@foreach($locations as $location) @foreach($locations as $location)
{{$location->name}}<br /> <a href="/location/{{$location->uuid}}">{{$location->name}}</a></a><br />
@endforeach @endforeach
<a href="/listings/{{$prev}}">PREV</a> <a href="/listings/{{$prev}}">PREV</a>
{{$pageNum}} of {{$totalPages}} {{$pageNum}} of {{$totalPages}}

View file

@ -0,0 +1,19 @@
@extends('frame')
@section('title', 'The Bad Space | Location Info')
@section('main-content')
@parent
<section>
<article>
<h2>Description</h2>
{{$location->description}}<br />
<h2>Screens</h2>
@foreach($images as $image)
<a href="/{{$image->path}}" class="location-image" style="background: url(/{{$image->path}}) no-repeat center center / cover #fc6399" />
</a>
@endforeach
<br />UPDATED : {{$updated}}
</article>
</section>
@endsection

View file

@ -20,6 +20,8 @@ use App\Http\Controllers\LocationController;
//front //front
Route::get("/", [FrontIndexController::class, 'start']); Route::get("/", [FrontIndexController::class, 'start']);
Route::get("/listings/{pageNum}", [FrontIndexController::class, 'listings']); Route::get("/listings/{pageNum}", [FrontIndexController::class, 'listings']);
Route::get("/about", [FrontIndexController::class, 'about']);
Route::get("/location/{uuid}", [FrontIndexController::class, 'location']);
//auth //auth
Route::get("/login", [AuthController::class, 'showLogin']); Route::get("/login", [AuthController::class, 'showLogin']);