diff --git a/remember_laravel/app/Http/Controllers/HomeController.php b/remember_laravel/app/Http/Controllers/HomeController.php index ba3e661cff8e44d2524751cbbad73924a96d4883..2706128dbfe42124e7f4fb3a30c0b7b66b19ab95 100644 --- a/remember_laravel/app/Http/Controllers/HomeController.php +++ b/remember_laravel/app/Http/Controllers/HomeController.php @@ -7,6 +7,7 @@ use Illuminate\Support\Facades\Auth; use App\User; use App\Image; +use App\Interview; class HomeController extends Controller { @@ -53,7 +54,15 @@ class HomeController extends Controller public function interview() { - return view('frontend.interview')->with(['frase' => $this->frase()]); + $interviews = Interview::all(); + return view('frontend.interviews.index')->with(['interviews' => $interviews, 'frase' => $this->frase()]); + } + + public function showInterview($id) + { + $interview = Interview::findOrFail($id); + + return view('frontend.interviews.show')->with(['interview' => $interview, 'frase' => $this->frase()]); } public function about() diff --git a/remember_laravel/resources/views/dashboard/galeria/create.blade.php b/remember_laravel/resources/views/dashboard/galeria/create.blade.php index 94b68051f05e3705ae23dcad1ad8f7f1e2ac41e3..ccf0191234836170e439a534f8832da35f2c43f6 100644 --- a/remember_laravel/resources/views/dashboard/galeria/create.blade.php +++ b/remember_laravel/resources/views/dashboard/galeria/create.blade.php @@ -6,7 +6,7 @@ <h4 class="page-title">Galeria</h4> <ol class="breadcrumb"> <li><a href="{{ route('dashboard') }}">Dashboard</a></li> - <li><a href="{{ route('gallery') }}">Galeria</a></li> + <li><a href="{{ route('gallery-dashboard') }}">Galeria</a></li> <li class="active">Nova imagem</li> </ol> </div> @@ -15,7 +15,7 @@ <div class="col-xs-12"> <div class="card-box"> <h4 class="m-t-0 m-b-30 header-title"><b>Nova Imagem</b></h4> - <form role="form" method="POST" action="{{ action('GalleryController@store') }}" enctype="multipart/form-data"> + <form role="form" action="{{ action('GalleryController@store') }}" method="POST" enctype="multipart/form-data"> @csrf <div class="row"> <div class="col-xs-12 col-md-3"> @@ -67,7 +67,7 @@ <div class="col-xs-12"> <div class="form-group text-right m-b-0"> <button type="submit" class="btn btn-primary waves-effect waves-light" autofocus>Cadastrar</button> - <a href="{{ route('gallery') }}" class="btn btn-white waves-effect waves-light m-l-5">Cancelar</a> + <a href="{{ route('gallery-dashboard') }}" class="btn btn-white waves-effect waves-light m-l-5">Cancelar</a> </div> </div> </div> diff --git a/remember_laravel/resources/views/dashboard/galeria/edit.blade.php b/remember_laravel/resources/views/dashboard/galeria/edit.blade.php index 3f985b65febb66896ebac49a1d593077591b27a3..63d627e27d8befe579eb793fe5d08f2e1d1b9b47 100644 --- a/remember_laravel/resources/views/dashboard/galeria/edit.blade.php +++ b/remember_laravel/resources/views/dashboard/galeria/edit.blade.php @@ -6,7 +6,7 @@ <h4 class="page-title">Galeria</h4> <ol class="breadcrumb"> <li><a href="{{ route('dashboard') }}">Dashboard</a></li> - <li><a href="{{ route('gallery') }}">Galeria</a></li> + <li><a href="{{ route('gallery-dashboard') }}">Galeria</a></li> <li class="active">Editar {{ $image->title }}</li> </ol> </div> diff --git a/remember_laravel/resources/views/dashboard/galeria/index.blade.php b/remember_laravel/resources/views/dashboard/galeria/index.blade.php index 22ddbf1c95d10e3fb59eac371d2f714e7d6b70db..9c9260a298fba5774ee55e7a0f84433aabfebd54 100644 --- a/remember_laravel/resources/views/dashboard/galeria/index.blade.php +++ b/remember_laravel/resources/views/dashboard/galeria/index.blade.php @@ -6,7 +6,7 @@ <div class="btn-group pull-right m-t-15"> <button type="button" class="btn btn-default dropdown-toggle waves-effect waves-light" data-toggle="dropdown" aria-expanded="false">Opções <span class="m-l-5"><i class="fa fa-cog"></i></span></button> <ul class="dropdown-menu drop-menu-right" role="menu"> - <li><a href="{{ route('upload') }}">Nova imagem</a></li> + <li><a href="{{ route('upload-image') }}">Nova imagem</a></li> </ul> </div> diff --git a/remember_laravel/resources/views/dashboard/galeria/show.blade.php b/remember_laravel/resources/views/dashboard/galeria/show.blade.php index d358ed6f573b3dec737cf1e3a655cacf3054eef3..f43e2a13f858cf5ade68ff88957a2c7fda056654 100644 --- a/remember_laravel/resources/views/dashboard/galeria/show.blade.php +++ b/remember_laravel/resources/views/dashboard/galeria/show.blade.php @@ -6,12 +6,12 @@ <div class="btn-group pull-right m-t-15"> <button type="button" class="btn btn-default dropdown-toggle waves-effect waves-light" data-toggle="dropdown" aria-expanded="false">Opções <span class="m-l-5"><i class="fa fa-cog"></i></span></button> <ul class="dropdown-menu drop-menu-right" role="menu"> - <li><a href="{{ route('edit', $image->id) }}">Editar</a></li> + <li><a href="{{ route('edit-image', $image->id) }}">Editar</a></li> <form role="form" method="POST" action="{{ action('GalleryController@destroy', $image->id) }}" enctype="multipart/form-data"> @method('DELETE') @csrf <li class="dropdown-btn"><a> - <button class="options-dropdown-btn" type="submit">Delete</button> + <button class="options-dropdown-btn" type="submit">Excluir</button> </a></li> </form> </ul> diff --git a/remember_laravel/resources/views/dashboard/layout/coreJs.blade.php b/remember_laravel/resources/views/dashboard/layout/coreJs.blade.php index d05dd6ec2eaec47d62ce50226b4f5dace0c4822c..13c86b2f5071ea4e711f2c489aea7d4f17ac18c9 100644 --- a/remember_laravel/resources/views/dashboard/layout/coreJs.blade.php +++ b/remember_laravel/resources/views/dashboard/layout/coreJs.blade.php @@ -1,3 +1,7 @@ <!-- App core js --> <script src="{{ asset('js/dashboard/jquery.core.js') }}"></script> -<script src="{{ asset('js/dashboard/jquery.app.js') }}"></script> \ No newline at end of file +<script src="{{ asset('js/dashboard/jquery.app.js') }}"></script> +<script src="{{ asset('js/ckeditor/ckeditor.js') }}"></script> +<script> + CKEDITOR.replace( 'editor' ); +</script> \ No newline at end of file diff --git a/remember_laravel/resources/views/dashboard/layout/navbar.blade.php b/remember_laravel/resources/views/dashboard/layout/navbar.blade.php index 5db6c6431ba65ac5497d2b9cc7ba2c3806741bfe..dfeb73d8fe75b02c730963d38665c72dcf94b73a 100644 --- a/remember_laravel/resources/views/dashboard/layout/navbar.blade.php +++ b/remember_laravel/resources/views/dashboard/layout/navbar.blade.php @@ -5,7 +5,7 @@ <!-- Logo container--> <div class="logo"> - <a href="{{ route('dashboard') }}" class="logo"><span>RememberPET</span></a> + <a href="{{ route('home') }}" class="logo"><span>RememberPET</span></a> </div> <!-- End Logo container--> @@ -46,10 +46,21 @@ <a href="#"><i class="md md-dashboard"></i>Galeria</a> <ul class="submenu"> <li> - <a href="{{ route('gallery') }}">Lista de imagens</a> + <a href="{{ route('gallery-dashboard') }}">Lista de imagens</a> </li> <li> - <a href="{{ route('upload') }}">Nova imagem</a> + <a href="{{ route('upload-image') }}">Nova imagem</a> + </li> + </ul> + </li> + <li class="has-submenu"> + <a href="#"><i class="md md-dashboard"></i>Entrevistas</a> + <ul class="submenu"> + <li> + <a href="{{ route('interview-dashboard') }}">Lista de entrevistas</a> + </li> + <li> + <a href="{{ route('upload-interview') }}">Nova entrevista</a> </li> </ul> </li> diff --git a/remember_laravel/resources/views/frontend/about.blade.php b/remember_laravel/resources/views/frontend/about.blade.php index 0fa2f1a806eb2d5026e9c0a19aa40c271febc308..935fe8b7135b4ea180913f037b3872edc8163ce9 100644 --- a/remember_laravel/resources/views/frontend/about.blade.php +++ b/remember_laravel/resources/views/frontend/about.blade.php @@ -4,10 +4,7 @@ <!-- Header --> <div class="div-index-geral"> - <!-- Header --> - <header class="w3-container w3-center centro"> - <img class="logo" src="{{ asset('storage/images/NovaLogo/Novalogo_2.png') }}" width="500px"/> - </header> + @include('frontend.layout.header') <section class="gallery-block cards-gallery"> <div class="container"> diff --git a/remember_laravel/resources/views/frontend/contact.blade.php b/remember_laravel/resources/views/frontend/contact.blade.php index bcd7098f371307d696f1d7583e82e2ff3bee2b1a..6e185470c3060b74d6c5a506143bff163baec030 100644 --- a/remember_laravel/resources/views/frontend/contact.blade.php +++ b/remember_laravel/resources/views/frontend/contact.blade.php @@ -4,9 +4,7 @@ <!-- Header --> <div class="div-index-geral"> - <header class="w3-container w3-center centro"> - <img class="logo" src="{{ asset('storage/images/NovaLogo/Novalogo_2.png') }}" width="500px"/> - </header> + @include('frontend.layout.header') <section class="gallery-block cards-gallery"> <div class="container"> @@ -27,7 +25,7 @@ <img src="https://www.facebook.com/images/fb_icon_325x325.png" style=" width: 100px"/> </a> <a href="https://www.instagram.com/petcompufpr"> - <img src="https://cdn.icon-icons.com/icons2/1294/PNG/512/2362135-instagram-photo-round-social_85523.png" style=" width: 110px; padding-left: 10px"/> + <img src="https://cdn-icons-png.flaticon.com/512/174/174855.png" style=" width: 110px; padding-left: 10px"/> </a> <a href="https://www.twitter.com/petcompufpr"> <img src="https://cdn1.iconfinder.com/data/icons/logotypes/32/square-twitter-512.png" style=" width: 110px; padding-left: 10px"/> diff --git a/remember_laravel/resources/views/frontend/gallery.blade.php b/remember_laravel/resources/views/frontend/gallery.blade.php index f1b3a8eabb209cfbf2d558662f806c0b3f10e07d..7f5ad71bcccb8f5ac8e7608442c409e17f18f248 100644 --- a/remember_laravel/resources/views/frontend/gallery.blade.php +++ b/remember_laravel/resources/views/frontend/gallery.blade.php @@ -4,10 +4,7 @@ <!-- Header --> <div class="div-index-geral"> - <!-- Header --> - <header class="w3-container w3-center centro"> - <img class="logo" src="{{ asset('storage/images/NovaLogo/Novalogo_2.png') }}" width="500px"/> - </header> + @include('frontend.layout.header') <section class="gallery-block cards-gallery"> <div class="container"> diff --git a/remember_laravel/resources/views/frontend/interview.blade.php b/remember_laravel/resources/views/frontend/interview.blade.php deleted file mode 100644 index 65c54091200c788a0f1bc40abae39796b927efe7..0000000000000000000000000000000000000000 --- a/remember_laravel/resources/views/frontend/interview.blade.php +++ /dev/null @@ -1,134 +0,0 @@ -@extends('frontend.layout.base') - -@section('content') - -<div class="div-index-geral"> - - <header class="w3-container w3-center centro"> - <img class="logo" src="{{ asset('storage/images/NovaLogo/Novalogo_2.png') }}" width="500px"/> - </header> - - <div class="container"> - - <!-- Page Heading --> - <h1 class="my-4">Page Heading - <small>Secondary Text</small> - </h1> - - <!-- Project One --> - <div class="row"> - <div class="col-md-7"> - <a href="#"> - <img class="img-fluid rounded mb-3 mb-md-0" src="http://placehold.it/650x300" alt=""> - </a> - </div> - <div class="col-md-5"> - <h3>Project One</h3> - <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Laudantium veniam exercitationem expedita laborum at voluptate. Labore, voluptates totam at aut nemo deserunt rem magni pariatur quos perspiciatis atque eveniet unde.</p> - <a class="btn btn-primary" href="#">View Project</a> - </div> - </div> - <!-- /.row --> - - <hr> - - <!-- Project Two --> - <div class="row"> - <div class="col-md-7"> - <a href="#"> - <img class="img-fluid rounded mb-3 mb-md-0" src="http://placehold.it/650x300" alt=""> - </a> - </div> - <div class="col-md-5"> - <h3>Project One</h3> - <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Laudantium veniam exercitationem expedita laborum at voluptate. Labore, voluptates totam at aut nemo deserunt rem magni pariatur quos perspiciatis atque eveniet unde.</p> - <a class="btn btn-primary" href="#">View Project</a> - </div> - </div> - <!-- /.row --> - - <hr> - - <!-- Project Three --> - <div class="row"> - <div class="col-md-7"> - <a href="#"> - <img class="img-fluid rounded mb-3 mb-md-0" src="http://placehold.it/650x300" alt=""> - </a> - </div> - <div class="col-md-5"> - <h3>Project One</h3> - <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Laudantium veniam exercitationem expedita laborum at voluptate. Labore, voluptates totam at aut nemo deserunt rem magni pariatur quos perspiciatis atque eveniet unde.</p> - <a class="btn btn-primary" href="#">View Project</a> - </div> - </div> - <!-- /.row --> - - <hr> - - <!-- Project Four --> - <div class="row"> - <div class="col-md-7"> - <a href="#"> - <img class="img-fluid rounded mb-3 mb-md-0" src="http://placehold.it/650x300" alt=""> - </a> - </div> - <div class="col-md-5"> - <h3>Project One</h3> - <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Laudantium veniam exercitationem expedita laborum at voluptate. Labore, voluptates totam at aut nemo deserunt rem magni pariatur quos perspiciatis atque eveniet unde.</p> - <a class="btn btn-primary" href="#">View Project</a> - </div> - </div> - <!-- /.row --> - - <hr> - - <!-- Pagination --> - <ul class="pagination justify-content-center"> - <li class="page-item"> - <a class="page-link" href="#" aria-label="Previous"> - <span aria-hidden="true">«</span> - <span class="sr-only">Previous</span> - </a> - </li> - <li class="page-item"> - <a class="page-link" href="#">1</a> - </li> - <li class="page-item"> - <a class="page-link" href="#">2</a> - </li> - <li class="page-item"> - <a class="page-link" href="#">3</a> - </li> - <li class="page-item"> - <a class="page-link" href="#" aria-label="Next"> - <span aria-hidden="true">»</span> - <span class="sr-only">Next</span> - </a> - </li> - </ul> - </div> -</div> - -<div class="w3-container w3-black w3-center w3-opacity w3-padding-64" style="bottom:0"> - {{ $frase }} -</div> - -@endsection - - -@section('bottomJs') - -<script> -// Used to toggle the menu on small screens when clicking on the menu button -function myFunction() { - var x = document.getElementById("navDemo"); - if (x.className.indexOf("w3-show") == -1) { - x.className += " w3-show"; - } else { - x.className = x.className.replace(" w3-show", ""); - } -} -</script> - -@endsection diff --git a/remember_laravel/resources/views/frontend/layout/navbar.blade.php b/remember_laravel/resources/views/frontend/layout/navbar.blade.php index de851b67e07d17e03c8496ed0217477a11f19085..f371f0bd3922f4951b6e19a9819e923c9cb778be 100644 --- a/remember_laravel/resources/views/frontend/layout/navbar.blade.php +++ b/remember_laravel/resources/views/frontend/layout/navbar.blade.php @@ -3,20 +3,20 @@ <div class="w3-bar w3-black w3-card w3-left-align w3-large"> <a class="w3-bar-item w3-button w3-hide-medium w3-hide-large w3-right w3-padding-large w3-hover-white w3-large w3-black" href="javascript:void(0);" onclick="myFunction()" title="Toggle Navigation Menu"><i class="fa fa-bars"></i></a> <a href="/" class="w3-bar-item w3-button w3-padding-large home">REMEMBER PET</a> - <a href="gallery" class="w3-bar-item w3-button w3-hide-small w3-padding-large w3-hover-white">Galeria</a> - <a href="interview" class="w3-bar-item w3-button w3-hide-small w3-padding-large w3-hover-white">Entrevistas</a> - <a href="about" class="w3-bar-item w3-button w3-hide-small w3-padding-large w3-hover-white">Sobre</a> - <a href="contact" class="w3-bar-item w3-button w3-hide-small w3-padding-large w3-hover-white">Contato</a> - <a href="dashboard" class="w3-bar-item w3-button w3-hide-small w3-padding-large w3-right w3-hover-red">ADMIN</a> + <a href="{{ route('galery') }}" class="w3-bar-item w3-button w3-hide-small w3-padding-large w3-hover-white">Galeria</a> + <a href="{{ route('interview') }}" class="w3-bar-item w3-button w3-hide-small w3-padding-large w3-hover-white">Entrevistas</a> + <a href="{{ route('about') }}" class="w3-bar-item w3-button w3-hide-small w3-padding-large w3-hover-white">Sobre</a> + <a href="{{ route('contact') }}" class="w3-bar-item w3-button w3-hide-small w3-padding-large w3-hover-white">Contato</a> + <a href="{{ route('dashboard') }}" class="w3-bar-item w3-button w3-hide-small w3-padding-large w3-right w3-hover-red">ADMIN</a> <!--<a href="#" class="w3-bar-item w3-button w3-hide-small w3-padding-large w3-hover-white">Link 4</a> --> </div> <!-- Navbar on small screens --> <div id="navDemo" class="w3-bar-block w3-black w3-hide w3-hide-large w3-hide-medium w3-large"> - <a href="gallery" class="w3-bar-item w3-button w3-padding-large w3-hover-white">Galeria</a> - <a href="interview" class="w3-bar-item w3-button w3-padding-large w3-hover-white">Entrevistas</a> - <a href="about" class="w3-bar-item w3-button w3-padding-large w3-hover-white">Sobre</a> - <a href="contact" class="w3-bar-item w3-button w3-padding-large w3-hover-white">Contato</a> - <a href="dashboard" class="w3-bar-item w3-button w3-padding-large w3-right w3-hover-red">ADMIN</a> + <a href="{{ route('galery') }}" class="w3-bar-item w3-button w3-padding-large w3-hover-white">Galeria</a> + <a href="{{ route('interview') }}" class="w3-bar-item w3-button w3-padding-large w3-hover-white">Entrevistas</a> + <a href="{{ route('about') }}" class="w3-bar-item w3-button w3-padding-large w3-hover-white">Sobre</a> + <a href="{{ route('contact') }}" class="w3-bar-item w3-button w3-padding-large w3-hover-white">Contato</a> + <a href="{{ route('dashboard') }}" class="w3-bar-item w3-button w3-padding-large w3-right w3-hover-red">ADMIN</a> <!--<a href="#" class="w3-bar-item w3-button w3-padding-large">Link 4</a> --> </div> </div> diff --git a/remember_laravel/routes/web.php b/remember_laravel/routes/web.php index 24389dca2c59286f9325c6705d62c219fbab4b45..2edfeb939b038d2f3a444672b2575d90b7c9b139 100644 --- a/remember_laravel/routes/web.php +++ b/remember_laravel/routes/web.php @@ -1,5 +1,7 @@ <?php +use Illuminate\Support\Facades\Route; + /* |-------------------------------------------------------------------------- | Web Routes @@ -19,6 +21,7 @@ Route::get('/', 'HomeController@index')->name('home'); Route::get('/gallery', 'HomeController@gallery')->name('galery'); Route::get('/interview', 'HomeController@interview')->name('interview'); +Route::get('/interview/{id}', 'HomeController@showInterview')->name('interview-page'); Route::get('/about', 'HomeController@about')->name('about'); Route::get('/contact', 'HomeController@contact')->name('contact'); @@ -28,14 +31,24 @@ Route::group(['prefix' => 'dashboard', 'middleware' => ['web', 'auth']], functio })->name('dashboard'); Route::group(['prefix' => 'galeria'], function () { - Route::get('/', 'GalleryController@index')->name('gallery'); - Route::get('/upload', 'GalleryController@create')->name('upload'); + Route::get('/', 'GalleryController@index')->name('gallery-dashboard'); + Route::get('/upload', 'GalleryController@create')->name('upload-image'); Route::post('/upload', 'GalleryController@store'); Route::get('/{id}', 'GalleryController@show')->name('show-image'); - Route::get('/{id}/editar', 'GalleryController@edit')->name('edit'); + Route::get('/{id}/editar', 'GalleryController@edit')->name('edit-image'); Route::put('/{id}/editar', 'GalleryController@update'); Route::delete('/{id}/deletar', 'GalleryController@destroy')->name('delete-image'); }); + + Route::group(['prefix' => 'entrevista'], function () { + Route::get('/', 'InterviewController@index')->name('interview-dashboard'); + Route::get('/upload', 'InterviewController@create')->name('upload-interview'); + Route::post('/upload', 'InterviewController@store'); + Route::get('/{id}', 'InterviewController@show')->name('show-interview'); + Route::get('/{id}/editar', 'InterviewController@edit')->name('edit-interview'); + Route::put('/{id}/editar', 'InterviewController@update'); + Route::delete('/{id}/deletar', 'InterviewController@destroy')->name('delete-interview'); + }); }); Route::get('login', 'Auth\LoginController@showLoginForm')->name('login');