-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #22 from illegalstudio/collection-public-page
Collection public page
- Loading branch information
Showing
37 changed files
with
250 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
import '../css/app.scss'; | ||
|
||
/** | ||
* Alpine JS | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<html lang="en"> | ||
<head> | ||
<title>@yield('title', 'Linky')</title> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
|
||
{{ Vite::useHotFile(base_path() . '/vendor/illegal/linky/public/hot')->useBuildDirectory('vendor/illegal/linky')->withEntryPoints([ 'resources/css/app.scss' ]) }} | ||
</head> | ||
<body> | ||
@yield('body') | ||
@vite('resources/js/app.js', 'vendor/illegal/linky') | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
@extends('linky::public.collection._layout') | ||
@section('title') | ||
{{$collection->content->name}} | ||
@endsection | ||
@section('body') | ||
<div class="flex flex-col w-full h-full justify-center gap-4 bg-gray-50"> | ||
@foreach($collection->contents as $content ) | ||
<a class="w-[360px] max-w-[100%] mx-auto bg-indigo-500 p-4 text-white rounded-md border-indigo-900 border-2 drop-shadow-md hover:bg-indigo-600" | ||
href="/{{ $content->slug }}" target="_blank"> | ||
{{ $content->name ?: $content->slug }} | ||
</a> | ||
@endforeach | ||
</div> | ||
@endsection |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
namespace Illegal\Linky\Contracts; | ||
|
||
use Illegal\Linky\Models\Content; | ||
use Illuminate\Http\Request; | ||
use Illuminate\Http\RedirectResponse; | ||
use Illuminate\Http\Response; | ||
|
||
/** | ||
* This is the abstract renderer class. | ||
* It should be extended by all renderers. | ||
* A renderer is responsible for rendering a specific content type. | ||
*/ | ||
abstract class AbstractRenderer | ||
{ | ||
abstract public function handle(Request $request, Content $content): RedirectResponse|Response; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 1 addition & 3 deletions
4
src/Traits/Livewire/Sortable.php → src/Contracts/Livewire/Sortable.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
|
||
namespace Illegal\Linky\Http\Renderers; | ||
|
||
use Illegal\Linky\Contracts\AbstractRenderer; | ||
use Illegal\Linky\Models\Content; | ||
use Illuminate\Http\RedirectResponse; | ||
use Illuminate\Http\Request; | ||
use Illuminate\Http\Response; | ||
|
||
/** | ||
* This is the abort renderer class. | ||
* It is responsible for rendering a 404 page if the | ||
* content type is not supported. | ||
*/ | ||
class AbortRenderer extends AbstractRenderer | ||
{ | ||
|
||
public function handle(Request $request, Content $content): Response|RedirectResponse | ||
{ | ||
abort(404); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
|
||
namespace Illegal\Linky\Http\Renderers; | ||
|
||
use Illegal\Linky\Contracts\AbstractRenderer; | ||
use Illegal\Linky\Models\Content; | ||
use Illegal\Linky\Models\Contentable\Collection; | ||
use Illuminate\Http\Request; | ||
use Illuminate\Support\Facades\Response; | ||
use Illuminate\Http\Response as IlluminateResponse; | ||
|
||
class CollectionRenderer extends AbstractRenderer | ||
{ | ||
|
||
public function handle(Request $request, Content $content): IlluminateResponse | ||
{ | ||
/** @var Collection $collection */ | ||
$collection = $content->contentable; | ||
return Response::make(view('linky::public.collection.default', [ | ||
'collection' => $collection, | ||
])); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
|
||
namespace Illegal\Linky\Http\Renderers; | ||
|
||
use Illegal\Linky\Contracts\AbstractRenderer; | ||
use Illegal\Linky\Models\Content; | ||
use Illegal\Linky\Models\Contentable\Link; | ||
use Illuminate\Http\RedirectResponse; | ||
use Illuminate\Http\Request; | ||
use Illuminate\Support\Facades\Redirect; | ||
|
||
class LinkRenderer extends AbstractRenderer | ||
{ | ||
|
||
public function handle(Request $request, Content $content): RedirectResponse | ||
{ | ||
/** @var Link $link */ | ||
$link = $content->contentable; | ||
return Redirect::to($link->url); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
|
||
namespace Illegal\Linky\Http\Renderers; | ||
|
||
use Illegal\Linky\Contracts\AbstractRenderer; | ||
use Illegal\Linky\Models\Content; | ||
use Illegal\Linky\Models\Contentable\Page; | ||
use Illuminate\Http\Request; | ||
use Illuminate\Http\Response as IlluminateResponse; | ||
use Illuminate\Support\Facades\Response; | ||
|
||
class PageRenderer extends AbstractRenderer | ||
{ | ||
|
||
public function handle(Request $request, Content $content): IlluminateResponse | ||
{ | ||
/** @var Page $page */ | ||
$page = $content->contentable; | ||
return Response::make($page->body); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.