✨ feat: update collection metadata and add tags collection with test data
This commit is contained in:
@@ -2,7 +2,8 @@ name: comments
|
|||||||
meta:
|
meta:
|
||||||
label: { de: "Kommentare", en: "Comments" }
|
label: { de: "Kommentare", en: "Comments" }
|
||||||
muiIcon: chat
|
muiIcon: chat
|
||||||
group: content
|
group: community
|
||||||
|
imageUrl: "https://images.unsplash.com/photo-1516321318423-f06f85e504b3?auto=format&fit=crop&q=80&w=800"
|
||||||
preview:
|
preview:
|
||||||
label: author
|
label: author
|
||||||
secondary: message
|
secondary: message
|
||||||
|
|||||||
@@ -6,8 +6,9 @@ name: content
|
|||||||
uploadPath: ../media/content
|
uploadPath: ../media/content
|
||||||
meta:
|
meta:
|
||||||
label: { de: "Inhalte", en: "Content" }
|
label: { de: "Inhalte", en: "Content" }
|
||||||
muiIcon: article
|
muiIcon: description
|
||||||
group: content
|
group: content
|
||||||
|
imageUrl: "https://images.unsplash.com/photo-1499750310107-5fef28a66643?auto=format&fit=crop&q=80&w=800"
|
||||||
preview:
|
preview:
|
||||||
label: name
|
label: name
|
||||||
secondary: path
|
secondary: path
|
||||||
|
|||||||
@@ -6,8 +6,9 @@ name: medialib
|
|||||||
uploadPath: ../media/medialib
|
uploadPath: ../media/medialib
|
||||||
meta:
|
meta:
|
||||||
label: { de: "Mediathek", en: "Media Library" }
|
label: { de: "Mediathek", en: "Media Library" }
|
||||||
muiIcon: image_multiple
|
muiIcon: perm_media
|
||||||
group: media
|
group: content
|
||||||
|
imageUrl: "https://images.unsplash.com/photo-1542204165-65bf26472b9b?auto=format&fit=crop&q=80&w=800"
|
||||||
viewHint:
|
viewHint:
|
||||||
media:
|
media:
|
||||||
ai:
|
ai:
|
||||||
@@ -22,13 +23,10 @@ meta:
|
|||||||
file: file
|
file: file
|
||||||
preview:
|
preview:
|
||||||
label: title
|
label: title
|
||||||
secondary: description
|
secondary: tags
|
||||||
tertiary: tags
|
tertiary: description
|
||||||
image: file
|
image: file
|
||||||
table:
|
mediaFile: file
|
||||||
- file
|
|
||||||
- title
|
|
||||||
- tags
|
|
||||||
subNavigation:
|
subNavigation:
|
||||||
- name: images
|
- name: images
|
||||||
label: { de: "Bilder", en: "Images" }
|
label: { de: "Bilder", en: "Images" }
|
||||||
@@ -134,8 +132,10 @@ fields:
|
|||||||
- name: tags
|
- name: tags
|
||||||
type: string[]
|
type: string[]
|
||||||
meta:
|
meta:
|
||||||
label: { de: "Tags", en: "Tags" }
|
label: { de: "Schlagwörter", en: "Tags" }
|
||||||
widget: chipArray
|
widget: foreignKey
|
||||||
|
foreign:
|
||||||
|
collection: tags
|
||||||
- name: _testdata
|
- name: _testdata
|
||||||
type: boolean
|
type: boolean
|
||||||
meta:
|
meta:
|
||||||
|
|||||||
@@ -6,7 +6,8 @@ name: navigation
|
|||||||
meta:
|
meta:
|
||||||
label: { de: "Navigation", en: "Navigation" }
|
label: { de: "Navigation", en: "Navigation" }
|
||||||
muiIcon: menu
|
muiIcon: menu
|
||||||
group: structure
|
group: content
|
||||||
|
imageUrl: "https://images.unsplash.com/photo-1506784926709-22f1ec395907?auto=format&fit=crop&q=80&w=800"
|
||||||
viewHint:
|
viewHint:
|
||||||
navigation:
|
navigation:
|
||||||
nodesField: elements
|
nodesField: elements
|
||||||
|
|||||||
@@ -5,8 +5,9 @@
|
|||||||
name: ssr
|
name: ssr
|
||||||
meta:
|
meta:
|
||||||
label: { de: "SSR Dummy", en: "ssr dummy" }
|
label: { de: "SSR Dummy", en: "ssr dummy" }
|
||||||
muiIcon: server
|
muiIcon: storage
|
||||||
group: system
|
group: system
|
||||||
|
imageUrl: "https://images.unsplash.com/photo-1518770660439-4636190af475?auto=format&fit=crop&q=80&w=800"
|
||||||
hide: true
|
hide: true
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
|
|||||||
@@ -0,0 +1,104 @@
|
|||||||
|
########################################################################
|
||||||
|
# Tags — verwaltete Schlagwörter für Mediathek und andere Collections
|
||||||
|
########################################################################
|
||||||
|
|
||||||
|
name: tags
|
||||||
|
meta:
|
||||||
|
label: { de: "Schlagwörter", en: "Tags" }
|
||||||
|
muiIcon: tag
|
||||||
|
group: content
|
||||||
|
imageUrl: "https://images.unsplash.com/photo-1543285198-3af15c4592ce?auto=format&fit=crop&w=640&q=80"
|
||||||
|
preview:
|
||||||
|
select: [ name, color ]
|
||||||
|
label: name
|
||||||
|
labelStyle:
|
||||||
|
eval: |
|
||||||
|
//js
|
||||||
|
(function() {
|
||||||
|
const raw = ($this?.color || '').trim()
|
||||||
|
if (!raw) return ''
|
||||||
|
|
||||||
|
const hex = raw.replace(/^#/, '')
|
||||||
|
if (!/^[0-9a-fA-F]{6}$/.test(hex)) {
|
||||||
|
return 'background:' + raw + ';color:#F9FAFB;border:1px solid ' + raw
|
||||||
|
}
|
||||||
|
|
||||||
|
const r = parseInt(hex.slice(0, 2), 16)
|
||||||
|
const g = parseInt(hex.slice(2, 4), 16)
|
||||||
|
const b = parseInt(hex.slice(4, 6), 16)
|
||||||
|
|
||||||
|
const toLinear = (channel) => {
|
||||||
|
const normalized = channel / 255
|
||||||
|
return normalized <= 0.04045
|
||||||
|
? normalized / 12.92
|
||||||
|
: Math.pow((normalized + 0.055) / 1.055, 2.4)
|
||||||
|
}
|
||||||
|
|
||||||
|
const luminance = (
|
||||||
|
0.2126 * toLinear(r) +
|
||||||
|
0.7152 * toLinear(g) +
|
||||||
|
0.0722 * toLinear(b)
|
||||||
|
)
|
||||||
|
const whiteContrast = 1.05 / (luminance + 0.05)
|
||||||
|
const darkContrast = (luminance + 0.05) / 0.05
|
||||||
|
const text = darkContrast >= whiteContrast ? '#111827' : '#F9FAFB'
|
||||||
|
const border = luminance > 0.85 ? '#D1D5DB' : raw
|
||||||
|
|
||||||
|
return 'background:' + raw + ';color:' + text + ';border:1px solid ' + border
|
||||||
|
})()
|
||||||
|
//!js
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
public:
|
||||||
|
methods:
|
||||||
|
get: true
|
||||||
|
user:
|
||||||
|
methods:
|
||||||
|
get: true
|
||||||
|
post: true
|
||||||
|
put: true
|
||||||
|
delete: true
|
||||||
|
"token:${ADMIN_TOKEN}":
|
||||||
|
methods:
|
||||||
|
get: true
|
||||||
|
post: true
|
||||||
|
put: true
|
||||||
|
delete: true
|
||||||
|
|
||||||
|
fields:
|
||||||
|
- name: name
|
||||||
|
type: string
|
||||||
|
meta:
|
||||||
|
label: { de: "Name", en: "Name" }
|
||||||
|
- name: group
|
||||||
|
type: string
|
||||||
|
meta:
|
||||||
|
label: { de: "Gruppe", en: "Group" }
|
||||||
|
widget: select
|
||||||
|
choices:
|
||||||
|
- id: system
|
||||||
|
name: { de: "System", en: "System" }
|
||||||
|
- id: kategorie
|
||||||
|
name: { de: "Kategorie", en: "Category" }
|
||||||
|
- name: color
|
||||||
|
type: string
|
||||||
|
meta:
|
||||||
|
label: { de: "Farbe", en: "Color" }
|
||||||
|
widget: select
|
||||||
|
choices:
|
||||||
|
- id: "#4caf50"
|
||||||
|
name: { de: "Grün", en: "Green" }
|
||||||
|
badgeStyle: { backgroundColor: "#4caf50", color: "#ffffff" }
|
||||||
|
- id: "#2196f3"
|
||||||
|
name: { de: "Blau", en: "Blue" }
|
||||||
|
badgeStyle: { backgroundColor: "#2196f3", color: "#ffffff" }
|
||||||
|
- id: "#f44336"
|
||||||
|
name: { de: "Rot", en: "Red" }
|
||||||
|
badgeStyle: { backgroundColor: "#f44336", color: "#ffffff" }
|
||||||
|
- id: "#9c27b0"
|
||||||
|
name: { de: "Lila", en: "Purple" }
|
||||||
|
badgeStyle: { backgroundColor: "#9c27b0", color: "#ffffff" }
|
||||||
|
- name: _testdata
|
||||||
|
type: boolean
|
||||||
|
meta:
|
||||||
|
hide: true
|
||||||
+5
-7
@@ -13,18 +13,16 @@ meta:
|
|||||||
collectionGroups:
|
collectionGroups:
|
||||||
- name: content
|
- name: content
|
||||||
label: { de: "Inhalte", en: "Content" }
|
label: { de: "Inhalte", en: "Content" }
|
||||||
icon: article
|
icon: description
|
||||||
- name: media
|
- name: community
|
||||||
label: { de: "Medien", en: "Media" }
|
label: { de: "Community", en: "Community" }
|
||||||
icon: image_multiple
|
icon: forum
|
||||||
- name: structure
|
|
||||||
label: { de: "Struktur", en: "Structure" }
|
|
||||||
icon: account_tree
|
|
||||||
- name: system
|
- name: system
|
||||||
label: { de: "System", en: "System" }
|
label: { de: "System", en: "System" }
|
||||||
icon: settings
|
icon: settings
|
||||||
|
|
||||||
collections:
|
collections:
|
||||||
|
- !include collections/tags.yml
|
||||||
- !include collections/content.yml
|
- !include collections/content.yml
|
||||||
- !include collections/medialib.yml
|
- !include collections/medialib.yml
|
||||||
- !include collections/navigation.yml
|
- !include collections/navigation.yml
|
||||||
|
|||||||
+1
-1
@@ -1,2 +1,2 @@
|
|||||||
ADMIN_TOKEN=5bdfjc78hdxn338cuhSJ
|
ADMIN_TOKEN=5bdfjc78hdxn338cuhSJ
|
||||||
ADMIN_ASSET_VERSION=db968ab-dirty-1779031350052
|
ADMIN_ASSET_VERSION=db968ab-dirty-1779031609756
|
||||||
|
|||||||
@@ -11640,7 +11640,7 @@
|
|||||||
"format": "esm"
|
"format": "esm"
|
||||||
},
|
},
|
||||||
"frontend/src/App.svelte": {
|
"frontend/src/App.svelte": {
|
||||||
"bytes": 45905,
|
"bytes": 46448,
|
||||||
"imports": [
|
"imports": [
|
||||||
{
|
{
|
||||||
"path": "node_modules/svelte/src/internal/server/index.js",
|
"path": "node_modules/svelte/src/internal/server/index.js",
|
||||||
@@ -11757,7 +11757,7 @@
|
|||||||
"imports": [],
|
"imports": [],
|
||||||
"exports": [],
|
"exports": [],
|
||||||
"inputs": {},
|
"inputs": {},
|
||||||
"bytes": 2552032
|
"bytes": 2552325
|
||||||
},
|
},
|
||||||
"api/hooks/lib/app.server.js": {
|
"api/hooks/lib/app.server.js": {
|
||||||
"imports": [
|
"imports": [
|
||||||
@@ -12567,10 +12567,10 @@
|
|||||||
"bytesInOutput": 1049
|
"bytesInOutput": 1049
|
||||||
},
|
},
|
||||||
"frontend/src/App.svelte": {
|
"frontend/src/App.svelte": {
|
||||||
"bytesInOutput": 15559
|
"bytesInOutput": 15747
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"bytes": 983431
|
"bytes": 983619
|
||||||
},
|
},
|
||||||
"api/hooks/lib/app.server.css.map": {
|
"api/hooks/lib/app.server.css.map": {
|
||||||
"imports": [],
|
"imports": [],
|
||||||
|
|||||||
@@ -0,0 +1,33 @@
|
|||||||
|
{
|
||||||
|
"data": [
|
||||||
|
{
|
||||||
|
"id": "6a09f082c6bc3af398907092",
|
||||||
|
"name": "Hero Image",
|
||||||
|
"group": "kategorie",
|
||||||
|
"color": "#4caf50",
|
||||||
|
"_testdata": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "6a09f082c6bc3af398907093",
|
||||||
|
"name": "Homepage",
|
||||||
|
"group": "kategorie",
|
||||||
|
"color": "#2196f3",
|
||||||
|
"_testdata": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "6a09f082c6bc3af398907094",
|
||||||
|
"name": "Natur",
|
||||||
|
"group": "kategorie",
|
||||||
|
"color": "#f44336",
|
||||||
|
"_testdata": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "6a09f082c6bc3af398907095",
|
||||||
|
"name": "Code",
|
||||||
|
"group": "system",
|
||||||
|
"color": "#9c27b0",
|
||||||
|
"_testdata": true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"count": 4
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user