mas mejoras de ui, cambie el css a mano por purecss
This commit is contained in:
14
resources/js/admin.js
vendored
Normal file
14
resources/js/admin.js
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
switch(window.location.pathname){
|
||||
case "/admin/posts":
|
||||
document.getElementById("posts-link").classList.add("pure-menu-highlight");
|
||||
break;
|
||||
case "/admin/now":
|
||||
document.getElementById("now-link").classList.add("pure-menu-highlight");
|
||||
break;
|
||||
case "/admin/projects":
|
||||
document.getElementById("proyectos-link").classList.add("pure-menu-highlight");
|
||||
break;
|
||||
case "/admin/setup":
|
||||
document.getElementById("setup-link").classList.add("pure-menu-highlight");
|
||||
break;
|
||||
}
|
||||
18
resources/js/app.js
vendored
18
resources/js/app.js
vendored
@@ -0,0 +1,18 @@
|
||||
switch(window.location.pathname){
|
||||
case "/":
|
||||
document.getElementById("title-link").classList.add("pure-menu-highlight");
|
||||
break;
|
||||
case "/blog":
|
||||
case "/blog/archive":
|
||||
document.getElementById("blog-link").classList.add("pure-menu-highlight");
|
||||
break;
|
||||
case "/now":
|
||||
document.getElementById("now-link").classList.add("pure-menu-highlight");
|
||||
break;
|
||||
case "/projects":
|
||||
document.getElementById("proyectos-link").classList.add("pure-menu-highlight");
|
||||
break;
|
||||
case "/setup":
|
||||
document.getElementById("setup-link").classList.add("pure-menu-highlight");
|
||||
break;
|
||||
}
|
||||
|
||||
93
resources/sass/app.scss
vendored
93
resources/sass/app.scss
vendored
@@ -1,10 +1,15 @@
|
||||
@import "~purecss/build/pure.css";
|
||||
|
||||
body {
|
||||
color: hsl(10, 10%, 13%);
|
||||
background-color: hsl(10, 100%, 99%);
|
||||
overflow-y: scroll;
|
||||
}
|
||||
|
||||
.container {
|
||||
max-width: 70ch;
|
||||
padding: 2ch;
|
||||
padding-bottom: 2ch;
|
||||
margin: auto;
|
||||
color: #212121;
|
||||
}
|
||||
|
||||
img {
|
||||
@@ -15,26 +20,73 @@ a {
|
||||
color: #0fa0ce;
|
||||
}
|
||||
|
||||
.link {
|
||||
color: #0fa0ce;
|
||||
border: none;
|
||||
background: none;
|
||||
text-decoration: underline;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
p {
|
||||
line-height: 1.5rem;
|
||||
}
|
||||
|
||||
textarea {
|
||||
.pure-form textarea {
|
||||
height: 30ch;
|
||||
}
|
||||
|
||||
.pure-form input[type="text"],
|
||||
.pure-form textarea {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.pure-form label {
|
||||
margin-top: 1em;
|
||||
}
|
||||
|
||||
|
||||
.pure-menu-horizontal {
|
||||
display: flex;
|
||||
padding-left: 40ch;
|
||||
padding-right: 40ch;
|
||||
padding-bottom: 1em;
|
||||
padding-top: 1em;
|
||||
margin-bottom: 1em;
|
||||
box-shadow: 0 -5px 10px black;
|
||||
}
|
||||
|
||||
.pure-menu-horizontal .pure-menu-list {
|
||||
display: flex;
|
||||
justify-content: right;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.pure-menu-link {
|
||||
color: #212121;
|
||||
}
|
||||
.pure-menu-link:hover {
|
||||
|
||||
.pure-menu-link:hover, .pure-menu-highlight {
|
||||
color: #0fa0ce;
|
||||
border-bottom: 1px #0fa0ce solid;
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.pure-menu-heading {
|
||||
letter-spacing: .5ch;
|
||||
padding: .5em 0;
|
||||
}
|
||||
|
||||
.admin-link {
|
||||
color: #ee1155;
|
||||
}
|
||||
|
||||
.admin-link:hover{
|
||||
color: #ee1155;
|
||||
border-bottom: 1px #ee1155 solid;
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.button-black-white {
|
||||
background-color: #ffffff;
|
||||
color: #212121;
|
||||
@@ -48,6 +100,35 @@ textarea {
|
||||
background-image: none;
|
||||
}
|
||||
|
||||
.u-align-right {
|
||||
float: right;
|
||||
.table-heading {
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
|
||||
.pure-table {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.pure-table,
|
||||
.pure-table td,
|
||||
.pure-table th {
|
||||
border:none;
|
||||
}
|
||||
|
||||
.pure-table td {
|
||||
word-wrap: break-word;
|
||||
max-width: 30ch;
|
||||
}
|
||||
|
||||
.pure-table .controls {
|
||||
display: inline-flex;
|
||||
}
|
||||
|
||||
.pure-table .controls a:first-child{
|
||||
padding-right: 1em;
|
||||
}
|
||||
|
||||
.pure-form .control {
|
||||
padding-top: 1em;
|
||||
width:100%;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
@@ -10,10 +10,10 @@
|
||||
<div class="pure-menu pure-menu-horizontal">
|
||||
<span class="pure-menu-heading">Admin</span>
|
||||
<ul class="pure-menu-list">
|
||||
<li class="pure-menu-item"><a class="pure-menu-link" href="{{ route('admin.post.index') }}">Posts</a></li>
|
||||
<li class="pure-menu-item"><a class="pure-menu-link" href="{{ route('admin.now.index') }}">Now</a></li>
|
||||
<li class="pure-menu-item"><a class="pure-menu-link" href="#">Setup</a></li>
|
||||
<li class="pure-menu-item"><a class="pure-menu-link" href="{{ route('admin.project.index') }}">Projects</a></li>
|
||||
<li class="pure-menu-item"><a class="pure-menu-link" id="posts-link" href="{{ route('admin.post.index') }}">Posts</a></li>
|
||||
<li class="pure-menu-item"><a class="pure-menu-link" id="now-link"href="{{ route('admin.now.index') }}">Now</a></li>
|
||||
<li class="pure-menu-item"><a class="pure-menu-link" id="setup-link"href="#">Setup</a></li>
|
||||
<li class="pure-menu-item"><a class="pure-menu-link" id="projects-link"href="{{ route('admin.project.index') }}">Projects</a></li>
|
||||
<li class="pure-menu-item"><a class="pure-menu-link" href="{{ route('index') }}">Volver</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
@@ -23,6 +23,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="js/app.js"></script>
|
||||
<script src="{{ asset('js/app.js') }}"></script>
|
||||
<script src="{{ asset('js/admin.js') }}"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -8,19 +8,14 @@
|
||||
<form class="pure-form pure-form-stacked" action="{{ route('admin.post.save') }}" method="post">
|
||||
@csrf
|
||||
<fieldset>
|
||||
<div class="pure-g">
|
||||
<div class="pure-u-1">
|
||||
<label for="title">Titulo</label>
|
||||
<input type="text" class="pure-u-23-24" id="title" name="title" required/>
|
||||
</div>
|
||||
<label for="title">Titulo</label>
|
||||
<input type="text" id="title" name="title" required/>
|
||||
|
||||
<div class="pure-u-1">
|
||||
<label for="md">Contenido</label>
|
||||
<textarea id="md" class="pure-u-23-24" name="md"></textarea>
|
||||
</div>
|
||||
<label for="md">Contenido</label>
|
||||
<textarea id="md" name="md"></textarea>
|
||||
<div class="control">
|
||||
<button class="pure-button button-black-white" type="submit">Crear</button>
|
||||
</div>
|
||||
<button class="pure-button" type="submit" class="form-submit">Crear</button>
|
||||
</fieldset>
|
||||
</form>
|
||||
|
||||
@endsection
|
||||
|
||||
@@ -8,16 +8,14 @@
|
||||
<form class="pure-form pure-form-stacked" action="{{ route('admin.post.update', ['post' => $post->id]) }}" method="post">
|
||||
@csrf
|
||||
<fieldset>
|
||||
<div class="pure-g">
|
||||
<div class="pure-u-1">
|
||||
<label for="title">Titulo</label>
|
||||
<input type="text" class="pure-u-23-24" id="title" name="title" value="{{ old('title', $post->title) }}" required/>
|
||||
<label for="title">Titulo</label>
|
||||
<input type="text" id="title" name="title" value="{{ old('title', $post->title) }}" required/>
|
||||
<label for="md">Contenido</label>
|
||||
<textarea id="md" name="md">{{ old('md', $post->md) }}</textarea>
|
||||
<div class="control">
|
||||
<button type="submit" class="pure-button button-black-white">Actualizar</button>
|
||||
</div>
|
||||
<div class="pure-u-1">
|
||||
<label for="md">Contenido</label>
|
||||
<textarea class="pure-u-23-24" id="md" name="md">{{ old('md', $post->md) }}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<button type="submit" class="pure-button">Actualizar</button>
|
||||
</fieldset>
|
||||
</form>
|
||||
@endsection
|
||||
|
||||
@@ -1,13 +1,10 @@
|
||||
@extends('admin.base')
|
||||
|
||||
@section('content')
|
||||
<div class="pure-g">
|
||||
<div class="pure-u-1-5">
|
||||
<h1>Posts</h1>
|
||||
</div>
|
||||
<div class="pure-u-4-5">
|
||||
<a class="pure-button u-align-right" href="{{ route('admin.post.create') }}">Create</a>
|
||||
</div>
|
||||
|
||||
<div class="table-heading">
|
||||
<h1>Posts</h1>
|
||||
<a class="pure-button button-black-white" href="{{ route('admin.post.create') }}">Create Post</a>
|
||||
</div>
|
||||
|
||||
<table class="pure-table">
|
||||
@@ -26,13 +23,11 @@
|
||||
<td>{{$post->id}}</td>
|
||||
<td>{{$post->title}}</td>
|
||||
<td>{{$post->created_at->format('Y-m-d')}}</td>
|
||||
<td>
|
||||
<a class="pure-button" href="{{ route('admin.post.edit', ['post' => $post->id]) }}">Edit</a>
|
||||
</td>
|
||||
<td>
|
||||
<td class="controls">
|
||||
<a href="{{ route('admin.post.edit', ['post' => $post->id]) }}">Edit</a>
|
||||
<form action={{ route('admin.post.delete', ['post' => $post->id]) }} method="post">
|
||||
@csrf
|
||||
<button type="submit" class="pure-button">Delete</button>
|
||||
<button type="submit" class="link" onclick="return confirm('Estas seguro?')">Delete</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -10,19 +10,19 @@
|
||||
</head>
|
||||
<body>
|
||||
<nav class="pure-menu pure-menu-horizontal">
|
||||
<a class="pure-menu-heading pure-menu-link" href="{{route('index')}}">Daniel Cortes</a>
|
||||
<a class="pure-menu-heading pure-menu-link" id="title-link" href="{{route('index')}}">Daniel Cortes</a>
|
||||
<ul class="pure-menu-list">
|
||||
<li class="pure-menu-item">
|
||||
<a class="pure-menu-link" href="{{route('blog.index')}}">Blog</a>
|
||||
<a class="pure-menu-link" id="blog-link" href="{{route('blog.index')}}">Blog</a>
|
||||
</li>
|
||||
<li class="pure-menu-item">
|
||||
<a class="pure-menu-link" href="{{route('now.index')}}">Now</a>
|
||||
<a class="pure-menu-link" id="now-link" href="{{route('now.index')}}">Now</a>
|
||||
</li>
|
||||
<li class="pure-menu-item">
|
||||
<a class="pure-menu-link" href="{{route('project.index')}}">Proyectos</a>
|
||||
<a class="pure-menu-link" id="proyectos-link" href="{{route('project.index')}}">Proyectos</a>
|
||||
</li>
|
||||
<li class="pure-menu-item">
|
||||
<a class="pure-menu-link" href="{{route('setup')}}">Setup</a>
|
||||
<a class="pure-menu-link" id="setup-link" href="{{route('setup')}}">Setup</a>
|
||||
</li>
|
||||
@auth
|
||||
<li class="pure-menu-item">
|
||||
@@ -36,6 +36,6 @@
|
||||
@yield('content')
|
||||
</div>
|
||||
|
||||
<script src="js/app.js"></script>
|
||||
<script src="{{ asset('js/app.js') }}"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user