diff --git a/public/assets/css/front/about.css b/public/assets/css/front/about.css new file mode 100644 index 0000000..3b0fd1b --- /dev/null +++ b/public/assets/css/front/about.css @@ -0,0 +1,12 @@ +section[role="about"] { + background: var(--primary); + width: 100%; + max-width: 600px; + padding: 100px; + margin: 0 auto; + color: var(--white); +} + +section[role="about"] a { + color: var(--highlight); +} diff --git a/public/assets/css/front/index.css b/public/assets/css/front/index.css index d2e0006..7fb9463 100644 --- a/public/assets/css/front/index.css +++ b/public/assets/css/front/index.css @@ -1,15 +1,37 @@ -section[role="intro"] { - padding: 10px; - width: 300px; - color: var(--highlight); +section[role="start"] { + background-image: url("../../images/global/special-trash.jpg"); + height: 100%; + background-position: center; + background-repeat: no-repeat; + background-size: cover; + display: flex; + align-items: center; + justify-content: center; } -section[role="intro"] span[role="title"] { +section[role="start"] div { + background: var(--primary); + width: 400px; + border-radius: 3px; + padding: 5px; +} + +section[role="start"] span[role="title"] { font-size: 100px; line-height: 80px; + font-weight: bold; color: var(--secondary); } -section[role="intro"] p { +section[role="start"] p { color: var(--white); + display: inline-block; + vertical-align: top; + margin: 6px auto; + font-size: 1.87em; +} + +section[role="start"] p a { + color: var(--highlight); + margin-top: 5px; } diff --git a/public/assets/css/front/listing.css b/public/assets/css/front/listing.css new file mode 100644 index 0000000..b629c8e --- /dev/null +++ b/public/assets/css/front/listing.css @@ -0,0 +1,13 @@ +section[role="listings"] { + background: var(--primary); + width: 100%; + max-width: 600px; + border-radius: 3px; + padding: 100px; + margin: 0 auto; + color: var(--white); +} + +section[role="listings"] a { + color: var(--highlight); +} diff --git a/public/assets/css/front/start.css b/public/assets/css/front/start.css index 8a2f945..1a340dd 100644 --- a/public/assets/css/front/start.css +++ b/public/assets/css/front/start.css @@ -3,5 +3,6 @@ @import "../global/typography.css"; @import "../global/frame.css"; @import "../global/icons.css"; - @import "index.css"; +@import "about.css"; +@import "listing.css"; diff --git a/public/assets/css/global/frame.css b/public/assets/css/global/frame.css index c0ff8f1..7127e93 100644 --- a/public/assets/css/global/frame.css +++ b/public/assets/css/global/frame.css @@ -24,7 +24,7 @@ header { header > nav { display: grid; - grid-template-columns: 200px 1fr; + grid-template-columns: 1fr 1fr; padding: 10px; } @@ -36,6 +36,16 @@ header > nav > div[role="nav-right"] { text-align: right; } +div[role="system-notice"] { + background: var(--highlight); + color: var(--primary); + padding: 10px; +} + +main { + height: 100%; +} + /* GLOBALS */ a { @@ -45,6 +55,11 @@ a { transition: all 0.2s linear; } +a[role="nav-links"] { + padding: 7px; + border-bottom: none; +} + a:hover { border-bottom: 1px solid var(--primary); } diff --git a/public/assets/css/global/typography.css b/public/assets/css/global/typography.css index 218367c..ccc1bb1 100644 --- a/public/assets/css/global/typography.css +++ b/public/assets/css/global/typography.css @@ -28,6 +28,7 @@ h3 { h1 { font-size: 2.5em; font-weight: 700; + line-height: 1em; } h2 { diff --git a/public/assets/images/global/special-trash.jpg b/public/assets/images/global/special-trash.jpg new file mode 100644 index 0000000..6ee082a Binary files /dev/null and b/public/assets/images/global/special-trash.jpg differ diff --git a/src/Controller/Routes/Front/Index.php b/src/Controller/Routes/Front/Index.php index 1560311..788f34b 100644 --- a/src/Controller/Routes/Front/Index.php +++ b/src/Controller/Routes/Front/Index.php @@ -11,26 +11,42 @@ use Symfony\Component\Routing\Annotation\Route; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use App\Service\Auth; use App\Service\Render; +use App\Service\HandleLocations; class Index extends AbstractController { /** * @Route("/", name="index") */ - public function showIndex(Request $request, Auth $auth, Render $render): Response + public function showIndex(Request $request, Auth $auth, Render $render, HandleLocations $locations): Response { - $check = $auth->status(); - - return $render->page([], "This is The Bad Space", "front/index.twig"); + $list = $locations->getActiveLocations(); + return $render->page(["count" => count($list)], "This is The Bad Space", "front/index.twig"); } /** - * @Route("/knockknock", name="access") + * @Route("/about", name="about") */ - public function access(Request $request): Response - { - return $this->render("front/knock.twig", [ - "title" => "Wipe Your feet", - ]); + public function showAbout( + Request $request, + Auth $auth, + Render $render, + HandleLocations $locations + ): Response { + return $render->page([], "About The Bad Space", "front/about.twig"); + } + + /** + * @Route("/listings/page/{pageNum}", name="listings") + */ + public function showListing( + Request $request, + Auth $auth, + Render $render, + HandleLocations $locations, + string $pageNum + ): Response { + $list = $locations->getLocationsPage($pageNum, "true"); + return $render->page(["list" => $list, "page" => $pageNum], "About The Bad Space", "front/listing.twig"); } } diff --git a/src/Service/HandleLocations.php b/src/Service/HandleLocations.php index 22d67d5..c09ae94 100644 --- a/src/Service/HandleLocations.php +++ b/src/Service/HandleLocations.php @@ -48,13 +48,14 @@ class HandleLocations return $this->entityManager->getRepository(Location::class)->findBy(["uuid" => $uuid]); } - public function getLocationsPage(int $page) + public function getLocationsPage(int $page, string $active = "all") { $locations = $this->entityManager->getRepository(Location::class); - $list = $locations->findBy( - [], - ["id" => "ASC"] - ); + if ($active == "true" || $active == "false") { + $list = $locations->findBy(["active" => $active], ["id" => "ASC"]); + } else { + $list = $locations->findBy([], ["id" => "ASC"]); + } $count = ceil(count($list) / $this->limit); $totalCount = count($list); @@ -121,7 +122,7 @@ class HandleLocations $location->setAddedBy($memberId); $this->entityManager->persist($location); } else { - $active = ($request->request->get("rating") == "true" ? true : false); + $active = ($request->request->get("active") == "true" ? true : false); $location->setActive($active); } diff --git a/templates/back/index.twig b/templates/back/index.twig index 3ae1fe5..dc2d882 100644 --- a/templates/back/index.twig +++ b/templates/back/index.twig @@ -16,12 +16,7 @@ {% else %}
-

This is the Den


- {% if options.notice is defined %} -
- {{ options.notice }} -
- {% endif %} +

The Den


{{ include("forms/login-form.twig") }}
diff --git a/templates/back/locations.twig b/templates/back/locations.twig index fbd4d72..e2ade17 100644 --- a/templates/back/locations.twig +++ b/templates/back/locations.twig @@ -8,12 +8,6 @@

Location Listing

- {% if options.notice is defined %} -
- {{ options.notice }} -
- {% endif %} - {% if options.mode == "add" %}

Add New Location

{{ include("forms/add-location.twig") }} diff --git a/templates/base/frame.twig b/templates/base/frame.twig index 4cab48d..5030b97 100644 --- a/templates/base/frame.twig +++ b/templates/base/frame.twig @@ -13,33 +13,50 @@
+
+ {% if options.notice is defined %} +
+ + {{ options.notice }} +
+ {% endif %} - +
+ {% block main %}{% endblock %} +
+ -
-{% block main %}{% endblock %}
{% block javascripts %}{% endblock %} + diff --git a/templates/front/about.twig b/templates/front/about.twig new file mode 100644 index 0000000..e889b42 --- /dev/null +++ b/templates/front/about.twig @@ -0,0 +1,25 @@ +{% extends "base/frame.twig" %} +{% block stylesheets %} + + {% endblock %} + + {% block main %} +
+

About The Bad Space

+

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. It is an extension of the + #fediblock + hashtag created + by Arist Maricia X + with additional support from + Ginger + to provide a catolog of instances seek to cause harm and reduce the quality of experience in the fediverse. +

+ + + +

+ Technial support provided by + Ro. +

+
+ {% endblock %} diff --git a/templates/front/index.twig b/templates/front/index.twig index ee97cce..690d5ae 100644 --- a/templates/front/index.twig +++ b/templates/front/index.twig @@ -4,11 +4,13 @@ {% endblock %} {% block main %} -
- The Bad Space
- Because some people are just awful humans. -

Coming Soonish... -

- +
+
+ {{ options.count }} +

+ Bad Spaces tracked.
+ Pace yourself. +

+
{% endblock %} diff --git a/templates/front/listing.twig b/templates/front/listing.twig new file mode 100644 index 0000000..eafc676 --- /dev/null +++ b/templates/front/listing.twig @@ -0,0 +1,18 @@ +{% extends "base/frame.twig" %} +{% block stylesheets %} + + {% endblock %} + + {% block main %} +
+

The Bad Space Listings

+

Page + {{ options.page }}

+ {% for location in options.list.locations %} + ID:{{ location.id }} + + + {{ location.name }}
+ {% endfor %} +
+ {% endblock %}