<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" version="1.0">

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


<xsl:param name="pixmapsDir"/>

<xsl:param name="baseUrl"/> 
<xsl:param name="showFeedName"/>
<xsl:param name="txtDirection"/>	
<xsl:param name="appDirection"/>	

<xsl:template match="/itemset">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8"/>
  <base href="{$baseUrl}"/>
</head>
<xsl:element name="body">

<xsl:for-each select="item">
  <xsl:call-template name="item"/>
</xsl:for-each>

</xsl:element>
</html>

</xsl:template>



<xsl:template name="item">

<div class='item'>


<table dir="{$txtDirection}" class="itemhead" cellspacing="0" cellpadding="0">
<tbody>
<tr>
  <td valign="middle" class="head_favicon">
    

    <xsl:variable name="favicon">
      <xsl:choose>
        <xsl:when test="not(sourceFavicon)">
          <xsl:value-of select="/itemset/feed/favicon"/>
        </xsl:when>
        <xsl:otherwise>
          <xsl:value-of select="sourceFavicon"/>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:variable>

    <a href="{/itemset/feed/attributes/attribute[ @name = 'homepage' ]}" class="favicon">
      <img src="{$favicon}"/>
    </a>
  </td>
  <td class="head_title">
    
    <a href="{source}" class="itemhead">
      <xsl:value-of select="title"/>
      
      <xsl:if test="title = ''">
         <xsl:value-of select="timestr"/>
      </xsl:if>
    </a>
  </td>
</tr>
</tbody>
</table>


<table dir="{$appDirection}" class='headmeta' cellspacing="0" cellpadding="0">
<tbody>
<xsl:if test="attributes/attribute[ @name = 'slash' ]">
<tr>
 <td valign="top" class='slash'>
   <xsl:apply-templates select="attributes/attribute[ @name = 'slash']"/>
 </td>
</tr>
</xsl:if>

<xsl:if test="attributes/attribute[ @name = 'realSourceUrl' ]">
<tr>
 <td valign="top" class='source'>
     <span>Source</span>
     <span xml:lang="ar">المصدر</span>
     <span xml:lang="ast">Fonte</span>
     <span xml:lang="be@latin">Krynica</span>
     <span xml:lang="ca">Font</span>
     <span xml:lang="cs">Zdroj</span>
     <span xml:lang="da">Kilde</span>
     <span xml:lang="de">Quelle</span>
     <span xml:lang="el">Πηγή</span>
     <span xml:lang="es">Fuente</span>
     <span xml:lang="eu">Iturburua</span>
     <span xml:lang="fi">Lähde</span>
     <span xml:lang="fr">Source</span>
     <span xml:lang="gl">Fonte</span>
     <span xml:lang="he">מקור</span>
     <span xml:lang="hu">Forrás</span>
     <span xml:lang="id">Sumber</span>
     <span xml:lang="it">Fonte</span>
     <span xml:lang="ja">ソース</span>
     <span xml:lang="lt">Šaltinis</span>
     <span xml:lang="lv">Avots</span>
     <span xml:lang="nl">Bron</span>
     <span xml:lang="pl">Zasób</span>
     <span xml:lang="pt">Fonte</span>
     <span xml:lang="pt_BR">Fonte</span>
     <span xml:lang="ro">Sursă</span>
     <span xml:lang="ru">Источник</span>
     <span xml:lang="sk">Zdroj</span>
     <span xml:lang="sq">Burim</span>
     <span xml:lang="sv">Källa</span>
     <span xml:lang="tr">Kaynak</span>
     <span xml:lang="uk">Джерело</span>
     <span xml:lang="vi">Nguồn</span>
     <span xml:lang="zh_CN">来源</span>
     <b><span class='source'>
       <a href="{attributes/attribute[ @name = 'realSourceUrl' ]}">
         <xsl:value-of select="attributes/attribute[ @name = 'realSourceTitle' ]"/>
       </a>
     </span></b>
 </td>
</tr>
</xsl:if>


<xsl:if test="$showFeedName = '1'">
<tr>
 <td valign="top" class='source'>
     <span>Feed</span>
     <span xml:lang="ar">تلقيمة</span>
     <span xml:lang="ast">Canal</span>
     <span xml:lang="be@latin">Kanał</span>
     <span xml:lang="bg">Емисия</span>
     <span xml:lang="ca">Canal</span>
     <span xml:lang="cs">Kanál</span>
     <span xml:lang="da">Nyhedskilde</span>
     <span xml:lang="de">Abonnement</span>
     <span xml:lang="el">Ροή</span>
     <span xml:lang="es">Canal</span>
     <span xml:lang="eu">Iturria</span>
     <span xml:lang="fi">Syöte</span>
     <span xml:lang="fr">Flux</span>
     <span xml:lang="gl">Fonte</span>
     <span xml:lang="he">ערוץ</span>
     <span xml:lang="hu">Hírforrás</span>
     <span xml:lang="id">Feed</span>
     <span xml:lang="it">Notiziario</span>
     <span xml:lang="ja">配信元</span>
     <span xml:lang="ko">피드</span>
     <span xml:lang="lt">Naujienų kanalas</span>
     <span xml:lang="lv">Plūsma</span>
     <span xml:lang="mk">Вест</span>
     <span xml:lang="nl">Feed</span>
     <span xml:lang="pl">Kanał</span>
     <span xml:lang="pt">Fonte</span>
     <span xml:lang="pt_BR">Fontes de Notícias</span>
     <span xml:lang="ro">Flux</span>
     <span xml:lang="ru">Лента</span>
     <span xml:lang="sk">Kanál</span>
     <span xml:lang="sq">Prurje</span>
     <span xml:lang="sv">Flöde</span>
     <span xml:lang="tr">Besleme</span>
     <span xml:lang="uk">Подача</span>
     <span xml:lang="vi">Feed</span>
     <span xml:lang="zh_CN">Feed</span>
     <span xml:lang="zh_TW">饋流</span>
     <b><span class='source'>
       <a href="{/itemset/feed/attributes/attribute[ @name = 'homepage' ]}">
         <xsl:value-of select="/itemset/feed/feedTitle"/>
       </a>
     </span></b>
 </td>
</tr>
</xsl:if>

<xsl:if test="attributes/attribute[ @name = 'category' ]">
<tr>
 <td valign="top" class='categories'>
     <span>Filed under</span>
     <span xml:lang="ar">وُضِع تحت</span>
     <span xml:lang="ast">Archiváu en</span>
     <span xml:lang="be@latin">Vykładziena na</span>
     <span xml:lang="ca">Arxivat a</span>
     <span xml:lang="cs">Zařazeno do</span>
     <span xml:lang="da">Arkiveret under</span>
     <span xml:lang="de">Unter</span>
     <span xml:lang="el">Αρχειοθετημένο στο</span>
     <span xml:lang="es">Archivado en</span>
     <span xml:lang="eu">Hemen artxibatua</span>
     <span xml:lang="fi">Avainsanat</span>
     <span xml:lang="fr">Classé sous</span>
     <span xml:lang="gl">Arquivado en</span>
     <span xml:lang="he">תויק תחת</span>
     <span xml:lang="hu">Beküldve ez alatt</span>
     <span xml:lang="id">Berada di</span>
     <span xml:lang="it">Archiviato sotto</span>
     <span xml:lang="ja">カテゴリ:</span>
     <span xml:lang="lt">Etiketės:</span>
     <span xml:lang="lv">Saglabāts zem</span>
     <span xml:lang="nl">Opgeslagen onder</span>
     <span xml:lang="pl">Zaszeregowany w</span>
     <span xml:lang="pt">Arquivado sob</span>
     <span xml:lang="pt_BR">Arquivado sob</span>
     <span xml:lang="ro">Clasat sub</span>
     <span xml:lang="ru">Опубликовано в</span>
     <span xml:lang="sk">Zaradené pod</span>
     <span xml:lang="sq">Skeduar te</span>
     <span xml:lang="sv">Arkiverad under</span>
     <span xml:lang="tr">Dosyalandığı yer</span>
     <span xml:lang="uk">Додано до теки</span>
     <span xml:lang="vi">Được lọc dưới</span>
     <span xml:lang="zh_CN">分类：</span>
     <b><span class='categories'>
       <xsl:for-each select="attributes/attribute[ @name = 'category' ]">
         <xsl:if test="position() != 1">, </xsl:if>
         <xsl:value-of select="." disable-output-escaping='yes'/>
       </xsl:for-each>
     </span></b>
 </td>
</tr>
</xsl:if>

<xsl:if test="attributes/attribute[ @name = 'author' ]">
 <tr>
   <td valign="top" class='author'>
     <span>Author</span>
     <span xml:lang="ar">المؤلّف</span>
     <span xml:lang="ast">Autor</span>
     <span xml:lang="be@latin">Aŭtar</span>
     <span xml:lang="ca">Autor</span>
     <span xml:lang="cs">Autor</span>
     <span xml:lang="da">Forfatter</span>
     <span xml:lang="de">Autor</span>
     <span xml:lang="el">Συγγραφέας</span>
     <span xml:lang="es">Autor</span>
     <span xml:lang="eu">Egilea</span>
     <span xml:lang="fi">Tekijä</span>
     <span xml:lang="fr">Auteur</span>
     <span xml:lang="gl">Autor</span>
     <span xml:lang="he">מחבר</span>
     <span xml:lang="hu">Szerző</span>
     <span xml:lang="id">Penulis</span>
     <span xml:lang="it">Autore</span>
     <span xml:lang="ja">作者</span>
     <span xml:lang="lt">Autorius</span>
     <span xml:lang="lv">Autors</span>
     <span xml:lang="nl">Auteur</span>
     <span xml:lang="pl">Autor</span>
     <span xml:lang="pt">Autor</span>
     <span xml:lang="pt_BR">Autor</span>
     <span xml:lang="ro">Autor</span>
     <span xml:lang="ru">Автор</span>
     <span xml:lang="sk">Autor</span>
     <span xml:lang="sq">Autor</span>
     <span xml:lang="sv">Författare</span>
     <span xml:lang="tr">Yazar</span>
     <span xml:lang="uk">Автор</span>
     <span xml:lang="vi">Tác giả</span>
     <span xml:lang="zh_CN">作者</span>
     <b><span class='author'>
       <xsl:value-of select="attributes/attribute[ @name = 'author' ]" disable-output-escaping='yes'/>
     </span></b>
   </td>
 </tr>
</xsl:if>

<xsl:if test="attributes/attribute[ @name = 'sharedby' ]">
 <tr>
   <td valign="top" class='sharedby'>
     <span>Shared by</span>
     <span xml:lang="ar">شارَكهُ</span>
     <span xml:lang="ast">Compartíu por</span>
     <span xml:lang="ca">Compartit per</span>
     <span xml:lang="da">Delt af</span>
     <span xml:lang="de">Empfohlen von</span>
     <span xml:lang="es">Compartido por</span>
     <span xml:lang="eu">Honek elkarbanatua</span>
     <span xml:lang="fi">Jaettu:</span>
     <span xml:lang="fr">Partagé par</span>
     <span xml:lang="gl">Compartido por</span>
     <span xml:lang="he">מומלץ על ידי</span>
     <span xml:lang="hu">Megosztotta</span>
     <span xml:lang="id">Dibagikan oleh</span>
     <span xml:lang="it">Condiviso da</span>
     <span xml:lang="ja">共有</span>
     <span xml:lang="lt">Pasidalino</span>
     <span xml:lang="lv">Dalījās</span>
     <span xml:lang="nl">Gedeeld met</span>
     <span xml:lang="pl">Udostępnił</span>
     <span xml:lang="pt">Partilhado por</span>
     <span xml:lang="pt_BR">Compartilhado por</span>
     <span xml:lang="ro">Partajat de</span>
     <span xml:lang="ru">Опубликовано</span>
     <span xml:lang="sk">Zdielané cez</span>
     <span xml:lang="sq">Ndarë me të tjerët nga</span>
     <span xml:lang="sv">Delad av</span>
     <span xml:lang="tr">Paylaşan</span>
     <span xml:lang="uk">Спільно використовується</span>
     <span xml:lang="vi">Chia sẻ bởi</span>
     <span xml:lang="zh_CN">分享：</span>
     <b><span class='sharedby'>
       <xsl:value-of select="attributes/attribute[ @name = 'sharedby' ]" disable-output-escaping='yes'/>
     </span></b>
   </td>
 </tr>
</xsl:if>


<xsl:for-each select="attributes/attribute[ @name = 'via' ]">
<tr>
 <td valign="top" class='source'>
     <span>Via</span>
     <span xml:lang="ar">عبر</span>
     <span xml:lang="ast">Vía</span>
     <span xml:lang="be@latin">Ad</span>
     <span xml:lang="ca">A través de</span>
     <span xml:lang="da">Via</span>
     <span xml:lang="de">Via</span>
     <span xml:lang="es">Vía</span>
     <span xml:lang="eu">Honen bitartez</span>
     <span xml:lang="fi">Kautta</span>
     <span xml:lang="fr">Via</span>
     <span xml:lang="gl">Vía</span>
     <span xml:lang="he">דרך</span>
     <span xml:lang="hu">Ezen keresztül</span>
     <span xml:lang="id">Melalui</span>
     <span xml:lang="it">Tramite</span>
     <span xml:lang="ja">経由</span>
     <span xml:lang="lt">per</span>
     <span xml:lang="lv">Caur</span>
     <span xml:lang="nl">Via</span>
     <span xml:lang="pl">Za</span>
     <span xml:lang="pt">Via</span>
     <span xml:lang="pt_BR">Via</span>
     <span xml:lang="ro">Via</span>
     <span xml:lang="ru">С помощью</span>
     <span xml:lang="sk">Cez</span>
     <span xml:lang="sq">Përmes</span>
     <span xml:lang="sv">Via</span>
     <span xml:lang="tr">Aracılığıyla</span>
     <span xml:lang="uk">Проміжні</span>
     <span xml:lang="vi">Thông qua</span>
     <span xml:lang="zh_CN">通过</span>
     <b><span class='source'>
       <a href="{.}">
         <xsl:value-of select="."/>
       </a>
     </span></b>
 </td>
</tr>
</xsl:for-each>
<xsl:for-each select="attributes/attribute[ @name = 'related' ]">
<tr>
 <td valign="top" class='source'>
     <span>Related</span>
     <span xml:lang="ar">متعلق</span>
     <span xml:lang="ast">Rellacionáu</span>
     <span xml:lang="be@latin">Padobnyja</span>
     <span xml:lang="ca">Relacionats</span>
     <span xml:lang="cs">Související</span>
     <span xml:lang="da">Forbundne</span>
     <span xml:lang="de">Verwandt</span>
     <span xml:lang="es">Relacionado</span>
     <span xml:lang="eu">Erlazionatua</span>
     <span xml:lang="fi">Suhteessa kohteeseen</span>
     <span xml:lang="fr">Lié</span>
     <span xml:lang="gl">Relacionado</span>
     <span xml:lang="he">קשורים</span>
     <span xml:lang="hu">Kapcsolódó</span>
     <span xml:lang="id">Terkait</span>
     <span xml:lang="it">Correlato</span>
     <span xml:lang="ja">関連</span>
     <span xml:lang="lt">Susiję</span>
     <span xml:lang="lv">Saistīts</span>
     <span xml:lang="nl">Verwant</span>
     <span xml:lang="pl">Zmień nazwę</span>
     <span xml:lang="pt">Relacionado</span>
     <span xml:lang="pt_BR">Relacionados</span>
     <span xml:lang="ro">Asociat</span>
     <span xml:lang="ru">Похожие</span>
     <span xml:lang="sk">Príbuzné</span>
     <span xml:lang="sq">Të afërta</span>
     <span xml:lang="sv">Relaterade</span>
     <span xml:lang="tr">İlişkili</span>
     <span xml:lang="uk">Пов’язано з</span>
     <span xml:lang="vi">Quan hệ</span>
     <span xml:lang="zh_CN">相关</span>
     <b><span class='source'>
       <a href="{.}">
         <xsl:value-of select="."/>
       </a>
     </span></b>
 </td>
</tr>
</xsl:for-each>


<xsl:for-each select="duplicates/duplicateNode">
<tr>
 <td valign="top" class='source'>
     <span>Also posted in</span>
     <span xml:lang="ar">منشورة أيضا في</span>
     <span xml:lang="ast">Tamién escritu en</span>
     <span xml:lang="be@latin">Taksama napisana ŭ</span>
     <span xml:lang="ca">Publicat també a</span>
     <span xml:lang="cs">Také zasláno do</span>
     <span xml:lang="da">Også sendt til</span>
     <span xml:lang="de">Auch in</span>
     <span xml:lang="el">Καταχωρήθηκε και στο</span>
     <span xml:lang="es">Publicada también en</span>
     <span xml:lang="eu">Hemen argitaratua ere</span>
     <span xml:lang="fi">Myös lähetetty kohteessa</span>
     <span xml:lang="fr">Aussi posté dans</span>
     <span xml:lang="gl">Tamén publicado en</span>
     <span xml:lang="he">פורסם גם בערוץ</span>
     <span xml:lang="hu">Beküldve továbbá</span>
     <span xml:lang="id">Juga diposkan di</span>
     <span xml:lang="it">Inserito anche in</span>
     <span xml:lang="ja">別の投稿先</span>
     <span xml:lang="lt">Taip pat paskelbė</span>
     <span xml:lang="lv">Ievietots arī</span>
     <span xml:lang="nl">Ook gepubliceerd in</span>
     <span xml:lang="pl">Opublikowane również w</span>
     <span xml:lang="pt">Também publicado em</span>
     <span xml:lang="pt_BR">Também publicado em</span>
     <span xml:lang="ro">Postat și în</span>
     <span xml:lang="ru">Доступно в</span>
     <span xml:lang="sk">Tiež poslané v</span>
     <span xml:lang="sq">Postuar edhe te</span>
     <span xml:lang="sv">Även postad i</span>
     <span xml:lang="tr">Yinelenen yer</span>
     <span xml:lang="uk">Також оприлюднено у</span>
     <span xml:lang="vi">Đồng thời post tại</span>
     <span xml:lang="zh_CN">还发表在：</span>
     <b><span class='source'>
         <xsl:value-of select="."/>
     </span></b>
 </td>
</tr>
</xsl:for-each>

<xsl:if test="attributes/attribute[ @name = 'creator' ]">
 <tr>
   <td valign="top" class='creator'>
     <span>Creator</span>
     <span xml:lang="ar">المنشيء</span>
     <span xml:lang="ast">Creador</span>
     <span xml:lang="be@latin">Stvaralnik</span>
     <span xml:lang="ca">Creador</span>
     <span xml:lang="cs">Tvůrce</span>
     <span xml:lang="da">Forfatter</span>
     <span xml:lang="de">Ersteller</span>
     <span xml:lang="el">Δημιουργός</span>
     <span xml:lang="es">Creador</span>
     <span xml:lang="eu">Sortzailea</span>
     <span xml:lang="fi">Kirjoittaja</span>
     <span xml:lang="fr">Créateur</span>
     <span xml:lang="gl">Creador</span>
     <span xml:lang="he">יוצר</span>
     <span xml:lang="hu">Létrehozó</span>
     <span xml:lang="id">Pembuat</span>
     <span xml:lang="it">Creatore</span>
     <span xml:lang="ja">作者</span>
     <span xml:lang="lt">Sukūrė</span>
     <span xml:lang="lv">Veidotājs</span>
     <span xml:lang="nl">Producent</span>
     <span xml:lang="pl">Autor</span>
     <span xml:lang="pt">Criador</span>
     <span xml:lang="pt_BR">Criador</span>
     <span xml:lang="ro">Realizat de</span>
     <span xml:lang="ru">Создал</span>
     <span xml:lang="sk">Tvorca</span>
     <span xml:lang="sq">Krijues</span>
     <span xml:lang="sv">Skapare</span>
     <span xml:lang="tr">Oluşturan</span>
     <span xml:lang="uk">Створено у</span>
     <span xml:lang="vi">Người tạo</span>
     <span xml:lang="zh_CN">创作者</span>
     <b><span class='creator'>
       <xsl:value-of select="attributes/attribute[ @name = 'creator' ]" disable-output-escaping='yes'/>
     </span></b>
   </td>
 </tr>
</xsl:if>

<xsl:if test="attributes/attribute[ @name = 'point' ]">
 <xsl:variable select="substring-before(attributes/attribute[ @name = 'point' ],' ')" name="lat"/>
 <xsl:variable select="substring-after(attributes/attribute[ @name = 'point' ],' ')" name="lng"/>
 <tr>
   <td valign="top" class='point'>
     <span>Coordinates</span>
     <span xml:lang="de">Koordinaten</span>
     <span xml:lang="es">Coordenadas</span>
     <span xml:lang="fi">Koordinaatit</span>
     <span xml:lang="fr">Coordonnées</span>
     <span xml:lang="hu">Koordináták</span>
     <span xml:lang="id">Kordinat</span>
     <span xml:lang="it">Coordinate</span>
     <span xml:lang="pl">Koordynaty</span>
     <span xml:lang="pt_BR">Coordenadas</span>
     <span xml:lang="sq">Koordinata</span>
     <span xml:lang="sv">Koordinerar</span>
     <span xml:lang="tr">Koordinatlar</span>
     <span xml:lang="uk">Координати</span>
     <span xml:lang="vi">Tọa độ</span>
     <b><span class='point'><xsl:value-of select="$lat"/>, <xsl:value-of select="$lng"/></span></b>
   </td>
 </tr>
  <tr>
   <td valign="top" class='point'>
     <span>Map</span>
     <span xml:lang="de">Karte</span>
     <span xml:lang="es">Mapa</span>
     <span xml:lang="fi">Kartta</span>
     <span xml:lang="fr">Carte</span>
     <span xml:lang="hu">Térkép</span>
     <span xml:lang="id">Peta</span>
     <span xml:lang="it">Mappa</span>
     <span xml:lang="pl">Mapa</span>
     <span xml:lang="pt_BR">Mapa</span>
     <span xml:lang="sq">Hartë</span>
     <span xml:lang="sv">Karta</span>
     <span xml:lang="tr">Harita</span>
     <span xml:lang="uk">Карта</span>
     <span xml:lang="vi">Bản đồ</span>
     <b><span class='point'>
     <a href="https://www.openstreetmap.org/?mlat={$lat}&amp;mlon={$lng}#map=12/{$lat}/{$lng}">OpenStreeMap</a>
     </span></b>
   </td>
 </tr>
</xsl:if>

<xsl:if test="attributes/attribute[ @name = 'mediaviews' ]">
 <tr>
   <td valign="top" class='mediaviews'>
     <span>View count</span>
     <span xml:lang="cs">Počet zhlédnutí</span>
     <span xml:lang="de">Anzahl Views</span>
     <span xml:lang="fr">Nombre de vues</span>
     <span xml:lang="hu">Megtekintések száma</span>
     <span xml:lang="id">Jumlah penayangan</span>
     <span xml:lang="it">Numero di visualizzazioni</span>
     <span xml:lang="pl">Licznik wyświetleń</span>
     <span xml:lang="pt_BR">Contagem de visualizações</span>
     <span xml:lang="sq">Numër parjesh</span>
     <b><span class='mediaviews'>
       <xsl:value-of select="attributes/attribute[ @name = 'mediaviews' ]"/>
     </span></b>
   </td>
 </tr>
</xsl:if>

<xsl:if test="(attributes/attribute[ @name = 'mediastarRatingmax' ]) and (attributes/attribute[ @name = 'mediastarRatingavg' ])">
 <tr>
   <td valign="top" class='mediastarRating'>
     <span>Rating</span>
     <span xml:lang="cs">Hodnocení</span>
     <span xml:lang="de">Bewertung</span>
     <span xml:lang="fr">Évaluation</span>
     <span xml:lang="hu">Értékelés</span>
     <span xml:lang="id">Peringkat</span>
     <span xml:lang="it">Valutazione</span>
     <span xml:lang="pl">Ocena</span>
     <span xml:lang="pt_BR">Avaliação</span>
     <span xml:lang="sq">Vlerësim</span>
     <b><span class='mediastarRating'>
       <xsl:value-of select="attributes/attribute[ @name = 'mediastarRatingavg' ]"/> / <xsl:value-of select="attributes/attribute[ @name = 'mediastarRatingmax' ]"/>
       <xsl:if test="attributes/attribute[ @name = 'mediastarRatingcount' ]">
         (<xsl:value-of select="attributes/attribute[ @name = 'mediastarRatingcount' ]"/> votes)
       </xsl:if>
     </span></b>
   </td>
 </tr>
</xsl:if>

</tbody>
</table> 

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

  
  <p>
    
    <xsl:if test="attributes/attribute[ @name = 'gravatar' ]">
      <img src="{attributes/attribute[ @name = 'gravatar' ]}" class='gravatar' align='left'/>
    </xsl:if>
    
    <xsl:if test="attributes/attribute[ @name = 'mediathumbnail' ]">
      <img src="{attributes/attribute[ @name = 'mediathumbnail' ]}" class='thumbnail' align='left'/>
    </xsl:if>
    
    <xsl:variable name="url"><xsl:value-of select="source"/></xsl:variable>
    <xsl:if test="contains($url,'https://www.youtube.com/watch?v=')">
      <xsl:variable select="substring-after($url,'https://www.youtube.com/watch?v=')" name="youtubeid"/>
      <p><iframe width="640" src="https://www.youtube.com/embed/{$youtubeid}" height="480" frameborder="0" allowfullscreen="1"/></p>
    </xsl:if>
    
    <xsl:if test="attributes/attribute[ @name = 'mediadescription' ]">
      <xsl:call-template name="add-newline">
        <xsl:with-param select="attributes/attribute[ @name = 'mediadescription' ]" name="input"/>
       </xsl:call-template>
    </xsl:if>

    
    <xsl:value-of select="description" disable-output-escaping='yes'/>
  </p>
</div> 

  
<div id='item_comments' class='item_comments'>
  <xsl:if test="attributes/attribute[ @name = 'commentFeedUri' ] and not(./commentsSuppressed)">
     <p>
        <xsl:if test="count(comments/item) != 0">
	   <b><span>Comments</span>
	   <span xml:lang="ar">التعليقات</span>
	   <span xml:lang="ast">Comentarios</span>
	   <span xml:lang="be@latin">Kamentary</span>
	   <span xml:lang="ca">Comentaris</span>
	   <span xml:lang="cs">Komentáře</span>
	   <span xml:lang="da">Bemærkninger</span>
	   <span xml:lang="de">Kommentare</span>
	   <span xml:lang="el">Σχόλια</span>
	   <span xml:lang="es">Comentarios</span>
	   <span xml:lang="eu">Iruzkinak</span>
	   <span xml:lang="fi">Kommentit</span>
	   <span xml:lang="fr">Commentaires</span>
	   <span xml:lang="gl">Comentarios</span>
	   <span xml:lang="he">תגובות‮</span>
	   <span xml:lang="hu">Hozzászólások</span>
	   <span xml:lang="id">Komentar</span>
	   <span xml:lang="it">Commenti</span>
	   <span xml:lang="ja">コメント</span>
	   <span xml:lang="lt">Komentarai</span>
	   <span xml:lang="lv">Komentāri</span>
	   <span xml:lang="nl">Commentaren</span>
	   <span xml:lang="pl">Komentarze</span>
	   <span xml:lang="pt">Comentários</span>
	   <span xml:lang="pt_BR">Comentários</span>
	   <span xml:lang="ro">Comentarii</span>
	   <span xml:lang="ru">Комментарии</span>
	   <span xml:lang="sk">Komentáre</span>
	   <span xml:lang="sq">Komente</span>
	   <span xml:lang="sv">Kommentarer</span>
	   <span xml:lang="tr">Yorumlar</span>
	   <span xml:lang="uk">Коментарі</span>
	   <span xml:lang="vi">Ghi chú</span>
	   <span xml:lang="zh_CN">评论</span></b>
	</xsl:if>

     
        <xsl:if test="comments/updateState = 'updating'">
           (<span>
	      <span>Updating...</span>
	      <span xml:lang="ar">يجري تحديث...</span>
	      <span xml:lang="ast">Anovando...</span>
	      <span xml:lang="be@latin">Aktualizacyja...</span>
	      <span xml:lang="ca">S'està actualitzant...</span>
	      <span xml:lang="cs">Aktualizuje se...</span>
	      <span xml:lang="da">Opdaterer ...</span>
	      <span xml:lang="de">Aktualisiere...</span>
	      <span xml:lang="el">Ενημέρωση...</span>
	      <span xml:lang="es">Actualizando...</span>
	      <span xml:lang="eu">Eguneratzen...</span>
	      <span xml:lang="fi">Päivitetään...</span>
	      <span xml:lang="fr">Mise à jour…</span>
	      <span xml:lang="gl">Actualizando...</span>
	      <span xml:lang="he">מעדכן כעת…</span>
	      <span xml:lang="hu">Frissítés…</span>
	      <span xml:lang="id">Memerbarui...</span>
	      <span xml:lang="it">Aggiornamento...</span>
	      <span xml:lang="ja">更新中...</span>
	      <span xml:lang="lt">Atnaujinama...</span>
	      <span xml:lang="lv">Atjaunina...</span>
	      <span xml:lang="nl">Bijwerken...</span>
	      <span xml:lang="pl">Uaktualnianie...</span>
	      <span xml:lang="pt">A Actualizar...</span>
	      <span xml:lang="pt_BR">Atualizando...</span>
	      <span xml:lang="ro">În curs de actualizare...</span>
	      <span xml:lang="ru">Обновление...</span>
	      <span xml:lang="sk">Aktualizuje sa...</span>
	      <span xml:lang="sq">Po përditësohet…</span>
	      <span xml:lang="sv">Uppdaterar...</span>
	      <span xml:lang="tr">Güncelleniyor...</span>
	      <span xml:lang="uk">Оновлення…</span>
	      <span xml:lang="vi">Đang cập nhật…</span>
	      <span xml:lang="zh_CN">正在更新...</span>
	    </span>)
	</xsl:if>
     </p>

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

     <p>
        <xsl:apply-templates select="comments/item">
           <xsl:sort select="time"/>
        </xsl:apply-templates>
     </p>
  </xsl:if>
</div> 
</div> 
</div> 

</xsl:template>




<xsl:template match="attributes/attribute[ @name = 'slash']">
  <span class="slashSection"><span>Section</span>
  <span xml:lang="ar">القسم</span>
  <span xml:lang="ast">Seición</span>
  <span xml:lang="be@latin">Raździeł</span>
  <span xml:lang="ca">Secció</span>
  <span xml:lang="cs">Sekce</span>
  <span xml:lang="da">Afsnit</span>
  <span xml:lang="de">Sektion</span>
  <span xml:lang="el">Τομέας</span>
  <span xml:lang="es">Sección</span>
  <span xml:lang="eu">Sekzioa</span>
  <span xml:lang="fi">Lohko</span>
  <span xml:lang="fr">Section</span>
  <span xml:lang="gl">Sección</span>
  <span xml:lang="he">פלג</span>
  <span xml:lang="hu">Szakasz</span>
  <span xml:lang="id">Bagian</span>
  <span xml:lang="it">Sezione</span>
  <span xml:lang="ja">セクション</span>
  <span xml:lang="lt">Sekcija</span>
  <span xml:lang="lv">Sadaļa</span>
  <span xml:lang="nl">Sectie</span>
  <span xml:lang="pl">Sekcja</span>
  <span xml:lang="pt">Secção</span>
  <span xml:lang="pt_BR">Seção</span>
  <span xml:lang="ro">Secțiune</span>
  <span xml:lang="ru">Раздел</span>
  <span xml:lang="sk">Sekcia</span>
  <span xml:lang="sq">Ndarje</span>
  <span xml:lang="sv">Avsnitt</span>
  <span xml:lang="tr">Bölüm</span>
  <span xml:lang="uk">Розділ</span>
  <span xml:lang="vi">Phần</span>
  <span xml:lang="zh_CN">章节</span></span>
  <span class="slashValue"><xsl:value-of select="substring-before(., ',')"/></span>
  <span class="slashDepartment"><span>Department</span>
  <span xml:lang="ar">المصلحة</span>
  <span xml:lang="ast">Departamentu</span>
  <span xml:lang="be@latin">Addzieł</span>
  <span xml:lang="ca">Departament</span>
  <span xml:lang="cs">Oddělení</span>
  <span xml:lang="da">Afdeling</span>
  <span xml:lang="de">Department</span>
  <span xml:lang="el">Τμήμα</span>
  <span xml:lang="es">Departamento</span>
  <span xml:lang="eu">Saila</span>
  <span xml:lang="fi">Osasto</span>
  <span xml:lang="fr">Département</span>
  <span xml:lang="gl">Departamento</span>
  <span xml:lang="he">אגף</span>
  <span xml:lang="hu">Részleg</span>
  <span xml:lang="id">Departemen</span>
  <span xml:lang="it">Reparto</span>
  <span xml:lang="ja">部門</span>
  <span xml:lang="lt">Padalinys</span>
  <span xml:lang="lv">Nodaļa</span>
  <span xml:lang="nl">Afdeling</span>
  <span xml:lang="pl">Wydział</span>
  <span xml:lang="pt">Departamento</span>
  <span xml:lang="pt_BR">Departamento</span>
  <span xml:lang="ro">Departament</span>
  <span xml:lang="ru">Отдел</span>
  <span xml:lang="sk">Odelenie</span>
  <span xml:lang="sq">Degë</span>
  <span xml:lang="sv">Avdelning</span>
  <span xml:lang="tr">Şube</span>
  <span xml:lang="uk">Відділ</span>
  <span xml:lang="vi">Phòng ban</span>
  <span xml:lang="zh_CN">部门</span></span>
  <span class="slashValue"><xsl:value-of select="substring-after(., ',')"/></span>
</xsl:template>




<xsl:template match="comments/item">
   <div dir="{$txtDirection}" class="comment">
      <div class="comment_title"><xsl:value-of select="title"/></div>
      <div class="comment_body"><xsl:value-of select="description" disable-output-escaping='yes'/></div>
   </div>
</xsl:template>




<xsl:template name="add-newline">
  <xsl:param name="input"/>

  <xsl:choose>
    <xsl:when test="not(contains($input, '&#xA;'))">
      <xsl:copy-of select="$input"/>
    </xsl:when>
    <xsl:otherwise>
      <xsl:value-of select="substring-before($input, '&#xA;')" disable-output-escaping='yes'/>
      <br/>
      <xsl:call-template name="add-newline">
        <xsl:with-param select="substring-after($input, '&#xA;')" name="input"/>
      </xsl:call-template>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>

</xsl:stylesheet>