|
10 | 10 | </div> |
11 | 11 |
|
12 | 12 | <div class="cards-row"> |
| 13 | + |
| 14 | + {% set prefix = "/de" if locale == "de" else "" %} |
| 15 | + |
13 | 16 | {# Loop through the partners.projects array. The variable "partner" represents the current project item. #} |
14 | 17 | {% for partner in partners.projects %} |
| 18 | + |
15 | 19 | {# Insert section heading before the 4th project #} |
16 | 20 | {% if loop.index == 4 %} |
17 | 21 | <div class="related-services-section"> |
|
24 | 28 | {# Localize partner text/description and prepare a clean URL for later use in the template #} |
25 | 29 | {% set text = partner.text | localize %} |
26 | 30 | {% set description = partner.description | localize %} |
27 | | - {% set partner_url = partner.url | url %} |
| 31 | + |
| 32 | + {# Localize coli-conc pages: EN => /..., DE => /de/... #} |
| 33 | + {% if partner.url and partner.url.startsWith("https://coli-conc.gbv.de/") %} |
| 34 | + {% set path = partner.url | replace("https://coli-conc.gbv.de", "") %} |
| 35 | + {% set partner_url = prefix ~ path %} |
| 36 | + {% else %} |
| 37 | + {% set partner_url = partner.url %} |
| 38 | + {% endif %} |
28 | 39 |
|
29 | 40 | {# Helper variable for the title conditional below #} |
30 | 41 | {% set text_norm = (text | string | trim | lower) %} |
31 | 42 |
|
32 | | - {# Render title with special handling for "Metadata / Vocabulary Hosting Services" #} |
33 | 43 | <div class="project-card-header"> |
34 | 44 | {% if text|trim == "Metadata / Vocabulary Hosting Services" %} |
35 | 45 | <span class="project-card-title font-size-large">{{ text }}</span> |
36 | 46 | {% else %} |
37 | | - <a href="{{ partner_url }}" class="project-card-title font-size-large"> |
38 | | - {{ text }} |
39 | | - </a> |
| 47 | + <a href="{{ partner_url }}" class="project-card-title font-size-large"> |
| 48 | + {{ text }} |
| 49 | + </a> |
40 | 50 | {% endif %} |
41 | 51 | </div> |
42 | 52 |
|
43 | 53 | {# Prepare and render project action buttons #} |
44 | 54 | {% set btns = partner.buttons %} |
45 | 55 |
|
46 | | - {# Render action buttons if button data is available. |
47 | | - Each button (Info / Start) is rendered only if its URL exists. |
48 | | - #} |
49 | 56 | {% if btns %} |
50 | 57 | <div class="project-card-actions"> |
| 58 | + |
| 59 | + {# Info button: localize coli-conc pages, but keep /app/ links unchanged #} |
51 | 60 | {% if btns.info %} |
52 | | - <a href="{{ btns.info }}" class="button">Info</a> |
| 61 | + {% if "/app/" in btns.info %} |
| 62 | + <a href="{{ btns.info }}" class="button">Info</a> |
| 63 | + {% elif btns.info.startsWith("https://coli-conc.gbv.de/") %} |
| 64 | + {% set infoPath = btns.info | replace("https://coli-conc.gbv.de", "") %} |
| 65 | + <a href="{{ prefix ~ infoPath }}" class="button">Info</a> |
| 66 | + {% else %} |
| 67 | + <a href="{{ btns.info }}" class="button">Info</a> |
| 68 | + {% endif %} |
53 | 69 | {% endif %} |
| 70 | + |
| 71 | + {# Start button: keep /app/ links unchanged, localize other coli-conc pages #} |
54 | 72 | {% if btns.start %} |
55 | | - <a href="{{ btns.start }}" class="button">Start</a> |
| 73 | + {% if "/app/" in btns.start %} |
| 74 | + <a href="{{ btns.start }}" class="button">Start</a> |
| 75 | + {% elif btns.start.startsWith("https://coli-conc.gbv.de/") %} |
| 76 | + {% set startPath = btns.start | replace("https://coli-conc.gbv.de", "") %} |
| 77 | + <a href="{{ prefix ~ startPath }}" class="button">Start</a> |
| 78 | + {% else %} |
| 79 | + <a href="{{ btns.start }}" class="button">Start</a> |
| 80 | + {% endif %} |
56 | 81 | {% endif %} |
| 82 | + |
57 | 83 | </div> |
58 | 84 | {% endif %} |
59 | 85 |
|
60 | | - {# Render the localized project description #} |
61 | 86 | <p class="project-card-description">{{ description }}</p> |
62 | 87 |
|
63 | 88 | {# Render project-specific related links based on project type #} |
64 | 89 | {% if partner_url and ("cocoda" in partner_url) %} |
65 | 90 | <ul class="project-card-list"> |
66 | | - <li><a href="https://coli-conc.gbv.de/cocoda/">Cocoda</a></li> |
67 | | - <li><a href="https://coli-conc.gbv.de/terminologies/">KOS Registry</a></li> |
68 | | - <li><a href="https://coli-conc.gbv.de/concordances/">Concordance Registry</a></li> |
69 | | - <li><a href="https://coli-conc.gbv.de/ccmapper/">CCMapper</a></li> |
| 91 | + <li><a href="{{ prefix ~ '/cocoda/' }}">Cocoda</a></li> |
| 92 | + <li><a href="{{ prefix ~ '/terminologies/' }}">KOS Registry</a></li> |
| 93 | + <li><a href="{{ prefix ~ '/concordances/' }}">Concordance Registry</a></li> |
| 94 | + <li><a href="{{ prefix ~ '/ccmapper/' }}">CCMapper</a></li> |
70 | 95 | </ul> |
71 | 96 | {% elif "vocabulary hosting services" in (text | string | lower) %} |
72 | 97 | <ul class="project-card-list"> |
|
97 | 122 | > |
98 | 123 | </div> |
99 | 124 | {% endif %} |
| 125 | + |
100 | 126 | </div> |
| 127 | + |
101 | 128 | {% endfor %} |
| 129 | + |
102 | 130 | </div> |
103 | 131 | </div> |
0 commit comments