Creo que termine con el admin del post

This commit is contained in:
Daniel Cortés
2019-06-23 20:12:37 -04:00
parent 8753ad62e7
commit 08f6e9a0ab
8 changed files with 82 additions and 12 deletions

View File

@@ -94,13 +94,27 @@ table {
}
td.controls {
a {
a, input[type=submit]{
margin: 0;
border: 0;
padding: 0;
width: 100%;
display:block;
text-transform: uppercase;
font-weight: bold;
text-align: left;
font-size: 1rem;
font-weight: 600;
text-decoration: none;
letter-spacing: .1em;
color: $colorfg;
}
input[type=submit] {
border: 0;
background-color: white;
cursor: pointer;
}
}
th.controls {
@@ -122,6 +136,7 @@ form {
text-transform: uppercase;
font-weight: bold;
font-size: .9em;
margin-bottom: .6em;
}
input[type=text], textarea{
@@ -133,15 +148,18 @@ form {
border-radius: 4px;
margin-bottom: 1em;
padding: .4em;
font-size: 1rem;
font-weight: 400;
}
textarea {
font-family: inherit;
box-sizing: border-box;
height: 30em;
}
input[type=submit]{
.button{
display: inline-block;
box-sizing: border-box;
text-align: center;

View File

@@ -15,7 +15,7 @@
<label for="md">Contenido</label>
<textarea id="md" name="md"></textarea>
</div>
<input type="submit" value="Crear"/>
<input type="submit" class="button" value="Crear"/>
</form>
@endsection

View File

@@ -0,0 +1,20 @@
@extends('admin.base')
@section('title')
<h1>Edit Post</h1>
@endsection
@section('content')
<form action="{{ route('admin.post.update', ['post' => $post->id]) }}" method="post">
@csrf
<div>
<label for="title">Titulo</label>
<input type="text" id="title" name="title" value="{{ old('title', $post->title) }}" required/>
</div>
<div>
<label for="md">Contenido</label>
<textarea id="md" name="md">{{ old('md', $post->md) }}</textarea>
</div>
<input type="submit" class="button" value="Actualizar"/>
</form>
@endsection

View File

@@ -21,8 +21,11 @@
<td>{{$post->title}}</td>
<td>{{$post->created_at->format('Y-m-d')}}</td>
<td class="controls">
<a href="#">edit</a>
<a href="#">delete</a>
<a href="{{ route('admin.post.edit', ['post' => $post->id]) }}">edit</a>
<form action={{ route('admin.post.delete', ['post' => $post->id]) }} method="post">
@csrf
<input type="submit" value="delete"/>
</form>
</td>
</tr>
@endforeach