From 8fcbe44d3ed8f1e12bae50a104a91bc9feb00e92 Mon Sep 17 00:00:00 2001 From: Dan Brown Date: Sat, 26 Aug 2017 13:24:55 +0100 Subject: [PATCH] Updated styles for auth and books views. Also added sourcemaps to gulp sass build --- app/Http/Controllers/BookController.php | 8 +- gulpfile.js | 8 +- package.json | 1 + resources/assets/sass/_blocks.scss | 8 +- resources/assets/sass/_buttons.scss | 37 +++++++-- resources/assets/sass/_forms.scss | 29 ++----- resources/assets/sass/_html.scss | 3 + resources/assets/sass/_lists.scss | 12 +-- resources/assets/sass/_text.scss | 2 +- resources/assets/sass/styles.scss | 9 +-- resources/lang/en/entities.php | 4 +- resources/views/auth/login.blade.php | 48 +++++------ resources/views/auth/register.blade.php | 61 +++++++------- resources/views/books/create.blade.php | 29 +++++-- resources/views/books/delete.blade.php | 42 +++++----- resources/views/books/edit.blade.php | 33 ++++---- resources/views/books/form.blade.php | 4 +- resources/views/books/index.blade.php | 9 +++ resources/views/books/restrictions.blade.php | 27 +++---- resources/views/books/show.blade.php | 43 +++++----- resources/views/books/sort.blade.php | 79 ++++++++++--------- .../views/form/restriction-form.blade.php | 6 +- resources/views/home.blade.php | 12 ++- resources/views/public.blade.php | 6 +- 24 files changed, 291 insertions(+), 229 deletions(-) diff --git a/app/Http/Controllers/BookController.php b/app/Http/Controllers/BookController.php index 6283ac8d1..5342ece6b 100644 --- a/app/Http/Controllers/BookController.php +++ b/app/Http/Controllers/BookController.php @@ -39,8 +39,14 @@ class BookController extends Controller $books = $this->entityRepo->getAllPaginated('book', 20); $recents = $this->signedIn ? $this->entityRepo->getRecentlyViewed('book', 4, 0) : false; $popular = $this->entityRepo->getPopular('book', 4, 0); + $new = $this->entityRepo->getRecentlyCreated('book', 4, 0); $this->setPageTitle('Books'); - return view('books/index', ['books' => $books, 'recents' => $recents, 'popular' => $popular]); + return view('books/index', [ + 'books' => $books, + 'recents' => $recents, + 'popular' => $popular, + 'new' => $new + ]); } /** diff --git a/gulpfile.js b/gulpfile.js index f851dd7d6..c9f3f7956 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -3,16 +3,20 @@ const argv = require('yargs').argv; const gulp = require('gulp'), plumber = require('gulp-plumber'); + const autoprefixer = require('gulp-autoprefixer'); -const uglify = require('gulp-uglify'); const minifycss = require('gulp-clean-css'); const sass = require('gulp-sass'); +const sourcemaps = require('gulp-sourcemaps'); + const browserify = require("browserify"); const source = require('vinyl-source-stream'); const buffer = require('vinyl-buffer'); const babelify = require("babelify"); const watchify = require("watchify"); const envify = require("envify"); +const uglify = require('gulp-uglify'); + const gutil = require("gulp-util"); const liveReload = require('gulp-livereload'); @@ -21,6 +25,7 @@ let isProduction = argv.production || process.env.NODE_ENV === 'production'; gulp.task('styles', () => { let chain = gulp.src(['resources/assets/sass/**/*.scss']) + .pipe(sourcemaps.init()) .pipe(plumber({ errorHandler: function (error) { console.log(error.message); @@ -29,6 +34,7 @@ gulp.task('styles', () => { .pipe(sass()) .pipe(autoprefixer('last 2 versions')); if (isProduction) chain = chain.pipe(minifycss()); + chain = chain.pipe(sourcemaps.write()); return chain.pipe(gulp.dest('public/css/')).pipe(liveReload()); }); diff --git a/package.json b/package.json index f447ec786..ed8338abb 100644 --- a/package.json +++ b/package.json @@ -36,6 +36,7 @@ "clipboard": "^1.7.1", "codemirror": "^5.26.0", "dropzone": "^4.0.1", + "gulp-sourcemaps": "^2.6.1", "gulp-util": "^3.0.8", "markdown-it": "^8.3.1", "markdown-it-task-lists": "^2.0.0", diff --git a/resources/assets/sass/_blocks.scss b/resources/assets/sass/_blocks.scss index 3eb60152d..c5b850507 100644 --- a/resources/assets/sass/_blocks.scss +++ b/resources/assets/sass/_blocks.scss @@ -195,7 +195,13 @@ font-weight: 400; text-transform: uppercase; } - .body { + .body, p.empty-text { padding: $-m; } +} + +.well { + background-color: #F8F8F8; + padding: $-m; + border: 1px solid #DDD; } \ No newline at end of file diff --git a/resources/assets/sass/_buttons.scss b/resources/assets/sass/_buttons.scss index 202eb935b..c07e6a37a 100644 --- a/resources/assets/sass/_buttons.scss +++ b/resources/assets/sass/_buttons.scss @@ -2,9 +2,10 @@ @mixin generate-button-colors($textColor, $backgroundColor) { background-color: $backgroundColor; color: $textColor; + text-transform: uppercase; &:hover { background-color: lighten($backgroundColor, 8%); - box-shadow: $bs-med; + //box-shadow: $bs-med; text-decoration: none; color: $textColor; } @@ -26,16 +27,16 @@ $button-border-radius: 2px; text-decoration: none; font-size: $fs-m; line-height: 1.4em; - padding: $-xs $-m; + padding: $-xs*1.3 $-m; margin: $-xs $-xs $-xs 0; display: inline-block; border: none; - font-weight: 500; + font-weight: 400; outline: 0; border-radius: $button-border-radius; cursor: pointer; transition: all ease-in-out 120ms; - box-shadow: 0 0.5px 1.5px 0 rgba(0, 0, 0, 0.21); + box-shadow: 0; @include generate-button-colors(#EEE, $primary); } @@ -51,13 +52,39 @@ $button-border-radius: 2px; @include generate-button-colors(#EEE, $secondary); } &.muted { - @include generate-button-colors(#EEE, #888); + @include generate-button-colors(#EEE, #AAA); } &.muted-light { @include generate-button-colors(#666, #e4e4e4); } } +.button.outline { + background-color: transparent; + color: #888; + border: 1px solid #DDD; + &:hover, &:focus, &:active { + box-shadow: none; + background-color: #EEE; + } + &.page { + border-color: $color-page; + color: $color-page; + &:hover, &:focus, &:active { + background-color: $color-page; + color: #FFF; + } + } + &.chapter { + border-color: $color-chapter; + color: $color-chapter; + &:hover, &:focus, &:active { + background-color: $color-chapter; + color: #FFF; + } + } +} + .text-button { @extend .link; background-color: transparent; diff --git a/resources/assets/sass/_forms.scss b/resources/assets/sass/_forms.scss index d372359cc..94752f26e 100644 --- a/resources/assets/sass/_forms.scss +++ b/resources/assets/sass/_forms.scss @@ -2,14 +2,13 @@ .input-base { background-color: #FFF; border-radius: 3px; - border: 1px solid #CCC; + border: 1px solid #D4D4D4; display: inline-block; font-size: $fs-s; - padding: $-xs; - color: #222; + padding: $-xs*1.5; + color: #666; width: 250px; max-width: 100%; - //-webkit-appearance:none; &.neg, &.invalid { border: 1px solid $negative; } @@ -84,8 +83,9 @@ label { display: block; line-height: 1.4em; font-size: 0.94em; - font-weight: 500; - color: #666; + font-weight: 400; + color: #999; + text-transform: uppercase; padding-bottom: 2px; margin-bottom: 0.2em; &.inline { @@ -186,28 +186,15 @@ input:checked + .toggle-switch { } .inline-input-style { - border: 2px dotted #BBB; display: block; width: 100%; - padding: $-xs $-s; -} - -.title-input .input { - width: 100%; -} - -.title-input label, .description-input label{ - margin-top: $-m; - color: #666; + padding: $-s; } .title-input input[type="text"] { - @extend h1; @extend .inline-input-style; margin-top: 0; - padding-right: 0; - width: 100%; - color: #444; + font-size: 2em; } .title-input.page-title { diff --git a/resources/assets/sass/_html.scss b/resources/assets/sass/_html.scss index 9e47f4387..65f05a71d 100644 --- a/resources/assets/sass/_html.scss +++ b/resources/assets/sass/_html.scss @@ -9,6 +9,9 @@ html { &.flexbox { overflow-y: hidden; } + &.shaded { + background-color: #F2F2F2; + } } body { diff --git a/resources/assets/sass/_lists.scss b/resources/assets/sass/_lists.scss index 0cb58432c..5d607ba16 100644 --- a/resources/assets/sass/_lists.scss +++ b/resources/assets/sass/_lists.scss @@ -239,6 +239,9 @@ .left + .right { margin-left: 30px + $-s; } + &:last-of-type { + border-bottom: 0; + } } ul.pagination { @@ -291,9 +294,6 @@ ul.pagination { h4 { margin: 0; } - p { - margin: $-xs 0 0 0; - } hr { margin: 0; } @@ -310,7 +310,7 @@ ul.pagination { } } -.card .entity-list-item { +.card .entity-list-item, .card .activity-list-item { padding-left: $-m; padding-right: $-m; } @@ -323,9 +323,11 @@ ul.pagination { .entity-item-snippet { display: none; } - p { + .entity-list-item p { font-size: $fs-m * 0.8; padding-top: $-xs; + } + p { margin: 0; } > p.empty-text { diff --git a/resources/assets/sass/_text.scss b/resources/assets/sass/_text.scss index d38a5c515..2911a88c6 100644 --- a/resources/assets/sass/_text.scss +++ b/resources/assets/sass/_text.scss @@ -2,7 +2,7 @@ * Fonts */ -body, button, input, select, label { +body, button, input, select, label, textarea { font-family: $text; } .Codemirror, pre, #markdown-editor-input, .editor-toolbar, .code-base { diff --git a/resources/assets/sass/styles.scss b/resources/assets/sass/styles.scss index b912bf7ee..3a6f9e062 100644 --- a/resources/assets/sass/styles.scss +++ b/resources/assets/sass/styles.scss @@ -217,22 +217,15 @@ $btt-size: 40px; } .center-box { - margin: $-xl auto 0 auto; - padding: $-m $-xxl $-xl $-xxl; + margin: $-xxl auto 0 auto; width: 420px; max-width: 100%; display: inline-block; text-align: left; vertical-align: top; - //border: 1px solid #DDD; input { width: 100%; } - &.login { - background-color: #EEE; - box-shadow: 0 0 2px 0 rgba(0, 0, 0, 0.1); - border: 1px solid #DDD; - } } diff --git a/resources/lang/en/entities.php b/resources/lang/en/entities.php index 43053df10..5b76559ea 100644 --- a/resources/lang/en/entities.php +++ b/resources/lang/en/entities.php @@ -73,11 +73,13 @@ return [ 'books_empty' => 'No books have been created', 'books_popular' => 'Popular Books', 'books_recent' => 'Recent Books', + 'books_new' => 'New Books', 'books_popular_empty' => 'The most popular books will appear here.', + 'books_new_empty' => 'The most recently created books will appear here.', 'books_create' => 'Create New Book', 'books_delete' => 'Delete Book', 'books_delete_named' => 'Delete Book :bookName', - 'books_delete_explain' => 'This will delete the book with the name \':bookName\', All pages and chapters will be removed.', + 'books_delete_explain' => 'This will delete the book with the name \':bookName\'. All pages and chapters will be removed.', 'books_delete_confirmation' => 'Are you sure you want to delete this book?', 'books_edit' => 'Edit Book', 'books_edit_named' => 'Edit Book :bookName', diff --git a/resources/views/auth/login.blade.php b/resources/views/auth/login.blade.php index 706747b8b..dda733645 100644 --- a/resources/views/auth/login.blade.php +++ b/resources/views/auth/login.blade.php @@ -9,36 +9,38 @@ @section('content')
-
-

{{ title_case(trans('auth.log_in')) }}

+
+

{{ title_case(trans('auth.log_in')) }}

-
- {!! csrf_field() !!} +
+ + {!! csrf_field() !!} - @include('auth/forms/login/' . $authMethod) + @include('auth/forms/login/' . $authMethod) -
- - - -
+
+ + + +
-
- -
- +
+ +
+ - @if(count($socialDrivers) > 0) -
- @foreach($socialDrivers as $driver => $name) - - @icon($driver) - {{ trans('auth.log_in_with', ['socialDriver' => $name]) }} - - @endforeach - @endif + @if(count($socialDrivers) > 0) +
+ @foreach($socialDrivers as $driver => $name) + + @icon($driver) + {{ trans('auth.log_in_with', ['socialDriver' => $name]) }} + + @endforeach + @endif +
diff --git a/resources/views/auth/register.blade.php b/resources/views/auth/register.blade.php index d5db4afa8..7b319d30c 100644 --- a/resources/views/auth/register.blade.php +++ b/resources/views/auth/register.blade.php @@ -7,41 +7,42 @@ @section('content')
-
-

{{ title_case(trans('auth.sign_up')) }}

+
+

{{ title_case(trans('auth.sign_up')) }}

+
+
+ {!! csrf_field() !!} - - {!! csrf_field() !!} +
+ + @include('form/text', ['name' => 'name']) +
-
- - @include('form/text', ['name' => 'name']) -
+
+ + @include('form/text', ['name' => 'email']) +
-
- - @include('form/text', ['name' => 'email']) -
+
+ + @include('form/password', ['name' => 'password', 'placeholder' => trans('auth.password_hint')]) +
-
- - @include('form/password', ['name' => 'password', 'placeholder' => trans('auth.password_hint')]) -
+
+ +
+
-
- -
- - - @if(count($socialDrivers) > 0) -
- @foreach($socialDrivers as $driver => $name) - - @icon($driver) - {{ trans('auth.sign_up_with', ['socialDriver' => $name]) }} - - @endforeach - @endif + @if(count($socialDrivers) > 0) +
+ @foreach($socialDrivers as $driver => $name) + + @icon($driver) + {{ trans('auth.sign_up_with', ['socialDriver' => $name]) }} + + @endforeach + @endif +
diff --git a/resources/views/books/create.blade.php b/resources/views/books/create.blade.php index 2c629e699..385e6b9d7 100644 --- a/resources/views/books/create.blade.php +++ b/resources/views/books/create.blade.php @@ -1,12 +1,27 @@ -@extends('base') +@extends('simple-layout') -@section('content') +@section('toolbar') + +@stop -
-

{{ trans('entities.books_create') }}

-
- @include('books/form') -
+@section('body') + +
+

 

+
+

{{ trans('entities.books_create') }}

+
+
+ @include('books/form') +
+
+
@stop \ No newline at end of file diff --git a/resources/views/books/delete.blade.php b/resources/views/books/delete.blade.php index 0b1e67d4a..9bcb1cfc6 100644 --- a/resources/views/books/delete.blade.php +++ b/resources/views/books/delete.blade.php @@ -1,28 +1,30 @@ -@extends('base') +@extends('simple-layout') -@section('content') - -
-
-
-
- @include('books._breadcrumbs', ['book' => $book]) -
-
-
+@section('toolbar') +
+ @include('books._breadcrumbs', ['book' => $book])
+@stop + +@section('body')
-

{{ trans('entities.books_delete') }}

-

{{ trans('entities.books_delete_explain', ['bookName' => $book->name]) }}

-

{{ trans('entities.books_delete_confirmation') }}

+

 

+
+

{{ trans('entities.books_delete') }}

+
+

{{ trans('entities.books_delete_explain', ['bookName' => $book->name]) }}

+

{{ trans('entities.books_delete_confirmation') }}

+ +
+ {!! csrf_field() !!} + + {{ trans('common.cancel') }} + +
+
+
-
- {!! csrf_field() !!} - - {{ trans('common.cancel') }} - -
@stop \ No newline at end of file diff --git a/resources/views/books/edit.blade.php b/resources/views/books/edit.blade.php index 2419b68da..9d9c54fec 100644 --- a/resources/views/books/edit.blade.php +++ b/resources/views/books/edit.blade.php @@ -1,23 +1,24 @@ -@extends('base') +@extends('simple-layout') -@section('content') +@section('toolbar') +
+ @include('books._breadcrumbs', ['book' => $book]) +
+@stop -
-
-
-
- @include('books._breadcrumbs', ['book' => $book]) -
+@section('body') + +
+

 

+
+

{{ trans('entities.books_edit') }}

+
+
+ + @include('books/form', ['model' => $book]) +
-
-

{{ trans('entities.books_edit') }}

-
- - @include('books/form', ['model' => $book]) -
-
- @stop \ No newline at end of file diff --git a/resources/views/books/form.blade.php b/resources/views/books/form.blade.php index b1484d129..84a30e7e9 100644 --- a/resources/views/books/form.blade.php +++ b/resources/views/books/form.blade.php @@ -10,7 +10,7 @@ @include('form/textarea', ['name' => 'description'])
-
- {{ trans('common.cancel') }} +
+ {{ trans('common.cancel') }}
\ No newline at end of file diff --git a/resources/views/books/index.blade.php b/resources/views/books/index.blade.php index 3c05f32a5..c22b4591f 100644 --- a/resources/views/books/index.blade.php +++ b/resources/views/books/index.blade.php @@ -27,6 +27,15 @@
{{ trans('entities.books_popular_empty') }}
@endif
+ +
+

{{ trans('entities.books_new') }}

+ @if(count($popular) > 0) + @include('partials/entity-list', ['entities' => $new, 'style' => 'compact']) + @else +
{{ trans('entities.books_new_empty') }}
+ @endif +
@stop @section('body') diff --git a/resources/views/books/restrictions.blade.php b/resources/views/books/restrictions.blade.php index f558fdfce..f87625a67 100644 --- a/resources/views/books/restrictions.blade.php +++ b/resources/views/books/restrictions.blade.php @@ -1,21 +1,20 @@ -@extends('base') +@extends('simple-layout') -@section('content') +@section('toolbar') +
+ @include('books._breadcrumbs', ['book' => $book]) +
+@stop -
-
-
-
- @include('books._breadcrumbs', ['book' => $book]) -
+@section('body') + +
+
+

{{ trans('entities.books_permissions') }}

+
+ @include('form/restriction-form', ['model' => $book])
- -
-

{{ trans('entities.books_permissions') }}

- @include('form/restriction-form', ['model' => $book]) -
- @stop diff --git a/resources/views/books/show.blade.php b/resources/views/books/show.blade.php index 28cd08928..956dbaf16 100644 --- a/resources/views/books/show.blade.php +++ b/resources/views/books/show.blade.php @@ -71,9 +71,7 @@ @if(count($activity) > 0)

{{ trans('entities.recent_activity') }}

-
- @include('partials/activity-list', ['activity' => $activity]) -
+ @include('partials/activity-list', ['activity' => $activity])
@endif @@ -97,34 +95,33 @@

{{$book->name}}

{!! nl2br(e($book->description)) !!}

- + @if(count($bookChildren) > 0)

- @if(count($bookChildren) > 0) - @foreach($bookChildren as $childElement) - @if($childElement->isA('chapter')) - @include('chapters/list-item', ['chapter' => $childElement]) - @else - @include('pages/list-item', ['page' => $childElement]) - @endif -
- @endforeach - @else -

{{ trans('entities.books_empty_contents') }}

-

+ @foreach($bookChildren as $childElement) + @if($childElement->isA('chapter')) + @include('chapters/list-item', ['chapter' => $childElement]) + @else + @include('pages/list-item', ['page' => $childElement]) + @endif +


+ @endforeach +
+ @else +
+

{{ trans('entities.books_empty_contents') }}

@if(userCan('page-create', $book)) - {{ trans('entities.books_empty_create_page') }} + {{ trans('entities.books_empty_create_page') }} @endif @if(userCan('page-create', $book) && userCan('chapter-create', $book)) -   -{{ trans('entities.books_empty_or') }}-    +   -{{ trans('entities.books_empty_or') }}-    @endif @if(userCan('chapter-create', $book)) - {{ trans('entities.books_empty_add_chapter') }} + {{ trans('entities.books_empty_add_chapter') }} @endif -

-
- @endif -
+
+ @endif +

{{ trans('entities.search_results') }} {{ trans('entities.search_clear') }}

diff --git a/resources/views/books/sort.blade.php b/resources/views/books/sort.blade.php index d96f502f1..ebabb90ce 100644 --- a/resources/views/books/sort.blade.php +++ b/resources/views/books/sort.blade.php @@ -1,56 +1,59 @@ -@extends('base') +@extends('simple-layout') @section('head') @stop -@section('content') - -
-
-
-
- @include('books._breadcrumbs', ['book' => $book]) -
-
-
+@section('toolbar') +
+ @include('books._breadcrumbs', ['book' => $book])
+@stop + +@section('body')
-

{{ trans('entities.books_sort') }}

+
-
- - @include('books/sort-box', ['book' => $book, 'bookChildren' => $bookChildren]) - -
- - @if(count($books) > 1) -
-

{{ trans('entities.books_sort_show_other') }}

-
- @foreach($books as $otherBook) - @if($otherBook->id !== $book->id) -
- {{ $otherBook->name }} +
+
+

{{ trans('entities.books_sort') }}

+
+
+ @include('books/sort-box', ['book' => $book, 'bookChildren' => $bookChildren])
- @endif - @endforeach + +
+ {!! csrf_field() !!} + + +
+ {{ trans('common.cancel') }} + +
+
+
+ @if(count($books) > 1) +
+
+

{{ trans('entities.books_sort_show_other') }}

+
+ @foreach($books as $otherBook) + @if($otherBook->id !== $book->id) + + @endif + @endforeach +
+
+
@endif -
-
- {!! csrf_field() !!} - - -
- {{ trans('common.cancel') }} - -
-
+
diff --git a/resources/views/form/restriction-form.blade.php b/resources/views/form/restriction-form.blade.php index 7a1605197..c32fe005a 100644 --- a/resources/views/form/restriction-form.blade.php +++ b/resources/views/form/restriction-form.blade.php @@ -27,6 +27,8 @@ @endforeach - {{ trans('common.cancel') }} - +
+ {{ trans('common.cancel') }} + +
\ No newline at end of file diff --git a/resources/views/home.blade.php b/resources/views/home.blade.php index 6cd450a82..28be91414 100644 --- a/resources/views/home.blade.php +++ b/resources/views/home.blade.php @@ -16,13 +16,13 @@
@if(count($draftPages) > 0)
-

{{ trans('entities.my_recent_drafts') }}

+

{{ trans('entities.my_recent_drafts') }}

@include('partials/entity-list', ['entities' => $draftPages, 'style' => 'compact'])
@endif
-

{{ trans('entities.' . ($signedIn ? 'my_recently_viewed' : 'books_recent')) }}

+

{{ trans('entities.' . ($signedIn ? 'my_recently_viewed' : 'books_recent')) }}

@include('partials/entity-list', [ 'entities' => $recents, 'style' => 'compact', @@ -33,7 +33,7 @@
-

{{ trans('entities.recently_updated_pages') }}

+

{{ trans('entities.recently_updated_pages') }}

@include('partials/entity-list', [ 'entities' => $recentlyUpdatedPages, @@ -46,10 +46,8 @@
-

{{ trans('entities.recent_activity') }}

-
- @include('partials/activity-list', ['activity' => $activity]) -
+

{{ trans('entities.recent_activity') }}

+ @include('partials/activity-list', ['activity' => $activity])
diff --git a/resources/views/public.blade.php b/resources/views/public.blade.php index ea2069b86..87d4f1c88 100644 --- a/resources/views/public.blade.php +++ b/resources/views/public.blade.php @@ -1,5 +1,5 @@ - + {{ setting('app-name') }} @@ -23,12 +23,12 @@ {!! setting('app-custom-head') !!} @endif - + @include('partials.notifications')