Primer commit proyecto Laravel
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
@extends('layouts.landing')
|
||||
|
||||
@section('title',"Crear")
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="container-fluid">
|
||||
<div class="card shadow mb-4">
|
||||
<div class="card-header py-3">
|
||||
<h6 class="m-0 font-weight-bold text-primary">Crear Nota</h6>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<a href="{{route('note.index')}}">Regresar</a>
|
||||
<form action="{{route('note.store')}}" method="POST">
|
||||
@csrf
|
||||
<div class="mb-3">
|
||||
<label class="small mb-1">title</label>
|
||||
<input class="form-control" name="title">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="small mb-1">description</label>
|
||||
<input class="form-control" name="description">
|
||||
</div>
|
||||
<input class="btn btn-primary" type="submit" value="Create">
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
@@ -0,0 +1,32 @@
|
||||
@extends('layouts.landing')
|
||||
|
||||
@section('title',"Edit")
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="container-fluid">
|
||||
<div class="card shadow mb-4">
|
||||
<div class="card-header py-3">
|
||||
<h6 class="m-0 font-weight-bold text-primary">Editar nota</h6>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<a href="{{route('note.index')}}">Regresar</a>
|
||||
<form action="{{route('note.update',$note->id)}}" method="POST">
|
||||
@method('PUT')
|
||||
@csrf
|
||||
<div class="mb-3">
|
||||
<label class="small mb-1">title</label>
|
||||
<input class="form-control" name="title" value="{{$note->title}}">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="small mb-1">description</label>
|
||||
<input class="form-control" name="description" value="{{$note->description}}">
|
||||
</div>
|
||||
<input class="btn btn-primary" type="submit" value="Update">
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
@@ -0,0 +1,76 @@
|
||||
@extends('layouts.landing')
|
||||
|
||||
@section('head')
|
||||
@include('layouts._partials.tablaStyle')
|
||||
@endsection
|
||||
@section('title',"Inicio")
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="container-fluid">
|
||||
<div class="card shadow mb-4">
|
||||
<div class="card-header py-3">
|
||||
<div class="d-sm-flex align-items-center justify-content-between">
|
||||
<h6 class="m-0 font-weight-bold text-primary">Notas</h6>
|
||||
@can('note.create')
|
||||
<a href="{{route('note.create')}}" class="d-sm-inline-block btn btn-sm btn-primary shadow-sm"><i class="fas fa-download fa-sm text-white-50"></i> Crear nota</a>
|
||||
@endcan
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<div class="container-fluid">
|
||||
|
||||
<table id="tcont" class="table table-striped table-bordered nowrap table-hover" style="width:100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Id</th>
|
||||
<th>Titulo</th>
|
||||
<th>Descripción</th>
|
||||
<th>Opciones</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@forelse ($notes as $note)
|
||||
<tr style="width:100%">
|
||||
|
||||
<td>{{$note->id}}</td>
|
||||
<td><a href="{{route('note.show',$note->id)}}">{{$note->title}}</a></td>
|
||||
<td>{{$note->description}}</td>
|
||||
<td class="row mx-auto">
|
||||
@can('note.edit')
|
||||
<div class="col-sm-6 col-md-6"><a class="btn btn-primary" href="{{route('note.edit',$note->id)}}">Edit</a></div>
|
||||
@endcan
|
||||
|
||||
@can('note.destroy')
|
||||
<div class="col-sm-6 col-md-6">
|
||||
<form action="{{route('note.destroy',$note->id)}}" method="POST">
|
||||
@csrf
|
||||
@method('DELETE')
|
||||
<input type="submit" value="DELETE" class="btn btn-danger">
|
||||
</form>
|
||||
</div>
|
||||
@endcan
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
@empty
|
||||
<p>Sin notas.</p>
|
||||
@endforelse
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
|
||||
|
||||
@section('scripts')
|
||||
@include('layouts._partials.tablaScript')
|
||||
@endsection
|
||||
@@ -0,0 +1,23 @@
|
||||
@extends('layouts.landing')
|
||||
|
||||
@section('title',"show")
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="container-fluid">
|
||||
<div class="card shadow mb-4">
|
||||
<div class="card-header py-3">
|
||||
<div class="d-sm-flex align-items-center justify-content-between">
|
||||
<h6 class="m-0 font-weight-bold text-primary">Datos de la nota</h6>
|
||||
<a href="{{route('note.index')}}" class="d-sm-inline-block btn btn-sm btn-primary shadow-sm"><i class="fas fa-download fa-sm text-white-50"></i> Regresar</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<h1>{{$note->title}}</h1>
|
||||
<p>{{$note->description}}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
Reference in New Issue
Block a user