Skip to content

Commit

Permalink
Add translations.
Browse files Browse the repository at this point in the history
Add navroot.
Add expanders support.
Add multilingual support.
  • Loading branch information
robgietema committed Nov 28, 2024
1 parent 5146e88 commit be404bd
Show file tree
Hide file tree
Showing 71 changed files with 1,825 additions and 255 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@
- Add upgrade profile functionality @robgietema
- Add login by email @robgietema
- Add url to action @robgietema
- Add navroot endpoint @robgietema
- Add language token to content objects @robgietema
- Add support for expanders in content fetching @robgietema
- Add available languages endpoint @robgietema
- Add multilingual support @robgietema

### Bugfix

Expand All @@ -53,6 +58,8 @@
- Update workflow from seeds when already exists @robgietema
- Return default layout for content objects @robgietema
- Fix delete within transaction @robgietema
- Fix keywords endpoint @robgietema
- Fix supported languages endpoint @robgietema

### Internal

Expand Down
3 changes: 2 additions & 1 deletion docs/examples/breadcrumbs/get.res
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ Content-Type: application/json
"@id": "http://localhost:8000/events/event-1",
"title": "Event 1"
}
]
],
"root": "/"
}
30 changes: 30 additions & 0 deletions docs/examples/content/get.res
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,39 @@ Content-Type: application/json
]
},
"items": [],
"@components": {
"actions": {
"@id": "http://localhost:8000/news/@actions"
},
"breadcrumbs": {
"@id": "http://localhost:8000/news/@breadcrumbs"
},
"catalog": {
"@id": "http://localhost:8000/news/@catalog"
},
"navigation": {
"@id": "http://localhost:8000/news/@navigation"
},
"navroot": {
"@id": "http://localhost:8000/news/@navroot"
},
"translations": {
"@id": "http://localhost:8000/news/@translations"
},
"types": {
"@id": "http://localhost:8000/news/@types"
},
"workflow": {
"@id": "http://localhost:8000/news/@workflow"
}
},
"@id": "http://localhost:8000/news",
"@type": "Folder",
"id": "news",
"language": {
"title": "English",
"token": "en"
},
"created": "2022-04-02T20:22:00.000Z",
"modified": "2022-04-02T20:22:00.000Z",
"effective": "2022-04-02T20:22:00.000Z",
Expand Down
162 changes: 115 additions & 47 deletions docs/examples/content/get_root.res
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,75 @@ HTTP/1.1 200 OK
Content-Type: application/json

{
"title": "Welcome to Volto",
"title": "Welcome to Nick!",
"blocks": {
"495efb73-cbdd-4bef-935a-a56f70a20854": {
"text": {
"blocks": [
{
"key": "9f35d",
"data": {},
"text": "Congratulations! You have succesfully installed Volto.",
"text": "This is the demo site of Nick and is build with the Volto frontend.",
"type": "unstyled",
"depth": 0,
"entityRanges": [
{ "key": 0, "length": 4, "offset": 25 },
{ "key": 1, "length": 5, "offset": 52 }
],
"inlineStyleRanges": []
}
],
"entityMap": {
"0": {
"data": { "url": "https://nickcms.org" },
"type": "LINK",
"mutability": "MUTABLE"
},
"1": {
"data": { "url": "https://voltocms.com" },
"type": "LINK",
"mutability": "MUTABLE"
}
}
},
"@type": "text"
},
"6a6d1e67-fefd-4049-98a3-300f0302abcb": {
"text": {
"blocks": [
{
"key": "3jol2",
"data": {},
"text": "You can use this site to test the latest version of Nick. You can login with username admin and password admin.",
"type": "unstyled",
"depth": 0,
"entityRanges": [{ "key": 0, "length": 4, "offset": 52 }],
"inlineStyleRanges": [
{ "style": "ITALIC", "length": 8, "offset": 77 },
{ "style": "ITALIC", "length": 8, "offset": 96 },
{ "style": "BOLD", "length": 5, "offset": 86 },
{ "style": "BOLD", "length": 5, "offset": 105 }
]
}
],
"entityMap": {
"0": {
"data": { "url": "https://nickcms.org" },
"type": "LINK",
"mutability": "MUTABLE"
}
}
},
"@type": "text"
},
"79ba8858-1dd3-4719-b731-5951e32fbf79": { "@type": "title" },
"be383a3d-7409-42b5-a5bc-555e2fbf068d": {
"text": {
"blocks": [
{
"key": "atc31",
"data": {},
"text": "This instance is reset every night so feel free to make any changes!",
"type": "unstyled",
"depth": 0,
"entityRanges": [],
Expand All @@ -21,104 +81,112 @@ Content-Type: application/json
},
"@type": "text"
},
"79ba8858-1dd3-4719-b731-5951e32fbf79": {
"@type": "title"
"eb024f35-ab6a-4034-ac5b-77c91fe3d400": {
"text": {
"blocks": [
{
"key": "5s8ah",
"data": {},
"text": "Demo",
"type": "header-three",
"depth": 0,
"entityRanges": [],
"inlineStyleRanges": []
}
],
"entityMap": {}
},
"@type": "text"
}
},
"effective": "2022-04-02T20:00:00.000Z",
"description": "Congratulations! You have successfully installed Volto.",
"description": "Congratulations! You have successfully installed Nick.",
"blocks_layout": {
"items": [
"79ba8858-1dd3-4719-b731-5951e32fbf79",
"495efb73-cbdd-4bef-935a-a56f70a20854"
"495efb73-cbdd-4bef-935a-a56f70a20854",
"eb024f35-ab6a-4034-ac5b-77c91fe3d400",
"6a6d1e67-fefd-4049-98a3-300f0302abcb",
"be383a3d-7409-42b5-a5bc-555e2fbf068d"
]
},
"items": [
{
"title": "Events",
"blocks": {
"79ba8858-1dd3-4719-b731-5951e32fbf79": {
"@type": "title"
}
},
"blocks": { "79ba8858-1dd3-4719-b731-5951e32fbf79": { "@type": "title" } },
"effective": "2022-04-02T20:30:00.000Z",
"blocks_layout": {
"items": ["79ba8858-1dd3-4719-b731-5951e32fbf79"]
},
"blocks_layout": { "items": ["79ba8858-1dd3-4719-b731-5951e32fbf79"] },
"@id": "http://localhost:8000/events",
"@type": "Folder",
"id": "events",
"created": "2022-04-02T20:30:00.000Z",
"modified": "2022-04-02T20:30:00.000Z",
"UID": "1a2123ba-14e8-4910-8e6b-c04a40d72a41",
"owner": "admin",
"layout": "view",
"is_folderish": true,
"language": { "token": "en", "title": "English" },
"review_state": "published",
"lock": {
"locked": false,
"stealable": true
}
"lock": { "locked": false, "stealable": true }
},
{
"title": "News",
"blocks": {
"79ba8858-1dd3-4719-b731-5951e32fbf79": {
"@type": "title"
}
},
"blocks": { "79ba8858-1dd3-4719-b731-5951e32fbf79": { "@type": "title" } },
"effective": "2022-04-02T20:22:00.000Z",
"description": "News Items",
"blocks_layout": {
"items": ["79ba8858-1dd3-4719-b731-5951e32fbf79"]
},
"blocks_layout": { "items": ["79ba8858-1dd3-4719-b731-5951e32fbf79"] },
"@id": "http://localhost:8000/news",
"@type": "Folder",
"id": "news",
"created": "2022-04-02T20:22:00.000Z",
"modified": "2022-04-02T20:22:00.000Z",
"UID": "32215c67-86de-462a-8cc0-eabcd2b39c26",
"owner": "admin",
"layout": "view",
"is_folderish": true,
"language": { "token": "en", "title": "English" },
"review_state": "published",
"lock": {
"locked": false,
"stealable": true
}
"lock": { "locked": false, "stealable": true }
},
{
"title": "Users",
"blocks": {
"79ba8858-1dd3-4719-b731-5951e32fbf79": {
"@type": "title"
}
},
"blocks": { "79ba8858-1dd3-4719-b731-5951e32fbf79": { "@type": "title" } },
"effective": "2022-04-02T20:24:00.000Z",
"blocks_layout": {
"items": ["79ba8858-1dd3-4719-b731-5951e32fbf79"]
},
"blocks_layout": { "items": ["79ba8858-1dd3-4719-b731-5951e32fbf79"] },
"@id": "http://localhost:8000/users",
"@type": "Folder",
"id": "users",
"created": "2022-04-02T20:24:00.000Z",
"modified": "2022-04-02T20:24:00.000Z",
"UID": "80994493-74ca-4b94-9a7c-145a33a6dd80",
"owner": "admin",
"layout": "view",
"is_folderish": true,
"language": { "token": "en", "title": "English" },
"review_state": "published",
"lock": {
"locked": false,
"stealable": true
}
"lock": { "locked": false, "stealable": true }
}
],
"@components": {
"catalog": { "@id": "http://localhost:8000/@catalog" },
"actions": { "@id": "http://localhost:8000/@actions" },
"breadcrumbs": { "@id": "http://localhost:8000/@breadcrumbs" },
"navigation": { "@id": "http://localhost:8000/@navigation" },
"navroot": { "@id": "http://localhost:8000/@navroot" },
"types": { "@id": "http://localhost:8000/@types" },
"workflow": { "@id": "http://localhost:8000/@workflow" },
"translations": { "@id": "http://localhost:8000/@translations" }
},
"@id": "http://localhost:8000",
"@type": "Site",
"id": "root",
"created": "2022-04-02T20:00:00.000Z",
"modified": "2022-04-02T20:00:00.000Z",
"UID": "92a80817-f5b7-400d-8f58-b08126f0f09b",
"is_folderish": true,
"owner": "admin",
"layout": "view",
"is_folderish": true,
"language": { "token": "en", "title": "English" },
"review_state": "published",
"lock": {
"locked": false,
"stealable": true
}
"lock": { "locked": false, "stealable": true }
}
26 changes: 26 additions & 0 deletions docs/examples/content/post.res
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,32 @@ Content-Type: application/json
{
"title": "My News Item",
"description": "News Description",
"@components": {
"actions": {
"@id": "http://localhost:8000/news/@actions"
},
"breadcrumbs": {
"@id": "http://localhost:8000/news/@breadcrumbs"
},
"catalog": {
"@id": "http://localhost:8000/news/@catalog"
},
"navigation": {
"@id": "http://localhost:8000/news/@navigation"
},
"navroot": {
"@id": "http://localhost:8000/news/@navroot"
},
"translations": {
"@id": "http://localhost:8000/news/@translations"
},
"types": {
"@id": "http://localhost:8000/news/@types"
},
"workflow": {
"@id": "http://localhost:8000/news/@workflow"
}
},
"@id": "http://localhost:8000/news/my-news-item",
"@type": "Page",
"id": "my-news-item",
Expand Down
1 change: 0 additions & 1 deletion docs/examples/history/get.res
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
HTTP/1.1 200 OK
Content-Type: application/json


[
{
"@id": "http://localhost:8000/news/@history/1",
Expand Down
34 changes: 31 additions & 3 deletions docs/examples/history/get_version.res
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,39 @@ Content-Type: application/json
},
"description": "News Items",
"blocks_layout": {
"items": [
"79ba8858-1dd3-4719-b731-5951e32fbf79"
]
"items": ["79ba8858-1dd3-4719-b731-5951e32fbf79"]
},
"items": [],
"@components": {
"actions": {
"@id": "http://localhost:8000/news/@actions"
},
"breadcrumbs": {
"@id": "http://localhost:8000/news/@breadcrumbs"
},
"catalog": {
"@id": "http://localhost:8000/news/@catalog"
},
"navigation": {
"@id": "http://localhost:8000/news/@navigation"
},
"navroot": {
"@id": "http://localhost:8000/news/@navroot"
},
"translations": {
"@id": "http://localhost:8000/news/@translations"
},
"types": {
"@id": "http://localhost:8000/news/@types"
},
"workflow": {
"@id": "http://localhost:8000/news/@workflow"
}
},
"language": {
"title": "English",
"token": "en"
},
"@id": "http://localhost:8000/news",
"@type": "Folder",
"id": "news",
Expand Down
3 changes: 3 additions & 0 deletions docs/examples/navroot/get.req
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
GET /news/@navroot HTTP/1.1
Accept: application/json
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImZ1bGxuYW1lIjoiQWRtaW4iLCJpYXQiOjE2NDkzMTI0NDl9.RS1Ny_r0v7vIylFfK6q0JVJrkiDuTOh9iG9IL8xbzAk
Loading

0 comments on commit be404bd

Please sign in to comment.