admin form view
This commit is contained in:
parent
a3f0284fc3
commit
c3f01cee54
|
@ -0,0 +1,37 @@
|
|||
a
|
||||
, body
|
||||
, nav
|
||||
, input
|
||||
, form
|
||||
{
|
||||
display: flex;
|
||||
gap: 0.5rem
|
||||
}
|
||||
|
||||
body
|
||||
{
|
||||
margin:0;
|
||||
padding:0;
|
||||
}
|
||||
|
||||
nav
|
||||
{
|
||||
flex-direction: column;
|
||||
width: 10rem;
|
||||
padding: 1rem;
|
||||
}
|
||||
|
||||
main
|
||||
{
|
||||
padding: 1rem 0;
|
||||
}
|
||||
|
||||
input[type='search']
|
||||
{
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
form
|
||||
{
|
||||
flex-direction: column;
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
<x-layout-admin>
|
||||
|
||||
<ol>
|
||||
@foreach($articles as $article)
|
||||
<li><a href="/{{ $article['slug'] }}">{{ $article['title'] ?? $article['slug'] }}</a>
|
||||
@endforeach
|
||||
</ol>
|
||||
|
||||
</x-layout-admin>
|
|
@ -0,0 +1,16 @@
|
|||
<x-layout-admin>
|
||||
|
||||
<form class="col c w-30" method="post" name="edit_form" action="/edit">
|
||||
@csrf
|
||||
<x-input name="id" type="hidden"
|
||||
value="{{ $id ?? 0 }}">
|
||||
<x-input name="title" class="w-30"
|
||||
value="{{ $title ?? '' }}">
|
||||
<x-input name="slug" class="w-30" pattern="[A-Za-z0-9-]+"
|
||||
value="{{ $slug ?? '' }}"
|
||||
required>
|
||||
<textarea name="body" class="w-30">{{ $body ?? '' }}</textarea>
|
||||
<button type="submit">Save</button>
|
||||
</form>
|
||||
|
||||
</x-layout-admin>
|
|
@ -0,0 +1,14 @@
|
|||
<x-layout>
|
||||
<main class="w-30 c">
|
||||
|
||||
<ul class="list">
|
||||
@foreach($items as $item)
|
||||
<li><a href="/{{ $item['slug'] }}">
|
||||
<img src="{{ $item['thumb'] ?? '' }}">
|
||||
<span>{{ $item['title'] ?? $item['slug'] }}</span>
|
||||
</a></li>
|
||||
@endforeach
|
||||
</ul>
|
||||
|
||||
</main>
|
||||
</x-layout>
|
|
@ -0,0 +1,12 @@
|
|||
<x-layout-admin>
|
||||
|
||||
<form class="col c w-30" method="post" name="new_form" action="/new">
|
||||
@csrf
|
||||
<x-input type="hidden">id</x-input>
|
||||
<x-input>title</x-input>
|
||||
<x-input pattern="[A-Za-z0-9-]+" required>slug</x-input>
|
||||
<textarea name="body"></textarea>
|
||||
<button type="submit">Create new</button>
|
||||
</form>
|
||||
|
||||
</x-layout-admin>
|
Loading…
Reference in New Issue