Added auth login control
This commit is contained in:
parent
2aca1794de
commit
71e2e057cb
|
@ -23,6 +23,10 @@ class AuthController extends Controller
|
||||||
|
|
||||||
use AuthenticatesAndRegistersUsers, ThrottlesLogins;
|
use AuthenticatesAndRegistersUsers, ThrottlesLogins;
|
||||||
|
|
||||||
|
protected $loginPath = '/login';
|
||||||
|
protected $redirectPath = '/';
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new authentication controller instance.
|
* Create a new authentication controller instance.
|
||||||
*
|
*
|
||||||
|
|
|
@ -12,7 +12,11 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
Route::group(['prefix' => 'books'], function() {
|
|
||||||
|
// Authentication routes...
|
||||||
|
Route::group(['middleware' => 'auth'], function() {
|
||||||
|
|
||||||
|
Route::group(['prefix' => 'books'], function() {
|
||||||
|
|
||||||
Route::get('/', 'BookController@index');
|
Route::get('/', 'BookController@index');
|
||||||
Route::get('/create', 'BookController@create');
|
Route::get('/create', 'BookController@create');
|
||||||
|
@ -42,17 +46,23 @@ Route::group(['prefix' => 'books'], function() {
|
||||||
Route::get('/{bookSlug}/chapter/{chapterSlug}/delete', 'ChapterController@showDelete');
|
Route::get('/{bookSlug}/chapter/{chapterSlug}/delete', 'ChapterController@showDelete');
|
||||||
Route::delete('/{bookSlug}/chapter/{chapterSlug}', 'ChapterController@destroy');
|
Route::delete('/{bookSlug}/chapter/{chapterSlug}', 'ChapterController@destroy');
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
Route::post('/upload/image', 'ImageController@upload');
|
Route::post('/upload/image', 'ImageController@upload');
|
||||||
|
|
||||||
Route::get('/images/all', 'ImageController@getAll');
|
Route::get('/images/all', 'ImageController@getAll');
|
||||||
Route::get('/images/all/{page}', 'ImageController@getAll');
|
Route::get('/images/all/{page}', 'ImageController@getAll');
|
||||||
Route::get('/images/{any}', 'ImageController@getImage')->where('any', '.*');
|
Route::get('/images/{any}', 'ImageController@getImage')->where('any', '.*');
|
||||||
|
|
||||||
Route::get('/link/{id}', 'PageController@redirectFromLink');
|
Route::get('/link/{id}', 'PageController@redirectFromLink');
|
||||||
Route::get('/pages/search/all', 'PageController@searchAll');
|
Route::get('/pages/search/all', 'PageController@searchAll');
|
||||||
|
|
||||||
Route::get('/', function () {
|
Route::get('/', function () {
|
||||||
return view('base');
|
return view('base');
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
Route::get('/login', 'Auth\AuthController@getLogin');
|
||||||
|
Route::post('/login', 'Auth\AuthController@postLogin');
|
||||||
|
Route::get('/logout', 'Auth\AuthController@getLogout');
|
||||||
|
|
|
@ -15,6 +15,11 @@ class DatabaseSeeder extends Seeder
|
||||||
Model::unguard();
|
Model::unguard();
|
||||||
|
|
||||||
// $this->call(UserTableSeeder::class);
|
// $this->call(UserTableSeeder::class);
|
||||||
|
\Oxbow\User::create([
|
||||||
|
'name' => 'Admin',
|
||||||
|
'email' => 'admin@admin.com',
|
||||||
|
'password' => \Illuminate\Support\Facades\Hash::make('password')
|
||||||
|
]);
|
||||||
|
|
||||||
Model::reguard();
|
Model::reguard();
|
||||||
}
|
}
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 276 KiB |
|
@ -60,6 +60,12 @@ $button-border-radius: 3px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.button.block {
|
||||||
|
width: 100%;
|
||||||
|
text-align: center;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
// Floating action button
|
// Floating action button
|
||||||
//.fab {
|
//.fab {
|
||||||
// $size: 70px;
|
// $size: 70px;
|
||||||
|
|
|
@ -59,6 +59,10 @@ a {
|
||||||
i {
|
i {
|
||||||
padding-right: $-s;
|
padding-right: $-s;
|
||||||
}
|
}
|
||||||
|
i.zmdi-hc-flip-horizontal {
|
||||||
|
padding-right: 0;
|
||||||
|
padding-left: $-s;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -27,7 +27,7 @@ header {
|
||||||
top: 0;
|
top: 0;
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
//padding-top: $-m;
|
//padding-top: $-m;
|
||||||
width: 300px;
|
width: 340px;
|
||||||
border-right: 1px solid #DDD;
|
border-right: 1px solid #DDD;
|
||||||
h4, li, p, a {
|
h4, li, p, a {
|
||||||
color: #CCC;
|
color: #CCC;
|
||||||
|
@ -36,19 +36,26 @@ header {
|
||||||
|
|
||||||
#content {
|
#content {
|
||||||
//margin-top: 63px;
|
//margin-top: 63px;
|
||||||
margin-left: 300px;
|
margin-left: 340px;
|
||||||
display: block;
|
display: block;
|
||||||
position: relative;
|
position: relative;
|
||||||
padding: 0 16px;
|
padding: 0 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.logo {
|
.logo-container {
|
||||||
font-size: 2em;
|
padding: $-xl $-s $-l $-s;
|
||||||
padding: $-xl $-s;
|
|
||||||
font-weight: bold;
|
|
||||||
color: #CCC;
|
color: #CCC;
|
||||||
|
.logo {
|
||||||
|
font-size: 2em;
|
||||||
|
font-weight: bold;
|
||||||
|
margin-bottom: $-m;
|
||||||
|
}
|
||||||
|
i {
|
||||||
|
padding-right: $-s;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.search-box {
|
.search-box {
|
||||||
input {
|
input {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
@ -311,6 +318,7 @@ h1, h2, h3, h4, h5, h6 {
|
||||||
.book-tree .sidebar-page-list {
|
.book-tree .sidebar-page-list {
|
||||||
list-style: none;
|
list-style: none;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
border-left: 1px solid #7BD06E;
|
||||||
li a {
|
li a {
|
||||||
display: block;
|
display: block;
|
||||||
border-bottom: 1px solid #3A3939;
|
border-bottom: 1px solid #3A3939;
|
||||||
|
@ -375,3 +383,59 @@ body.dragging, body.dragging * {
|
||||||
.sortable-page-list li.placeholder:before {
|
.sortable-page-list li.placeholder:before {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.image-cover {
|
||||||
|
height: 100vh;
|
||||||
|
width: 100%;
|
||||||
|
overflow: hidden;
|
||||||
|
background-size: cover;
|
||||||
|
&.login {
|
||||||
|
background-image: url('/images/bg-books.jpg');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar-bg {
|
||||||
|
background-image: url('/images/bg-books.jpg');
|
||||||
|
background-size: cover;
|
||||||
|
background-position: 50% 50%;
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
z-index: -1;
|
||||||
|
.overlay {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
z-index: -1;
|
||||||
|
background-color: rgba(0,0,0,0.7);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.image-cover #sidebar {
|
||||||
|
width: auto;
|
||||||
|
border: 0;
|
||||||
|
background-color: rgba(0, 0, 0, 0.38);
|
||||||
|
}
|
||||||
|
|
||||||
|
.center-box {
|
||||||
|
margin-top: 15vh;
|
||||||
|
padding: $-m $-xxl $-xl*2 $-xxl;
|
||||||
|
max-width: 346px;
|
||||||
|
h1, label {
|
||||||
|
color: #EEE;
|
||||||
|
}
|
||||||
|
h1 {
|
||||||
|
margin-bottom: $-m;
|
||||||
|
}
|
||||||
|
.button {
|
||||||
|
margin-top: $-xl;
|
||||||
|
}
|
||||||
|
input {
|
||||||
|
background-color: transparent;
|
||||||
|
color: #EEE;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,41 @@
|
||||||
|
@extends('public')
|
||||||
|
|
||||||
|
@section('body-class', 'image-cover login')
|
||||||
|
|
||||||
|
@section('sidebar')
|
||||||
|
|
||||||
|
|
||||||
|
{{--<div class="row faded-small">--}}
|
||||||
|
{{--<div class="col-md-6"></div>--}}
|
||||||
|
{{--<div class="col-md-6 faded">--}}
|
||||||
|
{{--<div class="action-buttons">--}}
|
||||||
|
{{--<a href="/books/create" class="text-pos"><i class="zmdi zmdi-plus"></i>Add new book</a>--}}
|
||||||
|
{{--</div>--}}
|
||||||
|
{{--</div>--}}
|
||||||
|
{{--</div>--}}
|
||||||
|
|
||||||
|
<div class="text-center">
|
||||||
|
<div class="center-box text-left">
|
||||||
|
<h1>Login</h1>
|
||||||
|
|
||||||
|
<form action="/login" method="POST">
|
||||||
|
{!! csrf_field() !!}
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="email">Email</label>
|
||||||
|
@include('form/text', ['name' => 'email'])
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="password">Password</label>
|
||||||
|
@include('form/password', ['name' => 'password'])
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="from-group">
|
||||||
|
<button class="button block pos">Login</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@stop
|
|
@ -29,11 +29,13 @@
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
<section id="sidebar">
|
<section id="sidebar">
|
||||||
|
<div class="sidebar-bg"><div class="overlay"></div></div>
|
||||||
<header>
|
<header>
|
||||||
<div class="padded row clearfix">
|
<div class="padded row clearfix">
|
||||||
<div class="col-md-12">
|
<div class="col-md-12 logo-container">
|
||||||
{{--<div ><img class="logo float left" src="/bookstack.svg" alt="BookStack"></div>--}}
|
{{--<div ><img class="logo float left" src="/bookstack.svg" alt="BookStack"></div>--}}
|
||||||
<div class="logo">BookStack</div>
|
<div class="logo">BookStack</div>
|
||||||
|
<div><i class="zmdi zmdi-account"></i> {{ \Illuminate\Support\Facades\Auth::user()->name }}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
|
@ -44,6 +46,7 @@
|
||||||
</div>
|
</div>
|
||||||
<ul class="menu">
|
<ul class="menu">
|
||||||
<li><a href="/books"><i class="zmdi zmdi-book"></i>Books</a></li>
|
<li><a href="/books"><i class="zmdi zmdi-book"></i>Books</a></li>
|
||||||
|
<li><a href="/logout"><i class="zmdi zmdi-run zmdi-hc-flip-horizontal"></i>Logout</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
@if(isset($book) && !isset($books))
|
@if(isset($book) && !isset($books))
|
||||||
<div class="book-tree">
|
<div class="book-tree">
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
<input type="password" id="{{ $name }}" name="{{ $name }}"
|
||||||
|
@if($errors->has($name)) class="neg" @endif
|
||||||
|
@if(isset($placeholder)) placeholder="{{$placeholder}}" @endif
|
||||||
|
@if(isset($model) || old($name)) value="{{ old($name) ? old($name) : $model->$name}}" @endif>
|
||||||
|
@if($errors->has($name))
|
||||||
|
<div class="text-neg text-small">{{ $errors->first($name) }}</div>
|
||||||
|
@endif
|
|
@ -0,0 +1,23 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>BookStack</title>
|
||||||
|
<meta name="viewport" content="width=device-width">
|
||||||
|
<link rel="stylesheet" href="/css/app.css">
|
||||||
|
<link href='//fonts.googleapis.com/css?family=Roboto:400,400italic,500,500italic,700,700italic,300italic,100,300' rel='stylesheet' type='text/css'>
|
||||||
|
<link rel="stylesheet" href="/bower/material-design-iconic-font/dist/css/material-design-iconic-font.min.css">
|
||||||
|
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
|
||||||
|
|
||||||
|
</head>
|
||||||
|
<body class="@yield('body-class')">
|
||||||
|
|
||||||
|
<section id="sidebar">
|
||||||
|
@yield('sidebar')
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section class="container">
|
||||||
|
@yield('content')
|
||||||
|
</section>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
Loading…
Reference in New Issue