diff --git a/app/Http/Controllers/BookController.php b/app/Http/Controllers/BookController.php index 46636016f..498d6bb7f 100644 --- a/app/Http/Controllers/BookController.php +++ b/app/Http/Controllers/BookController.php @@ -36,7 +36,6 @@ class BookController extends Controller /** * Display a listing of the book. - * * @return Response */ public function index() @@ -50,7 +49,6 @@ class BookController extends Controller /** * Show the form for creating a new book. - * * @return Response */ public function create() @@ -84,7 +82,6 @@ class BookController extends Controller /** * Display the specified book. - * * @param $slug * @return Response */ @@ -100,7 +97,6 @@ class BookController extends Controller /** * Show the form for editing the specified book. - * * @param $slug * @return Response */ @@ -114,7 +110,6 @@ class BookController extends Controller /** * Update the specified book in storage. - * * @param Request $request * @param $slug * @return Response @@ -157,7 +152,7 @@ class BookController extends Controller { $book = $this->bookRepo->getBySlug($bookSlug); $this->checkOwnablePermission('book-update', $book); - $bookChildren = $this->bookRepo->getChildren($book); + $bookChildren = $this->bookRepo->getChildren($book, true); $books = $this->bookRepo->getAll(false); $this->setPageTitle('Sort Book ' . $book->getShortName()); return view('books/sort', ['book' => $book, 'current' => $book, 'books' => $books, 'bookChildren' => $bookChildren]); diff --git a/app/Http/Controllers/PageController.php b/app/Http/Controllers/PageController.php index 30d6c2d76..d2cb647b7 100644 --- a/app/Http/Controllers/PageController.php +++ b/app/Http/Controllers/PageController.php @@ -4,6 +4,7 @@ use Activity; use BookStack\Exceptions\NotFoundException; use BookStack\Repos\UserRepo; use BookStack\Services\ExportService; +use Carbon\Carbon; use Illuminate\Http\Request; use BookStack\Http\Requests; use BookStack\Repos\BookRepo; @@ -216,8 +217,14 @@ class PageController extends Controller } else { $draft = $this->pageRepo->saveUpdateDraft($page, $request->only(['name', 'html', 'markdown'])); } - $updateTime = $draft->updated_at->format('H:i'); - return response()->json(['status' => 'success', 'message' => 'Draft saved at ' . $updateTime]); + + $updateTime = $draft->updated_at->timestamp; + $utcUpdateTimestamp = $updateTime + Carbon::createFromTimestamp(0)->offset; + return response()->json([ + 'status' => 'success', + 'message' => 'Draft saved at ', + 'timestamp' => $utcUpdateTimestamp + ]); } /** diff --git a/app/Repos/BookRepo.php b/app/Repos/BookRepo.php index b74821d31..1a56843ae 100644 --- a/app/Repos/BookRepo.php +++ b/app/Repos/BookRepo.php @@ -198,16 +198,23 @@ class BookRepo extends EntityRepo * Returns a sorted collection of Pages and Chapters. * Loads the bookslug onto child elements to prevent access database access for getting the slug. * @param Book $book + * @param bool $filterDrafts * @return mixed */ - public function getChildren(Book $book) + public function getChildren(Book $book, $filterDrafts = false) { $pageQuery = $book->pages()->where('chapter_id', '=', 0); $pageQuery = $this->restrictionService->enforcePageRestrictions($pageQuery, 'view'); + + if ($filterDrafts) { + $pageQuery = $pageQuery->where('draft', '=', false); + } + $pages = $pageQuery->get(); - $chapterQuery = $book->chapters()->with(['pages' => function($query) { + $chapterQuery = $book->chapters()->with(['pages' => function($query) use ($filterDrafts) { $this->restrictionService->enforcePageRestrictions($query, 'view'); + if ($filterDrafts) $query->where('draft', '=', false); }]); $chapterQuery = $this->restrictionService->enforceChapterRestrictions($chapterQuery, 'view'); $chapters = $chapterQuery->get(); diff --git a/app/Repos/EntityRepo.php b/app/Repos/EntityRepo.php index 1a798e53b..cb3dd6674 100644 --- a/app/Repos/EntityRepo.php +++ b/app/Repos/EntityRepo.php @@ -84,7 +84,7 @@ class EntityRepo if ($additionalQuery !== false && is_callable($additionalQuery)) { $additionalQuery($query); } - return $query->skip($page * $count)->take($count)->get(); + return $query->with('book')->skip($page * $count)->take($count)->get(); } /** @@ -114,7 +114,7 @@ class EntityRepo { return $this->restrictionService->enforcePageRestrictions($this->page) ->where('draft', '=', false) - ->orderBy('updated_at', 'desc')->skip($page * $count)->take($count)->get(); + ->orderBy('updated_at', 'desc')->with('book')->skip($page * $count)->take($count)->get(); } /** diff --git a/app/Repos/PageRepo.php b/app/Repos/PageRepo.php index 9a7502754..ef470c01d 100644 --- a/app/Repos/PageRepo.php +++ b/app/Repos/PageRepo.php @@ -154,10 +154,10 @@ class PageRepo extends EntityRepo /** * Get a new draft page instance. * @param Book $book - * @param Chapter|null $chapter + * @param Chapter|bool $chapter * @return static */ - public function getDraftPage(Book $book, $chapter) + public function getDraftPage(Book $book, $chapter = false) { $page = $this->page->newInstance(); $page->name = 'New Page'; diff --git a/app/Services/ViewService.php b/app/Services/ViewService.php index 75ffd21dc..6b50e90de 100644 --- a/app/Services/ViewService.php +++ b/app/Services/ViewService.php @@ -1,6 +1,5 @@ restrictionService->filterRestrictedEntityRelations($this->view, 'views', 'viewable_id', 'viewable_type') - ->select('id', 'viewable_id', 'viewable_type', \DB::raw('SUM(views) as view_count')) + ->select('*', 'viewable_id', 'viewable_type', \DB::raw('SUM(views) as view_count')) ->groupBy('viewable_id', 'viewable_type') ->orderBy('view_count', 'desc'); if ($filterModel) $query->where('viewable_type', '=', get_class($filterModel)); - $views = $query->with('viewable')->skip($skipCount)->take($count)->get(); - $viewedEntities = $views->map(function ($item) { - return $item->viewable()->getResults(); - }); - return $viewedEntities; + return $query->with('viewable')->skip($skipCount)->take($count)->get()->pluck('viewable'); } /** @@ -81,21 +75,18 @@ class ViewService public function getUserRecentlyViewed($count = 10, $page = 0, $filterModel = false) { if ($this->user === null) return collect(); - $skipCount = $count * $page; + $query = $this->restrictionService ->filterRestrictedEntityRelations($this->view, 'views', 'viewable_id', 'viewable_type'); if ($filterModel) $query = $query->where('viewable_type', '=', get_class($filterModel)); $query = $query->where('user_id', '=', auth()->user()->id); - $views = $query->with('viewable')->orderBy('updated_at', 'desc')->skip($skipCount)->take($count)->get(); - $viewedEntities = $views->map(function ($item) { - return $item->viewable; - }); - return $viewedEntities; + $viewables = $query->with('viewable')->orderBy('updated_at', 'desc') + ->skip($count * $page)->take($count)->get()->pluck('viewable'); + return $viewables; } - /** * Reset all view counts by deleting all views. */ @@ -104,5 +95,4 @@ class ViewService $this->view->truncate(); } - } \ No newline at end of file diff --git a/config/database.php b/config/database.php index 20d461fc9..e4d6880c7 100644 --- a/config/database.php +++ b/config/database.php @@ -139,6 +139,6 @@ return [ | */ - 'redis' => $redisConfig, + 'redis' => env('REDIS_SERVERS', false) ? $redisConfig : [], ]; diff --git a/package.json b/package.json index 7d1aa1a6a..866109c2a 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,7 @@ "dropzone": "^4.0.1", "laravel-elixir": "^3.4.0", "marked": "^0.3.5", + "moment": "^2.12.0", "zeroclipboard": "^2.2.0" } } diff --git a/public/fonts/roboto-bold-webfont.eot b/public/fonts/roboto-bold-webfont.eot deleted file mode 100644 index 48a565c0c..000000000 Binary files a/public/fonts/roboto-bold-webfont.eot and /dev/null differ diff --git a/public/fonts/roboto-bold-webfont.svg b/public/fonts/roboto-bold-webfont.svg deleted file mode 100644 index 79525e8db..000000000 --- a/public/fonts/roboto-bold-webfont.svg +++ /dev/null @@ -1,675 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/public/fonts/roboto-bold-webfont.ttf b/public/fonts/roboto-bold-webfont.ttf deleted file mode 100644 index 25564cacc..000000000 Binary files a/public/fonts/roboto-bold-webfont.ttf and /dev/null differ diff --git a/public/fonts/roboto-bold-webfont.woff b/public/fonts/roboto-bold-webfont.woff deleted file mode 100644 index 8a2cdccba..000000000 Binary files a/public/fonts/roboto-bold-webfont.woff and /dev/null differ diff --git a/public/fonts/roboto-bold-webfont.woff2 b/public/fonts/roboto-bold-webfont.woff2 deleted file mode 100644 index 2442142ff..000000000 Binary files a/public/fonts/roboto-bold-webfont.woff2 and /dev/null differ diff --git a/public/fonts/roboto-bolditalic-webfont.eot b/public/fonts/roboto-bolditalic-webfont.eot deleted file mode 100644 index afe5a43cd..000000000 Binary files a/public/fonts/roboto-bolditalic-webfont.eot and /dev/null differ diff --git a/public/fonts/roboto-bolditalic-webfont.svg b/public/fonts/roboto-bolditalic-webfont.svg deleted file mode 100644 index 5ce8417ea..000000000 --- a/public/fonts/roboto-bolditalic-webfont.svg +++ /dev/null @@ -1,675 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/public/fonts/roboto-bolditalic-webfont.ttf b/public/fonts/roboto-bolditalic-webfont.ttf deleted file mode 100644 index 85b3cd430..000000000 Binary files a/public/fonts/roboto-bolditalic-webfont.ttf and /dev/null differ diff --git a/public/fonts/roboto-bolditalic-webfont.woff b/public/fonts/roboto-bolditalic-webfont.woff deleted file mode 100644 index b71887e2c..000000000 Binary files a/public/fonts/roboto-bolditalic-webfont.woff and /dev/null differ diff --git a/public/fonts/roboto-bolditalic-webfont.woff2 b/public/fonts/roboto-bolditalic-webfont.woff2 deleted file mode 100644 index efdf48bc2..000000000 Binary files a/public/fonts/roboto-bolditalic-webfont.woff2 and /dev/null differ diff --git a/public/fonts/roboto-italic-webfont.eot b/public/fonts/roboto-italic-webfont.eot deleted file mode 100644 index e6b647dd6..000000000 Binary files a/public/fonts/roboto-italic-webfont.eot and /dev/null differ diff --git a/public/fonts/roboto-italic-webfont.svg b/public/fonts/roboto-italic-webfont.svg deleted file mode 100644 index fc472420a..000000000 --- a/public/fonts/roboto-italic-webfont.svg +++ /dev/null @@ -1,666 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/public/fonts/roboto-italic-webfont.ttf b/public/fonts/roboto-italic-webfont.ttf deleted file mode 100644 index d43bf8b06..000000000 Binary files a/public/fonts/roboto-italic-webfont.ttf and /dev/null differ diff --git a/public/fonts/roboto-italic-webfont.woff b/public/fonts/roboto-italic-webfont.woff deleted file mode 100644 index fb4e64cc0..000000000 Binary files a/public/fonts/roboto-italic-webfont.woff and /dev/null differ diff --git a/public/fonts/roboto-italic-webfont.woff2 b/public/fonts/roboto-italic-webfont.woff2 deleted file mode 100644 index a2004e2f1..000000000 Binary files a/public/fonts/roboto-italic-webfont.woff2 and /dev/null differ diff --git a/public/fonts/roboto-light-webfont.eot b/public/fonts/roboto-light-webfont.eot deleted file mode 100644 index b720697f5..000000000 Binary files a/public/fonts/roboto-light-webfont.eot and /dev/null differ diff --git a/public/fonts/roboto-light-webfont.svg b/public/fonts/roboto-light-webfont.svg deleted file mode 100644 index 3d23bff80..000000000 --- a/public/fonts/roboto-light-webfont.svg +++ /dev/null @@ -1,670 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/public/fonts/roboto-light-webfont.ttf b/public/fonts/roboto-light-webfont.ttf deleted file mode 100644 index a112e0076..000000000 Binary files a/public/fonts/roboto-light-webfont.ttf and /dev/null differ diff --git a/public/fonts/roboto-light-webfont.woff b/public/fonts/roboto-light-webfont.woff deleted file mode 100644 index 6c0f95e3e..000000000 Binary files a/public/fonts/roboto-light-webfont.woff and /dev/null differ diff --git a/public/fonts/roboto-light-webfont.woff2 b/public/fonts/roboto-light-webfont.woff2 deleted file mode 100644 index 2ace0ad77..000000000 Binary files a/public/fonts/roboto-light-webfont.woff2 and /dev/null differ diff --git a/public/fonts/roboto-lightitalic-webfont.eot b/public/fonts/roboto-lightitalic-webfont.eot deleted file mode 100644 index e2641bd5e..000000000 Binary files a/public/fonts/roboto-lightitalic-webfont.eot and /dev/null differ diff --git a/public/fonts/roboto-lightitalic-webfont.svg b/public/fonts/roboto-lightitalic-webfont.svg deleted file mode 100644 index d9f8868dc..000000000 --- a/public/fonts/roboto-lightitalic-webfont.svg +++ /dev/null @@ -1,670 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/public/fonts/roboto-lightitalic-webfont.ttf b/public/fonts/roboto-lightitalic-webfont.ttf deleted file mode 100644 index cd0dceea9..000000000 Binary files a/public/fonts/roboto-lightitalic-webfont.ttf and /dev/null differ diff --git a/public/fonts/roboto-lightitalic-webfont.woff b/public/fonts/roboto-lightitalic-webfont.woff deleted file mode 100644 index 8312da091..000000000 Binary files a/public/fonts/roboto-lightitalic-webfont.woff and /dev/null differ diff --git a/public/fonts/roboto-lightitalic-webfont.woff2 b/public/fonts/roboto-lightitalic-webfont.woff2 deleted file mode 100644 index f8ed688d0..000000000 Binary files a/public/fonts/roboto-lightitalic-webfont.woff2 and /dev/null differ diff --git a/public/fonts/roboto-medium-webfont.eot b/public/fonts/roboto-medium-webfont.eot deleted file mode 100644 index 97f5e5054..000000000 Binary files a/public/fonts/roboto-medium-webfont.eot and /dev/null differ diff --git a/public/fonts/roboto-medium-webfont.svg b/public/fonts/roboto-medium-webfont.svg deleted file mode 100644 index 2c07e1d5c..000000000 --- a/public/fonts/roboto-medium-webfont.svg +++ /dev/null @@ -1,680 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/public/fonts/roboto-medium-webfont.ttf b/public/fonts/roboto-medium-webfont.ttf deleted file mode 100644 index 8def2440a..000000000 Binary files a/public/fonts/roboto-medium-webfont.ttf and /dev/null differ diff --git a/public/fonts/roboto-medium-webfont.woff b/public/fonts/roboto-medium-webfont.woff deleted file mode 100644 index 211f4cca3..000000000 Binary files a/public/fonts/roboto-medium-webfont.woff and /dev/null differ diff --git a/public/fonts/roboto-medium-webfont.woff2 b/public/fonts/roboto-medium-webfont.woff2 deleted file mode 100644 index 93c620be8..000000000 Binary files a/public/fonts/roboto-medium-webfont.woff2 and /dev/null differ diff --git a/public/fonts/roboto-mediumitalic-webfont.eot b/public/fonts/roboto-mediumitalic-webfont.eot deleted file mode 100644 index fd43abc8d..000000000 Binary files a/public/fonts/roboto-mediumitalic-webfont.eot and /dev/null differ diff --git a/public/fonts/roboto-mediumitalic-webfont.svg b/public/fonts/roboto-mediumitalic-webfont.svg deleted file mode 100644 index 4f573a619..000000000 --- a/public/fonts/roboto-mediumitalic-webfont.svg +++ /dev/null @@ -1,680 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/public/fonts/roboto-mediumitalic-webfont.ttf b/public/fonts/roboto-mediumitalic-webfont.ttf deleted file mode 100644 index 91119dbfa..000000000 Binary files a/public/fonts/roboto-mediumitalic-webfont.ttf and /dev/null differ diff --git a/public/fonts/roboto-mediumitalic-webfont.woff b/public/fonts/roboto-mediumitalic-webfont.woff deleted file mode 100644 index 0b290a080..000000000 Binary files a/public/fonts/roboto-mediumitalic-webfont.woff and /dev/null differ diff --git a/public/fonts/roboto-mediumitalic-webfont.woff2 b/public/fonts/roboto-mediumitalic-webfont.woff2 deleted file mode 100644 index 886bd287d..000000000 Binary files a/public/fonts/roboto-mediumitalic-webfont.woff2 and /dev/null differ diff --git a/public/fonts/roboto-regular-webfont.eot b/public/fonts/roboto-regular-webfont.eot deleted file mode 100644 index 9ef2f019c..000000000 Binary files a/public/fonts/roboto-regular-webfont.eot and /dev/null differ diff --git a/public/fonts/roboto-regular-webfont.svg b/public/fonts/roboto-regular-webfont.svg deleted file mode 100644 index 8bf6da3bf..000000000 --- a/public/fonts/roboto-regular-webfont.svg +++ /dev/null @@ -1,666 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/public/fonts/roboto-regular-webfont.ttf b/public/fonts/roboto-regular-webfont.ttf deleted file mode 100644 index 615002876..000000000 Binary files a/public/fonts/roboto-regular-webfont.ttf and /dev/null differ diff --git a/public/fonts/roboto-regular-webfont.woff b/public/fonts/roboto-regular-webfont.woff deleted file mode 100644 index dd5f8d0ce..000000000 Binary files a/public/fonts/roboto-regular-webfont.woff and /dev/null differ diff --git a/public/fonts/roboto-regular-webfont.woff2 b/public/fonts/roboto-regular-webfont.woff2 deleted file mode 100644 index 4d5654f9b..000000000 Binary files a/public/fonts/roboto-regular-webfont.woff2 and /dev/null differ diff --git a/public/fonts/roboto-v15-cyrillic_latin-100.woff b/public/fonts/roboto-v15-cyrillic_latin-100.woff new file mode 100644 index 000000000..4eb2be6a1 Binary files /dev/null and b/public/fonts/roboto-v15-cyrillic_latin-100.woff differ diff --git a/public/fonts/roboto-v15-cyrillic_latin-100.woff2 b/public/fonts/roboto-v15-cyrillic_latin-100.woff2 new file mode 100644 index 000000000..007b90e85 Binary files /dev/null and b/public/fonts/roboto-v15-cyrillic_latin-100.woff2 differ diff --git a/public/fonts/roboto-v15-cyrillic_latin-100italic.woff b/public/fonts/roboto-v15-cyrillic_latin-100italic.woff new file mode 100644 index 000000000..fa7e51bc8 Binary files /dev/null and b/public/fonts/roboto-v15-cyrillic_latin-100italic.woff differ diff --git a/public/fonts/roboto-v15-cyrillic_latin-100italic.woff2 b/public/fonts/roboto-v15-cyrillic_latin-100italic.woff2 new file mode 100644 index 000000000..f27a169cb Binary files /dev/null and b/public/fonts/roboto-v15-cyrillic_latin-100italic.woff2 differ diff --git a/public/fonts/roboto-v15-cyrillic_latin-300.woff b/public/fonts/roboto-v15-cyrillic_latin-300.woff new file mode 100644 index 000000000..ace052941 Binary files /dev/null and b/public/fonts/roboto-v15-cyrillic_latin-300.woff differ diff --git a/public/fonts/roboto-v15-cyrillic_latin-300.woff2 b/public/fonts/roboto-v15-cyrillic_latin-300.woff2 new file mode 100644 index 000000000..0c093b91c Binary files /dev/null and b/public/fonts/roboto-v15-cyrillic_latin-300.woff2 differ diff --git a/public/fonts/roboto-v15-cyrillic_latin-300italic.woff b/public/fonts/roboto-v15-cyrillic_latin-300italic.woff new file mode 100644 index 000000000..7984971e7 Binary files /dev/null and b/public/fonts/roboto-v15-cyrillic_latin-300italic.woff differ diff --git a/public/fonts/roboto-v15-cyrillic_latin-300italic.woff2 b/public/fonts/roboto-v15-cyrillic_latin-300italic.woff2 new file mode 100644 index 000000000..46ed6c7cc Binary files /dev/null and b/public/fonts/roboto-v15-cyrillic_latin-300italic.woff2 differ diff --git a/public/fonts/roboto-v15-cyrillic_latin-500.woff b/public/fonts/roboto-v15-cyrillic_latin-500.woff new file mode 100644 index 000000000..8ae98f2de Binary files /dev/null and b/public/fonts/roboto-v15-cyrillic_latin-500.woff differ diff --git a/public/fonts/roboto-v15-cyrillic_latin-500.woff2 b/public/fonts/roboto-v15-cyrillic_latin-500.woff2 new file mode 100644 index 000000000..fba67842e Binary files /dev/null and b/public/fonts/roboto-v15-cyrillic_latin-500.woff2 differ diff --git a/public/fonts/roboto-v15-cyrillic_latin-500italic.woff b/public/fonts/roboto-v15-cyrillic_latin-500italic.woff new file mode 100644 index 000000000..560968d16 Binary files /dev/null and b/public/fonts/roboto-v15-cyrillic_latin-500italic.woff differ diff --git a/public/fonts/roboto-v15-cyrillic_latin-500italic.woff2 b/public/fonts/roboto-v15-cyrillic_latin-500italic.woff2 new file mode 100644 index 000000000..cc41bf873 Binary files /dev/null and b/public/fonts/roboto-v15-cyrillic_latin-500italic.woff2 differ diff --git a/public/fonts/roboto-v15-cyrillic_latin-700.woff b/public/fonts/roboto-v15-cyrillic_latin-700.woff new file mode 100644 index 000000000..7d19e332d Binary files /dev/null and b/public/fonts/roboto-v15-cyrillic_latin-700.woff differ diff --git a/public/fonts/roboto-v15-cyrillic_latin-700.woff2 b/public/fonts/roboto-v15-cyrillic_latin-700.woff2 new file mode 100644 index 000000000..e2274a4fb Binary files /dev/null and b/public/fonts/roboto-v15-cyrillic_latin-700.woff2 differ diff --git a/public/fonts/roboto-v15-cyrillic_latin-700italic.woff b/public/fonts/roboto-v15-cyrillic_latin-700italic.woff new file mode 100644 index 000000000..1604c8763 Binary files /dev/null and b/public/fonts/roboto-v15-cyrillic_latin-700italic.woff differ diff --git a/public/fonts/roboto-v15-cyrillic_latin-700italic.woff2 b/public/fonts/roboto-v15-cyrillic_latin-700italic.woff2 new file mode 100644 index 000000000..f950ca2aa Binary files /dev/null and b/public/fonts/roboto-v15-cyrillic_latin-700italic.woff2 differ diff --git a/public/fonts/roboto-v15-cyrillic_latin-italic.woff b/public/fonts/roboto-v15-cyrillic_latin-italic.woff new file mode 100644 index 000000000..d76d13d6a Binary files /dev/null and b/public/fonts/roboto-v15-cyrillic_latin-italic.woff differ diff --git a/public/fonts/roboto-v15-cyrillic_latin-italic.woff2 b/public/fonts/roboto-v15-cyrillic_latin-italic.woff2 new file mode 100644 index 000000000..a80f41528 Binary files /dev/null and b/public/fonts/roboto-v15-cyrillic_latin-italic.woff2 differ diff --git a/public/fonts/roboto-v15-cyrillic_latin-regular.woff b/public/fonts/roboto-v15-cyrillic_latin-regular.woff new file mode 100644 index 000000000..a2ada2f46 Binary files /dev/null and b/public/fonts/roboto-v15-cyrillic_latin-regular.woff differ diff --git a/public/fonts/roboto-v15-cyrillic_latin-regular.woff2 b/public/fonts/roboto-v15-cyrillic_latin-regular.woff2 new file mode 100644 index 000000000..a3b35e686 Binary files /dev/null and b/public/fonts/roboto-v15-cyrillic_latin-regular.woff2 differ diff --git a/resources/assets/js/controllers.js b/resources/assets/js/controllers.js index 83e58ee4b..8b3d952be 100644 --- a/resources/assets/js/controllers.js +++ b/resources/assets/js/controllers.js @@ -1,5 +1,7 @@ "use strict"; +var moment = require('moment'); + module.exports = function (ngApp, events) { ngApp.controller('ImageManagerController', ['$scope', '$attrs', '$http', '$timeout', 'imageManagerService', @@ -367,7 +369,8 @@ module.exports = function (ngApp, events) { if (isMarkdown) data.markdown = $scope.editContent; $http.put('/ajax/page/' + pageId + '/save-draft', data).then((responseData) => { - $scope.draftText = responseData.data.message; + var updateTime = moment.utc(moment.unix(responseData.data.timestamp)).toDate(); + $scope.draftText = responseData.data.message + moment(updateTime).format('HH:mm'); if (!$scope.isNewPageDraft) $scope.isUpdateDraft = true; }); } diff --git a/resources/assets/js/pages/page-form.js b/resources/assets/js/pages/page-form.js index c6787ba87..de7b3e687 100644 --- a/resources/assets/js/pages/page-form.js +++ b/resources/assets/js/pages/page-form.js @@ -11,7 +11,7 @@ var mceOptions = module.exports = { extended_valid_elements: 'pre[*]', automatic_uploads: false, valid_children: "-div[p|pre|h1|h2|h3|h4|h5|h6|blockquote]", - plugins: "image table textcolor paste link fullscreen imagetools code hr autosave", + plugins: "image table textcolor paste link fullscreen imagetools code hr autosave lists", imagetools_toolbar: 'imageoptions', toolbar: "undo redo | styleselect | bold italic underline strikethrough superscript subscript | forecolor backcolor | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | table image-insert link hr | removeformat code fullscreen", content_style: "body {padding-left: 15px !important; padding-right: 15px !important; margin:0!important; margin-left:auto!important;margin-right:auto!important;}", diff --git a/resources/assets/sass/_fonts.scss b/resources/assets/sass/_fonts.scss index 8cf677779..c9dff31e1 100644 --- a/resources/assets/sass/_fonts.scss +++ b/resources/assets/sass/_fonts.scss @@ -1,102 +1,97 @@ -/* Generated by Font Squirrel (http://www.fontsquirrel.com) on December 30, 2015 */ +// Generated using https://google-webfonts-helper.herokuapp.com + +/* roboto-100 - cyrillic_latin */ @font-face { font-family: 'Roboto'; - src: url('/fonts/roboto-bold-webfont.eot'); - src: url('/fonts/roboto-bold-webfont.eot?#iefix') format('embedded-opentype'), - url('/fonts/roboto-bold-webfont.woff2') format('woff2'), - url('/fonts/roboto-bold-webfont.woff') format('woff'), - url('/fonts/roboto-bold-webfont.ttf') format('truetype'), - url('/fonts/roboto-bold-webfont.svg#robotobold') format('svg'); - font-weight: bold; font-style: normal; + font-weight: 100; + src: local('Roboto Thin'), local('Roboto-Thin'), + url('/fonts/roboto-v15-cyrillic_latin-100.woff2') format('woff2'), /* Chrome 26+, Opera 23+ */ + url('/fonts/roboto-v15-cyrillic_latin-100.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ } - +/* roboto-100italic - cyrillic_latin */ @font-face { font-family: 'Roboto'; - src: url('/fonts/roboto-bolditalic-webfont.eot'); - src: url('/fonts/roboto-bolditalic-webfont.eot?#iefix') format('embedded-opentype'), - url('/fonts/roboto-bolditalic-webfont.woff2') format('woff2'), - url('/fonts/roboto-bolditalic-webfont.woff') format('woff'), - url('/fonts/roboto-bolditalic-webfont.ttf') format('truetype'), - url('/fonts/roboto-bolditalic-webfont.svg#robotobold_italic') format('svg'); - font-weight: bold; font-style: italic; + font-weight: 100; + src: local('Roboto Thin Italic'), local('Roboto-ThinItalic'), + url('/fonts/roboto-v15-cyrillic_latin-100italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+ */ + url('/fonts/roboto-v15-cyrillic_latin-100italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ } - +/* roboto-300 - cyrillic_latin */ @font-face { font-family: 'Roboto'; - src: url('/fonts/roboto-italic-webfont.eot'); - src: url('/fonts/roboto-italic-webfont.eot?#iefix') format('embedded-opentype'), - url('/fonts/roboto-italic-webfont.woff2') format('woff2'), - url('/fonts/roboto-italic-webfont.woff') format('woff'), - url('/fonts/roboto-italic-webfont.ttf') format('truetype'), - url('/fonts/roboto-italic-webfont.svg#robotoitalic') format('svg'); - font-weight: normal; - font-style: italic; -} - -@font-face { - font-family: 'Roboto'; - src: url('/fonts/roboto-light-webfont.eot'); - src: url('/fonts/roboto-light-webfont.eot?#iefix') format('embedded-opentype'), - url('/fonts/roboto-light-webfont.woff2') format('woff2'), - url('/fonts/roboto-light-webfont.woff') format('woff'), - url('/fonts/roboto-light-webfont.ttf') format('truetype'), - url('/fonts/roboto-light-webfont.svg#robotolight') format('svg'); + font-style: normal; font-weight: 300; - font-style: normal; + src: local('Roboto Light'), local('Roboto-Light'), + url('/fonts/roboto-v15-cyrillic_latin-300.woff2') format('woff2'), /* Chrome 26+, Opera 23+ */ + url('/fonts/roboto-v15-cyrillic_latin-300.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ } - +/* roboto-300italic - cyrillic_latin */ @font-face { font-family: 'Roboto'; - src: url('/fonts/roboto-lightitalic-webfont.eot'); - src: url('/fonts/roboto-lightitalic-webfont.eot?#iefix') format('embedded-opentype'), - url('/fonts/roboto-lightitalic-webfont.woff2') format('woff2'), - url('/fonts/roboto-lightitalic-webfont.woff') format('woff'), - url('/fonts/roboto-lightitalic-webfont.ttf') format('truetype'), - url('/fonts/roboto-lightitalic-webfont.svg#robotolight_italic') format('svg'); + font-style: italic; font-weight: 300; - font-style: italic; + src: local('Roboto Light Italic'), local('Roboto-LightItalic'), + url('/fonts/roboto-v15-cyrillic_latin-300italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+ */ + url('/fonts/roboto-v15-cyrillic_latin-300italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ } - +/* roboto-regular - cyrillic_latin */ @font-face { font-family: 'Roboto'; - src: url('/fonts/roboto-medium-webfont.eot'); - src: url('/fonts/roboto-medium-webfont.eot?#iefix') format('embedded-opentype'), - url('/fonts/roboto-medium-webfont.woff2') format('woff2'), - url('/fonts/roboto-medium-webfont.woff') format('woff'), - url('/fonts/roboto-medium-webfont.ttf') format('truetype'), - url('/fonts/roboto-medium-webfont.svg#robotomedium') format('svg'); - font-weight: 500; font-style: normal; + font-weight: 400; + src: local('Roboto'), local('Roboto-Regular'), + url('/fonts/roboto-v15-cyrillic_latin-regular.woff2') format('woff2'), /* Chrome 26+, Opera 23+ */ + url('/fonts/roboto-v15-cyrillic_latin-regular.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ } - +/* roboto-italic - cyrillic_latin */ @font-face { font-family: 'Roboto'; - src: url('/fonts/roboto-mediumitalic-webfont.eot'); - src: url('/fonts/roboto-mediumitalic-webfont.eot?#iefix') format('embedded-opentype'), - url('/fonts/roboto-mediumitalic-webfont.woff2') format('woff2'), - url('/fonts/roboto-mediumitalic-webfont.woff') format('woff'), - url('/fonts/roboto-mediumitalic-webfont.ttf') format('truetype'), - url('/fonts/roboto-mediumitalic-webfont.svg#robotomedium_italic') format('svg'); - font-weight: 500; font-style: italic; + font-weight: 400; + src: local('Roboto Italic'), local('Roboto-Italic'), + url('/fonts/roboto-v15-cyrillic_latin-italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+ */ + url('/fonts/roboto-v15-cyrillic_latin-italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ } - +/* roboto-500 - cyrillic_latin */ @font-face { font-family: 'Roboto'; - src: url('/fonts/roboto-regular-webfont.eot'); - src: url('/fonts/roboto-regular-webfont.eot?#iefix') format('embedded-opentype'), - url('/fonts/roboto-regular-webfont.woff2') format('woff2'), - url('/fonts/roboto-regular-webfont.woff') format('woff'), - url('/fonts/roboto-regular-webfont.ttf') format('truetype'), - url('/fonts/roboto-regular-webfont.svg#robotoregular') format('svg'); - font-weight: normal; font-style: normal; + font-weight: 500; + src: local('Roboto Medium'), local('Roboto-Medium'), + url('/fonts/roboto-v15-cyrillic_latin-500.woff2') format('woff2'), /* Chrome 26+, Opera 23+ */ + url('/fonts/roboto-v15-cyrillic_latin-500.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ +} +/* roboto-500italic - cyrillic_latin */ +@font-face { + font-family: 'Roboto'; + font-style: italic; + font-weight: 500; + src: local('Roboto Medium Italic'), local('Roboto-MediumItalic'), + url('/fonts/roboto-v15-cyrillic_latin-500italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+ */ + url('/fonts/roboto-v15-cyrillic_latin-500italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ +} +/* roboto-700 - cyrillic_latin */ +@font-face { + font-family: 'Roboto'; + font-style: normal; + font-weight: 700; + src: local('Roboto Bold'), local('Roboto-Bold'), + url('/fonts/roboto-v15-cyrillic_latin-700.woff2') format('woff2'), /* Chrome 26+, Opera 23+ */ + url('/fonts/roboto-v15-cyrillic_latin-700.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ +} +/* roboto-700italic - cyrillic_latin */ +@font-face { + font-family: 'Roboto'; + font-style: italic; + font-weight: 700; + src: local('Roboto Bold Italic'), local('Roboto-BoldItalic'), + url('/fonts/roboto-v15-cyrillic_latin-700italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+ */ + url('/fonts/roboto-v15-cyrillic_latin-700italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ } /* roboto-mono-regular - latin */ -// https://google-webfonts-helper.herokuapp.com @font-face { font-family: 'Roboto Mono'; font-style: normal; diff --git a/resources/assets/sass/_tables.scss b/resources/assets/sass/_tables.scss index 999d65f8d..e6ec76b38 100644 --- a/resources/assets/sass/_tables.scss +++ b/resources/assets/sass/_tables.scss @@ -24,4 +24,13 @@ table { background-color: #F8F8F8; font-weight: 500; } +} + +table.list-table { + margin: 0 -$-xs; + td { + border: 0; + vertical-align: middle; + padding: $-xs; + } } \ No newline at end of file diff --git a/resources/views/settings/roles/form.blade.php b/resources/views/settings/roles/form.blade.php index cd81febb1..0980d1b65 100644 --- a/resources/views/settings/roles/form.blade.php +++ b/resources/views/settings/roles/form.blade.php @@ -2,130 +2,142 @@
-
-

Role Details

-
- - @include('form/text', ['name' => 'display_name']) -
-
- - @include('form/text', ['name' => 'description']) -
-

System Permissions

+
-
- -
-
- -
-
-
-
-
+
+

Role Details

+
+ + @include('form/text', ['name' => 'display_name']) +
+
+ + @include('form/text', ['name' => 'description']) +
+

System Permissions

+ + -
-
+ +
+ +
+ +

Asset Permissions

+

+ These permissions control default access to the assets within the system. + Permissions on Books, Chapters and Pages will override these permissions. +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CreateEditDelete
Books + + + + + + + + + + +
Chapters + + + + + + + + + + + +
Pages + + + + + + + + + + + +
Images@include('settings/roles/checkbox', ['permission' => 'image-create-all']) + + + + + +
-
-
- -
-
- + Cancel +
+
+

Users in this role

-
- -

Asset Permissions

-

- These permissions control default access to the assets within the system.
- Permissions on Books, Chapters and Pages will override these permissions. -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @if(isset($role) && count($role->users) > 0) +
CreateViewEditDelete
Books - - - - - - - - - - -
Chapters - - - - - - - - - - - -
Pages - - - - - - - - - - - -
Images@include('settings/roles/checkbox', ['permission' => 'image-create-all']) - - - - - -
+ @foreach($role->users as $user) + + + + + @endforeach
{{$user->name}} + @if(userCan('users-manage') || $currentUser->id == $user->id) + + @endif + {{ $user->name }} + @if(userCan('users-manage') || $currentUser->id == $user->id) + + @endif +
+ @else +

+ No users currently in this role. +

+ @endif +
-
-Cancel - \ No newline at end of file + +
\ No newline at end of file diff --git a/tests/Entity/SortTest.php b/tests/Entity/SortTest.php new file mode 100644 index 000000000..8792a0a06 --- /dev/null +++ b/tests/Entity/SortTest.php @@ -0,0 +1,25 @@ +book = \BookStack\Book::first(); + } + + public function test_drafts_do_not_show_up() + { + $this->asAdmin(); + $pageRepo = app('\BookStack\Repos\PageRepo'); + $draft = $pageRepo->getDraftPage($this->book); + + $this->visit($this->book->getUrl()) + ->see($draft->name) + ->visit($this->book->getUrl() . '/sort') + ->dontSee($draft->name); + } + +} \ No newline at end of file