From 49fc9b1d3b1edb62b99be1a8a44e62fcf5f9d4c0 Mon Sep 17 00:00:00 2001
From: bourgesl <bourges.laurent@gmail.com>
Date: Fri, 16 Mar 2018 13:45:43 +0100
Subject: [PATCH] adjusted look and feel for titles + use table-condensed

---
 resources/xsl/3.1/doi2landing.xsl | 45 +++++++++++++++++++------------
 1 file changed, 28 insertions(+), 17 deletions(-)

diff --git a/resources/xsl/3.1/doi2landing.xsl b/resources/xsl/3.1/doi2landing.xsl
index 9099403..9c0da5b 100644
--- a/resources/xsl/3.1/doi2landing.xsl
+++ b/resources/xsl/3.1/doi2landing.xsl
@@ -139,10 +139,9 @@
 
     <!-- DOI xml root = resource -->
     <xsl:template match="d:resource">
-        <!-- main information -->
-        <!--  table-condensed -->
-        <table class="table">
+        <table class="table table-condensed">
             <tbody>
+                <!-- main information -->
                 <xsl:apply-templates select="./*[local-name() = 'identifier'
                                                 or local-name() = 'creators'
                                                 or local-name() = 'titles'
@@ -221,24 +220,36 @@
 
     <!-- 3. Title(s) -->
     <xsl:template match="d:titles">
+        <xsl:if test="d:title[not(@titleType)]">
+            <xsl:apply-templates select="d:title[not(@titleType)]"/>
+        </xsl:if>
+        <xsl:if test="d:title[@titleType]">
+            <xsl:apply-templates select="d:title[@titleType]"/>
+        </xsl:if>
+    </xsl:template>
+
+    <xsl:template match="d:title">
+        <xsl:variable name="row_css">
+            <xsl:choose>
+                <xsl:when test="not(@titleType)">flabel</xsl:when>
+                <xsl:otherwise></xsl:otherwise>
+            </xsl:choose>
+        </xsl:variable>
         <tr class="active bold">
-            <th class="flabel">Titles</th>
+            <th class="{$row_css}">
+                <xsl:choose>
+                    <xsl:when test="@titleType">
+                        <xsl:value-of select="@titleType" />
+                    </xsl:when>
+                    <xsl:otherwise>Title</xsl:otherwise>
+                </xsl:choose>
+            </th>
             <td>
-                <xsl:apply-templates />
+                <xsl:value-of select="." />
             </td>
         </tr>
     </xsl:template>
 
-    <xsl:template match="d:title">
-        <xsl:value-of select="." />
-        <xsl:if test="@titleType">
-            <xsl:text> (</xsl:text>
-            <xsl:value-of select="@titleType" />
-            <xsl:text>)</xsl:text>
-        </xsl:if>
-        <br/>
-    </xsl:template>
-
 
     <!-- 4. Publisher -->
     <xsl:template match="d:publisher">
@@ -297,9 +308,9 @@
         <xsl:apply-templates select="./d:contributor[@contributorType = 'ProjectLeader']"/>
         <xsl:apply-templates select="./d:contributor[@contributorType = 'WorkPackageLeader']"/>
         <xsl:apply-templates select="./d:contributor[@contributorType = 'ProjectMember']"/>
+        <xsl:apply-templates select="./d:contributor[@contributorType = 'DataCollector']"/>
         <xsl:apply-templates select="./d:contributor[@contributorType = 'Other']"/>
         <xsl:apply-templates select="./d:contributor[@contributorType = 'RelatedPerson']"/>
-        <xsl:apply-templates select="./d:contributor[@contributorType = 'DataCollector']"/>
         <xsl:apply-templates select="./d:contributor[@contributorType = 'DataManager']"/>
         <xsl:apply-templates select="./d:contributor[@contributorType = 'Funder']"/>
         <xsl:apply-templates select="./d:contributor[@contributorType = 'Sponsor']"/>
@@ -312,9 +323,9 @@
                                         and @contributorType != 'ProjectLeader'
                                         and @contributorType != 'WorkPackageLeader'
                                         and @contributorType != 'ProjectMember'
+                                        and @contributorType != 'DataCollector'
                                         and @contributorType != 'Other'
                                         and @contributorType != 'RelatedPerson'
-                                        and @contributorType != 'DataCollector'
                                         and @contributorType != 'DataManager'
                                         and @contributorType != 'Funder'
                                         and @contributorType != 'Sponsor'
-- 
GitLab