[Dive4elements-commits] [PATCH 2 of 2] Add location handling in waterlevels-fix macro

Wald Commits scm-commit at wald.intevation.org
Thu Jun 13 10:04:07 CEST 2013


# HG changeset patch
# User Andre Heinecke <aheinecke at intevation.de>
# Date 1371110461 -7200
# Node ID 3cf9e82b9c7577a55c86fca8a6cd4ea33ea31f5a
# Parent  f49749526af458c34d501e1942dec9f0911e96d5
Add location handling in waterlevels-fix macro

    For uesk calculations don't show locations
    For everything else change the description when we are
    at a location

diff -r f49749526af4 -r 3cf9e82b9c75 artifacts/doc/conf/meta-data.xml
--- a/artifacts/doc/conf/meta-data.xml	Thu Jun 13 09:43:50 2013 +0200
+++ b/artifacts/doc/conf/meta-data.xml	Thu Jun 13 10:01:01 2013 +0200
@@ -672,14 +672,22 @@
 
     <dc:comment>TODO doesnt work nicely for fix/wq-diags. Aheinecke (27.5.2013): Why?</dc:comment>
     <dc:macro name="waterlevels-fix">
-      <dc:filter expr="$out_name = 'longitudinal_section' and $facet_name = 'longitudinal_section.w'">
+      <dc:filter expr="($out_name = 'longitudinal_section' and $facet_name = 'longitudinal_section.w') and
+        (not ($current-state-id = 'state.winfo.uesk.wsp' and $ld_m = 'location'))">
         <dc:if test="dc:has-result()">
           <waterlevels>
             <dc:group expr="concat($river, ' ', dc:date-format('dd.MM.yyyy - H:m:s', $a_creation), ' ', $collection_name)">
               <waterlevels description="{dc:group-key()}">
                 <dc:for-each>
-                  <dc:variable name="combined_desc" expr="concat($facet_description, ' von KM ',
-                    $deffrom, ' bis KM ', $defto)"/>
+                  <dc:choose>
+                    <dc:when test="$ld_m = 'location'">
+                      <dc:variable name="combined_desc" expr="concat($facet_description, ' an KM ', $deffrom)"/>
+                    </dc:when>
+                    <dc:otherwise>
+                      <dc:variable name="combined_desc" expr="concat($facet_description, ' von KM ',
+                        $deffrom, ' bis KM ', $defto)"/>
+                    </dc:otherwise>
+                  </dc:choose>
                   <dc:element name="${facet_name}">
                     <dc:attribute name="description" value="${combined_desc}"/>
                     <dc:attribute name="ids" value="${facet_num}"/>


More information about the Dive4elements-commits mailing list