diff --git a/app/Http/Controllers/Auth/RegisterController.php b/app/Http/Controllers/Auth/RegisterController.php index 9a23fe2a1..1ba8b97db 100644 --- a/app/Http/Controllers/Auth/RegisterController.php +++ b/app/Http/Controllers/Auth/RegisterController.php @@ -231,7 +231,6 @@ class RegisterController extends Controller return redirect('/register/confirm'); } - $this->emailConfirmationService->sendConfirmation($user); session()->flash('success', trans('auth.email_confirm_resent')); return redirect('/register/confirm'); } diff --git a/app/Http/Controllers/BookController.php b/app/Http/Controllers/BookController.php index 8996ae64a..5342ece6b 100644 --- a/app/Http/Controllers/BookController.php +++ b/app/Http/Controllers/BookController.php @@ -36,11 +36,17 @@ class BookController extends Controller */ public function index() { - $books = $this->entityRepo->getAllPaginated('book', 10); + $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 + ]); } /** @@ -84,7 +90,12 @@ class BookController extends Controller $bookChildren = $this->entityRepo->getBookChildren($book); Views::add($book); $this->setPageTitle($book->getShortName()); - return view('books/show', ['book' => $book, 'current' => $book, 'bookChildren' => $bookChildren]); + return view('books/show', [ + 'book' => $book, + 'current' => $book, + 'bookChildren' => $bookChildren, + 'activity' => Activity::entityActivity($book, 20, 0) + ]); } /** diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php index 7f60d7009..ad3b41655 100644 --- a/app/Http/Controllers/HomeController.php +++ b/app/Http/Controllers/HomeController.php @@ -29,13 +29,11 @@ class HomeController extends Controller $activity = Activity::latest(10); $draftPages = $this->signedIn ? $this->entityRepo->getUserDraftPages(6) : []; $recentFactor = count($draftPages) > 0 ? 0.5 : 1; - $recents = $this->signedIn ? Views::getUserRecentlyViewed(12*$recentFactor, 0) : $this->entityRepo->getRecentlyCreated('book', 10*$recentFactor); - $recentlyCreatedPages = $this->entityRepo->getRecentlyCreated('page', 5); - $recentlyUpdatedPages = $this->entityRepo->getRecentlyUpdated('page', 5); + $recents = $this->signedIn ? Views::getUserRecentlyViewed(12*$recentFactor, 0) : $this->entityRepo->getRecentlyCreated('book', 12*$recentFactor); + $recentlyUpdatedPages = $this->entityRepo->getRecentlyUpdated('page', 12); return view('home', [ 'activity' => $activity, 'recents' => $recents, - 'recentlyCreatedPages' => $recentlyCreatedPages, 'recentlyUpdatedPages' => $recentlyUpdatedPages, 'draftPages' => $draftPages ]); diff --git a/app/Http/Controllers/PageController.php b/app/Http/Controllers/PageController.php index 9a8525c23..573907e56 100644 --- a/app/Http/Controllers/PageController.php +++ b/app/Http/Controllers/PageController.php @@ -380,6 +380,7 @@ class PageController extends Controller return view('pages/revision', [ 'page' => $page, 'book' => $page->book, + 'revision' => $revision ]); } @@ -409,6 +410,7 @@ class PageController extends Controller 'page' => $page, 'book' => $page->book, 'diff' => $diff, + 'revision' => $revision ]); } diff --git a/app/PageRevision.php b/app/PageRevision.php index ff469f0ed..0a9764729 100644 --- a/app/PageRevision.php +++ b/app/PageRevision.php @@ -47,4 +47,16 @@ class PageRevision extends Model return null; } + /** + * Allows checking of the exact class, Used to check entity type. + * Included here to align with entities in similar use cases. + * (Yup, Bit of an awkward hack) + * @param $type + * @return bool + */ + public static function isA($type) + { + return $type === 'revision'; + } + } diff --git a/app/Services/SearchService.php b/app/Services/SearchService.php index 3d1d45c3b..bb92a1d7c 100644 --- a/app/Services/SearchService.php +++ b/app/Services/SearchService.php @@ -92,7 +92,7 @@ class SearchService return [ 'total' => $total, 'count' => count($results), - 'results' => $results->sortByDesc('score') + 'results' => $results->sortByDesc('score')->values() ]; } 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/js/pages/page-show.js b/resources/assets/js/pages/page-show.js index 7754840af..832ec4b36 100644 --- a/resources/assets/js/pages/page-show.js +++ b/resources/assets/js/pages/page-show.js @@ -106,25 +106,25 @@ let setupPageShow = window.setupPageShow = function (pageId) { goToText(event.target.getAttribute('href').substr(1)); }); - // Make the book-tree sidebar stick in view on scroll + // Make the sidebar stick in view on scroll let $window = $(window); - let $bookTree = $(".book-tree"); - let $bookTreeParent = $bookTree.parent(); + let $sidebar = $("#sidebar .scroll-body"); + let $bookTreeParent = $sidebar.parent(); // Check the page is scrollable and the content is taller than the tree - let pageScrollable = ($(document).height() > $window.height()) && ($bookTree.height() < $('.page-content').height()); + let pageScrollable = ($(document).height() > $window.height()) && ($sidebar.height() < $('.page-content').height()); // Get current tree's width and header height let headerHeight = $("#header").height() + $(".toolbar").height(); let isFixed = $window.scrollTop() > headerHeight; // Function to fix the tree as a sidebar function stickTree() { - $bookTree.width($bookTreeParent.width() + 15); - $bookTree.addClass("fixed"); + $sidebar.width($bookTreeParent.width() + 15); + $sidebar.addClass("fixed"); isFixed = true; } // Function to un-fix the tree back into position function unstickTree() { - $bookTree.css('width', 'auto'); - $bookTree.removeClass("fixed"); + $sidebar.css('width', 'auto'); + $sidebar.removeClass("fixed"); isFixed = false; } // Checks if the tree stickiness state should change diff --git a/resources/assets/sass/_blocks.scss b/resources/assets/sass/_blocks.scss index e3a0d6952..c804b9aa8 100644 --- a/resources/assets/sass/_blocks.scss +++ b/resources/assets/sass/_blocks.scss @@ -180,4 +180,45 @@ &.warning:before { content: '\f1f1'; } +} + +.card { + margin: $-m; + background-color: #FFF; + box-shadow: 0 0 1px 0 rgba(0, 0, 0, 0.2); + h3 { + padding: $-m; + border-bottom: 1px solid #E8E8E8; + margin: 0; + font-size: $fs-s; + color: #888; + font-weight: 400; + text-transform: uppercase; + } + .body, p.empty-text { + padding: $-m; + } +} + +.well { + background-color: #F8F8F8; + padding: $-m; + border: 1px solid #DDD; +} + +#sidebar .scroll-body { + &.fixed { + z-index: 5; + position: fixed; + top: 0; + padding-right: $-m; + width: 30%; + left: 0; + height: 100%; + overflow-y: scroll; + -ms-overflow-style: none; + //background-color: $primary-faded; + border-left: 1px solid #DDD; + &::-webkit-scrollbar { width: 0 !important } + } } \ No newline at end of file diff --git a/resources/assets/sass/_buttons.scss b/resources/assets/sass/_buttons.scss index 202eb935b..f9c6d9b9a 100644 --- a/resources/assets/sass/_buttons.scss +++ b/resources/assets/sass/_buttons.scss @@ -2,9 +2,12 @@ @mixin generate-button-colors($textColor, $backgroundColor) { background-color: $backgroundColor; color: $textColor; + text-transform: uppercase; + border: 1px solid $backgroundColor; + vertical-align: top; &:hover { background-color: lighten($backgroundColor, 8%); - box-shadow: $bs-med; + //box-shadow: $bs-med; text-decoration: none; color: $textColor; } @@ -26,16 +29,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 +54,47 @@ $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; + } + } + &.book { + border-color: $color-book; + color: $color-book; + &:hover, &:focus, &:active { + background-color: $color-book; + color: #FFF; + } + } +} + .text-button { @extend .link; background-color: transparent; diff --git a/resources/assets/sass/_codemirror.scss b/resources/assets/sass/_codemirror.scss index 0f006c91a..89ed0f54e 100644 --- a/resources/assets/sass/_codemirror.scss +++ b/resources/assets/sass/_codemirror.scss @@ -392,7 +392,7 @@ span.CodeMirror-selectedtext { background: none; } } .cm-s-base16-light .CodeMirror-gutters { background: #f5f5f5; border-right: 1px solid #DDD; } -.flex-fill .CodeMirror { +.code-fill .CodeMirror { position: absolute; top: 0; bottom: 0; diff --git a/resources/assets/sass/_forms.scss b/resources/assets/sass/_forms.scss index d372359cc..657bbed17 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 { @@ -250,8 +237,8 @@ div[editor-type="markdown"] .title-input.page-title input[type="text"] { padding: 0; cursor: pointer; position: absolute; - left: 7px; - top: 7px; + left: 8px; + top: 9.5px; } input { display: block; diff --git a/resources/assets/sass/_grid.scss b/resources/assets/sass/_grid.scss index de1ee83fb..6bff97cb3 100644 --- a/resources/assets/sass/_grid.scss +++ b/resources/assets/sass/_grid.scss @@ -20,19 +20,46 @@ body.flexbox { align-items: stretch; min-height: 0; position: relative; - .flex, &.flex { - min-height: 0; - flex: 1; + &.rows { + flex-direction: row; } + &.columns { + flex-direction: column; + } +} + +.flex { + min-height: 0; + flex: 1; +} + +.flex.scroll { + //overflow-y: auto; + display: flex; + &.sidebar { + margin-right: -14px; + } +} +.flex.scroll .scroll-body { + overflow-y: scroll; + flex: 1; } .flex-child > div { flex: 1; } -//body.ie .flex-child > div { -// flex: 1 0 0px; -//} +.flex.sidebar { + flex: 1; + background-color: #F2F2F2; + max-width: 360px; + min-height: 90vh; +} +.flex.sidebar + .flex.content { + flex: 3; + background-color: #FFFFFF; + border-left: 1px solid #DDD; +} /** Rules for all columns */ div[class^="col-"] img { diff --git a/resources/assets/sass/_header.scss b/resources/assets/sass/_header.scss index 49bd74b07..3e92ce828 100644 --- a/resources/assets/sass/_header.scss +++ b/resources/assets/sass/_header.scss @@ -171,6 +171,10 @@ header .search-box { background-color: $primary-faded; } +.toolbar-container { + background-color: #FFF; +} + .breadcrumbs .text-button, .action-buttons .text-button { display: inline-block; padding: $-s; diff --git a/resources/assets/sass/_html.scss b/resources/assets/sass/_html.scss index 27ca04eb7..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 { @@ -16,6 +19,9 @@ body { line-height: 1.6; color: #616161; -webkit-font-smoothing: antialiased; + &.shaded { + background-color: #F2F2F2; + } } button { diff --git a/resources/assets/sass/_lists.scss b/resources/assets/sass/_lists.scss index d08ccc9bb..2dd4732f2 100644 --- a/resources/assets/sass/_lists.scss +++ b/resources/assets/sass/_lists.scss @@ -86,31 +86,8 @@ // Sidebar list .book-tree { - padding: $-xs 0 0 0; - position: relative; - right: 0; - top: 0; transition: ease-in-out 240ms; transition-property: right, border; - border-left: 0px solid #FFF; - background-color: #FFF; - max-width: 320px; - &.fixed { - background-color: #FFF; - z-index: 5; - position: fixed; - top: 0; - padding-left: $-l; - padding-right: $-l + 15; - width: 30%; - right: -15px; - height: 100%; - overflow-y: scroll; - -ms-overflow-style: none; - //background-color: $primary-faded; - border-left: 1px solid #DDD; - &::-webkit-scrollbar { width: 0 !important } - } } .book-tree h4 { padding: $-m $-s 0 $-s; @@ -245,6 +222,9 @@ .left + .right { margin-left: 30px + $-s; } + &:last-of-type { + border-bottom: 0; + } } ul.pagination { @@ -297,9 +277,6 @@ ul.pagination { h4 { margin: 0; } - p { - margin: $-xs 0 0 0; - } hr { margin: 0; } @@ -316,6 +293,11 @@ ul.pagination { } } +.card .entity-list-item, .card .activity-list-item { + padding-left: $-m; + padding-right: $-m; +} + .entity-list.compact { font-size: 0.6em; h4, a { @@ -324,9 +306,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/_pages.scss b/resources/assets/sass/_pages.scss index 65fdfbc4b..f73bbd546 100755 --- a/resources/assets/sass/_pages.scss +++ b/resources/assets/sass/_pages.scss @@ -1,12 +1,3 @@ -#page-show { - >.row .col-md-9 { - z-index: 2; - } - >.row .col-md-3 { - z-index: 1; - } -} - .page-editor { display: flex; flex-direction: column; @@ -36,6 +27,8 @@ .page-content { max-width: 840px; + margin: 0 auto; + margin-top: $-xxl; overflow-wrap: break-word; .align-left { text-align: left; @@ -252,8 +245,6 @@ } .tag-display { - width: 100%; - //opacity: 0.7; position: relative; table { width: 100%; diff --git a/resources/assets/sass/_text.scss b/resources/assets/sass/_text.scss index d38a5c515..719126526 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 { @@ -378,12 +378,6 @@ span.sep { display: block; } -.action-header { - h1 { - margin-top: $-m; - } -} - /** * Icons */ 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/common.php b/resources/lang/en/common.php index e1d74c95e..06b980970 100644 --- a/resources/lang/en/common.php +++ b/resources/lang/en/common.php @@ -10,6 +10,7 @@ return [ 'save' => 'Save', 'continue' => 'Continue', 'select' => 'Select', + 'more' => 'More', /** * Form Labels @@ -35,7 +36,6 @@ return [ 'remove' => 'Remove', 'add' => 'Add', - /** * Misc */ @@ -44,6 +44,7 @@ return [ 'no_items' => 'No items available', 'back_to_top' => 'Back to top', 'toggle_details' => 'Toggle Details', + 'details' => 'Details', /** * Header diff --git a/resources/lang/en/entities.php b/resources/lang/en/entities.php index 43053df10..b8be379cd 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', @@ -108,8 +110,7 @@ return [ 'chapters_create' => 'Create New Chapter', 'chapters_delete' => 'Delete Chapter', 'chapters_delete_named' => 'Delete Chapter :chapterName', - 'chapters_delete_explain' => 'This will delete the chapter with the name \':chapterName\', All pages will be removed - and added directly to the parent book.', + 'chapters_delete_explain' => 'This will delete the chapter with the name \':chapterName\'. All pages will be removed and added directly to the parent book.', 'chapters_delete_confirm' => 'Are you sure you want to delete this chapter?', 'chapters_edit' => 'Edit Chapter', 'chapters_edit_named' => 'Edit Chapter :chapterName', @@ -164,6 +165,7 @@ return [ 'pages_move_success' => 'Page moved to ":parentName"', 'pages_permissions' => 'Page Permissions', 'pages_permissions_success' => 'Page permissions updated', + 'pages_revision' => 'Revision', 'pages_revisions' => 'Page Revisions', 'pages_revisions_named' => 'Page Revisions for :pageName', 'pages_revision_named' => 'Page Revision for :pageName', 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')
{{ trans('auth.register_confirm', ['appName' => setting('app-name')]) }}
+{{ trans('auth.register_confirm', ['appName' => setting('app-name')]) }}
+{{ trans('auth.email_not_confirmed_text') }}
- {{ trans('auth.email_not_confirmed_click_link') }}
- {{ trans('auth.email_not_confirmed_resend') }}
-
+
{{ trans('auth.email_not_confirmed_text') }}
+ {{ trans('auth.email_not_confirmed_click_link') }}
+ {{ trans('auth.email_not_confirmed_resend') }}
+