Unified detail views, model

This commit is contained in:
Christoph Hagen
2024-12-16 09:54:21 +01:00
parent 1e67a99866
commit 31d1ecb8bd
57 changed files with 853 additions and 954 deletions

View File

@ -9,8 +9,10 @@ extension Post {
startDate: .now,
endDate: nil,
tags: [],
german: .init(content: "Text"),
english: .init(content: "Text"),
german: .init(content: .mock,
text: "Text"),
english: .init(content: .mock,
text: "Text"),
linkedPage: nil)
}
@ -23,8 +25,14 @@ extension Post {
startDate: .now,
endDate: nil,
tags: [.nature, .sports, .hiking],
german: .init(title: "Der Titel", content: "Sehr schöne und einsame Tour von Oberau zum Krottenkopf. Abwechslungsreich und stellenweise fordernd, aufgrund der Länge und der Höhenmeter auch anstrengend."),
english: .init(title: "The title", content: "Very nice and solitary hike from Oberau to Krottenkopf. Challenging and rewarding, due to the length and height")
german: .init(
content: .mock,
title: "Der Titel",
text: "Sehr schöne und einsame Tour von Oberau zum Krottenkopf. Abwechslungsreich und stellenweise fordernd, aufgrund der Länge und der Höhenmeter auch anstrengend."),
english: .init(
content: .mock,
title: "The title",
text: "Very nice and solitary hike from Oberau to Krottenkopf. Challenging and rewarding, due to the length and height")
)
}
@ -44,12 +52,14 @@ extension Post {
extension LocalizedPost {
static let german = LocalizedPost(
content: .mock,
title: "Ein langer Titel",
content: "Sehr schöne und einsame Tour von Oberau zum Krottenkopf. Abwechslungsreich und stellenweise fordernd, aufgrund der Länge und der Höhenmeter auch anstrengend.",
text: "Sehr schöne und einsame Tour von Oberau zum Krottenkopf. Abwechslungsreich und stellenweise fordernd, aufgrund der Länge und der Höhenmeter auch anstrengend.",
images: MockImage.images)
static let english = LocalizedPost(
content: .mock,
title: "A longer title",
content: "Very nice and solitary hike from Oberau to Krottenkopf. Challenging and rewarding, due to the length and height.",
text: "Very nice and solitary hike from Oberau to Krottenkopf. Challenging and rewarding, due to the length and height.",
images: MockImage.images)
}

View File

@ -11,35 +11,36 @@ extension Tag {
static let nature = Tag(
content: .mock,
id: "nature",
german: .init(urlComponent: "natur", name: "Natur"),
english: .init(urlComponent: "nature", name: "Nature")
german: .init(content: .mock, urlComponent: "natur", name: "Natur"),
english: .init(content: .mock, urlComponent: "nature", name: "Nature")
)
static let sports = Tag(
content: .mock,
id: "sports",
german: .init(urlComponent: "sport", name: "Sport"),
english: .init(urlComponent: "sports", name: "Sports")
german: .init(content: .mock, urlComponent: "sport", name: "Sport"),
english: .init(content: .mock, urlComponent: "sports", name: "Sports")
)
static let hiking = Tag(
content: .mock,
id: "hiking",
german: .init(urlComponent: "wandern", name: "Wandern"),
english: .init(urlComponent: "hiking", name: "Hiking")
german: .init(content: .mock, urlComponent: "wandern", name: "Wandern"),
english: .init(content: .mock, urlComponent: "hiking", name: "Hiking")
)
static let mountains = Tag(
content: .mock,
id: "mountains",
german: .init(urlComponent: "berge", name: "Berge"),
english: .init(urlComponent: "mountains", name: "Mountains")
german: .init(content: .mock, urlComponent: "berge", name: "Berge"),
english: .init(content: .mock, urlComponent: "mountains", name: "Mountains")
)
}
extension LocalizedTag {
static let english = LocalizedTag(
content: .mock,
urlComponent: "electronics",
name: "Electronics",
subtitle: "Projects with electronics",
@ -48,6 +49,7 @@ extension LocalizedTag {
originalUrl: "projects/electronics")
static let german = LocalizedTag(
content: .mock,
urlComponent: "elektronik",
name: "Elektronik",
subtitle: "Projekte mit Elektronik",