From aff4aea9f504956e58eb1d99c51748692166293d Mon Sep 17 00:00:00 2001 From: DrMint Date: Sun, 20 Mar 2022 14:07:18 +0100 Subject: [PATCH] Added more translated fields --- src/api/post/content-types/post/schema.json | 21 +++++- .../content-types/web-archive/schema.json | 66 +++++++++++++++++++ .../web-archive/controllers/web-archive.js | 9 +++ src/api/web-archive/routes/web-archive.js | 9 +++ src/api/web-archive/services/web-archive.js | 9 +++ .../website-interface/schema.json | 30 +++++++++ src/components/basics/file-size.json | 25 +++++++ .../library-obi-belt.json | 42 ++++++++---- src/components/translations/posts.json | 38 +++++++---- src/components/translations/web-archives.json | 21 ++++++ 10 files changed, 244 insertions(+), 26 deletions(-) create mode 100644 src/api/web-archive/content-types/web-archive/schema.json create mode 100644 src/api/web-archive/controllers/web-archive.js create mode 100644 src/api/web-archive/routes/web-archive.js create mode 100644 src/api/web-archive/services/web-archive.js create mode 100644 src/components/basics/file-size.json create mode 100644 src/components/translations/web-archives.json diff --git a/src/api/post/content-types/post/schema.json b/src/api/post/content-types/post/schema.json index bcf2680..cdc4dc7 100644 --- a/src/api/post/content-types/post/schema.json +++ b/src/api/post/content-types/post/schema.json @@ -8,7 +8,7 @@ "description": "" }, "options": { - "draftAndPublish": true + "draftAndPublish": false }, "pluginOptions": {}, "attributes": { @@ -33,6 +33,25 @@ "type": "component", "repeatable": true, "component": "translations.posts" + }, + "hidden": { + "type": "boolean", + "default": false, + "required": true + }, + "thumbnail": { + "type": "media", + "multiple": false, + "required": false, + "allowedTypes": [ + "images" + ] + }, + "date": { + "type": "component", + "repeatable": false, + "component": "basics.datepicker", + "required": true } } } diff --git a/src/api/web-archive/content-types/web-archive/schema.json b/src/api/web-archive/content-types/web-archive/schema.json new file mode 100644 index 0000000..a80c7a1 --- /dev/null +++ b/src/api/web-archive/content-types/web-archive/schema.json @@ -0,0 +1,66 @@ +{ + "kind": "collectionType", + "collectionName": "web_archives", + "info": { + "singularName": "web-archive", + "pluralName": "web-archives", + "displayName": "🟧 Web Archives", + "description": "" + }, + "options": { + "draftAndPublish": false + }, + "attributes": { + "type": { + "type": "enumeration", + "enum": [ + "website", + "webpage", + "online_doc" + ], + "required": true + }, + "source_url": { + "type": "string", + "required": true, + "unique": true + }, + "format": { + "type": "enumeration", + "enum": [ + "zip", + "wacz" + ], + "required": true + }, + "date": { + "type": "component", + "repeatable": false, + "component": "basics.datepicker", + "required": true + }, + "num_pages": { + "type": "integer" + }, + "author": { + "type": "string" + }, + "still_online": { + "type": "boolean", + "default": true, + "required": true + }, + "size": { + "type": "component", + "repeatable": false, + "component": "basics.file-size", + "required": true + }, + "descriptions": { + "displayName": "Web Archives", + "type": "component", + "repeatable": true, + "component": "translations.web-archives" + } + } +} diff --git a/src/api/web-archive/controllers/web-archive.js b/src/api/web-archive/controllers/web-archive.js new file mode 100644 index 0000000..5182bc1 --- /dev/null +++ b/src/api/web-archive/controllers/web-archive.js @@ -0,0 +1,9 @@ +'use strict'; + +/** + * web-archive controller + */ + +const { createCoreController } = require('@strapi/strapi').factories; + +module.exports = createCoreController('api::web-archive.web-archive'); diff --git a/src/api/web-archive/routes/web-archive.js b/src/api/web-archive/routes/web-archive.js new file mode 100644 index 0000000..0a6ce34 --- /dev/null +++ b/src/api/web-archive/routes/web-archive.js @@ -0,0 +1,9 @@ +'use strict'; + +/** + * web-archive router. + */ + +const { createCoreRouter } = require('@strapi/strapi').factories; + +module.exports = createCoreRouter('api::web-archive.web-archive'); diff --git a/src/api/web-archive/services/web-archive.js b/src/api/web-archive/services/web-archive.js new file mode 100644 index 0000000..d286041 --- /dev/null +++ b/src/api/web-archive/services/web-archive.js @@ -0,0 +1,9 @@ +'use strict'; + +/** + * web-archive service. + */ + +const { createCoreService } = require('@strapi/strapi').factories; + +module.exports = createCoreService('api::web-archive.web-archive'); diff --git a/src/api/website-interface/content-types/website-interface/schema.json b/src/api/website-interface/content-types/website-interface/schema.json index 3e1385c..3499e70 100644 --- a/src/api/website-interface/content-types/website-interface/schema.json +++ b/src/api/website-interface/content-types/website-interface/schema.json @@ -348,6 +348,36 @@ }, "results": { "type": "string" + }, + "language_switch_message": { + "type": "text" + }, + "open_settings": { + "type": "string" + }, + "change_language": { + "type": "string" + }, + "open_search": { + "type": "string" + }, + "chronology": { + "type": "string" + }, + "accords_handbook": { + "type": "string" + }, + "legality": { + "type": "string" + }, + "members": { + "type": "string" + }, + "sharing_policy": { + "type": "string" + }, + "contact_us": { + "type": "string" } } } diff --git a/src/components/basics/file-size.json b/src/components/basics/file-size.json new file mode 100644 index 0000000..5ff6b43 --- /dev/null +++ b/src/components/basics/file-size.json @@ -0,0 +1,25 @@ +{ + "collectionName": "components_basics_file_sizes", + "info": { + "displayName": "File Size", + "icon": "balance-scale", + "description": "" + }, + "options": {}, + "attributes": { + "size": { + "type": "decimal", + "required": true + }, + "unit": { + "type": "enumeration", + "enum": [ + "kb", + "mb", + "gb" + ], + "required": true, + "default": "kb" + } + } +} diff --git a/src/components/collections-component/library-obi-belt.json b/src/components/collections-component/library-obi-belt.json index e2c545a..1b5f85c 100644 --- a/src/components/collections-component/library-obi-belt.json +++ b/src/components/collections-component/library-obi-belt.json @@ -2,39 +2,59 @@ "collectionName": "components_collections_component_library_obi_belts", "info": { "displayName": "Library Obi Belt", - "icon": "circle-notch" + "icon": "circle-notch", + "description": "" }, "options": {}, "attributes": { "front": { + "type": "media", + "multiple": false, + "required": false, "allowedTypes": [ "images" - ], - "type": "media", - "multiple": false + ] }, "spine": { + "type": "media", + "multiple": false, + "required": false, "allowedTypes": [ "images" - ], - "type": "media", - "multiple": false + ] }, "back": { + "type": "media", + "multiple": false, + "required": false, "allowedTypes": [ "images" - ], - "type": "media", - "multiple": false + ] }, "full": { + "type": "media", + "multiple": false, + "required": false, + "allowedTypes": [ + "images" + ] + }, + "inside_full": { + "type": "media", + "multiple": false, + "required": false, + "allowedTypes": [ + "images" + ] + }, + "flap_front": { "allowedTypes": [ "images" ], "type": "media", "multiple": false }, - "inside_full": { + "flap_back": { "allowedTypes": [ "images" ], diff --git a/src/components/translations/posts.json b/src/components/translations/posts.json index be0384e..d894494 100644 --- a/src/components/translations/posts.json +++ b/src/components/translations/posts.json @@ -2,21 +2,11 @@ "collectionName": "components_translations_posts", "info": { "displayName": "Posts", - "icon": "icons" + "icon": "icons", + "description": "" }, "options": {}, "attributes": { - "Status": { - "type": "enumeration", - "enum": [ - "Incomplete", - "Draft", - "Review", - "Done" - ], - "default": "Incomplete", - "required": true - }, "title": { "type": "string", "required": true @@ -26,11 +16,31 @@ "maxLength": 150 }, "thumbnail": { + "type": "media", + "multiple": false, + "required": false, "allowedTypes": [ "images" + ] + }, + "body": { + "type": "richtext" + }, + "language": { + "type": "relation", + "relation": "oneToOne", + "target": "api::language.language" + }, + "status": { + "type": "enumeration", + "enum": [ + "Incomplete", + "Draft", + "Review", + "Done" ], - "type": "media", - "multiple": false + "default": "Incomplete", + "required": true } } } diff --git a/src/components/translations/web-archives.json b/src/components/translations/web-archives.json new file mode 100644 index 0000000..cf0e787 --- /dev/null +++ b/src/components/translations/web-archives.json @@ -0,0 +1,21 @@ +{ + "collectionName": "components_translations_web_archives", + "info": { + "displayName": "Web Archives", + "icon": "arrow-circle-down" + }, + "options": {}, + "attributes": { + "language": { + "type": "relation", + "relation": "oneToOne", + "target": "api::language.language" + }, + "description": { + "type": "text" + }, + "notes": { + "type": "text" + } + } +}