~ubuntu-branches/ubuntu/vivid/liferea/vivid-proposed

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
<?xml version="1.0" encoding="UTF-8"?>

<!--
/**
 * Rendering stylesheet for Liferea (feed description view)
 *
 * Copyright (C) 2006-2007 Lars Lindner <lars.lindner@gmail.com>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version. 
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
--> 

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
                xmlns="http://www.w3.org/1999/xhtml">

<xsl:output method="xml" version="1.0" indent="yes"/>

<xsl:param name="appDirection"/>	<!-- application direction, either "ltr" or "rtl" -->
<xsl:param name="txtDirection"/>	<!-- text direction, either "ltr" or "rtl" -->

<xsl:preserve-space elements="//*"/>

<xsl:template match="/feed" >
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
##STYLE_INSERT##
</head>
<body>

<!-- error header tables -->
<xsl:if test="parseError or filterError or updateError or httpError or feedDiscontinued = '1'">
<div id='errors'>

<xsl:if test="feedDiscontinued = '1'">
  <div id='updateError'>
     <_span>This feed is discontinued. It's no longer available. Liferea won't update it anymore but you can still access the cached headlines.</_span>
  </div>
</xsl:if>

<xsl:if test="updateError">
  <div id='updateError'>
    <xsl:value-of select="updateError"/>
  </div>
</xsl:if>

<xsl:if test="httpError">
  <div id='httpError'>
    <_span>The last update of this subscription failed!<br/><b>HTTP error code <xsl:value-of select="httpErrorCode"/>: <xsl:value-of select="httpError"/></b></_span>    
  </div>
</xsl:if>

<xsl:if test="parseError">
  <div id='parseError'>
    <_span>There were errors while parsing this feed!</_span>

    <span id="pdl" class="detaillink">
      (<span class="showmore" onclick="javascript:document.getElementById('pd').style.visibility='visible';document.getElementById('pd').style.display='block';document.getElementById('pdl').style.visibility='hidden';document.getElementById('pdl').style.display='none';">
        <_span>Parser Error Details</_span>
      </span>)
    </span>

    <span class="details" id='pd'>
      <b><_span>Details</_span></b><br />
      <xsl:value-of select="parseError" disable-output-escaping='yes'/>
      <script language="javascript" type="text/javascript">document.getElementById('pdl').style.visibility='visible';document.getElementById('pdl').style.display='inline';</script>

       <br /><_span>You may want to validate the feed using</_span>
       <xsl:text> </xsl:text>
       <a href="http://feedvalidator.org/check.cgi?url={feedSource}">FeedValidator</a>
    </span>
  </div>
</xsl:if>

<xsl:if test="filterError">
  <div id='filterError'>
    <_span>There were errors while filtering this feed!</_span>

    <span id="fdl" class="detaillink">
      (<span class="showmore" onclick="javascript:document.getElementById('fd').style.visibility='visible';document.getElementById('fd').style.display='block';document.getElementById('fdl').style.visibility='hidden';document.getElementById('fdl').style.display='none';">
        <_span>Filter Error Details</_span>
      </span>)
    </span>

    <span class="details" id='fd'>
      <b><_span>Details</_span></b><br />
      <xsl:value-of select="filterError" disable-output-escaping='yes'/>
      <script language="javascript" type="text/javascript">document.getElementById('fdl').style.visibility='visible';document.getElementById('fdl').style.display='inline';</script>
    </span>
  </div>
</xsl:if>

</div>
</xsl:if>

<!-- header table -->
<table class="feedhead" cellspacing="0" dir="{$appDirection}">
<tr>
  <td valign="middle" class="headleft">
    <b><_span>Feed:</_span></b>
  </td>
  <td width="100%" valign="middle" class="headright">
     <a href="{attributes/attribute[ @name = 'homepage' ]}">
        <xsl:value-of select="feedTitle"/>
     </a>
  </td>
</tr>
<tr>
  <td valign="middle" class="headleft">
    <b><_span>Source:</_span></b>
  </td>
  <td width="100%" valign="middle" class="headright">
     <xsl:variable name="href">
        <xsl:call-template name="strippwd">
           <xsl:with-param name="string" select="feedSource"/>
        </xsl:call-template>
     </xsl:variable>
     <a href="{$href}">
        <xsl:call-template name="strippwd">
           <xsl:with-param name="string" select="feedSource"/>
        </xsl:call-template>
     </a>
  </td>
</tr>
</table>

<!-- header metadata (author, copyright, language) -->
<table class='headmeta' cellspacing="0" cellpadding="0">
<xsl:if test="attributes/attribute[ @name = 'publisher' ]">
<tr>
 <td valign="top" class='publisher'>
     <b><_span>Publisher</_span></b>
     <span class='publisher'>
       <xsl:value-of select="attributes/attribute[ @name = 'publisher' ]" disable-output-escaping='yes'/>
     </span>
 </td>
</tr>
</xsl:if>
<xsl:if test="attributes/attribute[ @name = 'copyright' ]">
<tr>
 <td valign="top" class='copyright'>
     <b><_span>Copyright</_span></b>
     <span class='copyright'>
       <xsl:value-of select="attributes/attribute[ @name = 'copyright' ]" disable-output-escaping='yes'/>
     </span>
 </td>
</tr>
</xsl:if>
</table> <!-- end of header metadata -->

<div class='content' dir="{$txtDirection}">

<xsl:if test="attributes/attribute[ @name = 'imageUrl' ]">
<p>
<img class="feed" src="{attributes/attribute[ @name = 'imageUrl' ]}"/>
</p>
</xsl:if>

   <xsl:value-of select="attributes/attribute[@name = 'description']" disable-output-escaping='yes'/>

   <xsl:value-of select="attributes/attribute[@name = 'textInput']" disable-output-escaping='yes'/>
</div>

</body>
</html>
</xsl:template>

<xsl:template name="strippwd">
   <xsl:param name="string"/>
   <xsl:choose>
       <xsl:when test="contains($string, '@')"><xsl:value-of select="substring-before($string, '://')"/>://<xsl:value-of select="substring-after($string, '@')"/></xsl:when>
       <xsl:otherwise><xsl:value-of select="$string"/></xsl:otherwise>
   </xsl:choose>
</xsl:template>
</xsl:stylesheet>