Skip to content

Commit

Permalink
BGDIDIC-2867: fix if-else tests
Browse files Browse the repository at this point in the history
  • Loading branch information
faselm committed Oct 22, 2024
1 parent 1f2e430 commit 51df7e0
Showing 1 changed file with 15 additions and 17 deletions.
32 changes: 15 additions & 17 deletions chsdi/templates/htmlpopup/stopo_geologie_thermale_waesser.mako
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,9 @@
<%def name="table_body(c, lang)">
<%
lang = lang if lang in ('fr','it','en') else 'de'
category_text = 'category_%s' % lang
mineralisation_text = 'mineralisation_%s' % lang
use_text = 'use_%s' % lang
%>
<tr>
<td class="cell-left">${_(f'ch.swisstopo.geologie-thermale_waesser.category')}</td>
<td>${c['attributes'][category_text] or '-'}</td>
</tr>
<tr>
<td class="cell-left">${_(f'ch.swisstopo.geologie-thermale_waesser.name')}</td>
<td>${c['attributes']['name'] or '-'}</td>
Expand All @@ -32,7 +27,7 @@
<td>${c['attributes']['ph'] or '-'}</td>
</tr>
<tr>
<td class="cell-left">${_(f'ch.swisstopo.geologie-thermale_waesser.mineralisation_')}</td>
<td class="cell-left">${_(f'ch.swisstopo.geologie-thermale_waesser.mineralisation')}</td>
<td>${c['attributes'][mineralisation_text] or '-'}</td>
</tr>
<tr>
Expand All @@ -48,18 +43,13 @@
<%def name="extended_info(c, lang)">
<%
lang = lang if lang in ('fr','it','en') else 'de'
category_text = 'category_%s' % lang
mineralisation_text = 'mineralisation_%s' % lang
use_text = 'use_%s' % lang
annot_text = 'annot_%s' % lang
hydrogeologic_unit_text = 'hydrogeologic_unit_%s' % lang
%>
<table class="table-with-border" cellpadding="5">
<tr>
<td class="cell-left">${_(f'ch.swisstopo.geologie-thermale_waesser.category')}</td>
<td>${c['attributes'][category_text] or '-'}</td>
</tr>
<tr>
<td class="cell-left">${_(f'ch.swisstopo.geologie-thermale_waesser.name')}</td>
<td>${c['attributes']['name'] or '-'}</td>
Expand All @@ -85,7 +75,7 @@
<td>${c['attributes']['ec'] or '-'}</td>
</tr>
<tr>
<td class="cell-left">${_(f'ch.swisstopo.geologie-thermale_waesser.mineralisation_')}</td>
<td class="cell-left">${_(f'ch.swisstopo.geologie-thermale_waesser.mineralisation')}</td>
<td>${c['attributes'][mineralisation_text] or '-'}</td>
</tr>
<tr>
Expand Down Expand Up @@ -122,11 +112,19 @@
</tr>
<tr>
<td class="cell-left">${_(f'ch.swisstopo.geologie-thermale_waesser.src_link')}</td>
<td>${c['attributes']['src_link'] or '-'}</td>
% if c['attributes']['src_link'].startswith('http'):
<td><a href="${c['attributes']['src_link']}" target="_blank">${c['attributes']['src_link']}</a></td>
% else:
<td>-</td>
% endif
</tr>
<tr>
<td class="cell-left">${_(f'ch.swisstopo.geologie-thermale_waesser.download')}</td>
<td>${c['attributes']['download'] or '-'}</td>
% if c['attributes']['download'].startswith('http'):
<td><a href="${c['attributes']['download']}" target="_blank">${c['attributes']['download']}</a></td>
% else:
<td>-</td>
% endif
</tr>
<tr>
<td class="cell-left">${_(f'ch.swisstopo.geologie-thermale_waesser.swissgeol')}</td>
Expand All @@ -140,12 +138,12 @@
<td class="cell-left">${_(f'ch.swisstopo.geologie-thermale_waesser.boreholes_swissgeol')}</td>
<td>${c['attributes']['boreholes_swissgeol'] or '-'}</td>
</tr>
%if c['attributes']['category_de'] == 'Quelle':
% if c['attributes']['category_de'] == 'Quelle':
<tr>
<td class="cell-left">${_(f'ch.swisstopo.geologie-thermale_waesser.catchwork_type')}</td>
<td>${c['attributes']['catchwork_type_de'] or '-'}</td>
</tr>
%else if c['attributes']['category_de'] == 'Tunnel':
% elif c['attributes']['category_de'] == 'Tunnel':
<tr>
<td class="cell-left">${_(f'ch.swisstopo.geologie-thermale_waesser.rock_overlay')}</td>
<td>${c['attributes']['rock_overlay'] or '-'}</td>
Expand All @@ -158,7 +156,7 @@
<td class="cell-left">${_(f'ch.swisstopo.geologie-thermale_waesser.ref_portal')}</td>
<td>${c['attributes']['ref_portal'] or '-'}</td>
</tr>
%else if c['attributes']['category_de'] == 'Borehole':
%elif c['attributes']['category_de'] == 'Borehole':
<tr>
<td class="cell-left">${_(f'ch.swisstopo.geologie-thermale_waesser.borehole_name')}</td>
<td>${c['attributes']['borehole_name'] or '-'}</td>
Expand Down

0 comments on commit 51df7e0

Please sign in to comment.