generated from spatie/package-skeleton-laravel
-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add some basic styles to the workbench app
- Loading branch information
Showing
11 changed files
with
78 additions
and
75 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 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,12 +1,14 @@ | ||
<x-turbo-frame :id="$article"> | ||
<h2>{{ $article->title }}</h2> | ||
<x-turbo-frame :id="$article" class="contents"> | ||
<h2 class="text-4xl font-semibold">{{ $article->title }}</h2> | ||
|
||
<p>{{ $article->content }}</p> | ||
<p class="prose">{{ $article->content }}</p> | ||
|
||
<h4>{{ __('Actions') }}</h4> | ||
<div class="mt-4 border-t pt-2"> | ||
<h4 class="text-2xl">{{ __('Actions') }}</h4> | ||
|
||
<ul> | ||
<li><a href="{{ route('articles.edit', $article) }}">{{ __('Edit') }}</a></li> | ||
<li><a href="{{ route('articles.delete', $article) }}">{{ __('Delete') }}</a></li> | ||
</ul> | ||
<ul class="flex items-center space-x-2"> | ||
<li><a class="underline text-indigo-600" href="{{ route('articles.edit', $article) }}">{{ __('Edit') }}</a></li> | ||
<li><a class="underline text-red-600" href="{{ route('articles.delete', $article) }}">{{ __('Delete') }}</a></li> | ||
</ul> | ||
</div> | ||
</x-turbo-frame> |
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,3 +1,7 @@ | ||
<div id="@domid($article, 'card')"> | ||
<p>{{ $article->title }} - <a href="{{ route('articles.show', $article)}}">{{ __('View') }}</a></p> | ||
<div id="@domid($article, 'card')" class="p-4"> | ||
<p class="mb-2 flex items-center justify-between">{{ $article->title }}</p> | ||
|
||
<span class="pt-2 border-t text-sm"> | ||
<a class="underline text-indigo-500" href="{{ route('articles.show', $article)}}">{{ __('View') }}</a> | ||
</span> | ||
</div> |
12 changes: 9 additions & 3 deletions
12
workbench/resources/views/articles/_create_article_link.blade.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
<x-turbo-frame id="create_article"> | ||
<a href="{{ route('articles.create') }}">{{ __('New Article') }}</a> | ||
</x-turbo-frame> | ||
<details id="create_article_details" class="open:bg-white dark:open:bg-slate-900 open:ring-1 open:ring-black/5 dark:open:ring-white/10 open:shadow-lg p-6"> | ||
<summary class="list-none cursor-pointer"> | ||
<span class="underline text-indigo-500">{{ __('New Article') }}</span> | ||
</summary> | ||
|
||
<x-turbo-frame class="mt-2" id="create_article" src="{{ route('articles.create') }}" loading="lazy"> | ||
<p class="text-gray-600">{{ __('Loading...') }}</p> | ||
</x-turbo-frame> | ||
</details> |
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,29 @@ | ||
<form action="{{ ($article->exists ?? false) ? route('articles.update', $article) : route('articles.store') }}" method="post"> | ||
@if ($article->exists ?? false) | ||
@method('PUT') | ||
@endif | ||
|
||
<div> | ||
<label class="block font-medium text-sm text-gray-700 dark:text-gray-300" for="title">{{ __('Title') }}</label> | ||
<input class="w-full border-gray-300 dark:border-gray-700 dark:bg-gray-900 dark:text-gray-300 focus:border-indigo-500 dark:focus:border-indigo-600 focus:ring-indigo-500 dark:focus:ring-indigo-600 rounded-md shadow-sm" type="text" name="title" placeholder="{{ __('Title') }}" value="{{ old('title', $article?->title) }}" /> | ||
@error('title') | ||
<span class="mt-1 block text-sm text-red-600 dark:text-red-400">{{ $message }}</span> | ||
@enderror | ||
</div> | ||
|
||
<div class="mt-2"> | ||
<label class="block font-medium text-sm text-gray-700 dark:text-gray-300" for="content">{{ __('Content') }}</label> | ||
<textarea class="w-full border-gray-300 dark:border-gray-700 dark:bg-gray-900 dark:text-gray-300 focus:border-indigo-500 dark:focus:border-indigo-600 focus:ring-indigo-500 dark:focus:ring-indigo-600 rounded-md shadow-sm" name="content" id="content" cols="30" rows="10" placeholder="{{ __('Say something...') }}">{{ old('content', $article?->content) }}</textarea> | ||
@error('content') | ||
<span class="mt-1 block text-sm text-red-600 dark:text-red-400">{{ $message }}</span> | ||
@enderror | ||
</div> | ||
|
||
<div class="mt-4 flex items-center space-x-2 justify-end"> | ||
@if ($article?->exists) | ||
<a class="underline text-indigo-600" href="{{ route('articles.show', $article) }}">{{ __('Cancel') }}</a> | ||
@endif | ||
|
||
<button class="px-4 py-2 text-lg rounded bg-indigo-600 text-white" type="submit">{{ $article?->exists ? __('Save') : __('Create') }}</button> | ||
</div> | ||
</form> |
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,35 +1,15 @@ | ||
<x-app-layout> | ||
<x-slot name="title">{{ __('New Article') }}</x-slot> | ||
|
||
<h1>{{ __('New Article') }}</h1> | ||
<h1 class="mb-4 text-4xl font-semibold font-cursive">{{ __('New Article') }}</h1> | ||
|
||
<div> | ||
<a href="{{ route('articles.index') }}">{{ __('Back to Index') }}</a> | ||
<div class="p-6"> | ||
<a class="underline text-indigo-600" href="{{ route('articles.index') }}">{{ __('Back to Index') }}</a> | ||
</div> | ||
|
||
<br> | ||
|
||
<x-turbo-frame id="create_article"> | ||
<form action="{{ route('articles.store') }}" method="post"> | ||
<div> | ||
<label for="title">{{ __('Title') }}</label> | ||
<input type="text" name="title" /> | ||
@error('title') | ||
<span>{{ $message }}</span> | ||
@enderror | ||
</div> | ||
|
||
<div> | ||
<label for="content">{{ __('Content') }}</label> | ||
<textarea name="content" id="content" cols="30" rows="10"></textarea> | ||
@error('content') | ||
<span>{{ $message }}</span> | ||
@enderror | ||
</div> | ||
|
||
<div> | ||
<button type="submit">{{ __('Create') }}</button> | ||
</div> | ||
</form> | ||
@include('articles._form', ['article' => null]) | ||
</x-turbo-frame> | ||
</x-app-layout> |
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 |
---|---|---|
@@ -1,11 +1,11 @@ | ||
<x-app-layout> | ||
<x-slot name="title">{{ __('Articles') }}</x-slot> | ||
|
||
<h1>{{ __('Articles Index') }}</h1> | ||
<h1 class="mb-4 text-4xl font-semibold font-sans">{{ __('Articles Index') }}</h1> | ||
|
||
@include('articles._create_article_link') | ||
|
||
<div id="articles"> | ||
<div id="articles" class="mt-4 flex flex-col space-y-2 divide-y border rounded"> | ||
@each('articles._article_card', $articles, 'article') | ||
</div> | ||
</x-app-layout> |
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