diff --git a/app/Http/Controllers/AdminController.php b/app/Http/Controllers/AdminController.php index d55cc57..1804cfd 100644 --- a/app/Http/Controllers/AdminController.php +++ b/app/Http/Controllers/AdminController.php @@ -2,6 +2,7 @@ namespace App\Http\Controllers; +use App\Post; use Illuminate\Http\Request; class AdminController extends Controller @@ -10,4 +11,9 @@ class AdminController extends Controller { return view('admin.index'); } + + public function posts() + { + return view('admin.posts.index', ['posts' => Post::all()]); + } } diff --git a/app/Http/Controllers/PostController.php b/app/Http/Controllers/PostController.php new file mode 100644 index 0000000..184626c --- /dev/null +++ b/app/Http/Controllers/PostController.php @@ -0,0 +1,36 @@ +title = $request->title; + $post->md = $request->md; + $post->save(); + + return redirect()->route('admin.post.index'); + } + + public function edit($id) + { + } + + public function update($id) + { + } + + public function delete($id) + { + } +} diff --git a/public/css/admin.css b/public/css/admin.css index 42f4688..3756c04 100644 --- a/public/css/admin.css +++ b/public/css/admin.css @@ -3,6 +3,10 @@ body { color: #212121; } +hr { + border: 1px solid #f2f2f2; +} + .sidebar { position: fixed; left: 0; @@ -49,13 +53,103 @@ body { color: #0fa0ce; } -.sidebar span { - font-size: 1.2rem; - margin: 2em 0; +.sidebar h1 { + text-align: center; } .container { margin-left: 20ch; height: 100vh; + padding: 0em 2em; +} + +@media (max-width: 600px) { + .sidebar { + display: none; + } + + .container { + margin-left: 0; + } +} + +table { + width: 100%; + border-collapse: collapse; +} + +table th { + background: #212121; + color: #f2f2f2; + font-weight: bold; + text-transform: uppercase; +} + +table td, +table th { + padding: 6px; + height: 2em; + border-bottom: 1px solid #212121; + text-align: left; +} + +table td.controls a { + display: block; + text-transform: uppercase; + font-weight: bold; + text-decoration: none; + color: #212121; +} + +table th.controls a { + display: block; + text-transform: uppercase; + font-weight: bold; + text-decoration: none; + color: white; +} + +form { + height: 100%; +} + +form label { + display: block; + text-transform: uppercase; + font-weight: bold; + font-size: 0.9em; +} + +form input[type=text], +form textarea { + box-sizing: border-box; + display: block; + width: 100%; + height: 2em; + border: 1px solid #212121; + border-radius: 4px; + margin-bottom: 1em; + padding: 0.4em; +} + +form textarea { + box-sizing: border-box; + height: 30em; +} + +form input[type=submit] { + display: inline-block; + box-sizing: border-box; + text-align: center; + cursor: pointer; + color: #212121; + border: 1px solid #212121; + border-radius: 4px; + background-color: #fff; + font-weight: bold; + height: 38px; + padding: 0 38px; + margin-bottom: 3em; + text-transform: uppercase; } diff --git a/resources/sass/admin.scss b/resources/sass/admin.scss index d40c19f..d657eb8 100644 --- a/resources/sass/admin.scss +++ b/resources/sass/admin.scss @@ -7,6 +7,10 @@ body { color: $colorfg; } +hr { + border: 1px solid $colorborder; +} + .sidebar { position:fixed; left: 0; @@ -28,7 +32,7 @@ body { .end { margin-top: auto; - + a { padding: 2em 0; } @@ -49,13 +53,108 @@ body { color: $color01; } - span { - font-size: 1.2rem; - margin: 2em 0; + h1 { + text-align:center; } } .container { margin-left: 20ch; height:100vh; + padding: 0em 2em; +} + +@media (max-width: 600px) { + .sidebar{ + display: none; + } + + .container{ + margin-left: 0; + } + +} + +table { + width: 100%; + border-collapse: collapse; + + th { + background: $colorfg; + color: $colorborder; + font-weight: bold; + text-transform: uppercase; + } + + td, th { + padding: 6px; + height: 2em; + border-bottom: 1px solid $colorfg; + text-align: left; + } + + td.controls { + a { + display:block; + text-transform: uppercase; + font-weight: bold; + text-decoration: none; + color: $colorfg; + } + } + + th.controls { + a { + display:block; + text-transform: uppercase; + font-weight: bold; + text-decoration: none; + color: white; + } + } +} + +form { + height: 100%; + + label { + display: block; + text-transform: uppercase; + font-weight: bold; + font-size: .9em; + } + + input[type=text], textarea{ + box-sizing: border-box; + display: block; + width: 100%; + height: 2em; + border: 1px solid $colorfg; + border-radius: 4px; + margin-bottom: 1em; + padding: .4em; + } + + textarea { + box-sizing: border-box; + height: 30em; + } + + + input[type=submit]{ + display: inline-block; + box-sizing: border-box; + text-align: center; + cursor: pointer; + color: $colorfg; + border: 1px solid $colorfg; + border-radius: 4px; + background-color: #fff; + + font-weight: bold; + height: 38px; + padding: 0 38px; + margin-bottom: 3em; + text-transform: uppercase; + } } diff --git a/resources/views/admin/base.blade.php b/resources/views/admin/base.blade.php new file mode 100644 index 0000000..02a4f25 --- /dev/null +++ b/resources/views/admin/base.blade.php @@ -0,0 +1,29 @@ + + +
+ + +| Id | +Titulo | +Fecha | +create | +
|---|---|---|---|
| {{$post->id}} | +{{$post->title}} | +{{$post->created_at->format('Y-m-d')}} | ++ edit + delete + | +