Skip to content

Commit 3adb4d5

Browse files
committed
feat: Add partially possible reservation and subway
1 parent 718fe30 commit 3adb4d5

File tree

5 files changed

+38
-18
lines changed

5 files changed

+38
-18
lines changed

.opencode/command/update-traincategory.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,18 @@ A shortcode looks like:
1010
```
1111
{{% train-category
1212
title="title"
13-
type="highspeed" (can be highspeed, regional, bus, funicular, sleeper)
13+
type="highspeed" (can be highspeed, regional, subway, bus, funicular, sleeper)
1414
fip_accepted=true (can be true, false, partially)
1515
reservation_required=true (can be true, false, partially)
16-
reservation_possible=true (omit the attribute if false or if reservation_required is true)
16+
reservation_possible=true (can be true, false, partially; omit the attribute if false or if reservation_required is true)
1717
route_overview_url="https://example.com" (if there is an route overview link in the description, otherwise omit the attribute)
1818
additional_information_url="https://example.com" (if there is an additional information link in the description, otherwise omit the attribute)
1919
%}}
2020
{{% /train-category %}}
2121
```
2222

23+
Do not use brackets around boolean attributes like true and false. Place each attribute in a new line.
24+
2325
Important information (previously paragraphs that started with ⚠️ in the text) should be changed to an important highlight shortcut (in the same position as the text was before):
2426

2527
```
@@ -35,3 +37,7 @@ If there is a risk of confusion (previously marked with ℹ️ in the text), add
3537
```
3638

3739
Tranform the "**Reservation cost:**" (or language equivalent) section to a heading "### Reservation".
40+
41+
If there is additional information in the text that can't be represented in the shortcode, add the information to the text. For example "**Reservation required:** ⚠️ sometimes (marked with _R_)" becomes "A reservation is required for some trains (marked with _R_)."
42+
43+
Make sure to remove the old expanders after adding the shortcode.

i18n/de.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ trainCategory:
111111
importantInformation: Wichtige Informationen
112112
reservation:
113113
notPossible: Keine Reservierung möglich
114+
partiallyPossible: Reservierung teilweise möglich
114115
partiallyRequired: Reservierung teilweise erforderlich
115116
possible: Reservierung möglich
116117
required: Reservierung erforderlich

i18n/en.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ trainCategory:
107107
importantInformation: Important information
108108
reservation:
109109
notPossible: No reservation possible
110+
partiallyPossible: Reservation partially possible
110111
partiallyRequired: Reservation partially required
111112
possible: Reservation possible
112113
required: Reservation required

i18n/fr.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ trainCategory:
107107
importantInformation: Informations importantes
108108
reservation:
109109
notPossible: Aucune réservation possible
110+
partiallyPossible: Réservation partiellement possible
110111
partiallyRequired: Réservation partiellement requise
111112
possible: Réservation possible
112113
required: Réservation requise

layouts/partials/train-category.html

Lines changed: 27 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
{{ $iconMapping := dict
66
"highspeed" "train"
77
"regional" "directions_subway"
8+
"subway" "subway"
89
"sleeper" "hotel"
910
"funicular" "funicular"
1011
"bus" "directions_bus"
@@ -64,6 +65,14 @@
6465
"Type" "info"
6566
)
6667
}}
68+
{{- else if eq .reservation_possible "partially" -}}
69+
{{ partial "tag" (
70+
dict
71+
"Icon" "calendar_lock"
72+
"Text" "trainCategory.reservation.partiallyPossible"
73+
"Type" "info"
74+
)
75+
}}
6776
{{- else if eq .reservation_possible false -}}
6877
{{ partial "tag" (
6978
dict
@@ -100,21 +109,23 @@
100109
<hr aria-hidden="true" />
101110
<div class="o-expander__content o-train-category__content">
102111
{{- .content -}}
103-
{{- if .route_overview_url -}}
104-
{{- partial "button"
105-
(dict
106-
"Destination" .route_overview_url
107-
"Text" (T "trainCategory.routeOverview")
108-
)
109-
-}}
110-
{{- end -}}
111-
{{- if .additional_information_url -}}
112-
{{- partial "button"
113-
(dict
114-
"Destination" .additional_information_url
115-
"Text" (T "trainCategory.additionalInformation")
116-
)
117-
-}}
118-
{{- end -}}
112+
<div>
113+
{{- if .route_overview_url -}}
114+
{{- partial "button"
115+
(dict
116+
"Destination" .route_overview_url
117+
"Text" (T "trainCategory.routeOverview")
118+
)
119+
-}}
120+
{{- end -}}
121+
{{- if .additional_information_url -}}
122+
{{- partial "button"
123+
(dict
124+
"Destination" .additional_information_url
125+
"Text" (T "trainCategory.additionalInformation")
126+
)
127+
-}}
128+
{{- end -}}
129+
</div>
119130
</div>
120131
</details>

0 commit comments

Comments
 (0)