diff --git a/app/Http/Controllers/Auth/AuthController.php b/app/Http/Controllers/Auth/AuthController.php index 84282b916..4b777e44c 100644 --- a/app/Http/Controllers/Auth/AuthController.php +++ b/app/Http/Controllers/Auth/AuthController.php @@ -23,6 +23,10 @@ class AuthController extends Controller use AuthenticatesAndRegistersUsers, ThrottlesLogins; + protected $loginPath = '/login'; + protected $redirectPath = '/'; + + /** * Create a new authentication controller instance. * diff --git a/app/Http/routes.php b/app/Http/routes.php index c6aa9a0bf..28b81b295 100644 --- a/app/Http/routes.php +++ b/app/Http/routes.php @@ -12,47 +12,57 @@ */ -Route::group(['prefix' => 'books'], function() { - Route::get('/', 'BookController@index'); - Route::get('/create', 'BookController@create'); - Route::post('/', 'BookController@store'); - Route::get('/{slug}/edit', 'BookController@edit'); - Route::put('/{slug}', 'BookController@update'); - Route::delete('/{id}', 'BookController@destroy'); - Route::get('/{slug}', 'BookController@show'); - Route::get('/{slug}/delete', 'BookController@showDelete'); +// Authentication routes... +Route::group(['middleware' => 'auth'], function() { - Route::get('/{bookSlug}/page/create', 'PageController@create'); - Route::post('/{bookSlug}/page', 'PageController@store'); - Route::get('/{bookSlug}/sort', 'PageController@sortPages'); - Route::put('/{bookSlug}/sort', 'PageController@savePageSort'); - Route::get('/{bookSlug}/page/{pageSlug}', 'PageController@show'); - Route::get('/{bookSlug}/page/{pageSlug}/edit', 'PageController@edit'); - Route::get('/{bookSlug}/page/{pageSlug}/delete', 'PageController@showDelete'); - Route::put('/{bookSlug}/page/{pageSlug}', 'PageController@update'); - Route::delete('/{bookSlug}/page/{pageSlug}', 'PageController@destroy'); + Route::group(['prefix' => 'books'], function() { + + Route::get('/', 'BookController@index'); + Route::get('/create', 'BookController@create'); + Route::post('/', 'BookController@store'); + Route::get('/{slug}/edit', 'BookController@edit'); + Route::put('/{slug}', 'BookController@update'); + Route::delete('/{id}', 'BookController@destroy'); + Route::get('/{slug}', 'BookController@show'); + Route::get('/{slug}/delete', 'BookController@showDelete'); + + Route::get('/{bookSlug}/page/create', 'PageController@create'); + Route::post('/{bookSlug}/page', 'PageController@store'); + Route::get('/{bookSlug}/sort', 'PageController@sortPages'); + Route::put('/{bookSlug}/sort', 'PageController@savePageSort'); + Route::get('/{bookSlug}/page/{pageSlug}', 'PageController@show'); + Route::get('/{bookSlug}/page/{pageSlug}/edit', 'PageController@edit'); + Route::get('/{bookSlug}/page/{pageSlug}/delete', 'PageController@showDelete'); + Route::put('/{bookSlug}/page/{pageSlug}', 'PageController@update'); + Route::delete('/{bookSlug}/page/{pageSlug}', 'PageController@destroy'); + + Route::get('/{bookSlug}/chapter/{chapterSlug}/create-page', 'PageController@create'); + Route::get('/{bookSlug}/chapter/create', 'ChapterController@create'); + Route::post('/{bookSlug}/chapter/create', 'ChapterController@store'); + Route::get('/{bookSlug}/chapter/{chapterSlug}', 'ChapterController@show'); + Route::put('/{bookSlug}/chapter/{chapterSlug}', 'ChapterController@update'); + Route::get('/{bookSlug}/chapter/{chapterSlug}/edit', 'ChapterController@edit'); + Route::get('/{bookSlug}/chapter/{chapterSlug}/delete', 'ChapterController@showDelete'); + Route::delete('/{bookSlug}/chapter/{chapterSlug}', 'ChapterController@destroy'); + + }); + + Route::post('/upload/image', 'ImageController@upload'); + + Route::get('/images/all', 'ImageController@getAll'); + Route::get('/images/all/{page}', 'ImageController@getAll'); + Route::get('/images/{any}', 'ImageController@getImage')->where('any', '.*'); + + Route::get('/link/{id}', 'PageController@redirectFromLink'); + Route::get('/pages/search/all', 'PageController@searchAll'); + + Route::get('/', function () { + return view('base'); + }); - Route::get('/{bookSlug}/chapter/{chapterSlug}/create-page', 'PageController@create'); - Route::get('/{bookSlug}/chapter/create', 'ChapterController@create'); - Route::post('/{bookSlug}/chapter/create', 'ChapterController@store'); - Route::get('/{bookSlug}/chapter/{chapterSlug}', 'ChapterController@show'); - Route::put('/{bookSlug}/chapter/{chapterSlug}', 'ChapterController@update'); - Route::get('/{bookSlug}/chapter/{chapterSlug}/edit', 'ChapterController@edit'); - Route::get('/{bookSlug}/chapter/{chapterSlug}/delete', 'ChapterController@showDelete'); - Route::delete('/{bookSlug}/chapter/{chapterSlug}', 'ChapterController@destroy'); }); - -Route::post('/upload/image', 'ImageController@upload'); - -Route::get('/images/all', 'ImageController@getAll'); -Route::get('/images/all/{page}', 'ImageController@getAll'); -Route::get('/images/{any}', 'ImageController@getImage')->where('any', '.*'); - -Route::get('/link/{id}', 'PageController@redirectFromLink'); -Route::get('/pages/search/all', 'PageController@searchAll'); - -Route::get('/', function () { - return view('base'); -}); +Route::get('/login', 'Auth\AuthController@getLogin'); +Route::post('/login', 'Auth\AuthController@postLogin'); +Route::get('/logout', 'Auth\AuthController@getLogout'); diff --git a/database/seeds/DatabaseSeeder.php b/database/seeds/DatabaseSeeder.php index 988ea2100..633b5e736 100644 --- a/database/seeds/DatabaseSeeder.php +++ b/database/seeds/DatabaseSeeder.php @@ -15,6 +15,11 @@ class DatabaseSeeder extends Seeder Model::unguard(); // $this->call(UserTableSeeder::class); + \Oxbow\User::create([ + 'name' => 'Admin', + 'email' => 'admin@admin.com', + 'password' => \Illuminate\Support\Facades\Hash::make('password') + ]); Model::reguard(); } diff --git a/public/images/bg-books.jpg b/public/images/bg-books.jpg new file mode 100644 index 000000000..dbf77c6b0 Binary files /dev/null and b/public/images/bg-books.jpg differ diff --git a/resources/assets/sass/_buttons.scss b/resources/assets/sass/_buttons.scss index b37fae4fb..49d8629d6 100644 --- a/resources/assets/sass/_buttons.scss +++ b/resources/assets/sass/_buttons.scss @@ -60,6 +60,12 @@ $button-border-radius: 3px; } } +.button.block { + width: 100%; + text-align: center; + display: block; +} + // Floating action button //.fab { // $size: 70px; diff --git a/resources/assets/sass/_text.scss b/resources/assets/sass/_text.scss index e286cc2ac..375162154 100644 --- a/resources/assets/sass/_text.scss +++ b/resources/assets/sass/_text.scss @@ -59,6 +59,10 @@ a { i { padding-right: $-s; } + i.zmdi-hc-flip-horizontal { + padding-right: 0; + padding-left: $-s; + } } /* diff --git a/resources/assets/sass/styles.scss b/resources/assets/sass/styles.scss index 1704bc2cd..9dc60a2f4 100644 --- a/resources/assets/sass/styles.scss +++ b/resources/assets/sass/styles.scss @@ -27,7 +27,7 @@ header { top: 0; z-index: 1; //padding-top: $-m; - width: 300px; + width: 340px; border-right: 1px solid #DDD; h4, li, p, a { color: #CCC; @@ -36,19 +36,26 @@ header { #content { //margin-top: 63px; - margin-left: 300px; + margin-left: 340px; display: block; position: relative; padding: 0 16px; } -.logo { - font-size: 2em; - padding: $-xl $-s; - font-weight: bold; +.logo-container { + padding: $-xl $-s $-l $-s; color: #CCC; + .logo { + font-size: 2em; + font-weight: bold; + margin-bottom: $-m; + } + i { + padding-right: $-s; + } } + .search-box { input { width: 100%; @@ -311,6 +318,7 @@ h1, h2, h3, h4, h5, h6 { .book-tree .sidebar-page-list { list-style: none; margin: 0; + border-left: 1px solid #7BD06E; li a { display: block; border-bottom: 1px solid #3A3939; @@ -375,3 +383,59 @@ body.dragging, body.dragging * { .sortable-page-list li.placeholder:before { 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; + } +} \ No newline at end of file diff --git a/resources/views/auth/login.blade.php b/resources/views/auth/login.blade.php new file mode 100644 index 000000000..97062cb79 --- /dev/null +++ b/resources/views/auth/login.blade.php @@ -0,0 +1,41 @@ +@extends('public') + +@section('body-class', 'image-cover login') + +@section('sidebar') + + + {{--
--}} + {{--
--}} + {{--
--}} + {{--
--}} + {{--Add new book--}} + {{--
--}} + {{--
--}} + {{--
--}} + +
+
+

Login

+ +
+ {!! csrf_field() !!} + +
+ + @include('form/text', ['name' => 'email']) +
+ +
+ + @include('form/password', ['name' => 'password']) +
+ +
+ +
+
+
+
+ +@stop \ No newline at end of file diff --git a/resources/views/base.blade.php b/resources/views/base.blade.php index 1c74f069a..f3f9a2d6f 100644 --- a/resources/views/base.blade.php +++ b/resources/views/base.blade.php @@ -29,11 +29,13 @@