actualizado admin-projects

This commit is contained in:
Daniel Cortés
2019-10-14 12:07:40 -03:00
parent a98fa27d78
commit 82973e7ca8
3 changed files with 43 additions and 30 deletions

View File

@@ -5,22 +5,25 @@
@endsection @endsection
@section('content') @section('content')
<form action="{{ route('admin.project.save') }}" enctype="multipart/form-data" method="post"> <form action="{{ route('admin.project.save') }}" enctype="multipart/form-data" class="pure-form pure-form-stacked" method="post">
@csrf @csrf
<div> <fieldset>
<label for="title">Titulo</label> <h1>Add Project</h1>
<input type="text" class="form-input" id="title" name="title" required/> <a class="pure-button button-black-white" href="{{ route('admin.project.index') }}">Volver</a>
</div>
<div>
<label for="md">Descripcion</label>
<textarea id="md" class="form-input" name="md"></textarea>
</div>
<div>
<label for="photos">Fotos</label>
<input multiple="multiple" id="photos" class="form-input" name="photos[]" type="file">
</div>
<input type="submit" class="form-submit" value="Crear"/> <label for="title">Titulo</label>
<input type="text" id="title" name="title" required/>
<label for="md">Descripcion</label>
<textarea id="md" name="md"></textarea>
<label for="photos">Fotos</label>
<input multiple="multiple" id="photos" name="photos[]" type="file">
<div class="control">
<button class="pure-button button-black-white" type="submit">Crear</button>
</div>
</fieldset>
</form> </form>
@endsection @endsection

View File

@@ -1,24 +1,25 @@
@extends('admin.base') @extends('admin.base')
@section('title') @section('title')
<h1>Edit Post</h1> <h1>Edit Project</h1>
@endsection @endsection
@section('content') @section('content')
<form action="{{ route('admin.project.update', ['project' => $project->id]) }}" enctype="multipart/form-data" method="post"> <form class="pure-form pure-form-stacked" action="{{ route('admin.project.update', ['project' => $project->id]) }}" method="post">
@csrf @csrf
<div> <fieldset>
<h1>Edit Project</h1>
<a href="{{ route('admin.project.index') }}" class="pure-button button-black-white">Volver</a>
<label for="title">Titulo</label> <label for="title">Titulo</label>
<input type="text" class="form-input" id="title" name="title" value="{{ old('title', $project->title) }}" required/> <input type="text" class="form-input" id="title" name="title" value="{{ old('title', $project->title) }}" required/>
</div>
<div>
<label for="md">Descripcion</label> <label for="md">Descripcion</label>
<textarea class="form-input" id="md" name="md">{{ old('md', $project->md) }}</textarea> <textarea class="form-input" id="md" name="md">{{ old('md', $project->md) }}</textarea>
</div>
<div> <div class="control">
<label for="photos">Fotos</label> <button type="submit" class="pure-button button-black-white">Actualizar</button>
<input multiple="multiple" id="photos" class="form-input" name="photos[]" type="file"> </div>
</div> </fieldset>
<input type="submit" class="form-submit" value="Actualizar"/>
</form> </form>
@endsection @endsection

View File

@@ -5,22 +5,31 @@
@endsection @endsection
@section('content') @section('content')
<table class="table"> <div class="table-heading">
<h1>Projects</h1>
<a class="pure-button button-black-white" href="{{ route('admin.project.create') }}">Add Project</a>
</div>
<table class="pure-table">
<thead> <thead>
<tr> <tr>
<th>Id</th>
<th>Titulo</th> <th>Titulo</th>
<th class="controls"><a href="{{ route('admin.project.create') }}">create</a></th> <th>Fecha</th>
<th></th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@foreach($projects as $project) @foreach($projects as $project)
<tr> <tr>
<td>{{$project->title}}</td> <td>{{$project->id}}</td>
<td>{{ Str::limit($project->title, 30, "...") }}</td>
<td>{{$project->created_at->format('Y-m-d')}}</td>
<td class="controls"> <td class="controls">
<a href="{{ route('admin.project.edit', ['project' => $project->id]) }}">edit</a> <a href="{{ route('admin.project.edit', ['project' => $project->id]) }}" class="pure-button button-black-white">Edit</a>
<form action={{ route('admin.project.delete', ['project' => $project->id]) }} method="post"> <form action={{ route('admin.project.delete', ['project' => $project->id]) }} method="post">
@csrf @csrf
<input type="submit" value="delete"/> <button type="submit" class="pure-button button-black-white" onclick="return confirm('Estas Seguro?')">Delete</button>
</form> </form>
</td> </td>
</tr> </tr>