mirror of
https://github.com/moparisthebest/mailcatcher
synced 2024-11-16 14:15:08 -05:00
Pretty up XSL, cater to empty case
This commit is contained in:
parent
50ea84cebf
commit
1067c208cb
@ -1,26 +1,33 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
||||
<xsl:template match="/xml">
|
||||
|
||||
<section class="fractal-analysis">
|
||||
<xsl:for-each select="result/errors/error">
|
||||
<xsl:variable name="errorCount" select="position()"/>
|
||||
<p class="report-intro">
|
||||
<strong><xsl:value-of select="$errorCount" />.</strong> The <span class="code"><xsl:value-of select="rule/rule_name" /></span> near <span class="code"><xsl:value-of select="snippet" /></span> on line <span class="code"><xsl:value-of select="error_line" /></span> of your code.
|
||||
</p>
|
||||
<dl class="unsupported-clients">
|
||||
<dt>This is unsupported in:</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
<xsl:for-each select="rule/email_client//item">
|
||||
<li>
|
||||
<xsl:value-of select="." />
|
||||
</li>
|
||||
</xsl:for-each>
|
||||
</ul>
|
||||
</dd>
|
||||
</dl>
|
||||
</xsl:for-each>
|
||||
</section>
|
||||
<section class="fractal-analysis">
|
||||
<h1>Fractal Results</h1>
|
||||
<xsl:choose>
|
||||
<xsl:when test="not(result/errors/node())">
|
||||
<p class="report-intro valid">Your HTML and CSS for your email is valid.</p>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<p class="report-intro invalid">Your HTML and CSS for your email contains potential errors:</p>
|
||||
<ol>
|
||||
<xsl:for-each select="result/errors/error">
|
||||
<li>
|
||||
<p class="error-intro">The <code><xsl:value-of select="rule/rule_name" /></code> near <code><xsl:value-of select="snippet" /></code> on line <code><xsl:value-of select="error_line" /></code> of your code.</p>
|
||||
<dl class="unsupported-clients">
|
||||
<dt>This is unsupported in:</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
<xsl:for-each select="rule/email_client//item">
|
||||
<li><xsl:value-of select="." /></li>
|
||||
</xsl:for-each>
|
||||
</ul>
|
||||
</dd>
|
||||
</dl>
|
||||
</li>
|
||||
</xsl:for-each>
|
||||
</ol>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</section>
|
||||
</xsl:template>
|
||||
</xsl:stylesheet>
|
||||
</xsl:stylesheet>
|
||||
|
Loading…
Reference in New Issue
Block a user