From 6982d1820e0be63b55b94ef7ad64fa486fcaf5d6 Mon Sep 17 00:00:00 2001
From: Martin Goik <goik@hdm-stuttgart.de>
Date: Fri, 8 Dec 2017 10:42:44 +0100
Subject: [PATCH] Configurable link slides to html

---
 ws/Docbook/CustomLayer/slide/slideHdm.xsl | 64 ++++++++++++-----------
 ws/Docbook/Preprocess/make.rules          |  2 +-
 2 files changed, 35 insertions(+), 31 deletions(-)

diff --git a/ws/Docbook/CustomLayer/slide/slideHdm.xsl b/ws/Docbook/CustomLayer/slide/slideHdm.xsl
index 743343bb4..dba79ada4 100644
--- a/ws/Docbook/CustomLayer/slide/slideHdm.xsl
+++ b/ws/Docbook/CustomLayer/slide/slideHdm.xsl
@@ -13,6 +13,7 @@
   
   <xsl:variable name="topicLookup" select="document('topics.tid.xml', .)"/>
   
+  <xsl:param name="slide2lectureref"/>
   <xsl:template match="/">    
     
     <xsl:apply-templates select="(//d:chapter | //d:section | //d:appendix) [contains(@annotations, 'slide') or descendant::*[contains(@annotations, 'slide')]]"
@@ -175,17 +176,18 @@
                   </xsl:attribute>              
                 </img>
               </div>
-              
-              <div class ="hdmfooter">
-                <p>
-                  <a target="_blank">
-                    <xsl:attribute name="href">
-                      <xsl:call-template name="href.target.uri"/>
-                    </xsl:attribute>
-                    <xsl:text>Lecture notes</xsl:text>
-                  </a>
-                </p>
-              </div>              
+              <xsl:if test="not($slide2lectureref = 'no')">                
+                <div class ="hdmfooter">
+                  <p>
+                    <a target="_blank">
+                      <xsl:attribute name="href">
+                        <xsl:call-template name="href.target.uri"/>
+                      </xsl:attribute>
+                      <xsl:text>Lecture notes</xsl:text>
+                    </a>
+                  </p>
+                </div>              
+              </xsl:if>
             </section>
         </xsl:for-each>
       </xsl:when>
@@ -195,29 +197,31 @@
           
           <xsl:apply-templates select="."/>
           
-          <div class ="hdmfooter">
-            <p>
-              <a target="_blank">
-                <xsl:attribute name="href">
-                  <xsl:call-template name="href.target.uri"/>
-                </xsl:attribute>
-                <xsl:text>Lecture notes</xsl:text>
-              </a>
-              <xsl:variable name="qandaId" select="@xml:id"/>
-              <xsl:if test="$topicLookup/map/entry[@id = $qandaId]">
-                <xsl:text> | </xsl:text>        
-                <xsl:variable name="tid" select="$topicLookup/map/entry[@id = $qandaId]/@tid"/>
+          <xsl:if test="not($slide2lectureref = 'no')">
+            <div class ="hdmfooter">
+              <p>
                 <a target="_blank">
                   <xsl:attribute name="href">
-                    <xsl:text>https://bb.mi.hdm-stuttgart.de/topic/</xsl:text>
-                    <xsl:value-of select="$tid"/>
+                    <xsl:call-template name="href.target.uri"/>
                   </xsl:attribute>
-                  <img src="common/images/comment.svg" width="30ex" style="border: 0mm;"/>
-                  <xsl:text> create comment</xsl:text>
+                  <xsl:text>Lecture notes</xsl:text>
                 </a>
-              </xsl:if>        
-            </p>
-          </div>
+                <xsl:variable name="qandaId" select="@xml:id"/>
+                <xsl:if test="$topicLookup/map/entry[@id = $qandaId]">
+                  <xsl:text> | </xsl:text>        
+                  <xsl:variable name="tid" select="$topicLookup/map/entry[@id = $qandaId]/@tid"/>
+                  <a target="_blank">
+                    <xsl:attribute name="href">
+                      <xsl:text>https://bb.mi.hdm-stuttgart.de/topic/</xsl:text>
+                      <xsl:value-of select="$tid"/>
+                    </xsl:attribute>
+                    <img src="common/images/comment.svg" width="30ex" style="border: 0mm;"/>
+                    <xsl:text> create comment</xsl:text>
+                  </a>
+                </xsl:if>        
+              </p>
+            </div>
+          </xsl:if>
         </section>
       </xsl:otherwise>      
     </xsl:choose>
diff --git a/ws/Docbook/Preprocess/make.rules b/ws/Docbook/Preprocess/make.rules
index 10aa2bbab..8a7e5d46a 100644
--- a/ws/Docbook/Preprocess/make.rules
+++ b/ws/Docbook/Preprocess/make.rules
@@ -40,7 +40,7 @@ fop1.extensions=1 \
 paper.type=A4
 
 # Slide related Docbook transformation parameter
-dbookXslSlideParam=${dbookXslCommonParam}
+dbookXslSlideParam=${dbookXslCommonParam} ${extraSlideParam}
 
 # Epub related Docbook transformation parameter
 dbookXslEpubParam=${dbookXslCommonParam} \
-- 
GitLab