diff --git a/.github/CODE_OF_CONDUCT.md b/.github/CODE_OF_CONDUCT.md new file mode 100644 index 000000000..2c6317af6 --- /dev/null +++ b/.github/CODE_OF_CONDUCT.md @@ -0,0 +1,84 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of experience, +education, socio-economic status, nationality, personal appearance, race, +religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +### Project Maintainer Standards + +Project maintainers should generally follow these additional standards: + +* Avoid using a negative or harsh tone in communication, Even if the other party +is being negative themselves. +* When providing criticism, try to make it constructive to lead the other person +down the correct path. +* Keep the [project definition](https://github.com/BookStackApp/BookStack#project-definition) +in mind when deciding what's in scope of the Project. + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. In addition, Project +maintainers are responsible for following the standards themselves. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at the email address shown on [the profile here](https://github.com/ssddanbrown). All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html + +[homepage]: https://www.contributor-covenant.org diff --git a/LICENSE b/LICENSE index 281814bb8..080c54b3e 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,7 @@ The MIT License (MIT) -Copyright (c) 2016 Dan Brown +Copyright (c) 2018 Dan Brown and the BookStack Project contributors +https://github.com/BookStackApp/BookStack/graphs/contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/app/Book.php b/app/Book.php index 457a4c928..51ea226b4 100644 --- a/app/Book.php +++ b/app/Book.php @@ -2,6 +2,7 @@ class Book extends Entity { + public $searchFactor = 2; protected $fillable = ['name', 'description', 'image_id']; diff --git a/app/Chapter.php b/app/Chapter.php index 6dab9dc47..3726c57f4 100644 --- a/app/Chapter.php +++ b/app/Chapter.php @@ -2,6 +2,8 @@ class Chapter extends Entity { + public $searchFactor = 1.3; + protected $fillable = ['name', 'description', 'priority', 'book_id']; protected $with = ['book']; diff --git a/app/Entity.php b/app/Entity.php index 1ea4e8dac..67edec4e0 100644 --- a/app/Entity.php +++ b/app/Entity.php @@ -5,8 +5,16 @@ use Illuminate\Database\Eloquent\Relations\MorphMany; class Entity extends Ownable { + /** + * @var string - Name of property where the main text content is found + */ public $textField = 'description'; + /** + * @var float - Multiplier for search indexing. + */ + public $searchFactor = 1.0; + /** * Compares this entity to another given entity. * Matches by comparing class and id. diff --git a/app/Http/Controllers/ImageController.php b/app/Http/Controllers/ImageController.php index d71e38346..8437c80d7 100644 --- a/app/Http/Controllers/ImageController.php +++ b/app/Http/Controllers/ImageController.php @@ -120,7 +120,7 @@ class ImageController extends Controller { $this->checkPermission('image-create-all'); $this->validate($request, [ - 'file' => 'required|is_image' + 'file' => 'is_image' ]); if (!$this->imageRepo->isValidType($type)) { @@ -136,6 +136,7 @@ class ImageController extends Controller return response($e->getMessage(), 500); } + return response()->json($image); } diff --git a/app/Http/Controllers/SearchController.php b/app/Http/Controllers/SearchController.php index 0827eeb71..ddc92f705 100644 --- a/app/Http/Controllers/SearchController.php +++ b/app/Http/Controllers/SearchController.php @@ -40,13 +40,12 @@ class SearchController extends Controller $nextPageLink = baseUrl('/search?term=' . urlencode($searchTerm) . '&page=' . ($page+1)); $results = $this->searchService->searchEntities($searchTerm, 'all', $page, 20); - $hasNextPage = $this->searchService->searchEntities($searchTerm, 'all', $page+1, 20)['count'] > 0; return view('search/all', [ 'entities' => $results['results'], 'totalResults' => $results['total'], 'searchTerm' => $searchTerm, - 'hasNextPage' => $hasNextPage, + 'hasNextPage' => $results['has_more'], 'nextPageLink' => $nextPageLink ]); } diff --git a/app/Repos/EntityRepo.php b/app/Repos/EntityRepo.php index ece9aa305..acdda3c8d 100644 --- a/app/Repos/EntityRepo.php +++ b/app/Repos/EntityRepo.php @@ -774,7 +774,9 @@ class EntityRepo $scriptSearchRegex = '/.*?<\/script>/ms'; $matches = []; preg_match_all($scriptSearchRegex, $html, $matches); - if (count($matches) === 0) return $html; + if (count($matches) === 0) { + return $html; + } foreach ($matches[0] as $match) { $html = str_replace($match, htmlentities($match), $html); diff --git a/app/Repos/ImageRepo.php b/app/Repos/ImageRepo.php index ec2fda1d3..245c0f27b 100644 --- a/app/Repos/ImageRepo.php +++ b/app/Repos/ImageRepo.php @@ -225,7 +225,6 @@ class ImageRepo try { return $this->imageService->getThumbnail($image, $width, $height, $keepRatio); } catch (\Exception $exception) { - dd($exception); return null; } } diff --git a/app/Services/AttachmentService.php b/app/Services/AttachmentService.php index 381e44749..3a6f95dcc 100644 --- a/app/Services/AttachmentService.php +++ b/app/Services/AttachmentService.php @@ -14,10 +14,6 @@ class AttachmentService extends UploadService */ protected function getStorage() { - if ($this->storageInstance !== null) { - return $this->storageInstance; - } - $storageType = config('filesystems.default'); // Override default location if set to local public to ensure not visible. @@ -25,9 +21,7 @@ class AttachmentService extends UploadService $storageType = 'local_secure'; } - $this->storageInstance = $this->fileSystem->disk($storageType); - - return $this->storageInstance; + return $this->fileSystem->disk($storageType); } /** diff --git a/app/Services/ImageService.php b/app/Services/ImageService.php index 9755ea307..c2e915e2d 100644 --- a/app/Services/ImageService.php +++ b/app/Services/ImageService.php @@ -31,6 +31,23 @@ class ImageService extends UploadService parent::__construct($fileSystem); } + /** + * Get the storage that will be used for storing images. + * @param string $type + * @return \Illuminate\Contracts\Filesystem\Filesystem + */ + protected function getStorage($type = '') + { + $storageType = config('filesystems.default'); + + // Override default location if set to local public to ensure not visible. + if ($type === 'system' && $storageType === 'local_secure') { + $storageType = 'local'; + } + + return $this->fileSystem->disk($storageType); + } + /** * Saves a new image from an upload. * @param UploadedFile $uploadedFile @@ -119,7 +136,7 @@ class ImageService extends UploadService */ private function saveNew($imageName, $imageData, $type, $uploadedTo = 0) { - $storage = $this->getStorage(); + $storage = $this->getStorage($type); $secureUploads = setting('app-secure-images'); $imageName = str_replace(' ', '-', $imageName); @@ -170,6 +187,16 @@ class ImageService extends UploadService return $image->path; } + /** + * Checks if the image is a gif. Returns true if it is, else false. + * @param Image $image + * @return boolean + */ + protected function isGif(Image $image) + { + return strtolower(pathinfo($this->getPath($image), PATHINFO_EXTENSION)) === 'gif'; + } + /** * Get the thumbnail for an image. * If $keepRatio is true only the width will be used. @@ -184,6 +211,10 @@ class ImageService extends UploadService */ public function getThumbnail(Image $image, $width = 220, $height = 220, $keepRatio = false) { + if ($keepRatio && $this->isGif($image)) { + return $this->getPublicUrl($this->getPath($image)); + } + $thumbDirName = '/' . ($keepRatio ? 'scaled-' : 'thumbs-') . $width . '-' . $height . '/'; $imagePath = $this->getPath($image); $thumbFilePath = dirname($imagePath) . $thumbDirName . basename($imagePath); @@ -192,7 +223,7 @@ class ImageService extends UploadService return $this->getPublicUrl($thumbFilePath); } - $storage = $this->getStorage(); + $storage = $this->getStorage($image->type); if ($storage->exists($thumbFilePath)) { return $this->getPublicUrl($thumbFilePath); } @@ -274,8 +305,9 @@ class ImageService extends UploadService /** * Save a gravatar image and set a the profile image for a user. * @param User $user - * @param int $size + * @param int $size * @return mixed + * @throws Exception */ public function saveUserGravatar(User $user, $size = 500) { diff --git a/app/Services/SearchService.php b/app/Services/SearchService.php index 6786c5cf4..056e1f077 100644 --- a/app/Services/SearchService.php +++ b/app/Services/SearchService.php @@ -64,7 +64,7 @@ class SearchService * @param string $searchString * @param string $entityType * @param int $page - * @param int $count + * @param int $count - Count of each entity to search, Total returned could can be larger and not guaranteed. * @return array[int, Collection]; */ public function searchEntities($searchString, $entityType = 'all', $page = 1, $count = 20) @@ -72,7 +72,6 @@ class SearchService $terms = $this->parseSearchString($searchString); $entityTypes = array_keys($this->entities); $entityTypesToSearch = $entityTypes; - $results = collect(); if ($entityType !== 'all') { $entityTypesToSearch = $entityType; @@ -80,20 +79,27 @@ class SearchService $entityTypesToSearch = explode('|', $terms['filters']['type']); } + $results = collect(); $total = 0; + $hasMore = false; foreach ($entityTypesToSearch as $entityType) { if (!in_array($entityType, $entityTypes)) { continue; } $search = $this->searchEntityTable($terms, $entityType, $page, $count); - $total += $this->searchEntityTable($terms, $entityType, $page, $count, true); + $entityTotal = $this->searchEntityTable($terms, $entityType, $page, $count, true); + if ($entityTotal > $page * $count) { + $hasMore = true; + } + $total += $entityTotal; $results = $results->merge($search); } return [ 'total' => $total, 'count' => count($results), + 'has_more' => $hasMore, 'results' => $results->sortByDesc('score')->values() ]; } @@ -322,8 +328,8 @@ class SearchService public function indexEntity(Entity $entity) { $this->deleteEntityTerms($entity); - $nameTerms = $this->generateTermArrayFromText($entity->name, 5); - $bodyTerms = $this->generateTermArrayFromText($entity->getText(), 1); + $nameTerms = $this->generateTermArrayFromText($entity->name, 5 * $entity->searchFactor); + $bodyTerms = $this->generateTermArrayFromText($entity->getText(), 1 * $entity->searchFactor); $terms = array_merge($nameTerms, $bodyTerms); foreach ($terms as $index => $term) { $terms[$index]['entity_type'] = $entity->getMorphClass(); @@ -340,8 +346,8 @@ class SearchService { $terms = []; foreach ($entities as $entity) { - $nameTerms = $this->generateTermArrayFromText($entity->name, 5); - $bodyTerms = $this->generateTermArrayFromText($entity->getText(), 1); + $nameTerms = $this->generateTermArrayFromText($entity->name, 5 * $entity->searchFactor); + $bodyTerms = $this->generateTermArrayFromText($entity->getText(), 1 * $entity->searchFactor); foreach (array_merge($nameTerms, $bodyTerms) as $term) { $term['entity_id'] = $entity->id; $term['entity_type'] = $entity->getMorphClass(); diff --git a/app/Services/UploadService.php b/app/Services/UploadService.php index cd0567559..df597a40f 100644 --- a/app/Services/UploadService.php +++ b/app/Services/UploadService.php @@ -11,11 +11,6 @@ class UploadService */ protected $fileSystem; - /** - * @var FileSystemInstance - */ - protected $storageInstance; - /** * FileService constructor. @@ -32,14 +27,8 @@ class UploadService */ protected function getStorage() { - if ($this->storageInstance !== null) { - return $this->storageInstance; - } - $storageType = config('filesystems.default'); - $this->storageInstance = $this->fileSystem->disk($storageType); - - return $this->storageInstance; + return $this->fileSystem->disk($storageType); } /** @@ -53,13 +42,4 @@ class UploadService $folders = $this->getStorage()->directories($path); return (count($files) === 0 && count($folders) === 0); } - - /** - * Check if using a local filesystem. - * @return bool - */ - protected function isLocal() - { - return strtolower(config('filesystems.default')) === 'local'; - } } diff --git a/readme.md b/readme.md index a003bcdec..acf1cf3d7 100644 --- a/readme.md +++ b/readme.md @@ -17,7 +17,9 @@ A platform for storing and organising information and documentation. General inf BookStack is an opinionated wiki system that provides a pleasant and simple out of the box experience. New users to an instance should find the experience intuitive and only basic word-processing skills should be required to get involved in creating content on BookStack. The platform should provide advanced power features to those that desire it but they should not interfere with the core simple user experience. -BookStack is not designed as an extensible platform to be used for purposes that differ to the statement above. +BookStack is not designed as an extensible platform to be used for purposes that differ to the statement above. + +In regards to development philosophy, BookStack has a relaxed, open & positive approach. Put simply, At the end of the day this is free software developed and maintained by people donating their own free time. ## Development & Testing @@ -25,17 +27,17 @@ All development on BookStack is currently done on the master branch. When it's t * [Node.js](https://nodejs.org/en/) v6.9+ -SASS is used to help the CSS development and the JavaScript is run through browserify/babel to allow for writing ES6 code. Both of these are done using gulp. To run the build task you can use the following commands: +SASS is used to help the CSS development and the JavaScript is run through babel to allow for writing ES6 code. This is done using webpack. To run the build task you can use the following commands: ``` bash # Build assets for development -npm run-script build +npm run build # Build and minify assets for production -npm run-script production +npm run production # Build for dev (With sourcemaps) and watch for changes -npm run-script dev +npm run dev ``` BookStack has many integration tests that use Laravel's built-in testing capabilities which makes use of PHPUnit. To use you will need PHPUnit installed and accessible via command line. There is a `mysql_testing` database defined within the app config which is what is used by PHPUnit. This database is set with the following database name, user name and password defined as `bookstack-test`. You will have to create that database and credentials before testing. @@ -65,14 +67,16 @@ php resources/lang/check.php php resources/lang/check.php fr php resources/lang/check.php pt_BR ``` - + Some strings have colon-prefixed variables in such as `:userName`. Leave these values as they are as they will be replaced at run-time. - -## Contributing + +## Contributing & Maintenence Feel free to create issues to request new features or to report bugs and problems. Just please follow the template given when creating the issue. -### Standards +The project's code of conduct [can be found here](https://github.com/BookStackApp/BookStack/blob/master/.github/CODE_OF_CONDUCT.md). + +### Code Standards PHP code within BookStack is generally to [PSR-2](http://www.php-fig.org/psr/psr-2/) standards. From the BookStack root folder you can run `./vendor/bin/phpcs` to check code is formatted correctly and `./vendor/bin/phpcbf` to auto-fix non-PSR-2 code. @@ -82,9 +86,9 @@ Pull requests are very welcome. If the scope of your pull request is large it ma Pull requests should be created from the `master` branch and should be merged back into `master` once done. Please do not build from or request a merge into the `release` branch as this is only for publishing releases. -If you are looking to alter CSS or JavaScript content please edit the source files found in `resources/assets`. Any CSS or JS files within `public` are built from these source files and therefore should not be edited directly. +If you are looking to alter CSS or JavaScript content please edit the source files found in `resources/assets`. Any CSS or JS files within `public` are built from these source files and therefore should not be edited directly. -## Website, Docs & Blog +## Website, Docs & Blog The website project docs & Blog can be found in the [BookStackApp/website](https://github.com/BookStackApp/website) repo. @@ -94,6 +98,8 @@ The BookStack source is provided under the MIT License. ## Attribution +The great people that have worked to build and improve BookStack can [be seen here](https://github.com/BookStackApp/BookStack/graphs/contributors). + These are the great open-source projects used to help build BookStack: * [Laravel](http://laravel.com/) diff --git a/resources/assets/js/vues/components/dropzone.js b/resources/assets/js/vues/components/dropzone.js index 0f31bd579..0e40b20ca 100644 --- a/resources/assets/js/vues/components/dropzone.js +++ b/resources/assets/js/vues/components/dropzone.js @@ -12,7 +12,9 @@ const props = ['placeholder', 'uploadUrl', 'uploadedTo']; function mounted() { let container = this.$el; let _this = this; - new DropZone(container, { + this._dz = new DropZone(container, { + addRemoveLinks: true, + dictRemoveFile: trans('components.image_upload_remove'), url: function() { return _this.uploadUrl; }, @@ -35,26 +37,33 @@ function mounted() { dz.on('error', function (file, errorMessage, xhr) { _this.$emit('error', {file, errorMessage, xhr}); - console.log(errorMessage); - console.log(xhr); + function setMessage(message) { $(file.previewElement).find('[data-dz-errormessage]').text(message); } - if (xhr.status === 413) setMessage(trans('errors.server_upload_limit')); - if (errorMessage.file) setMessage(errorMessage.file[0]); + if (xhr && xhr.status === 413) setMessage(trans('errors.server_upload_limit')); + else if (errorMessage.file) setMessage(errorMessage.file); + }); } }); } function data() { - return {} + return {}; } +const methods = { + onClose: function () { + this._dz.removeAllFiles(true); + } +}; + module.exports = { template, props, mounted, data, -}; \ No newline at end of file + methods +}; diff --git a/resources/assets/js/vues/image-manager.js b/resources/assets/js/vues/image-manager.js index 12ccc970d..89fe6769e 100644 --- a/resources/assets/js/vues/image-manager.js +++ b/resources/assets/js/vues/image-manager.js @@ -43,6 +43,8 @@ const methods = { hide() { this.showing = false; + this.selectedImage = false; + this.$refs.dropzone.onClose(); this.$el.children[0].components.overlay.hide(); }, @@ -175,4 +177,4 @@ module.exports = { data, computed, components: {dropzone}, -}; \ No newline at end of file +}; diff --git a/resources/assets/sass/_blocks.scss b/resources/assets/sass/_blocks.scss index e3238f4b4..4cf2397bc 100644 --- a/resources/assets/sass/_blocks.scss +++ b/resources/assets/sass/_blocks.scss @@ -224,15 +224,15 @@ padding: 0; align-items: center; text-align: center; + justify-content: center; width: 28px; padding-left: $-xs; padding-right: $-xs; &:hover { background-color: #EEE; } - i { - flex: 1; - padding: 0; + .svg-icon { + margin-right: 0px; } } > div .outline input { @@ -258,4 +258,4 @@ background-color: #F8F8F8; padding: $-m; border: 1px solid #DDD; -} \ No newline at end of file +} diff --git a/resources/assets/sass/_buttons.scss b/resources/assets/sass/_buttons.scss index 41a6e02c8..2c20c3f41 100644 --- a/resources/assets/sass/_buttons.scss +++ b/resources/assets/sass/_buttons.scss @@ -158,6 +158,7 @@ $button-border-radius: 2px; left: $-m; top: $-s - 2px; width: 24px; + height: 24px; } padding: $-s $-m; padding-bottom: $-s - 2px; diff --git a/resources/assets/sass/_components.scss b/resources/assets/sass/_components.scss index f15528167..84eebc89b 100644 --- a/resources/assets/sass/_components.scss +++ b/resources/assets/sass/_components.scss @@ -23,6 +23,7 @@ svg { fill: #EEEEEE; width: 4em; + height: 4em; padding-right: $-m; } span { @@ -211,6 +212,7 @@ body.flexbox-support #entity-selector-wrap .popup-body .form-group { margin-left: 1px; padding: $-m $-l; overflow-y: auto; + overflow-x: hidden; border-left: 1px solid #DDD; .dropzone-container { margin-top: $-m; @@ -315,8 +317,7 @@ body.flexbox-support #entity-selector-wrap .popup-body .form-group { .dz-preview.dz-file-preview .dz-image { border-radius: 4px; - background: #999; - background: linear-gradient(to bottom, #eee, #ddd); + background: #e9e9e9; } .dz-preview.dz-file-preview .dz-details { @@ -332,11 +333,12 @@ body.flexbox-support #entity-selector-wrap .popup-body .form-group { } .dz-preview .dz-remove { - font-size: 14px; + font-size: 13px; text-align: center; display: block; cursor: pointer; border: none; + margin-top: 3px; } .dz-preview .dz-remove:hover { @@ -385,7 +387,7 @@ body.flexbox-support #entity-selector-wrap .popup-body .form-group { border: 1px solid transparent; } -.dz-preview .dz-details .dz-filename span, .dz-preview .dz-details .dz-size span { +.dz-preview .dz-details .dz-filename span { background-color: rgba(255, 255, 255, 0.4); padding: 0 0.4em; border-radius: 3px; @@ -421,13 +423,13 @@ body.flexbox-support #entity-selector-wrap .popup-body .form-group { .dz-preview .dz-success-mark, .dz-preview .dz-error-mark { pointer-events: none; opacity: 0; - z-index: 500; + z-index: 1001; position: absolute; display: block; top: 50%; left: 50%; margin-left: -27px; - margin-top: -27px; + margin-top: -35px; } .dz-preview .dz-success-mark svg, .dz-preview .dz-error-mark svg { @@ -482,9 +484,13 @@ body.flexbox-support #entity-selector-wrap .popup-body .form-group { display: block; } -.dz-preview.dz-error:hover .dz-error-message { - opacity: 1; - pointer-events: auto; +.dz-preview.dz-error { + .dz-image, .dz-details { + &:hover ~ .dz-error-message { + opacity: 1; + pointer-events: auto; + } + } } .dz-preview .dz-error-message { @@ -496,7 +502,7 @@ body.flexbox-support #entity-selector-wrap .popup-body .form-group { opacity: 0; transition: opacity 0.3s ease; border-radius: 4px; - font-size: 11.5px; + font-size: 12px; line-height: 1.2; top: 88px; left: -26px; @@ -597,4 +603,4 @@ body.flexbox-support #entity-selector-wrap .popup-body .form-group { .text-muted { color: #999; } -} \ No newline at end of file +} diff --git a/resources/assets/sass/_pages.scss b/resources/assets/sass/_pages.scss index 3555111d8..3749b5321 100755 --- a/resources/assets/sass/_pages.scss +++ b/resources/assets/sass/_pages.scss @@ -210,6 +210,9 @@ flex: 1; padding-top: 0; } + div[toolbox-tab-content] .padded.files { + overflow-x: hidden; + } h4 { font-size: 24px; margin: $-m 0 0 0; diff --git a/resources/assets/sass/_text.scss b/resources/assets/sass/_text.scss index 3504154c2..d894a00e7 100644 --- a/resources/assets/sass/_text.scss +++ b/resources/assets/sass/_text.scss @@ -424,6 +424,7 @@ i { .svg-icon { width: 1em; + height: 1em; display: inline-block; position: relative; bottom: -0.105em; diff --git a/resources/assets/sass/styles.scss b/resources/assets/sass/styles.scss index 9f028f6ef..c7d288ad3 100644 --- a/resources/assets/sass/styles.scss +++ b/resources/assets/sass/styles.scss @@ -118,6 +118,7 @@ $btt-size: 40px; fill: #FFF; svg { width: $btt-size / 1.5; + height: $btt-size / 1.5; margin-right: 4px; } width: $btt-size; diff --git a/resources/lang/en/components.php b/resources/lang/en/components.php index 334502d05..2266fe2b2 100644 --- a/resources/lang/en/components.php +++ b/resources/lang/en/components.php @@ -21,6 +21,7 @@ return [ 'image_upload_success' => 'Image uploaded successfully', 'image_update_success' => 'Image details successfully updated', 'image_delete_success' => 'Image successfully deleted', + 'image_upload_remove' => 'Remove', /** * Code editor @@ -29,4 +30,4 @@ return [ 'code_language' => 'Code Language', 'code_content' => 'Code Content', 'code_save' => 'Save Code', -]; \ No newline at end of file +]; diff --git a/resources/lang/en/errors.php b/resources/lang/en/errors.php index 3b1d6e8b3..a86a1cdfc 100644 --- a/resources/lang/en/errors.php +++ b/resources/lang/en/errors.php @@ -35,6 +35,7 @@ return [ '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.', + 'uploaded' => 'The server does not allow uploads of this size. Please try a smaller file size.', 'image_upload_error' => 'An error occurred uploading the image', 'image_upload_type_error' => 'The image type being uploaded is invalid', @@ -78,4 +79,4 @@ return [ 'error_occurred' => 'An Error Occurred', 'app_down' => ':appName is down right now', 'back_soon' => 'It will be back up soon.', -]; \ No newline at end of file +]; diff --git a/resources/lang/fr/activities.php b/resources/lang/fr/activities.php index 32f225d5d..a59c9a543 100644 --- a/resources/lang/fr/activities.php +++ b/resources/lang/fr/activities.php @@ -37,4 +37,7 @@ return [ 'book_sort' => 'a réordonné le livre', 'book_sort_notification' => 'Livre réordonné avec succès', + // Other + 'commented_on' => 'a commenté' + ]; diff --git a/resources/lang/fr/auth.php b/resources/lang/fr/auth.php index 015bfdff0..154066ae4 100644 --- a/resources/lang/fr/auth.php +++ b/resources/lang/fr/auth.php @@ -18,6 +18,8 @@ return [ */ 'sign_up' => "S'inscrire", 'log_in' => 'Se connecter', + 'log_in_with' => 'Se connecter avec :socialDriver', + 'sign_up_with' => 'S\'inscrire avec :socialDriver', 'logout' => 'Se déconnecter', 'name' => 'Nom', diff --git a/resources/lang/fr/common.php b/resources/lang/fr/common.php index 2553d1482..823c6ee2f 100644 --- a/resources/lang/fr/common.php +++ b/resources/lang/fr/common.php @@ -10,6 +10,7 @@ return [ 'save' => 'Enregistrer', 'continue' => 'Continuer', 'select' => 'Sélectionner', + 'more' => 'Montrer plus', /** * Form Labels @@ -29,11 +30,13 @@ return [ 'edit' => 'Editer', 'sort' => 'Trier', 'move' => 'Déplacer', + 'reply' => 'Répondre', 'delete' => 'Supprimer', 'search' => 'Chercher', 'search_clear' => 'Réinitialiser la recherche', 'reset' => 'Réinitialiser', 'remove' => 'Enlever', + 'add' => 'Ajouter', /** @@ -45,6 +48,9 @@ return [ 'back_to_top' => 'Retour en haut', 'toggle_details' => 'Afficher les détails', 'toggle_thumbnails' => 'Afficher les vignettes', + 'details' => 'Détails', + 'grid_view' => 'Vue en grille', + 'list_view' => 'Vue en liste', /** * Header diff --git a/resources/lang/fr/components.php b/resources/lang/fr/components.php index 7c9c4cfc0..ddfe665d9 100644 --- a/resources/lang/fr/components.php +++ b/resources/lang/fr/components.php @@ -20,5 +20,13 @@ return [ 'image_preview' => 'Prévisualiser l\'image', 'image_upload_success' => 'Image ajoutée avec succès', 'image_update_success' => 'Détails de l\'image mis à jour', - 'image_delete_success' => 'Image supprimée avec succès' + 'image_delete_success' => 'Image supprimée avec succès', + + /** + * Code editor + */ + 'code_editor' => 'Editer le code', + 'code_language' => 'Language du code', + 'code_content' => 'Contenu du code', + 'code_save' => 'Enregistrer le code', ]; diff --git a/resources/lang/fr/entities.php b/resources/lang/fr/entities.php index d4d9d2475..7d0696c2a 100644 --- a/resources/lang/fr/entities.php +++ b/resources/lang/fr/entities.php @@ -14,6 +14,7 @@ return [ 'recent_activity' => 'Activité récente', 'create_now' => 'En créer un maintenant', 'revisions' => 'Révisions', + 'meta_revision' => 'Révision #:revisionCount', 'meta_created' => 'Créé :timeLength', 'meta_created_name' => 'Créé :timeLength par :user', 'meta_updated' => 'Mis à jour :timeLength', @@ -43,19 +44,39 @@ return [ * Search */ 'search_results' => 'Résultats de recherche', + 'search_total_results_found' => ':count résultats trouvés|:count résultats trouvés au total', 'search_clear' => 'Réinitialiser la recherche', 'search_no_pages' => 'Aucune page correspondant à cette recherche', 'search_for_term' => 'recherche pour :term', + 'search_more' => 'Plus de résultats', + 'search_filters' => 'Filtres de recherche', + 'search_content_type' => 'Type de contenu', + 'search_exact_matches' => 'Correspondances exactes', + 'search_tags' => 'Recherche par tags', + 'search_viewed_by_me' => 'Vu par moi', + 'search_not_viewed_by_me' => 'Non vu par moi', + 'search_permissions_set' => 'Ensemble d\'autorisations', + 'search_created_by_me' => 'Créé par moi', + 'search_updated_by_me' => 'Mis à jour par moi', + 'search_updated_before' => 'Mis à jour avant', + 'search_updated_after' => 'Mis à jour après', + 'search_created_before' => 'Créé avant', + 'search_created_after' => 'Créé après', + 'search_set_date' => 'Choisir la date', + 'search_update' => 'Actualiser la recherche', /** * Books */ 'book' => 'Livre', 'books' => 'Livres', + 'x_books' => ':count livre|:count livres', 'books_empty' => 'Aucun livre n\'a été créé', 'books_popular' => 'Livres populaires', 'books_recent' => 'Livres récents', + 'books_new' => 'Nouveaux livres', 'books_popular_empty' => 'Les livres les plus populaires apparaîtront ici.', + 'books_new_empty' => 'Les livres les plus récents apparaitront ici.', 'books_create' => 'Créer un nouveau livre', 'books_delete' => 'Supprimer un livre', 'books_delete_named' => 'Supprimer le livre :bookName', @@ -85,6 +106,7 @@ return [ */ 'chapter' => 'Chapitre', 'chapters' => 'Chapitres', + 'x_chapters' => ':count chapitre|:count chapitres', 'chapters_popular' => 'Chapitres populaires', 'chapters_new' => 'Nouveau chapitre', 'chapters_create' => 'Créer un nouveau chapitre', @@ -102,6 +124,7 @@ return [ 'chapters_empty' => 'Il n\'y a pas de page dans ce chapitre actuellement.', 'chapters_permissions_active' => 'Permissions du chapitre activées', 'chapters_permissions_success' => 'Permissions du chapitre mises à jour', + 'chapters_search_this' => 'Rechercher dans ce chapitre', /** * Pages @@ -139,16 +162,19 @@ return [ 'pages_md_preview' => 'Prévisualisation', 'pages_md_insert_image' => 'Insérer une image', 'pages_md_insert_link' => 'Insérer un lien', + 'pages_md_insert_drawing' => 'Insérer un dessin', 'pages_not_in_chapter' => 'La page n\'est pas dans un chapitre', 'pages_move' => 'Déplacer la page', 'pages_move_success' => 'Page déplacée à ":parentName"', 'pages_permissions' => 'Permissions de la page', 'pages_permissions_success' => 'Permissions de la page mises à jour', + 'pages_revision' => 'Révision', 'pages_revisions' => 'Révisions de la page', 'pages_revisions_named' => 'Révisions pour :pageName', 'pages_revision_named' => 'Révision pour :pageName', 'pages_revisions_created_by' => 'Créé par', 'pages_revisions_date' => 'Date de révision', + 'pages_revisions_number' => '#', 'pages_revisions_changelog' => 'Journal des changements', 'pages_revisions_changes' => 'Changements', 'pages_revisions_current' => 'Version courante', @@ -219,6 +245,18 @@ return [ */ 'comment' => 'Commentaire', 'comments' => 'Commentaires', + 'comment_add' => 'Ajouter un commentaire', 'comment_placeholder' => 'Entrez vos commentaires ici', + 'comment_count' => '{0} Pas de commentaires|{1} 1 Commentaire|[2,*] :count Commentaires', 'comment_save' => 'Enregistrer le commentaire', + 'comment_saving' => 'Enregistrement du commentaire...', + 'comment_deleting' => 'Suppression du commentaire...', + 'comment_new' => 'Nouveau commentaire', + 'comment_created' => 'commenté :createDiff', + 'comment_updated' => 'Mis à jour :updateDiff par :username', + 'comment_deleted_success' => 'Commentaire supprimé', + 'comment_created_success' => 'Commentaire ajouté', + 'comment_updated_success' => 'Commentaire mis à jour', + 'comment_delete_confirm' => 'Etes-vous sûr de vouloir supprimer ce commentaire?', + 'comment_in_reply_to' => 'En réponse à :commentId', ]; diff --git a/resources/lang/fr/settings.php b/resources/lang/fr/settings.php index 2f0163368..ea6214d84 100644 --- a/resources/lang/fr/settings.php +++ b/resources/lang/fr/settings.php @@ -31,6 +31,9 @@ return [ 'app_logo_desc' => 'Cette image doit faire 43px de hauteur.
Les images plus larges seront réduites.', 'app_primary_color' => 'Couleur principale de l\'application', 'app_primary_color_desc' => 'Cela devrait être une valeur hexadécimale.
Laisser vide pour rétablir la couleur par défaut.', + 'app_homepage' => 'Page d\'accueil de l\'application', + 'app_homepage_desc' => 'Choisissez une page à afficher sur la page d\'accueil au lieu de la vue par défaut. Les permissions sont ignorées pour les pages sélectionnées.', + 'app_homepage_default' => 'Page d\'accueil par défaut sélectionnée', 'app_disable_comments' => 'Désactiver les commentaires', 'app_disable_comments_desc' => 'Désactive les commentaires sur toutes les pages de l\'application. Les commentaires existants ne sont pas affichés.', /** diff --git a/resources/views/books/create.blade.php b/resources/views/books/create.blade.php index eb0664ad8..a86cb3352 100644 --- a/resources/views/books/create.blade.php +++ b/resources/views/books/create.blade.php @@ -5,7 +5,7 @@ @stop diff --git a/resources/views/books/index.blade.php b/resources/views/books/index.blade.php index d66612f62..d1435ab66 100644 --- a/resources/views/books/index.blade.php +++ b/resources/views/books/index.blade.php @@ -18,7 +18,7 @@ @@ -78,7 +78,7 @@ @else

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

@if(userCan('books-create-all')) - @icon('edit'){{ trans('entities.create_one_now') }} + @icon('edit'){{ trans('entities.create_one_now') }} @endif @endif diff --git a/resources/views/books/restrictions.blade.php b/resources/views/books/restrictions.blade.php index b85396933..88a3b2419 100644 --- a/resources/views/books/restrictions.blade.php +++ b/resources/views/books/restrictions.blade.php @@ -11,7 +11,7 @@

 

-

<@icon('lock') {{ trans('entities.books_permissions') }}

+

@icon('lock') {{ trans('entities.books_permissions') }}

@include('form/restriction-form', ['model' => $book])
diff --git a/resources/views/books/show.blade.php b/resources/views/books/show.blade.php index bb5189187..d3a51cb3a 100644 --- a/resources/views/books/show.blade.php +++ b/resources/views/books/show.blade.php @@ -15,10 +15,10 @@ @if(userCan('page-create', $book)) - @icon('add'){{ trans('entities.pages_new') }} + @icon('add'){{ trans('entities.pages_new') }} @endif @if(userCan('chapter-create', $book)) - @icon('add'){{ trans('entities.chapters_new') }} + @icon('add'){{ trans('entities.chapters_new') }} @endif @if(userCan('book-update', $book) || userCan('restrictions-manage', $book) || userCan('book-delete', $book))