Skip to content

Commit

Permalink
BGDIDIC-1408: Tooltip for snowshoe and tourenski
Browse files Browse the repository at this point in the history
  • Loading branch information
rebert committed Oct 24, 2024
1 parent f9ea0ef commit cde3bf9
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 30 deletions.
12 changes: 6 additions & 6 deletions chsdi/models/vector/stopo.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,10 +244,12 @@ class DosisleistungTerrestrisch(Base, Vector):

register('ch.swisstopo.geologie-dosisleistung-terrestrisch', DosisleistungTerrestrisch)


class SchneeRouten:
__table_args__ = ({'schema': 'karto', 'autoload': False})
__label__ = 'target_name'
id = Column('bgdi_id', Integer, primary_key=True)
__template__ = 'templates/htmlpopup/karto_schneerouten.mako'
id = Column('route_uuid', Unicode, primary_key=True)
target_name = Column('target_name', Unicode)
target_altitude = Column('target_altitude', Integer)
name = Column('name', Unicode)
Expand All @@ -267,21 +269,20 @@ class SchneeRouten:
url_sac_it = Column('url_sac_it', Unicode)
url_sac_en = Column('url_sac_en', Unicode)
source_url = Column('source_url', Unicode)
source_txt = Column('source_url', Unicode)
source_txt = Column('source_txt', Unicode)
the_geom = Column(Geometry2D)


class SkiTouren(Base, SchneeRouten, Vector):
__tablename__ = 'ski_routes'
__template__ = 'templates/htmlpopup/karto_skitouren.mako'
__bodId__ = 'ch.swisstopo-karto.skitouren'


register(SkiTouren.__bodId__, SkiTouren)


class SchneeSchuhRouten(Base, SchneeRouten, Vector):
__tablename__ = 'shnowshoe_routes'
__template__ = 'templates/htmlpopup/karto_schneeschuhrouten.mako'
__tablename__ = 'snowshoe_routes'
__bodId__ = 'ch.swisstopo-karto.schneeschuhrouten'


Expand Down Expand Up @@ -313,7 +314,6 @@ class Landesschwerenetz:
the_geom = Column(Geometry2D)



class LandesschwerenetzZoom1(Base, Landesschwerenetz, Vector):
__tablename__ = 'landesschwerenetz'
__minscale__ = 1
Expand Down
27 changes: 27 additions & 0 deletions chsdi/templates/htmlpopup/karto_schneerouten.mako
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<%inherit file="base.mako"/>

<%def name="table_body(c, lang)">
<%
lang = lang if lang in ('fr', 'it', 'en') else 'de'
name = 'name_%s' % lang
difficulty = 'difficulty_%s' % lang
url_sac = 'url_sac_%s' % lang
%>
<% c['stable_id'] = True %>
% if c['attributes']['source_url']:
<tr><td class="cell-left">${_('ch.swisstopo-karto.skitouren.name')}</td> <td>${c['attributes'][name] or c['attributes']['name'] or '-'}</td></tr>
<tr><td class="cell-left">${_('ch.swisstopo-karto.skitouren.source_txt')}</td> <td><a target="_blank" href="${c['attributes']['source_url']}">${c['attributes']['source_txt'] or 'link'}</td></tr>
% else:
<tr><td class="cell-left">${_('ch.swisstopo-karto.skitouren.summit')}</td> <td>${c['attributes']['target_name']} (${c['attributes']['target_altitude'] or '-'} m)</td></tr>
<tr><td class="cell-left">${_('ch.swisstopo-karto.skitouren.name')}</td> <td>${c['attributes'][name] or c['attributes']['name'] or '-'}</td></tr>
<tr><td class="cell-left">${_('ch.swisstopo-karto.skitouren.difficulty')}</td> <td>${c['attributes'][difficulty] or '-'}</td></tr>
<tr><td class="cell-left">${_('ch.swisstopo-karto.skitouren.ascent')}</td> <td>${c['attributes']['ascent_time_label'] or '-'}, ${c['attributes']['ascent_altitude'] or '-'} Hm</td></tr>
<tr><td class="cell-left">${_('ch.swisstopo-karto.skitouren.descent')}</td> <td>${c['attributes']['descent_altitude'] or '-'} Hm</td></tr>
% if c['attributes'][url_sac]:
<tr><td class="cell-left">${_('ch.swisstopo-karto.skitouren.info')}</td> <td><a target="_blank" href="${c['attributes'][url_sac]}">${_('ch.swisstopo-karto.skitouren.info')}</a></td></tr>
% else:
<tr><td class="cell-left">${_('ch.swisstopo-karto.skitouren.info')}</td> <td>-</td></tr>
% endif
% endif
</%def>
12 changes: 0 additions & 12 deletions chsdi/templates/htmlpopup/karto_schneeschuhrouten.mako

This file was deleted.

12 changes: 0 additions & 12 deletions chsdi/templates/htmlpopup/karto_skitouren.mako

This file was deleted.

0 comments on commit cde3bf9

Please sign in to comment.