diff --git a/app/Console/Commands/RegeneratePermissions.php b/app/Console/Commands/RegeneratePermissions.php index 1dc25f9aa..9cd577a17 100644 --- a/app/Console/Commands/RegeneratePermissions.php +++ b/app/Console/Commands/RegeneratePermissions.php @@ -49,6 +49,7 @@ class RegeneratePermissions extends Command $connection = \DB::getDefaultConnection(); if ($this->option('database') !== null) { \DB::setDefaultConnection($this->option('database')); + $this->permissionService->setConnection(\DB::connection($this->option('database'))); } $this->permissionService->buildJointPermissions(); diff --git a/app/Console/Commands/RegenerateSearch.php b/app/Console/Commands/RegenerateSearch.php index 35ecd46c0..1757911a7 100644 --- a/app/Console/Commands/RegenerateSearch.php +++ b/app/Console/Commands/RegenerateSearch.php @@ -44,6 +44,7 @@ class RegenerateSearch extends Command $connection = \DB::getDefaultConnection(); if ($this->option('database') !== null) { \DB::setDefaultConnection($this->option('database')); + $this->searchService->setConnection(\DB::connection($this->option('database'))); } $this->searchService->indexAllEntities(); diff --git a/app/Entity.php b/app/Entity.php index 6aeb66481..e5dd04bf2 100644 --- a/app/Entity.php +++ b/app/Entity.php @@ -94,17 +94,6 @@ class Entity extends Ownable ->where('action', '=', $action)->count() > 0; } - /** - * Check if this entity has live (active) restrictions in place. - * @param $role_id - * @param $action - * @return bool - */ - public function hasActiveRestriction($role_id, $action) - { - return $this->getRawAttribute('restricted') && $this->hasRestriction($role_id, $action); - } - /** * Get the entity jointPermissions this is connected to. * @return \Illuminate\Database\Eloquent\Relations\MorphMany @@ -176,5 +165,11 @@ class Entity extends Ownable */ public function entityRawQuery(){return '';} + /** + * Get the url of this entity + * @param $path + * @return string + */ + public function getUrl($path){return '/';} } diff --git a/app/Http/Controllers/BookController.php b/app/Http/Controllers/BookController.php index fe9ece5b2..8996ae64a 100644 --- a/app/Http/Controllers/BookController.php +++ b/app/Http/Controllers/BookController.php @@ -1,6 +1,7 @@ entityRepo->getById('book', $bookId); + $this->entityRepo->buildJointPermissionsForBook($updatedBook); Activity::add($updatedBook, 'book_sort', $updatedBook->id); } - // Update permissions on changed models - if (count($updatedModels) === 0) $this->entityRepo->buildJointPermissions($updatedModels); - return redirect($book->getUrl()); } diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php index 7892fe8ae..7f60d7009 100644 --- a/app/Http/Controllers/HomeController.php +++ b/app/Http/Controllers/HomeController.php @@ -46,7 +46,7 @@ class HomeController extends Controller * @return \Illuminate\Contracts\Routing\ResponseFactory|\Symfony\Component\HttpFoundation\Response */ public function getTranslations() { - $locale = trans()->getLocale(); + $locale = app()->getLocale(); $cacheKey = 'GLOBAL_TRANSLATIONS_' . $locale; if (cache()->has($cacheKey) && config('app.env') !== 'development') { $resp = cache($cacheKey); diff --git a/app/Http/Middleware/Localization.php b/app/Http/Middleware/Localization.php index 31cb5d9a2..14c87c377 100644 --- a/app/Http/Middleware/Localization.php +++ b/app/Http/Middleware/Localization.php @@ -15,7 +15,17 @@ class Localization public function handle($request, Closure $next) { $defaultLang = config('app.locale'); - $locale = setting()->getUser(user(), 'language', $defaultLang); + if (user()->isDefault()) { + $locale = $defaultLang; + $availableLocales = config('app.locales'); + foreach ($request->getLanguages() as $lang) { + if (!in_array($lang, $availableLocales)) continue; + $locale = $lang; + break; + } + } else { + $locale = setting()->getUser(user(), 'language', $defaultLang); + } app()->setLocale($locale); Carbon::setLocale($locale); return $next($request); diff --git a/app/Notifications/ConfirmEmail.php b/app/Notifications/ConfirmEmail.php index 64d9bb9ac..27ac89c32 100644 --- a/app/Notifications/ConfirmEmail.php +++ b/app/Notifications/ConfirmEmail.php @@ -2,12 +2,16 @@ namespace BookStack\Notifications; +use Illuminate\Bus\Queueable; use Illuminate\Notifications\Notification; +use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Notifications\Messages\MailMessage; -class ConfirmEmail extends Notification +class ConfirmEmail extends Notification implements ShouldQueue { + use Queueable; + public $token; /** diff --git a/app/Repos/EntityRepo.php b/app/Repos/EntityRepo.php index 449e3aa7d..7bc5fc4fc 100644 --- a/app/Repos/EntityRepo.php +++ b/app/Repos/EntityRepo.php @@ -348,6 +348,10 @@ class EntityRepo foreach ($entities as $entity) { if ($entity->chapter_id === 0 || $entity->chapter_id === '0') continue; $parentKey = 'BookStack\\Chapter:' . $entity->chapter_id; + if (!isset($parents[$parentKey])) { + $tree[] = $entity; + continue; + } $chapter = $parents[$parentKey]; $chapter->pages->push($entity); } @@ -529,11 +533,11 @@ class EntityRepo /** * Alias method to update the book jointPermissions in the PermissionService. - * @param Collection $collection collection on entities + * @param Book $book */ - public function buildJointPermissions(Collection $collection) + public function buildJointPermissionsForBook(Book $book) { - $this->permissionService->buildJointPermissionsForEntities($collection); + $this->permissionService->buildJointPermissionsForEntity($book); } /** @@ -569,6 +573,7 @@ class EntityRepo $draftPage->html = $this->formatHtml($input['html']); $draftPage->text = strip_tags($draftPage->html); $draftPage->draft = false; + $draftPage->revision_count = 1; $draftPage->save(); $this->savePageRevision($draftPage, trans('entities.pages_initial_revision')); @@ -593,6 +598,7 @@ class EntityRepo $revision->created_at = $page->updated_at; $revision->type = 'version'; $revision->summary = $summary; + $revision->revision_number = $page->revision_count; $revision->save(); // Clear old revisions @@ -724,6 +730,7 @@ class EntityRepo if ($chapter) $page->chapter_id = $chapter->id; $book->pages()->save($page); + $page = $this->page->find($page->id); $this->permissionService->buildJointPermissionsForEntity($page); return $page; } @@ -812,6 +819,7 @@ class EntityRepo $page->text = strip_tags($page->html); if (setting('app-editor') !== 'markdown') $page->markdown = ''; $page->updated_by = $userId; + $page->revision_count++; $page->save(); // Remove all update drafts for this user & page. @@ -920,6 +928,7 @@ class EntityRepo */ public function restorePageRevision(Page $page, Book $book, $revisionId) { + $page->revision_count++; $this->savePageRevision($page); $revision = $page->revisions()->where('id', '=', $revisionId)->first(); $page->fill($revision->toArray()); diff --git a/app/Services/PermissionService.php b/app/Services/PermissionService.php index cb0b68026..c86ef0e7a 100644 --- a/app/Services/PermissionService.php +++ b/app/Services/PermissionService.php @@ -3,6 +3,7 @@ use BookStack\Book; use BookStack\Chapter; use BookStack\Entity; +use BookStack\EntityPermission; use BookStack\JointPermission; use BookStack\Ownable; use BookStack\Page; @@ -10,6 +11,7 @@ use BookStack\Role; use BookStack\User; use Illuminate\Database\Connection; use Illuminate\Database\Eloquent\Builder; +use Illuminate\Database\Query\Builder as QueryBuilder; use Illuminate\Support\Collection; class PermissionService @@ -28,22 +30,25 @@ class PermissionService protected $jointPermission; protected $role; + protected $entityPermission; protected $entityCache; /** * PermissionService constructor. * @param JointPermission $jointPermission + * @param EntityPermission $entityPermission * @param Connection $db * @param Book $book * @param Chapter $chapter * @param Page $page * @param Role $role */ - public function __construct(JointPermission $jointPermission, Connection $db, Book $book, Chapter $chapter, Page $page, Role $role) + public function __construct(JointPermission $jointPermission, EntityPermission $entityPermission, Connection $db, Book $book, Chapter $chapter, Page $page, Role $role) { $this->db = $db; $this->jointPermission = $jointPermission; + $this->entityPermission = $entityPermission; $this->role = $role; $this->book = $book; $this->chapter = $chapter; @@ -51,6 +56,15 @@ class PermissionService // TODO - Update so admin still goes through filters } + /** + * Set the database connection + * @param Connection $connection + */ + public function setConnection(Connection $connection) + { + $this->db = $connection; + } + /** * Prepare the local entity cache and ensure it's empty */ @@ -133,22 +147,48 @@ class PermissionService $this->readyEntityCache(); // Get all roles (Should be the most limited dimension) - $roles = $this->role->with('permissions')->get(); + $roles = $this->role->with('permissions')->get()->all(); // Chunk through all books - $this->book->with('permissions')->chunk(500, function ($books) use ($roles) { - $this->createManyJointPermissions($books, $roles); + $this->bookFetchQuery()->chunk(5, function ($books) use ($roles) { + $this->buildJointPermissionsForBooks($books, $roles); }); + } - // Chunk through all chapters - $this->chapter->with('book', 'permissions')->chunk(500, function ($chapters) use ($roles) { - $this->createManyJointPermissions($chapters, $roles); - }); + /** + * Get a query for fetching a book with it's children. + * @return QueryBuilder + */ + protected function bookFetchQuery() + { + return $this->book->newQuery()->select(['id', 'restricted', 'created_by'])->with(['chapters' => function($query) { + $query->select(['id', 'restricted', 'created_by', 'book_id']); + }, 'pages' => function($query) { + $query->select(['id', 'restricted', 'created_by', 'book_id', 'chapter_id']); + }]); + } - // Chunk through all pages - $this->page->with('book', 'chapter', 'permissions')->chunk(500, function ($pages) use ($roles) { - $this->createManyJointPermissions($pages, $roles); - }); + /** + * Build joint permissions for an array of books + * @param Collection $books + * @param array $roles + * @param bool $deleteOld + */ + protected function buildJointPermissionsForBooks($books, $roles, $deleteOld = false) { + $entities = clone $books; + + /** @var Book $book */ + foreach ($books->all() as $book) { + foreach ($book->getRelation('chapters') as $chapter) { + $entities->push($chapter); + } + foreach ($book->getRelation('pages') as $page) { + $entities->push($page); + } + } + + if ($deleteOld) $this->deleteManyJointPermissionsForEntities($entities->all()); + $this->createManyJointPermissions($entities, $roles); } /** @@ -157,18 +197,22 @@ class PermissionService */ public function buildJointPermissionsForEntity(Entity $entity) { - $roles = $this->role->get(); - $entities = collect([$entity]); - + $entities = [$entity]; if ($entity->isA('book')) { - $entities = $entities->merge($entity->chapters); - $entities = $entities->merge($entity->pages); - } elseif ($entity->isA('chapter')) { - $entities = $entities->merge($entity->pages); + $books = $this->bookFetchQuery()->where('id', '=', $entity->id)->get(); + $this->buildJointPermissionsForBooks($books, $this->role->newQuery()->get(), true); + return; } + $entities[] = $entity->book; + if ($entity->isA('page') && $entity->chapter_id) $entities[] = $entity->chapter; + if ($entity->isA('chapter')) { + foreach ($entity->pages as $page) { + $entities[] = $page; + } + } $this->deleteManyJointPermissionsForEntities($entities); - $this->createManyJointPermissions($entities, $roles); + $this->buildJointPermissionsForEntities(collect($entities)); } /** @@ -177,8 +221,8 @@ class PermissionService */ public function buildJointPermissionsForEntities(Collection $entities) { - $roles = $this->role->get(); - $this->deleteManyJointPermissionsForEntities($entities); + $roles = $this->role->newQuery()->get(); + $this->deleteManyJointPermissionsForEntities($entities->all()); $this->createManyJointPermissions($entities, $roles); } @@ -188,23 +232,12 @@ class PermissionService */ public function buildJointPermissionForRole(Role $role) { - $roles = collect([$role]); - + $roles = [$role]; $this->deleteManyJointPermissionsForRoles($roles); // Chunk through all books - $this->book->with('permissions')->chunk(500, function ($books) use ($roles) { - $this->createManyJointPermissions($books, $roles); - }); - - // Chunk through all chapters - $this->chapter->with('book', 'permissions')->chunk(500, function ($books) use ($roles) { - $this->createManyJointPermissions($books, $roles); - }); - - // Chunk through all pages - $this->page->with('book', 'chapter', 'permissions')->chunk(500, function ($books) use ($roles) { - $this->createManyJointPermissions($books, $roles); + $this->bookFetchQuery()->chunk(5, function ($books) use ($roles) { + $this->buildJointPermissionsForBooks($books, $roles); }); } @@ -223,9 +256,10 @@ class PermissionService */ protected function deleteManyJointPermissionsForRoles($roles) { - foreach ($roles as $role) { - $role->jointPermissions()->delete(); - } + $roleIds = array_map(function($role) { + return $role->id; + }, $roles); + $this->jointPermission->newQuery()->whereIn('id', $roleIds)->delete(); } /** @@ -244,53 +278,88 @@ class PermissionService protected function deleteManyJointPermissionsForEntities($entities) { if (count($entities) === 0) return; - $query = $this->jointPermission->newQuery(); - foreach ($entities as $entity) { - $query->orWhere(function($query) use ($entity) { - $query->where('entity_id', '=', $entity->id) - ->where('entity_type', '=', $entity->getMorphClass()); - }); + + $this->db->transaction(function() use ($entities) { + + foreach (array_chunk($entities, 1000) as $entityChunk) { + $query = $this->db->table('joint_permissions'); + foreach ($entityChunk as $entity) { + $query->orWhere(function(QueryBuilder $query) use ($entity) { + $query->where('entity_id', '=', $entity->id) + ->where('entity_type', '=', $entity->getMorphClass()); + }); + } + $query->delete(); } - $query->delete(); + + }); } /** * Create & Save entity jointPermissions for many entities and jointPermissions. * @param Collection $entities - * @param Collection $roles + * @param array $roles */ protected function createManyJointPermissions($entities, $roles) { $this->readyEntityCache(); $jointPermissions = []; + + // Fetch Entity Permissions and create a mapping of entity restricted statuses + $entityRestrictedMap = []; + $permissionFetch = $this->entityPermission->newQuery(); + foreach ($entities as $entity) { + $entityRestrictedMap[$entity->getMorphClass() . ':' . $entity->id] = boolval($entity->getRawAttribute('restricted')); + $permissionFetch->orWhere(function($query) use ($entity) { + $query->where('restrictable_id', '=', $entity->id)->where('restrictable_type', '=', $entity->getMorphClass()); + }); + } + $permissions = $permissionFetch->get(); + + // Create a mapping of explicit entity permissions + $permissionMap = []; + foreach ($permissions as $permission) { + $key = $permission->restrictable_type . ':' . $permission->restrictable_id . ':' . $permission->role_id . ':' . $permission->action; + $isRestricted = $entityRestrictedMap[$permission->restrictable_type . ':' . $permission->restrictable_id]; + $permissionMap[$key] = $isRestricted; + } + + // Create a mapping of role permissions + $rolePermissionMap = []; + foreach ($roles as $role) { + foreach ($role->getRelationValue('permissions') as $permission) { + $rolePermissionMap[$role->getRawAttribute('id') . ':' . $permission->getRawAttribute('name')] = true; + } + } + + // Create Joint Permission Data foreach ($entities as $entity) { foreach ($roles as $role) { foreach ($this->getActions($entity) as $action) { - $jointPermissions[] = $this->createJointPermissionData($entity, $role, $action); + $jointPermissions[] = $this->createJointPermissionData($entity, $role, $action, $permissionMap, $rolePermissionMap); } } } - $this->jointPermission->insert($jointPermissions); + + $this->db->transaction(function() use ($jointPermissions) { + foreach (array_chunk($jointPermissions, 1000) as $jointPermissionChunk) { + $this->db->table('joint_permissions')->insert($jointPermissionChunk); + } + }); } /** * Get the actions related to an entity. - * @param $entity + * @param Entity $entity * @return array */ - protected function getActions($entity) + protected function getActions(Entity $entity) { $baseActions = ['view', 'update', 'delete']; - - if ($entity->isA('chapter')) { - $baseActions[] = 'page-create'; - } else if ($entity->isA('book')) { - $baseActions[] = 'page-create'; - $baseActions[] = 'chapter-create'; - } - - return $baseActions; + if ($entity->isA('chapter') || $entity->isA('book')) $baseActions[] = 'page-create'; + if ($entity->isA('book')) $baseActions[] = 'chapter-create'; + return $baseActions; } /** @@ -298,14 +367,16 @@ class PermissionService * for a particular action. * @param Entity $entity * @param Role $role - * @param $action + * @param string $action + * @param array $permissionMap + * @param array $rolePermissionMap * @return array */ - protected function createJointPermissionData(Entity $entity, Role $role, $action) + protected function createJointPermissionData(Entity $entity, Role $role, $action, $permissionMap, $rolePermissionMap) { $permissionPrefix = (strpos($action, '-') === false ? ($entity->getType() . '-') : '') . $action; - $roleHasPermission = $role->hasPermission($permissionPrefix . '-all'); - $roleHasPermissionOwn = $role->hasPermission($permissionPrefix . '-own'); + $roleHasPermission = isset($rolePermissionMap[$role->getRawAttribute('id') . ':' . $permissionPrefix . '-all']); + $roleHasPermissionOwn = isset($rolePermissionMap[$role->getRawAttribute('id') . ':' . $permissionPrefix . '-own']); $explodedAction = explode('-', $action); $restrictionAction = end($explodedAction); @@ -313,54 +384,46 @@ class PermissionService return $this->createJointPermissionDataArray($entity, $role, $action, true, true); } - if ($entity->isA('book')) { - - if (!$entity->restricted) { - return $this->createJointPermissionDataArray($entity, $role, $action, $roleHasPermission, $roleHasPermissionOwn); - } else { - $hasAccess = $entity->hasActiveRestriction($role->id, $restrictionAction); - return $this->createJointPermissionDataArray($entity, $role, $action, $hasAccess, $hasAccess); - } - - } elseif ($entity->isA('chapter')) { - - if (!$entity->restricted) { - $book = $this->getBook($entity->book_id); - $hasExplicitAccessToBook = $book->hasActiveRestriction($role->id, $restrictionAction); - $hasPermissiveAccessToBook = !$book->restricted; - return $this->createJointPermissionDataArray($entity, $role, $action, - ($hasExplicitAccessToBook || ($roleHasPermission && $hasPermissiveAccessToBook)), - ($hasExplicitAccessToBook || ($roleHasPermissionOwn && $hasPermissiveAccessToBook))); - } else { - $hasAccess = $entity->hasActiveRestriction($role->id, $restrictionAction); - return $this->createJointPermissionDataArray($entity, $role, $action, $hasAccess, $hasAccess); - } - - } elseif ($entity->isA('page')) { - - if (!$entity->restricted) { - $book = $this->getBook($entity->book_id); - $hasExplicitAccessToBook = $book->hasActiveRestriction($role->id, $restrictionAction); - $hasPermissiveAccessToBook = !$book->restricted; - - $chapter = $this->getChapter($entity->chapter_id); - $hasExplicitAccessToChapter = $chapter && $chapter->hasActiveRestriction($role->id, $restrictionAction); - $hasPermissiveAccessToChapter = $chapter && !$chapter->restricted; - $acknowledgeChapter = ($chapter && $chapter->restricted); - - $hasExplicitAccessToParents = $acknowledgeChapter ? $hasExplicitAccessToChapter : $hasExplicitAccessToBook; - $hasPermissiveAccessToParents = $acknowledgeChapter ? $hasPermissiveAccessToChapter : $hasPermissiveAccessToBook; - - return $this->createJointPermissionDataArray($entity, $role, $action, - ($hasExplicitAccessToParents || ($roleHasPermission && $hasPermissiveAccessToParents)), - ($hasExplicitAccessToParents || ($roleHasPermissionOwn && $hasPermissiveAccessToParents)) - ); - } else { - $hasAccess = $entity->hasRestriction($role->id, $action); - return $this->createJointPermissionDataArray($entity, $role, $action, $hasAccess, $hasAccess); - } - + if ($entity->restricted) { + $hasAccess = $this->mapHasActiveRestriction($permissionMap, $entity, $role, $restrictionAction); + return $this->createJointPermissionDataArray($entity, $role, $action, $hasAccess, $hasAccess); } + + if ($entity->isA('book')) { + return $this->createJointPermissionDataArray($entity, $role, $action, $roleHasPermission, $roleHasPermissionOwn); + } + + // For chapters and pages, Check if explicit permissions are set on the Book. + $book = $this->getBook($entity->book_id); + $hasExplicitAccessToParents = $this->mapHasActiveRestriction($permissionMap, $book, $role, $restrictionAction); + $hasPermissiveAccessToParents = !$book->restricted; + + // For pages with a chapter, Check if explicit permissions are set on the Chapter + if ($entity->isA('page') && $entity->chapter_id !== 0) { + $chapter = $this->getChapter($entity->chapter_id); + $hasPermissiveAccessToParents = $hasPermissiveAccessToParents && !$chapter->restricted; + if ($chapter->restricted) { + $hasExplicitAccessToParents = $this->mapHasActiveRestriction($permissionMap, $chapter, $role, $restrictionAction); + } + } + + return $this->createJointPermissionDataArray($entity, $role, $action, + ($hasExplicitAccessToParents || ($roleHasPermission && $hasPermissiveAccessToParents)), + ($hasExplicitAccessToParents || ($roleHasPermissionOwn && $hasPermissiveAccessToParents)) + ); + } + + /** + * Check for an active restriction in an entity map. + * @param $entityMap + * @param Entity $entity + * @param Role $role + * @param $action + * @return bool + */ + protected function mapHasActiveRestriction($entityMap, Entity $entity, Role $role, $action) { + $key = $entity->getMorphClass() . ':' . $entity->getRawAttribute('id') . ':' . $role->getRawAttribute('id') . ':' . $action; + return isset($entityMap[$key]) ? $entityMap[$key] : false; } /** @@ -375,11 +438,10 @@ class PermissionService */ protected function createJointPermissionDataArray(Entity $entity, Role $role, $action, $permissionAll, $permissionOwn) { - $entityClass = get_class($entity); return [ 'role_id' => $role->getRawAttribute('id'), 'entity_id' => $entity->getRawAttribute('id'), - 'entity_type' => $entityClass, + 'entity_type' => $entity->getMorphClass(), 'action' => $action, 'has_permission' => $permissionAll, 'has_permission_own' => $permissionOwn, @@ -476,7 +538,7 @@ class PermissionService * @param integer $book_id * @param bool $filterDrafts * @param bool $fetchPageContent - * @return \Illuminate\Database\Query\Builder + * @return QueryBuilder */ public function bookChildrenQuery($book_id, $filterDrafts = false, $fetchPageContent = false) { $pageSelect = $this->db->table('pages')->selectRaw($this->page->entityRawQuery($fetchPageContent))->where('book_id', '=', $book_id)->where(function($query) use ($filterDrafts) { diff --git a/app/Services/SearchService.php b/app/Services/SearchService.php index a3186e8f4..3d1d45c3b 100644 --- a/app/Services/SearchService.php +++ b/app/Services/SearchService.php @@ -50,6 +50,15 @@ class SearchService $this->permissionService = $permissionService; } + /** + * Set the database connection + * @param Connection $connection + */ + public function setConnection(Connection $connection) + { + $this->db = $connection; + } + /** * Search all entities in the system. * @param string $searchString @@ -154,6 +163,7 @@ class SearchService // Handle normal search terms if (count($terms['search']) > 0) { $subQuery = $this->db->table('search_terms')->select('entity_id', 'entity_type', \DB::raw('SUM(score) as score')); + $subQuery->where('entity_type', '=', 'BookStack\\' . ucfirst($entityType)); $subQuery->where(function(Builder $query) use ($terms) { foreach ($terms['search'] as $inputTerm) { $query->orWhere('term', 'like', $inputTerm .'%'); diff --git a/composer.json b/composer.json index 396a9babd..2381c534b 100644 --- a/composer.json +++ b/composer.json @@ -64,6 +64,10 @@ "post-update-cmd": [ "Illuminate\\Foundation\\ComposerScripts::postUpdate", "php artisan optimize" + ], + "refresh-test-database": [ + "php artisan migrate:refresh --database=mysql_testing", + "php artisan db:seed --class=DummyContentSeeder --database=mysql_testing" ] }, "config": { diff --git a/config/app.php b/config/app.php index feab6651c..13bb9aa7d 100644 --- a/config/app.php +++ b/config/app.php @@ -58,6 +58,7 @@ return [ */ 'locale' => env('APP_LANG', 'en'), + 'locales' => ['en', 'de', 'es', 'fr', 'nl', 'pt_BR', 'sk'], /* |-------------------------------------------------------------------------- diff --git a/database/factories/ModelFactory.php b/database/factories/ModelFactory.php index 43e214386..ebf78d1fa 100644 --- a/database/factories/ModelFactory.php +++ b/database/factories/ModelFactory.php @@ -43,7 +43,8 @@ $factory->define(BookStack\Page::class, function ($faker) { 'name' => $faker->sentence, 'slug' => str_random(10), 'html' => $html, - 'text' => strip_tags($html) + 'text' => strip_tags($html), + 'revision_count' => 1 ]; }); diff --git a/database/migrations/2017_04_20_185112_add_revision_counts.php b/database/migrations/2017_04_20_185112_add_revision_counts.php new file mode 100644 index 000000000..3583f36f3 --- /dev/null +++ b/database/migrations/2017_04_20_185112_add_revision_counts.php @@ -0,0 +1,44 @@ +integer('revision_count'); + }); + Schema::table('page_revisions', function (Blueprint $table) { + $table->integer('revision_number'); + $table->index('revision_number'); + }); + + // Update revision count + $pTable = DB::getTablePrefix() . 'pages'; + $rTable = DB::getTablePrefix() . 'page_revisions'; + DB::statement("UPDATE ${pTable} SET ${pTable}.revision_count=(SELECT count(*) FROM ${rTable} WHERE ${rTable}.page_id=${pTable}.id)"); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('pages', function (Blueprint $table) { + $table->dropColumn('revision_count'); + }); + Schema::table('page_revisions', function (Blueprint $table) { + $table->dropColumn('revision_number'); + }); + } +} diff --git a/database/seeds/DummyContentSeeder.php b/database/seeds/DummyContentSeeder.php index 6f6b3ddc5..3d92efab1 100644 --- a/database/seeds/DummyContentSeeder.php +++ b/database/seeds/DummyContentSeeder.php @@ -28,6 +28,12 @@ class DummyContentSeeder extends Seeder $book->pages()->saveMany($pages); }); + $largeBook = factory(\BookStack\Book::class)->create(['name' => 'Large book' . str_random(10), 'created_by' => $user->id, 'updated_by' => $user->id]); + $pages = factory(\BookStack\Page::class, 200)->make(['created_by' => $user->id, 'updated_by' => $user->id]); + $chapters = factory(\BookStack\Chapter::class, 50)->make(['created_by' => $user->id, 'updated_by' => $user->id]); + $largeBook->pages()->saveMany($pages); + $largeBook->chapters()->saveMany($chapters); + app(\BookStack\Services\PermissionService::class)->buildJointPermissions(); app(\BookStack\Services\SearchService::class)->indexAllEntities(); } diff --git a/readme.md b/readme.md index 3e269e175..e2f16e171 100644 --- a/readme.md +++ b/readme.md @@ -43,6 +43,8 @@ Once done you can run `phpunit` in the application root directory to run all tes ## Translations As part of BookStack v0.14 support for translations has been built in. All text strings can be found in the `resources/lang` folder where each language option has its own folder. To add a new language you should copy the `en` folder to an new folder (eg. `fr` for french) then go through and translate all text strings in those files, leaving the keys and file-names intact. If a language string is missing then the `en` translation will be used. To show the language option in the user preferences language drop-down you will need to add your language to the options found at the bottom of the `resources/lang/en/settings.php` file. A system-wide language can also be set in the `.env` file like so: `APP_LANG=en`. + +You will also need to add the language to the `locales` array in the `config/app.php` file. Some strings have colon-prefixed variables in such as `:userName`. Leave these values as they are as they will be replaced at run-time. diff --git a/resources/assets/js/directives.js b/resources/assets/js/directives.js index d119d2e92..cae07a166 100644 --- a/resources/assets/js/directives.js +++ b/resources/assets/js/directives.js @@ -215,7 +215,7 @@ module.exports = function (ngApp, events) { } }]); - const md = new MarkdownIt(); + const md = new MarkdownIt({html: true}); md.use(mdTasksLists, {label: true}); /** diff --git a/resources/lang/en/entities.php b/resources/lang/en/entities.php index ec0e17306..11e29976a 100644 --- a/resources/lang/en/entities.php +++ b/resources/lang/en/entities.php @@ -14,6 +14,7 @@ return [ 'recent_activity' => 'Recent Activity', 'create_now' => 'Create one now', 'revisions' => 'Revisions', + 'meta_revision' => 'Revision #:revisionCount', 'meta_created' => 'Created :timeLength', 'meta_created_name' => 'Created :timeLength by :user', 'meta_updated' => 'Updated :timeLength', @@ -168,6 +169,7 @@ return [ 'pages_revision_named' => 'Page Revision for :pageName', 'pages_revisions_created_by' => 'Created By', 'pages_revisions_date' => 'Revision Date', + 'pages_revisions_number' => '#', 'pages_revisions_changelog' => 'Changelog', 'pages_revisions_changes' => 'Changes', 'pages_revisions_current' => 'Current Version', diff --git a/resources/lang/es/auth.php b/resources/lang/es/auth.php index 8837525ae..572267904 100644 --- a/resources/lang/es/auth.php +++ b/resources/lang/es/auth.php @@ -11,7 +11,7 @@ return [ | */ 'failed' => 'Las credenciales no concuerdan con nuestros registros.', - 'throttle' => 'Demasiados intentos fallidos de conexiÃn. Por favor intente nuevamente en :seconds segundos.', + 'throttle' => 'Demasiados intentos fallidos de conexión. Por favor intente nuevamente en :seconds segundos.', /** * Login & Register diff --git a/resources/lang/es/components.php b/resources/lang/es/components.php index fead3d4a3..980765866 100644 --- a/resources/lang/es/components.php +++ b/resources/lang/es/components.php @@ -18,7 +18,7 @@ return [ 'image_dropzone' => 'Arrastre las imágenes o hacer click aquà para Subir', 'images_deleted' => 'Imágenes borradas', 'image_preview' => 'Preview de la imagen', - 'image_upload_success' => 'Imagen subida exitosamente', + 'image_upload_success' => 'Imagen subida éxitosamente', 'image_update_success' => 'Detalles de la imagen actualizados exitosamente', 'image_delete_success' => 'Imagen borrada exitosamente' ]; diff --git a/resources/lang/es/entities.php b/resources/lang/es/entities.php index b03366da6..d6b2810bc 100644 --- a/resources/lang/es/entities.php +++ b/resources/lang/es/entities.php @@ -4,7 +4,7 @@ return [ /** * Shared */ - 'recently_created' => 'Recientemente creadod', + 'recently_created' => 'Recientemente creado', 'recently_created_pages' => 'Páginas recientemente creadas', 'recently_updated_pages' => 'Páginas recientemente actualizadas', 'recently_created_chapters' => 'CapÃtulos recientemente creados', @@ -139,79 +139,79 @@ return [ 'pages_md_editor' => 'Editor', 'pages_md_preview' => 'Preview', 'pages_md_insert_image' => 'Insertar Imagen', - 'pages_md_insert_link' => 'Insert Entity Link', - 'pages_not_in_chapter' => 'Page is not in a chapter', - 'pages_move' => 'Move Page', - 'pages_move_success' => 'Page moved to ":parentName"', - 'pages_permissions' => 'Page Permissions', - 'pages_permissions_success' => 'Page permissions updated', - 'pages_revisions' => 'Page Revisions', - 'pages_revisions_named' => 'Page Revisions for :pageName', - 'pages_revision_named' => 'Page Revision for :pageName', - 'pages_revisions_created_by' => 'Created By', - 'pages_revisions_date' => 'Revision Date', + 'pages_md_insert_link' => 'Insertar link de entidad', + 'pages_not_in_chapter' => 'La página no esá en el caÃtulo', + 'pages_move' => 'Mover página', + 'pages_move_success' => 'Página movida a ":parentName"', + 'pages_permissions' => 'Permisos de página', + 'pages_permissions_success' => 'Permisos de página actualizados', + 'pages_revisions' => 'Revisiones de página', + 'pages_revisions_named' => 'Revisiones de página para :pageName', + 'pages_revision_named' => 'Revisión de ágina para :pageName', + 'pages_revisions_created_by' => 'Creado por', + 'pages_revisions_date' => 'Fecha de revisión', 'pages_revisions_changelog' => 'Changelog', - 'pages_revisions_changes' => 'Changes', - 'pages_revisions_current' => 'Current Version', + 'pages_revisions_changes' => 'Cambios', + 'pages_revisions_current' => 'Versión actual', 'pages_revisions_preview' => 'Preview', - 'pages_revisions_restore' => 'Restore', - 'pages_revisions_none' => 'This page has no revisions', - 'pages_copy_link' => 'Copy Link', - 'pages_permissions_active' => 'Page Permissions Active', - 'pages_initial_revision' => 'Initial publish', - 'pages_initial_name' => 'New Page', - 'pages_editing_draft_notification' => 'You are currently editing a draft that was last saved :timeDiff.', - 'pages_draft_edited_notification' => 'This page has been updated by since that time. It is recommended that you discard this draft.', + 'pages_revisions_restore' => 'Restaurar', + 'pages_revisions_none' => 'Esta página no tiene revisiones', + 'pages_copy_link' => 'Copiar Link', + 'pages_permissions_active' => 'Permisos de página activos', + 'pages_initial_revision' => 'Publicación inicial', + 'pages_initial_name' => 'Página nueva', + 'pages_editing_draft_notification' => 'Ud. está actualmente editando un borrador que fue guardado porúltima vez el :timeDiff.', + 'pages_draft_edited_notification' => 'Esta página ha sido actualizada desde aquel momento. Se recomienda que cancele este borrador.', 'pages_draft_edit_active' => [ - 'start_a' => ':count users have started editing this page', - 'start_b' => ':userName has started editing this page', - 'time_a' => 'since the pages was last updated', - 'time_b' => 'in the last :minCount minutes', - 'message' => ':start :time. Take care not to overwrite each other\'s updates!', + 'start_a' => ':count usuarios han comenzado a editar esta página', + 'start_b' => ':userName ha comenzado a editar esta página', + 'time_a' => 'desde que las página fue actualizada', + 'time_b' => 'en los últimos :minCount minutos', + 'message' => ':start :time. Ten cuidado de no sobreescribir los cambios del otro usuario', ], - 'pages_draft_discarded' => 'Draft discarded, The editor has been updated with the current page content', + 'pages_draft_discarded' => 'Borrador descartado, el editor ha sido actualizado con el contenido de la página actual', /** * Editor sidebar */ - 'page_tags' => 'Page Tags', - 'tag' => 'Tag', - 'tags' => '', - 'tag_value' => 'Tag Value (Optional)', - 'tags_explain' => "Add some tags to better categorise your content. \n You can assign a value to a tag for more in-depth organisation.", - 'tags_add' => 'Add another tag', - 'attachments' => 'Attachments', - 'attachments_explain' => 'Upload some files or attach some link to display on your page. These are visible in the page sidebar.', - 'attachments_explain_instant_save' => 'Changes here are saved instantly.', - 'attachments_items' => 'Attached Items', - 'attachments_upload' => 'Upload File', - 'attachments_link' => 'Attach Link', - 'attachments_set_link' => 'Set Link', - 'attachments_delete_confirm' => 'Click delete again to confirm you want to delete this attachment.', - 'attachments_dropzone' => 'Drop files or click here to attach a file', - 'attachments_no_files' => 'No files have been uploaded', - 'attachments_explain_link' => 'You can attach a link if you\'d prefer not to upload a file. This can be a link to another page or a link to a file in the cloud.', - 'attachments_link_name' => 'Link Name', - 'attachment_link' => 'Attachment link', - 'attachments_link_url' => 'Link to file', - 'attachments_link_url_hint' => 'Url of site or file', - 'attach' => 'Attach', - 'attachments_edit_file' => 'Edit File', - 'attachments_edit_file_name' => 'File Name', - 'attachments_edit_drop_upload' => 'Drop files or click here to upload and overwrite', - 'attachments_order_updated' => 'Attachment order updated', - 'attachments_updated_success' => 'Attachment details updated', - 'attachments_deleted' => 'Attachment deleted', - 'attachments_file_uploaded' => 'File successfully uploaded', - 'attachments_file_updated' => 'File successfully updated', - 'attachments_link_attached' => 'Link successfully attached to page', + 'page_tags' => 'Etiquetas de página', + 'tag' => 'Etiqueta', + 'tags' => 'Etiquetas', + 'tag_value' => 'Valor de la etiqueta (Opcional)', + 'tags_explain' => "Agregar algunas etiquetas para mejorar la categorización de su contenido. \n Ud. puede asignar un valor a una etiqueta para una organizacón a mayor detalle.", + 'tags_add' => 'Agregar otra etiqueta', + 'attachments' => 'Adjuntos', + 'attachments_explain' => 'Subir ficheros o agregar links para mostrar en la página. Estos son visibles en la barra lateral de la página.', + 'attachments_explain_instant_save' => 'Los cambios son guardados de manera instantánea .', + 'attachments_items' => 'Items adjuntados', + 'attachments_upload' => 'Fichero adjuntado', + 'attachments_link' => 'Adjuntar Link', + 'attachments_set_link' => 'Setear Link', + 'attachments_delete_confirm' => 'Haga click en borrar nuevamente para confirmar que quiere borrar este adjunto.', + 'attachments_dropzone' => 'Arrastre ficheros aquÃo haga click aquÃpara adjuntar un fichero', + 'attachments_no_files' => 'Ningún fichero ha sido adjuntado', + 'attachments_explain_link' => 'Ud. puede agregar un link o si lo prefiere puede agregar un fichero. Esto puede ser un link a otra página o un link a un fichero en la nube.', + 'attachments_link_name' => 'Nombre de Link', + 'attachment_link' => 'Link adjunto', + 'attachments_link_url' => 'Link a fichero', + 'attachments_link_url_hint' => 'Url del sitio o fichero', + 'attach' => 'Adjuntar', + 'attachments_edit_file' => 'Editar fichero', + 'attachments_edit_file_name' => 'Nombre del fichero', + 'attachments_edit_drop_upload' => 'Arrastre a los ficheros o haga click aquÃpara subir o sobreescribir', + 'attachments_order_updated' => 'Orden de adjuntos actualizado', + 'attachments_updated_success' => 'Detalles de adjuntos actualizados', + 'attachments_deleted' => 'Adjunto borrado', + 'attachments_file_uploaded' => 'Fichero subido éxitosamente', + 'attachments_file_updated' => 'Fichero actualizado éxitosamente', + 'attachments_link_attached' => 'Link agregado éxitosamente a la ágina', /** * Profile View */ - 'profile_user_for_x' => 'User for :time', - 'profile_created_content' => 'Created Content', - 'profile_not_created_pages' => ':userName has not created any pages', - 'profile_not_created_chapters' => ':userName has not created any chapters', - 'profile_not_created_books' => ':userName has not created any books', + 'profile_user_for_x' => 'Usuario para :time', + 'profile_created_content' => 'Contenido creado', + 'profile_not_created_pages' => ':userName no ha creado ninguna página', + 'profile_not_created_chapters' => ':userName no ha creado ningún capÃtulo', + 'profile_not_created_books' => ':userName no ha creado ningún libro', ]; diff --git a/resources/lang/es/errors.php b/resources/lang/es/errors.php index 08b8b0946..1e39a3cb8 100644 --- a/resources/lang/es/errors.php +++ b/resources/lang/es/errors.php @@ -7,64 +7,64 @@ return [ */ // Permissions - 'permission' => 'You do not have permission to access the requested page.', - 'permissionJson' => 'You do not have permission to perform the requested action.', + 'permission' => 'Ud. no tiene permisos para visualizar la página solicitada.', + 'permissionJson' => 'Ud. no tiene permisos para ejecutar la acción solicitada.', // Auth - 'error_user_exists_different_creds' => 'A user with the email :email already exists but with different credentials.', - 'email_already_confirmed' => 'Email has already been confirmed, Try logging in.', - 'email_confirmation_invalid' => 'This confirmation token is not valid or has already been used, Please try registering again.', - 'email_confirmation_expired' => 'The confirmation token has expired, A new confirmation email has been sent.', - 'ldap_fail_anonymous' => 'LDAP access failed using anonymous bind', - 'ldap_fail_authed' => 'LDAP access failed using given dn & password details', - 'ldap_extension_not_installed' => 'LDAP PHP extension not installed', - 'ldap_cannot_connect' => 'Cannot connect to ldap server, Initial connection failed', - 'social_no_action_defined' => 'No action defined', - 'social_account_in_use' => 'This :socialAccount account is already in use, Try logging in via the :socialAccount option.', - 'social_account_email_in_use' => 'The email :email is already in use. If you already have an account you can connect your :socialAccount account from your profile settings.', - 'social_account_existing' => 'This :socialAccount is already attached to your profile.', - 'social_account_already_used_existing' => 'This :socialAccount account is already used by another user.', - 'social_account_not_used' => 'This :socialAccount account is not linked to any users. Please attach it in your profile settings. ', - 'social_account_register_instructions' => 'If you do not yet have an account, You can register an account using the :socialAccount option.', - 'social_driver_not_found' => 'Social driver not found', - 'social_driver_not_configured' => 'Your :socialAccount social settings are not configured correctly.', + 'error_user_exists_different_creds' => 'Un usuario con el email :email ya existe pero con credenciales diferentes.', + 'email_already_confirmed' => 'El email ya ha sido confirmado, Intente loguearse en la aplicación.', + 'email_confirmation_invalid' => 'Este token de confirmación no e válido o ya ha sido usado,Intente registrar uno nuevamente.', + 'email_confirmation_expired' => 'El token de confirmación ha expirado, Un nuevo email de confirmacón ha sido enviado.', + 'ldap_fail_anonymous' => 'El acceso con LDAP ha fallado usando binding anónimo', + 'ldap_fail_authed' => 'El acceso LDAP usando el dn & password detallados', + 'ldap_extension_not_installed' => 'La extensión LDAP PHP no se encuentra instalada', + 'ldap_cannot_connect' => 'No se puede conectar con el servidor ldap, la conexión inicial ha fallado', + 'social_no_action_defined' => 'Acción no definida', + 'social_account_in_use' => 'la cuenta :socialAccount ya se encuentra en uso, intente loguearse a través de la opcón :socialAccount .', + 'social_account_email_in_use' => 'El email :email ya se encuentra en uso. Si ud. ya dispone de una cuenta puede loguearse a través de su cuenta :socialAccount desde la configuración de perfil.', + 'social_account_existing' => 'La cuenta :socialAccount ya se encuentra asignada a su perfil.', + 'social_account_already_used_existing' => 'La cuenta :socialAccount ya se encuentra usada por otro usuario.', + 'social_account_not_used' => 'La cuenta :socialAccount no está asociada a ningún usuario. Por favor adjuntela a su configuración de perfil. ', + 'social_account_register_instructions' => 'Si no dispone de una cuenta, puede registrar una cuenta usando la opción de :socialAccount .', + 'social_driver_not_found' => 'Driver social no encontrado', + 'social_driver_not_configured' => 'Su configuración :socialAccount no es correcta.', // System - 'path_not_writable' => 'File path :filePath could not be uploaded to. Ensure it is writable to the server.', - 'cannot_get_image_from_url' => 'Cannot get image from :url', - 'cannot_create_thumbs' => 'The server cannot create thumbnails. Please check you have the GD PHP extension installed.', - 'server_upload_limit' => 'The server does not allow uploads of this size. Please try a smaller file size.', - 'image_upload_error' => 'An error occurred uploading the image', + 'path_not_writable' => 'La ruta :filePath no pudo ser cargada. Asegurese de que es escribible por el servidor.', + 'cannot_get_image_from_url' => 'No se puede obtener la imagen desde :url', + 'cannot_create_thumbs' => 'El servidor no puede crear la imagen miniatura. Por favor chequee que tiene la extensión GD instalada.', + 'server_upload_limit' => 'El servidor no permite la subida de ficheros de este tamañ. Por favor intente con un fichero de menor tamañ.', + 'image_upload_error' => 'Ha ocurrido un error al subir la imagen', // Attachments - 'attachment_page_mismatch' => 'Page mismatch during attachment update', + 'attachment_page_mismatch' => 'Página no coincidente durante la subida del adjunto ', // Pages - 'page_draft_autosave_fail' => 'Failed to save draft. Ensure you have internet connection before saving this page', + 'page_draft_autosave_fail' => 'Fallo al guardar borrador. Asegurese de que tiene conexión a Internet antes de guardar este borrador', // Entities - 'entity_not_found' => 'Entity not found', - 'book_not_found' => 'Book not found', - 'page_not_found' => 'Page not found', - 'chapter_not_found' => 'Chapter not found', - 'selected_book_not_found' => 'The selected book was not found', - 'selected_book_chapter_not_found' => 'The selected Book or Chapter was not found', - 'guests_cannot_save_drafts' => 'Guests cannot save drafts', + 'entity_not_found' => 'Entidad no encontrada', + 'book_not_found' => 'Libro no encontrado', + 'page_not_found' => 'Página no encontrada', + 'chapter_not_found' => 'CapÃtulo no encontrado', + 'selected_book_not_found' => 'El libro seleccionado no fue encontrado', + 'selected_book_chapter_not_found' => 'El libro o capÃtulo seleccionado no fue encontrado', + 'guests_cannot_save_drafts' => 'Los invitados no pueden guardar los borradores', // Users - 'users_cannot_delete_only_admin' => 'You cannot delete the only admin', - 'users_cannot_delete_guest' => 'You cannot delete the guest user', + 'users_cannot_delete_only_admin' => 'No se puede borrar el único administrador', + 'users_cannot_delete_guest' => 'No se puede borrar el usuario invitado', // Roles - 'role_cannot_be_edited' => 'This role cannot be edited', - 'role_system_cannot_be_deleted' => 'This role is a system role and cannot be deleted', - 'role_registration_default_cannot_delete' => 'This role cannot be deleted while set as the default registration role', + 'role_cannot_be_edited' => 'Este rol no puede ser editado', + 'role_system_cannot_be_deleted' => 'Este rol es un rol de sistema y no puede ser borrado', + 'role_registration_default_cannot_delete' => 'Este rol no puede ser borrado mientras sea el rol por defecto de registro', // Error pages - '404_page_not_found' => 'Page Not Found', - 'sorry_page_not_found' => 'Sorry, The page you were looking for could not be found.', - 'return_home' => 'Return to home', - 'error_occurred' => 'An Error Occurred', - 'app_down' => ':appName is down right now', - 'back_soon' => 'It will be back up soon.', + '404_page_not_found' => 'Página no encontrada', + 'sorry_page_not_found' => 'Lo sentimos, la página que intenta acceder no pudo ser encontrada.', + 'return_home' => 'Volver al home', + 'error_occurred' => 'Ha ocurrido un error', + 'app_down' => 'La aplicación :appName se encuentra caÃda en este momento', + 'back_soon' => 'Volverá a estar operativa en corto tiempo.', ]; diff --git a/resources/lang/es/settings.php b/resources/lang/es/settings.php index cf926ae52..cd6a8b8d9 100644 --- a/resources/lang/es/settings.php +++ b/resources/lang/es/settings.php @@ -8,105 +8,105 @@ return [ * including users and roles. */ - 'settings' => 'Settings', - 'settings_save' => 'Save Settings', - 'settings_save_success' => 'Settings saved', + 'settings' => 'Ajustes', + 'settings_save' => 'Guardar ajustes', + 'settings_save_success' => 'Ajustes guardados', /** * App settings */ - 'app_settings' => 'App Settings', - 'app_name' => 'Application name', - 'app_name_desc' => 'This name is shown in the header and any emails.', - 'app_name_header' => 'Show Application name in header?', - 'app_public_viewing' => 'Allow public viewing?', - 'app_secure_images' => 'Enable higher security image uploads?', - 'app_secure_images_desc' => 'For performance reasons, all images are public. This option adds a random, hard-to-guess string in front of image urls. Ensure directory indexes are not enabled to prevent easy access.', - 'app_editor' => 'Page editor', - 'app_editor_desc' => 'Select which editor will be used by all users to edit pages.', - 'app_custom_html' => 'Custom HTML head content', - 'app_custom_html_desc' => 'Any content added here will be inserted into the bottom of the
section of every page. This is handy for overriding styles or adding analytics code.', - 'app_logo' => 'Application logo', - 'app_logo_desc' => 'This image should be 43px in height.{{ trans('entities.pages_revisions_number') }} | {{ trans('entities.pages_name') }} | {{ trans('entities.pages_revisions_created_by') }} | {{ trans('entities.pages_revisions_date') }} | @@ -27,6 +28,7 @@|
---|---|---|---|---|
{{ $revision->revision_number == 0 ? '' : $revision->revision_number }} | {{ $revision->name }} |
@if($revision->createdBy)
diff --git a/resources/views/pages/sidebar-tree-list.blade.php b/resources/views/pages/sidebar-tree-list.blade.php
index faae6420a..0a10987d6 100644
--- a/resources/views/pages/sidebar-tree-list.blade.php
+++ b/resources/views/pages/sidebar-tree-list.blade.php
@@ -39,8 +39,10 @@
{{ trans('entities.books_navigation') }} |