Fixing css (missing .), removing ifelse in pomen and removing plenty of unused tags.

Also, using css variables.
This commit is contained in:
Ozbolt Menegatti 2018-10-31 11:55:23 +01:00
parent 7d1e35486e
commit 2c70c47d5d

View File

@ -32,21 +32,38 @@
******************************** --> ******************************** -->
<xsl:variable name="global_style"> <xsl:variable name="global_style">
<style> <style type="text/css">
xslt-clanek { :root {
--light-gray: #999999;
--dark-gray: #666666
}
.xslt-clanek {
font-family: Verdana, sans-serif; font-family: Verdana, sans-serif;
font-size: 1rem; font-size: 1rem;
line-height: 1.5em; line-height: 1.5em;
} }
xslt-iztocnica { .xslt-iztocnica {
font-size: 1.15em; font-size: 1.15em;
color: #cc3366; color: #cc3366;
font-weight: bold; font-weight: bold;
} }
xslt-besedna-vrsta { .xslt-besedna-vrsta {
color: #666666; color: var(--dark-gray);
font-style: italic; font-style: italic;
} }
.xslt-pomen-top {
border-top: 1px dotted var(--light-gray);
padding-top: 0.5em;
margin-top: 0.5em;
}
.xslt-pomen-number {
float: left;
margin-left: 0.5em;
color: var(--light-gray);
font-weight: bold;
}
</style> </style>
</xsl:variable> </xsl:variable>
@ -55,6 +72,8 @@
Please dont polute xslt with it Please dont polute xslt with it
******************************** --> ******************************** -->
<!-- root tag, includes global script and tag -->
<xsl:template match="clanek"> <xsl:template match="clanek">
<xsl:copy-of select="$global_script" /> <xsl:copy-of select="$global_script" />
<xsl:copy-of select="$global_style" /> <xsl:copy-of select="$global_style" />
@ -94,51 +113,34 @@
<xsl:template match="frek_lema"/> <xsl:template match="frek_lema"/>
<xsl:template match="opombe"/> <xsl:template match="opombe"/>
<!-- END of HEAD (glava), go to BODY (geslo) -->
<xsl:template match="geslo"><xsl:apply-templates/></xsl:template> <xsl:template match="geslo"><xsl:apply-templates/></xsl:template>
<xsl:template match="pomen"> <xsl:template match="pomen">
<div style="border-top: 1px dotted #999999; padding-top: 0.5em; margin-top: 0.5em;"> <div class="xslt-pomen-top">
<div style="float: left; margin-left: 0.5em; color: #999999; font-weight: bold;"> <div class="xslt-pomen-number">
<xsl:choose> <xsl:number />
<xsl:when test="count(../pomen)&gt;1">
<xsl:value-of select="position()"/>
</xsl:when>
<xsl:otherwise>
</xsl:otherwise>
</xsl:choose>
</div> </div>
<div style="margin-left: 2em;"> <div style="margin-left: 2em;">
<xsl:apply-templates select="podpomen | indikator | oznaka | pomenska_shema"/> <xsl:apply-templates select="podpomen | indikator | oznaka | pomenska_shema"/>
<xsl:choose> <xsl:choose>
<xsl:when test="count(../pomen)&gt;1 and (skladenjske_skupine//text() | skladenjske_zveze//text() | stalne_zveze//text() | frazeoloske_zveze//text())"> <xsl:when test="count(../pomen)&gt;1 and skladenjske_skupine//text()">
<div style="padding: 0.5em 0;"> <div style="padding: 0.5em 0;">
<a class="morelessbutton" href="javascript:void(null)">▼ more</a> <a class="morelessbutton" href="javascript:void(null)">▼ more</a>
</div> </div>
<div class="hideable" style="display: none"> <div class="hideable" style="display: none">
<xsl:apply-templates select="skladenjske_skupine | skladenjske_zveze | stalne_zveze | frazeoloske_zveze"/> <xsl:apply-templates select="skladenjske_skupine"/>
</div> </div>
</xsl:when> </xsl:when>
<xsl:otherwise> <xsl:otherwise>
<xsl:apply-templates select="skladenjske_skupine | skladenjske_zveze | stalne_zveze | frazeoloske_zveze"/> <xsl:apply-templates select="skladenjske_skupine"/>
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>
</div> </div>
<div style="clear: left;"></div> <div style="clear: left;"></div>
</div> </div>
</xsl:template> </xsl:template>
<xsl:template match="stalne_zveze[not(ancestor::pomen)] | frazeoloske_zveze[not(ancestor::pomen)]">
<div style="border-top: 1px dotted #999999; padding-top: 0.5em; margin-top: 0.5em;">
<xsl:apply-templates/>
</div>
</xsl:template>
<xsl:template match="stalne_zveze[ancestor::pomen] | frazeoloske_zveze[ancestor::pomen]">
<div style="margin: 0.5em 0;">
<xsl:apply-templates/>
</div>
</xsl:template>
<xsl:template match="podpomen"> <xsl:template match="podpomen">
<xsl:variable name="pomenNum"> <xsl:variable name="pomenNum">
@ -151,19 +153,13 @@
</div> </div>
</xsl:template> </xsl:template>
<xsl:template match="skladenjska_struktura | skladenjska_zveza"> <xsl:template match="skladenjska_struktura">
<div style="margin: 0.5em 0; border-left: 8px solid #eeeeee; padding: 0 0 0 0.75em;"> <div style="margin: 0.5em 0; border-left: 8px solid #eeeeee; padding: 0 0 0 0.75em;">
<xsl:apply-templates/> <xsl:apply-templates/>
</div> </div>
</xsl:template> </xsl:template>
<xsl:template match="frazeoloska_enota | stalna_zveza">
<div>
<xsl:apply-templates/>
</div>
</xsl:template>
<xsl:template match="kolokacija | r_kolokacija | skladenjska_zveza//zveza"> <xsl:template match="kolokacija | r_kolokacija">
<xsl:text xml:space="preserve"> </xsl:text> <xsl:text xml:space="preserve"> </xsl:text>
<span style="color: #cc3366;"> <span style="color: #cc3366;">
<xsl:apply-templates/> <xsl:apply-templates/>
@ -176,7 +172,6 @@
<xsl:apply-templates/> <xsl:apply-templates/>
</xsl:template> </xsl:template>
<xsl:template match="kolokacije//ks"> <xsl:template match="kolokacije//ks">
<xsl:text xml:space="preserve"> (</xsl:text> <xsl:text xml:space="preserve"> (</xsl:text>
<xsl:apply-templates/> <xsl:apply-templates/>
@ -188,14 +183,6 @@
<xsl:text xml:space="preserve">, </xsl:text> <xsl:text xml:space="preserve">, </xsl:text>
</xsl:template> </xsl:template>
<xsl:template match="enota | stalna_zveza//zveza">
<xsl:text xml:space="preserve"> </xsl:text>
<span style="color: #cc3366; font-weight: bold;">
<xsl:apply-templates/>
</span>
<xsl:text xml:space="preserve"> </xsl:text>
</xsl:template>
<xsl:template match="indikator | oznaka"> <xsl:template match="indikator | oznaka">
<xsl:text xml:space="preserve"> </xsl:text> <xsl:text xml:space="preserve"> </xsl:text>
<span style="color: #999999; font-style: italic; text-transform: uppercase"> <span style="color: #999999; font-style: italic; text-transform: uppercase">
@ -209,25 +196,13 @@
<xsl:template match="definicija2"/> <xsl:template match="definicija2"/>
<xsl:template match="struktura"/> <xsl:template match="struktura"/>
<xsl:template match="vzorec"/>
<xsl:template match="zgledi"> <xsl:template match="zgledi">
<div style="margin: 0.5em 0;"> <div style="margin: 0.5em 0;">
<xsl:apply-templates/> <xsl:apply-templates/>
</div> </div>
</xsl:template> </xsl:template>
<xsl:template match="vecjez[zgled]"> <xsl:template match="zgled[not(parent::vecjez)]">
<div>
<div style="float: left; margin-left: 0.5em; color: #999999; font-weight: bold;">
»
</div>
<div style="margin-left: 2em;">
<xsl:apply-templates/>
</div>
<div style="clear: left;"></div>
</div>
</xsl:template>
<xsl:template match="vecjez[zgled] | zgled[not(parent::vecjez)]">
<div> <div>
<div style="float: left; margin-left: 0.5em; color: #999999; font-weight: bold;"> <div style="float: left; margin-left: 0.5em; color: #999999; font-weight: bold;">
» »