Cree las rutas para la creacion de projectos
This commit is contained in:
5
resources/sass/admin.scss
vendored
5
resources/sass/admin.scss
vendored
@@ -99,6 +99,11 @@ $sidebar-width: 13rem;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
td.controls, th.controls {
|
||||
margin-left: 0;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
td.controls {
|
||||
a, input[type=submit]{
|
||||
display: block;
|
||||
|
||||
34
resources/sass/app.scss
vendored
34
resources/sass/app.scss
vendored
@@ -3,11 +3,12 @@
|
||||
@import "variables.scss";
|
||||
|
||||
/* Base
|
||||
-------------------------------------*/
|
||||
-------------------------------------*/
|
||||
html {
|
||||
overflow-y: scroll;
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
body {
|
||||
font-size: 15px;
|
||||
line-height: 1.6rem;
|
||||
@@ -124,3 +125,34 @@ textarea.form-input {
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
|
||||
/* Images
|
||||
-------------------------------------*/
|
||||
.image-container {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
img {
|
||||
display: block;
|
||||
margin: .5rem;
|
||||
max-width: calc(100% - 1rem);
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (min-width: 600px) {
|
||||
.image-container {
|
||||
flex-direction: row;
|
||||
img {
|
||||
max-width: calc((100% / 2) - 1rem);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (min-width: 768px) {
|
||||
.image-container {
|
||||
flex-direction: row;
|
||||
img {
|
||||
max-width: calc((100% / 3) - 1rem);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -11,9 +11,9 @@
|
||||
<div class="sidebar-items">
|
||||
<div class="sidebar-head"><span>Admin</span></div>
|
||||
<div class="sidebar-item"><a href="{{ route('admin.post.index') }}" class="sidebar-link">Posts</a></div>
|
||||
<div class="sidebar-item"><a href="#" class="sidebar-link">Now</a></div>
|
||||
<div class="sidebar-item"><a href="{{ route('admin.now.index') }}" class="sidebar-link">Now</a></div>
|
||||
<div class="sidebar-item"><a href="#" class="sidebar-link">Setup</a></div>
|
||||
<div class="sidebar-item"><a href="#" class="sidebar-link">Projects</a></div>
|
||||
<div class="sidebar-item"><a href="{{ route('admin.project.index') }}" class="sidebar-link">Projects</a></div>
|
||||
<div class="sidebar-end"><a href="{{ route('index') }}" class="sidebar-link">Volver</a></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
17
resources/views/admin/now/create.blade.php
Normal file
17
resources/views/admin/now/create.blade.php
Normal file
@@ -0,0 +1,17 @@
|
||||
@extends('admin.base')
|
||||
|
||||
@section('title')
|
||||
<h1>Create Now</h1>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<form action="{{ route('admin.now.save') }}" method="post">
|
||||
@csrf
|
||||
<div>
|
||||
<label for="md">Contenido</label>
|
||||
<textarea id="md" class="form-input" name="md"></textarea>
|
||||
</div>
|
||||
<input type="submit" class="form-submit" value="Crear"/>
|
||||
</form>
|
||||
|
||||
@endsection
|
||||
16
resources/views/admin/now/edit.blade.php
Normal file
16
resources/views/admin/now/edit.blade.php
Normal file
@@ -0,0 +1,16 @@
|
||||
@extends('admin.base')
|
||||
|
||||
@section('title')
|
||||
<h1>Edit Now</h1>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<form action="{{ route('admin.now.update', ['now' => $now->id]) }}" method="post">
|
||||
@csrf
|
||||
<div>
|
||||
<label for="md">Contenido</label>
|
||||
<textarea class="form-input" id="md" name="md">{{ old('md', $now->md) }}</textarea>
|
||||
</div>
|
||||
<input type="submit" class="form-submit" value="Actualizar"/>
|
||||
</form>
|
||||
@endsection
|
||||
34
resources/views/admin/now/index.blade.php
Normal file
34
resources/views/admin/now/index.blade.php
Normal file
@@ -0,0 +1,34 @@
|
||||
@extends('admin.base')
|
||||
|
||||
@section('title')
|
||||
<h1>Now</h1>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Id</th>
|
||||
<th>Fecha</th>
|
||||
<th class="controls"><a href="{{ route('admin.now.create') }}">create</a></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($nows as $now)
|
||||
<tr>
|
||||
<td>{{$now->id}}</td>
|
||||
<td>{{$now->created_at->format('Y-m-d')}}</td>
|
||||
<td class="controls">
|
||||
<a href="{{ route('admin.now.edit', ['now' => $now->id]) }}">edit</a>
|
||||
<form action={{ route('admin.now.delete', ['now' => $now->id]) }} method="post">
|
||||
@csrf
|
||||
<input type="submit" value="delete"/>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
@endsection
|
||||
26
resources/views/admin/projects/create.blade.php
Normal file
26
resources/views/admin/projects/create.blade.php
Normal file
@@ -0,0 +1,26 @@
|
||||
@extends('admin.base')
|
||||
|
||||
@section('title')
|
||||
<h1>Create Project</h1>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<form action="{{ route('admin.project.save') }}" enctype="multipart/form-data" method="post">
|
||||
@csrf
|
||||
<div>
|
||||
<label for="title">Titulo</label>
|
||||
<input type="text" class="form-input" id="title" name="title" required/>
|
||||
</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"/>
|
||||
</form>
|
||||
|
||||
@endsection
|
||||
24
resources/views/admin/projects/edit.blade.php
Normal file
24
resources/views/admin/projects/edit.blade.php
Normal file
@@ -0,0 +1,24 @@
|
||||
@extends('admin.base')
|
||||
|
||||
@section('title')
|
||||
<h1>Edit Post</h1>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<form action="{{ route('admin.project.update', ['project' => $project->id]) }}" enctype="multipart/form-data" method="post">
|
||||
@csrf
|
||||
<div>
|
||||
<label for="title">Titulo</label>
|
||||
<input type="text" class="form-input" id="title" name="title" value="{{ old('title', $project->title) }}" required/>
|
||||
</div>
|
||||
<div>
|
||||
<label for="md">Descripcion</label>
|
||||
<textarea class="form-input" id="md" name="md">{{ old('md', $project->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="Actualizar"/>
|
||||
</form>
|
||||
@endsection
|
||||
32
resources/views/admin/projects/index.blade.php
Normal file
32
resources/views/admin/projects/index.blade.php
Normal file
@@ -0,0 +1,32 @@
|
||||
@extends('admin.base')
|
||||
|
||||
@section('title')
|
||||
<h1>Projects</h1>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Titulo</th>
|
||||
<th class="controls"><a href="{{ route('admin.project.create') }}">create</a></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($projects as $project)
|
||||
<tr>
|
||||
<td>{{$project->title}}</td>
|
||||
<td class="controls">
|
||||
<a href="{{ route('admin.project.edit', ['project' => $project->id]) }}">edit</a>
|
||||
<form action={{ route('admin.project.delete', ['project' => $project->id]) }} method="post">
|
||||
@csrf
|
||||
<input type="submit" value="delete"/>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
@endsection
|
||||
@@ -21,7 +21,7 @@
|
||||
<a class="navbar-item-link" href="{{route('now.index')}}">Now</a>
|
||||
</li>
|
||||
<li class="navbar-item">
|
||||
<a class="navbar-item-link" href="{{route('projects')}}">Proyectos</a>
|
||||
<a class="navbar-item-link" href="{{route('project.index')}}">Proyectos</a>
|
||||
</li>
|
||||
<li class="navbar-item">
|
||||
<a class="navbar-item-link" href="{{route('setup')}}">Setup</a>
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
@extends('base')
|
||||
|
||||
@section('content')
|
||||
<h1>Now</h1>
|
||||
@endsection
|
||||
@@ -1,5 +0,0 @@
|
||||
@extends('base')
|
||||
|
||||
@section('content')
|
||||
<h1>Projects</h1>
|
||||
@endsection
|
||||
22
resources/views/projects/index.blade.php
Normal file
22
resources/views/projects/index.blade.php
Normal file
@@ -0,0 +1,22 @@
|
||||
@extends('base')
|
||||
|
||||
@php
|
||||
$parse = new Parsedown();
|
||||
@endphp
|
||||
|
||||
@section('content')
|
||||
@foreach($projects as $project)
|
||||
<section>
|
||||
<h1>{{ $project->title }}</h1>
|
||||
|
||||
{!! $parse->text($project->md) !!}
|
||||
|
||||
<div class="image-container">
|
||||
@foreach($project->photos as $photo)
|
||||
<img src="{{ Storage::url($photo->filename) }}"/>
|
||||
@endforeach
|
||||
</div>
|
||||
</section>
|
||||
@endforeach
|
||||
<hr/>
|
||||
@endsection
|
||||
Reference in New Issue
Block a user