include social links in news articles

svn path=/trunk/; revision=26005
This commit is contained in:
paul 2013-07-18 16:08:06 +00:00
parent 293e7f6550
commit 90184517d8
2 changed files with 55 additions and 2 deletions

View File

@ -212,7 +212,30 @@
<xsl:if test="string(/buildinfo/document/@newsdate) and
(not(string(/buildinfo/document/@type)) or
/buildinfo/document/@type != 'newsletter')">
<!-- Social Links -->
<xsl:variable name="original_file"
select="concat(substring(string(/buildinfo/@filename), 2), '.' ,string(/buildinfo/@original), '.xhtml')"
as="xs:string" />
<xsl:variable name="originalDocument" select="document($original_file)/html" />
<xsl:element name="a">
<xsl:attribute name="class">social-link</xsl:attribute>
<xsl:attribute name="href">https://flattr.com/submit/auto?user_id=fsfe&amp;url=http://fsfe.org/<xsl:value-of select="/buildinfo/@filename" />.html&amp;title=<xsl:value-of select="$originalDocument/head/title" />&amp;description=<xsl:value-of select="$originalDocument/body/p[@newsteaser]" />&amp;tags=<xsl:for-each select="$originalDocument/tags/tag"><xsl:value-of select="node()" />,</xsl:for-each>&amp;category=text</xsl:attribute>
<xsl:element name="img">
<xsl:attribute name="src">/graphics/flattr-badge-large.png</xsl:attribute>
<xsl:attribute name="alt">Flattr this</xsl:attribute>
</xsl:element>
</xsl:element>
<xsl:element name="a">
<xsl:attribute name="class">social-link</xsl:attribute>
<xsl:attribute name="href">/support</xsl:attribute>
<xsl:element name="img">
<xsl:attribute name="src">/graphics/supporter/FSFE_plus1_48x22_b.png</xsl:attribute>
<xsl:attribute name="alt">Support FSFE</xsl:attribute>
</xsl:element>
</xsl:element>
<!-- End Social Links -->
<!-- add publishing information (author, date) -->
<xsl:element name="div">
<xsl:attribute name="id">article-metadata</xsl:attribute>
@ -223,9 +246,33 @@
</xsl:if>
<!-- End apply news page rules -->
<!-- Apply newsletter page -->
<xsl:if test="string(/buildinfo/document/@newsdate) and /buildinfo/document/@type = 'newsletter'">
<!-- Social Links -->
<xsl:variable name="original_file"
select="concat(substring(string(/buildinfo/@filename), 2), '.' ,string(/buildinfo/@original), '.xhtml')"
as="xs:string" />
<xsl:variable name="originalDocument" select="document($original_file)/html" />
<xsl:element name="a">
<xsl:attribute name="class">social-link</xsl:attribute>
<xsl:attribute name="href">https://flattr.com/submit/auto?user_id=fsfe&amp;url=http://fsfe.org/<xsl:value-of select="/buildinfo/@filename" />.html&amp;title=<xsl:value-of select="$originalDocument/head/title" />&amp;description=<xsl:value-of select="$originalDocument/body/p[@newsteaser]" />&amp;tags=<xsl:for-each select="$originalDocument/tags/tag"><xsl:value-of select="node()" />,</xsl:for-each>&amp;category=text</xsl:attribute>
<xsl:element name="img">
<xsl:attribute name="src">/graphics/flattr-badge-large.png</xsl:attribute>
<xsl:attribute name="alt">Flattr this</xsl:attribute>
</xsl:element>
</xsl:element>
<xsl:element name="a">
<xsl:attribute name="class">social-link</xsl:attribute>
<xsl:attribute name="href">/support</xsl:attribute>
<xsl:element name="img">
<xsl:attribute name="src">/graphics/supporter/FSFE_plus1_48x22_b.png</xsl:attribute>
<xsl:attribute name="alt">Support FSFE</xsl:attribute>
</xsl:element>
</xsl:element>
<!-- End Social Links -->
<xsl:call-template name="subscribe-nl" />
</xsl:if>
<!-- End apply newsletter page rules -->

View File

@ -1567,6 +1567,12 @@ ul.overview-horizontal li img.inline {
/* margin-left: 0;*/
/*}*/
.social-link { /*Flattr and Supporter*/
float: right;
margin-top: 7px;
margin-right: 4px;
}
#article-metadata img {
height:24px;
margin:.2em;