Estoy avanzando en el adminpanel

This commit is contained in:
Daniel Cortés
2019-06-23 18:18:35 -04:00
parent be42d6f599
commit 8753ad62e7
10 changed files with 352 additions and 40 deletions

View File

@@ -0,0 +1,29 @@
<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Daniel Cortés</title>
<link href="{{ asset('css/admin.css') }}" rel="stylesheet">
</head>
<body>
<div class="sidebar">
<div class="items">
<div class="head"><h1>Admin</h1></div>
<div class="item"><a href="{{ route('admin.post.index') }}">Posts</a></div>
<div class="item"><a href="#">Now</a></div>
<div class="item"><a href="#">Setup</a></div>
<div class="item"><a href="#">Projects</a></div>
<div class="end"><a href="{{ route('index') }}">Volver</a></div>
</div>
</div>
<div class="container">
@yield('title')
<hr/>
@yield('content')
</div>
<script src="js/app.js"></script>
</body>
</html>

View File

@@ -1,28 +1,9 @@
<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
@section('title')
<title>Daniel Cortés</title>
@show
<link href="{{ asset('css/admin.css') }}" rel="stylesheet">
</head>
<body>
<div class="sidebar">
<div class="items">
<div class="head"><span>ADMIN</span></div>
<div class="item"><a href="#">Posts</a></div>
<div class="item"><a href="#">Now</a></div>
<div class="item"><a href="#">Setup</a></div>
<div class="item"><a href="#">Projects</a></div>
<div class="end"><a href="{{ route('index') }}">Volver</a></div>
</div>
</div>
@extends('admin.base')
<div class="container">
</div>
@section('title')
<h1>Admin Panel</h1>
@endsection
<script src="js/app.js"></script>
</body>
</html>
@section('content')
@endsection

View File

@@ -0,0 +1,21 @@
@extends('admin.base')
@section('title')
<h1>Create Post</h1>
@endsection
@section('content')
<form action="{{ route('admin.post.save') }}" method="post">
@csrf
<div>
<label for="title">Titulo</label>
<input type="text" id="title" name="title" required/>
</div>
<div>
<label for="md">Contenido</label>
<textarea id="md" name="md"></textarea>
</div>
<input type="submit" value="Crear"/>
</form>
@endsection

View File

@@ -0,0 +1,33 @@
@extends('admin.base')
@section('title')
<h1>Posts</h1>
@endsection
@section('content')
<table>
<thead>
<tr>
<th>Id</th>
<th>Titulo</th>
<th>Fecha</th>
<th class="controls"><a href="{{ route('admin.post.create') }}">create</a></th>
</tr>
</thead>
<tbody>
@foreach($posts as $post)
<tr>
<td>{{$post->id}}</td>
<td>{{$post->title}}</td>
<td>{{$post->created_at->format('Y-m-d')}}</td>
<td class="controls">
<a href="#">edit</a>
<a href="#">delete</a>
</td>
</tr>
@endforeach
</tbody>
</table>
@endsection