- To access the API a user has to have the "Access System API" permission enabled on one of their assigned roles.
- Permissions to content accessed via the API is limited by the roles & permissions assigned to the user that's used to access the API.
-
-
Authentication to use the API is primarily done using API Tokens. Once the "Access System API" permission has been assigned to a user, a "API Tokens" section should be visible when editing their user profile. Choose "Create Token" and enter an appropriate name and expiry date, relevant for your API usage then press "Save". A "Token ID" and "Token Secret" will be immediately displayed. These values should be used as a header in API HTTP requests in the following format:
-
Authorization: Token <token_id>:<token_secret>
-
Here's an example of an authorized cURL request to list books in the system:
If already logged into the system within the browser, via a user account with permission to access the API, the system will also accept an existing session meaning you can browse API endpoints directly in the browser or use the browser devtools to play with the API.
-
-
-
-
Request Format
-
The API is primarily design to be interfaced using JSON so the majority of API endpoints, that accept data, will read JSON request data although application/x-www-form-urlencoded request data is also accepted. Endpoints that receive file data will need data sent in a multipart/form-data format although this will be highlighted in the documentation for such endpoints.
-
For endpoints in this documentation that accept data, a "Body Parameters" table will be available showing the parameters that will accepted in the request. Any rules for the values of such parameters, such as the data-type or if they're required, will be shown alongside the parameter name.
-
-
-
-
Listing Endpoints
-
Some endpoints will return a list of data models. These endpoints will return an array of the model data under a data property along with a numeric total property to indicate the total number of records found for the query within the system. Here's an example of a listing response:
-
{
- "data": [
- {
- "id": 1,
- "name": "BookStack User Guide",
- "slug": "bookstack-user-guide",
- "description": "This is a general guide on using BookStack on a day-to-day basis.",
- "created_at": "2019-05-05 21:48:46",
- "updated_at": "2019-12-11 20:57:31",
- "created_by": 1,
- "updated_by": 1,
- "image_id": 3
- }
- ],
- "total": 16
-}
-
- There are a number of standard URL parameters that can be supplied to manipulate and page through the results returned from a listing endpoint:
-
-
-
-
Parameter
-
Details
-
Examples
-
-
-
count
-
- Specify how many records will be returned in the response.
- (Default: {{ config('api.default_item_count') }}, Max: {{ config('api.max_item_count') }})
-
-
Limit the count to 50 ?count=50
-
-
-
offset
-
- Specify how many records to skip over in the response.
- (Default: 0)
-
-
Skip over the first 100 records ?offset=100
-
-
-
sort
-
- Specify what field is used to sort the data and the direction of the sort (Ascending or Descending).
- Value is the name of a field, A + or - prefix dictates ordering.
- Direction defaults to ascending.
- Can use most fields shown in the response.
-
-
- Sort by name ascending ?sort=+name
- Sort by "Created At" date descending ?sort=-created_at
-
-
-
-
filter[<field>]
-
- Specify a filter to be applied to the query. Can use most fields shown in the response.
- By default a filter will apply a "where equals" query but the below operations are available using the format filter[<field>:<operation>]
-
-
-
eq
-
Where <field> equals the filter value.
-
-
-
ne
-
Where <field> does not equal the filter value.
-
-
-
gt
-
Where <field> is greater than the filter value.
-
-
-
lt
-
Where <field> is less than the filter value.
-
-
-
gte
-
Where <field> is greater than or equal to the filter value.
-
-
-
lte
-
Where <field> is less than or equal to the filter value.
-
-
-
like
-
- Where <field> is "like" the filter value.
- % symbols can be used as wildcards.
-
-
-
-
-
- Filter where id is 5: ?filter[id]=5
- Filter where id is not 5: ?filter[id:ne]=5
- Filter where name contains "cat": ?filter[name:like]=%cat%
- Filter where created after 2020-01-01: ?filter[created_at:gt]=2020-01-01
-
-
-
-
-
-
-
Error Handling
-
- Successful responses will return a 200 or 204 HTTP response code. Errors will return a 4xx or a 5xx HTTP response code depending on the type of error. Errors follow a standard format as shown below. The message provided may be translated depending on the configured language of the system in addition to the API users' language preference. The code provided in the JSON response will match the HTTP response code.
-
-
-
{
- "error": {
- "code": 401,
- "message": "No authorization token found on the request"
- }
-}
-
+
+@endif
+
+@if(!$loop->last)
+
+@endif
\ No newline at end of file
diff --git a/resources/views/api-docs/parts/getting-started.blade.php b/resources/views/api-docs/parts/getting-started.blade.php
new file mode 100644
index 000000000..ba0f85fc7
--- /dev/null
+++ b/resources/views/api-docs/parts/getting-started.blade.php
@@ -0,0 +1,141 @@
+
Getting Started
+
+
Authentication
+
+ To access the API a user has to have the "Access System API" permission enabled on one of their assigned roles.
+ Permissions to content accessed via the API is limited by the roles & permissions assigned to the user that's used to access the API.
+
+
Authentication to use the API is primarily done using API Tokens. Once the "Access System API" permission has been assigned to a user, a "API Tokens" section should be visible when editing their user profile. Choose "Create Token" and enter an appropriate name and expiry date, relevant for your API usage then press "Save". A "Token ID" and "Token Secret" will be immediately displayed. These values should be used as a header in API HTTP requests in the following format:
+
Authorization: Token <token_id>:<token_secret>
+
Here's an example of an authorized cURL request to list books in the system:
If already logged into the system within the browser, via a user account with permission to access the API, the system will also accept an existing session meaning you can browse API endpoints directly in the browser or use the browser devtools to play with the API.
+
+
+
+
Request Format
+
The API is primarily design to be interfaced using JSON so the majority of API endpoints, that accept data, will read JSON request data although application/x-www-form-urlencoded request data is also accepted. Endpoints that receive file data will need data sent in a multipart/form-data format although this will be highlighted in the documentation for such endpoints.
+
For endpoints in this documentation that accept data, a "Body Parameters" table will be available showing the parameters that will accepted in the request. Any rules for the values of such parameters, such as the data-type or if they're required, will be shown alongside the parameter name.
+
+
+
+
Listing Endpoints
+
Some endpoints will return a list of data models. These endpoints will return an array of the model data under a data property along with a numeric total property to indicate the total number of records found for the query within the system. Here's an example of a listing response:
+
{
+ "data": [
+ {
+ "id": 1,
+ "name": "BookStack User Guide",
+ "slug": "bookstack-user-guide",
+ "description": "This is a general guide on using BookStack on a day-to-day basis.",
+ "created_at": "2019-05-05 21:48:46",
+ "updated_at": "2019-12-11 20:57:31",
+ "created_by": 1,
+ "updated_by": 1,
+ "image_id": 3
+ }
+ ],
+ "total": 16
+}
+
+ There are a number of standard URL parameters that can be supplied to manipulate and page through the results returned from a listing endpoint:
+
+
+
+
Parameter
+
Details
+
Examples
+
+
+
count
+
+ Specify how many records will be returned in the response.
+ (Default: {{ config('api.default_item_count') }}, Max: {{ config('api.max_item_count') }})
+
+
Limit the count to 50 ?count=50
+
+
+
offset
+
+ Specify how many records to skip over in the response.
+ (Default: 0)
+
+
Skip over the first 100 records ?offset=100
+
+
+
sort
+
+ Specify what field is used to sort the data and the direction of the sort (Ascending or Descending).
+ Value is the name of a field, A + or - prefix dictates ordering.
+ Direction defaults to ascending.
+ Can use most fields shown in the response.
+
+
+ Sort by name ascending ?sort=+name
+ Sort by "Created At" date descending ?sort=-created_at
+
+
+
+
filter[<field>]
+
+ Specify a filter to be applied to the query. Can use most fields shown in the response.
+ By default a filter will apply a "where equals" query but the below operations are available using the format filter[<field>:<operation>]
+
+
+
eq
+
Where <field> equals the filter value.
+
+
+
ne
+
Where <field> does not equal the filter value.
+
+
+
gt
+
Where <field> is greater than the filter value.
+
+
+
lt
+
Where <field> is less than the filter value.
+
+
+
gte
+
Where <field> is greater than or equal to the filter value.
+
+
+
lte
+
Where <field> is less than or equal to the filter value.
+
+
+
like
+
+ Where <field> is "like" the filter value.
+ % symbols can be used as wildcards.
+
+
+
+
+
+ Filter where id is 5: ?filter[id]=5
+ Filter where id is not 5: ?filter[id:ne]=5
+ Filter where name contains "cat": ?filter[name:like]=%cat%
+ Filter where created after 2020-01-01: ?filter[created_at:gt]=2020-01-01
+
+
+
+
+
+
+
Error Handling
+
+ Successful responses will return a 200 or 204 HTTP response code. Errors will return a 4xx or a 5xx HTTP response code depending on the type of error. Errors follow a standard format as shown below. The message provided may be translated depending on the configured language of the system in addition to the API users' language preference. The code provided in the JSON response will match the HTTP response code.
+
+
+
{
+ "error": {
+ "code": 401,
+ "message": "No authorization token found on the request"
+ }
+}
+
\ No newline at end of file
diff --git a/resources/views/attachments/manager-edit-form.blade.php b/resources/views/attachments/manager-edit-form.blade.php
index ee86dc240..15837448a 100644
--- a/resources/views/attachments/manager-edit-form.blade.php
+++ b/resources/views/attachments/manager-edit-form.blade.php
@@ -22,7 +22,7 @@
\ No newline at end of file
diff --git a/resources/views/books/create.blade.php b/resources/views/books/create.blade.php
index db3e90e51..eead4191c 100644
--- a/resources/views/books/create.blade.php
+++ b/resources/views/books/create.blade.php
@@ -1,10 +1,10 @@
-@extends('simple-layout')
+@extends('layouts.simple')
@section('body')
diff --git a/resources/views/partials/loading-icon.blade.php b/resources/views/common/loading-icon.blade.php
similarity index 100%
rename from resources/views/partials/loading-icon.blade.php
rename to resources/views/common/loading-icon.blade.php
diff --git a/resources/views/partials/notifications.blade.php b/resources/views/common/notifications.blade.php
similarity index 100%
rename from resources/views/partials/notifications.blade.php
rename to resources/views/common/notifications.blade.php
diff --git a/resources/views/common/parts/skip-to-content.blade.php b/resources/views/common/skip-to-content.blade.php
similarity index 100%
rename from resources/views/common/parts/skip-to-content.blade.php
rename to resources/views/common/skip-to-content.blade.php
diff --git a/resources/views/partials/book-tree.blade.php b/resources/views/entities/book-tree.blade.php
similarity index 77%
rename from resources/views/partials/book-tree.blade.php
rename to resources/views/entities/book-tree.blade.php
index 15b583289..ce016143a 100644
--- a/resources/views/partials/book-tree.blade.php
+++ b/resources/views/entities/book-tree.blade.php
@@ -7,19 +7,19 @@
- @include('components.entity-selector', ['name' => 'entity-selector'])
+ @include('entities.selector', ['name' => 'entity-selector'])
diff --git a/resources/views/components/entity-selector.blade.php b/resources/views/entities/selector.blade.php
similarity index 95%
rename from resources/views/components/entity-selector.blade.php
rename to resources/views/entities/selector.blade.php
index c71fdff63..687392dea 100644
--- a/resources/views/components/entity-selector.blade.php
+++ b/resources/views/entities/selector.blade.php
@@ -5,7 +5,7 @@
option:entity-selector:entity-permission="{{ $entityPermission ?? 'view' }}">
-
@include('partials.loading-icon')
+
@include('common.loading-icon')
@if($showAdd ?? false)
diff --git a/resources/views/partials/entity-sibling-navigation.blade.php b/resources/views/entities/sibling-navigation.blade.php
similarity index 100%
rename from resources/views/partials/entity-sibling-navigation.blade.php
rename to resources/views/entities/sibling-navigation.blade.php
diff --git a/resources/views/partials/sort.blade.php b/resources/views/entities/sort.blade.php
similarity index 100%
rename from resources/views/partials/sort.blade.php
rename to resources/views/entities/sort.blade.php
diff --git a/resources/views/components/tag-list.blade.php b/resources/views/entities/tag-list.blade.php
similarity index 100%
rename from resources/views/components/tag-list.blade.php
rename to resources/views/entities/tag-list.blade.php
diff --git a/resources/views/components/tag-manager-list.blade.php b/resources/views/entities/tag-manager-list.blade.php
similarity index 100%
rename from resources/views/components/tag-manager-list.blade.php
rename to resources/views/entities/tag-manager-list.blade.php
diff --git a/resources/views/components/tag-manager.blade.php b/resources/views/entities/tag-manager.blade.php
similarity index 85%
rename from resources/views/components/tag-manager.blade.php
rename to resources/views/entities/tag-manager.blade.php
index 9e24ba3fd..5975c4bd9 100644
--- a/resources/views/components/tag-manager.blade.php
+++ b/resources/views/entities/tag-manager.blade.php
@@ -9,7 +9,7 @@
diff --git a/resources/views/components/image-manager-form.blade.php b/resources/views/pages/parts/image-manager-form.blade.php
similarity index 100%
rename from resources/views/components/image-manager-form.blade.php
rename to resources/views/pages/parts/image-manager-form.blade.php
diff --git a/resources/views/components/image-manager-list.blade.php b/resources/views/pages/parts/image-manager-list.blade.php
similarity index 100%
rename from resources/views/components/image-manager-list.blade.php
rename to resources/views/pages/parts/image-manager-list.blade.php
diff --git a/resources/views/components/image-manager.blade.php b/resources/views/pages/parts/image-manager.blade.php
similarity index 98%
rename from resources/views/components/image-manager.blade.php
rename to resources/views/pages/parts/image-manager.blade.php
index 4f03eeaec..c15c31b86 100644
--- a/resources/views/components/image-manager.blade.php
+++ b/resources/views/pages/parts/image-manager.blade.php
@@ -45,7 +45,7 @@
diff --git a/resources/views/pages/markdown-editor.blade.php b/resources/views/pages/parts/markdown-editor.blade.php
similarity index 100%
rename from resources/views/pages/markdown-editor.blade.php
rename to resources/views/pages/parts/markdown-editor.blade.php
diff --git a/resources/views/pages/page-display.blade.php b/resources/views/pages/parts/page-display.blade.php
similarity index 100%
rename from resources/views/pages/page-display.blade.php
rename to resources/views/pages/parts/page-display.blade.php
diff --git a/resources/views/pages/pointer.blade.php b/resources/views/pages/parts/pointer.blade.php
similarity index 100%
rename from resources/views/pages/pointer.blade.php
rename to resources/views/pages/parts/pointer.blade.php
diff --git a/resources/views/pages/template-manager-list.blade.php b/resources/views/pages/parts/template-manager-list.blade.php
similarity index 100%
rename from resources/views/pages/template-manager-list.blade.php
rename to resources/views/pages/parts/template-manager-list.blade.php
diff --git a/resources/views/pages/template-manager.blade.php b/resources/views/pages/parts/template-manager.blade.php
similarity index 87%
rename from resources/views/pages/template-manager.blade.php
rename to resources/views/pages/parts/template-manager.blade.php
index fbdb70a1b..66d53ae7e 100644
--- a/resources/views/pages/template-manager.blade.php
+++ b/resources/views/pages/parts/template-manager.blade.php
@@ -3,7 +3,7 @@
\ No newline at end of file
diff --git a/resources/views/pages/wysiwyg-editor.blade.php b/resources/views/pages/parts/wysiwyg-editor.blade.php
similarity index 100%
rename from resources/views/pages/wysiwyg-editor.blade.php
rename to resources/views/pages/parts/wysiwyg-editor.blade.php
diff --git a/resources/views/pages/permissions.blade.php b/resources/views/pages/permissions.blade.php
index de28137db..792015e28 100644
--- a/resources/views/pages/permissions.blade.php
+++ b/resources/views/pages/permissions.blade.php
@@ -1,11 +1,11 @@
-@extends('simple-layout')
+@extends('layouts.simple')
@section('body')
diff --git a/resources/views/pages/sidebar-tree-list.blade.php b/resources/views/pages/sidebar-tree-list.blade.php
deleted file mode 100644
index e69de29bb..000000000
diff --git a/resources/views/readme.md b/resources/views/readme.md
new file mode 100644
index 000000000..4646db2d8
--- /dev/null
+++ b/resources/views/readme.md
@@ -0,0 +1,43 @@
+# BookStack Views
+
+All views within this folder are [Laravel blade](https://laravel.com/docs/6.x/blade) views.
+
+### Overriding
+
+Views can be overridden on a per-file basis via the visual theme system.
+More information on this can be found within the `dev/docs/visual-theme-system.md`
+file within this project.
+
+### Convention
+
+Views are broken down into rough domain areas. These aren't too strict although many of the folders
+here will often match up to a HTTP controller.
+
+Within each folder views will be structured like so:
+
+```txt
+- folder/
+ - page-a.blade.php
+ - page-b.blade.php
+ - parts/
+ - partial-a.blade.php
+ - partial-b.blade.php
+ - subdomain/
+ - subdomain-page-a.blade.php
+ - subdomain-page-b.blade.php
+ - parts/
+ - subdomain-partial-a.blade.php
+ - subdomain-partial-b.blade.php
+```
+
+If a folder contains no pages at all (For example: `attachments`, `form`) and only partials, then
+the partials can be within the top-level folder instead of pages to prevent unneeded nesting.
+
+If a partial depends on another partial within the same directory, the naming of the child partials should be an extension of the parent.
+For example:
+
+```txt
+- tag-manager.blade.php
+- tag-manager-list.blade.php
+- tag-manager-input.blade.php
+```
\ No newline at end of file
diff --git a/resources/views/search/all.blade.php b/resources/views/search/all.blade.php
index 49a6c1f65..b9adccca7 100644
--- a/resources/views/search/all.blade.php
+++ b/resources/views/search/all.blade.php
@@ -1,4 +1,4 @@
-@extends('simple-layout')
+@extends('layouts.simple')
@section('body')
diff --git a/resources/views/settings/footer-links.blade.php b/resources/views/settings/parts/footer-links.blade.php
similarity index 100%
rename from resources/views/settings/footer-links.blade.php
rename to resources/views/settings/parts/footer-links.blade.php
diff --git a/resources/views/settings/navbar-with-version.blade.php b/resources/views/settings/parts/navbar-with-version.blade.php
similarity index 87%
rename from resources/views/settings/navbar-with-version.blade.php
rename to resources/views/settings/parts/navbar-with-version.blade.php
index c02c370fe..09af699a3 100644
--- a/resources/views/settings/navbar-with-version.blade.php
+++ b/resources/views/settings/parts/navbar-with-version.blade.php
@@ -4,7 +4,7 @@ $version - Version of bookstack to display
--}}
\ No newline at end of file
diff --git a/resources/views/shelves/create.blade.php b/resources/views/shelves/create.blade.php
index bea20eca9..95b459068 100644
--- a/resources/views/shelves/create.blade.php
+++ b/resources/views/shelves/create.blade.php
@@ -1,11 +1,11 @@
-@extends('simple-layout')
+@extends('layouts.simple')
@section('body')