✨ feat: update collection metadata and add tags collection with test data
This commit is contained in:
@@ -2,7 +2,8 @@ name: comments
|
||||
meta:
|
||||
label: { de: "Kommentare", en: "Comments" }
|
||||
muiIcon: chat
|
||||
group: content
|
||||
group: community
|
||||
imageUrl: "https://images.unsplash.com/photo-1516321318423-f06f85e504b3?auto=format&fit=crop&q=80&w=800"
|
||||
preview:
|
||||
label: author
|
||||
secondary: message
|
||||
|
||||
@@ -6,8 +6,9 @@ name: content
|
||||
uploadPath: ../media/content
|
||||
meta:
|
||||
label: { de: "Inhalte", en: "Content" }
|
||||
muiIcon: article
|
||||
muiIcon: description
|
||||
group: content
|
||||
imageUrl: "https://images.unsplash.com/photo-1499750310107-5fef28a66643?auto=format&fit=crop&q=80&w=800"
|
||||
preview:
|
||||
label: name
|
||||
secondary: path
|
||||
|
||||
@@ -6,8 +6,9 @@ name: medialib
|
||||
uploadPath: ../media/medialib
|
||||
meta:
|
||||
label: { de: "Mediathek", en: "Media Library" }
|
||||
muiIcon: image_multiple
|
||||
group: media
|
||||
muiIcon: perm_media
|
||||
group: content
|
||||
imageUrl: "https://images.unsplash.com/photo-1542204165-65bf26472b9b?auto=format&fit=crop&q=80&w=800"
|
||||
viewHint:
|
||||
media:
|
||||
ai:
|
||||
@@ -22,13 +23,10 @@ meta:
|
||||
file: file
|
||||
preview:
|
||||
label: title
|
||||
secondary: description
|
||||
tertiary: tags
|
||||
secondary: tags
|
||||
tertiary: description
|
||||
image: file
|
||||
table:
|
||||
- file
|
||||
- title
|
||||
- tags
|
||||
mediaFile: file
|
||||
subNavigation:
|
||||
- name: images
|
||||
label: { de: "Bilder", en: "Images" }
|
||||
@@ -134,8 +132,10 @@ fields:
|
||||
- name: tags
|
||||
type: string[]
|
||||
meta:
|
||||
label: { de: "Tags", en: "Tags" }
|
||||
widget: chipArray
|
||||
label: { de: "Schlagwörter", en: "Tags" }
|
||||
widget: foreignKey
|
||||
foreign:
|
||||
collection: tags
|
||||
- name: _testdata
|
||||
type: boolean
|
||||
meta:
|
||||
|
||||
@@ -6,7 +6,8 @@ name: navigation
|
||||
meta:
|
||||
label: { de: "Navigation", en: "Navigation" }
|
||||
muiIcon: menu
|
||||
group: structure
|
||||
group: content
|
||||
imageUrl: "https://images.unsplash.com/photo-1506784926709-22f1ec395907?auto=format&fit=crop&q=80&w=800"
|
||||
viewHint:
|
||||
navigation:
|
||||
nodesField: elements
|
||||
|
||||
@@ -5,8 +5,9 @@
|
||||
name: ssr
|
||||
meta:
|
||||
label: { de: "SSR Dummy", en: "ssr dummy" }
|
||||
muiIcon: server
|
||||
muiIcon: storage
|
||||
group: system
|
||||
imageUrl: "https://images.unsplash.com/photo-1518770660439-4636190af475?auto=format&fit=crop&q=80&w=800"
|
||||
hide: true
|
||||
|
||||
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
|
||||
Reference in New Issue
Block a user