added embedded mode - css has to be fixed accordingly

git-svn-id: http://yolanda.mister-muffin.de/svn@177 7eef14d0-6ed0-489d-bf55-20463b2d70db
This commit is contained in:
josch 2007-11-07 06:55:02 +00:00
parent 384fcb6467
commit 23f30e8259
5 changed files with 300 additions and 283 deletions

View file

@ -8,8 +8,8 @@ body
font-family: sans-serif;
font-size: 8pt;
font-weight: bold;
min-width: 550px;
margin: 2em;
// min-width: 550px; //what is this for? we do not know which font size the user will choose so something in pixel is bullshit
margin: 2em; //this has to be zero for embed viewing
text-align: center;
}

View file

@ -1,7 +1,6 @@
#!/usr/bin/perl -w
use DBI;
use Data::Dumper::Simple;
$database = 'yolanda';
$dbhost = 'localhost';

View file

@ -71,6 +71,8 @@ elsif($query->url_param('title') or $query->url_param('id'))
}
elsif($rowcount == 1)
{
$page->{'embed'} = $query->param('embed') eq 'true' ? "true" : "false";
#if there was a single result, display the video
my ($id, $title, $description, $publisher, $timestamp, $creator, $subject,
$contributor, $source, $language, $coverage, $rights, $license,

View file

@ -77,91 +77,94 @@
</head>
<body>
<xsl:choose>
<xsl:when test="string-length(//@username)=0">
<div class="header1">
<a>
<xsl:attribute name="href">
<xsl:value-of select="$site_strings[@id='page_login']" />
</xsl:attribute>
<xsl:value-of select="$locale_strings[@id='login_to_upload']" />
</a>
</div>
<div class="header2">
<a>
<xsl:attribute name="href">
<xsl:value-of select="$site_strings[@id='page_register']" />
</xsl:attribute>
<xsl:value-of select="$locale_strings[@id='register']" />
</a>
<xsl:value-of select="$locale_strings[@id='separator']" />
<a>
<xsl:attribute name="href">
<xsl:value-of select="$site_strings[@id='page_login']" />
</xsl:attribute>
<xsl:value-of select="$locale_strings[@id='login']" />
</a>
<xsl:value-of select="$locale_strings[@id='separator']" />
<img class="openid-icon" src="/images/openid-icon.png" alt="open id logo" />
<a>
<xsl:attribute name="href">
<xsl:value-of select="$site_strings[@id='page_login-openid']" />
</xsl:attribute>
<xsl:value-of select="$locale_strings[@id='login_openid']" />
</a>
</div>
</xsl:when>
<xsl:otherwise>
<div class="header1">
<a>
<xsl:attribute name="href">
<xsl:value-of select="$site_strings[@id='page_upload']" />
</xsl:attribute>
<xsl:value-of select="$locale_strings[@id='upload_video']" />
</a>
<xsl:value-of select="$locale_strings[@id='separator']" />
<a>
<xsl:attribute name="href">
<xsl:value-of select="$site_strings[@id='page_bookmarks']" />
</xsl:attribute>
<xsl:value-of select="$locale_strings[@id='bookmarks']" />
</a>
<xsl:value-of select="$locale_strings[@id='separator']" />
<a>
<xsl:attribute name="href">
<xsl:value-of select="$site_strings[@id='page_account']" />
</xsl:attribute>
<xsl:value-of select="$locale_strings[@id='account_details']" />
</a>
</div>
<div class="header2">
<xsl:value-of select="$locale_strings[@id='logged_in_as']" />
<a>
<xsl:attribute name="href">
user/<xsl:value-of select="//@username" />
</xsl:attribute>
<xsl:value-of select="//@username" />
</a>
<xsl:value-of select="$locale_strings[@id='separator']" />
<a>
<xsl:attribute name="href">
<xsl:value-of select="$site_strings[@id='page_logout']" />
</xsl:attribute>
<xsl:value-of select="$locale_strings[@id='logout']" />
</a>
</div>
</xsl:otherwise>
</xsl:choose>
<hr />
<xsl:if test="not(//frontpage)">
<xsl:call-template name="searchbar"/>
</xsl:if>
<xsl:if test="//message">
<xsl:call-template name="message"/>
<xsl:if test="not(//@embed='true')">
<xsl:choose>
<xsl:when test="string-length(//@username)=0">
<div class="header1">
<a>
<xsl:attribute name="href">
<xsl:value-of select="$site_strings[@id='page_login']" />
</xsl:attribute>
<xsl:value-of select="$locale_strings[@id='login_to_upload']" />
</a>
</div>
<div class="header2">
<a>
<xsl:attribute name="href">
<xsl:value-of select="$site_strings[@id='page_register']" />
</xsl:attribute>
<xsl:value-of select="$locale_strings[@id='register']" />
</a>
<xsl:value-of select="$locale_strings[@id='separator']" />
<a>
<xsl:attribute name="href">
<xsl:value-of select="$site_strings[@id='page_login']" />
</xsl:attribute>
<xsl:value-of select="$locale_strings[@id='login']" />
</a>
<xsl:value-of select="$locale_strings[@id='separator']" />
<img class="openid-icon" src="/images/openid-icon.png" alt="open id logo" />
<a>
<xsl:attribute name="href">
<xsl:value-of select="$site_strings[@id='page_login-openid']" />
</xsl:attribute>
<xsl:value-of select="$locale_strings[@id='login_openid']" />
</a>
</div>
</xsl:when>
<xsl:otherwise>
<div class="header1">
<a>
<xsl:attribute name="href">
<xsl:value-of select="$site_strings[@id='page_upload']" />
</xsl:attribute>
<xsl:value-of select="$locale_strings[@id='upload_video']" />
</a>
<xsl:value-of select="$locale_strings[@id='separator']" />
<a>
<xsl:attribute name="href">
<xsl:value-of select="$site_strings[@id='page_bookmarks']" />
</xsl:attribute>
<xsl:value-of select="$locale_strings[@id='bookmarks']" />
</a>
<xsl:value-of select="$locale_strings[@id='separator']" />
<a>
<xsl:attribute name="href">
<xsl:value-of select="$site_strings[@id='page_account']" />
</xsl:attribute>
<xsl:value-of select="$locale_strings[@id='account_details']" />
</a>
</div>
<div class="header2">
<xsl:value-of select="$locale_strings[@id='logged_in_as']" />
<a>
<xsl:attribute name="href">
user/<xsl:value-of select="//@username" />
</xsl:attribute>
<xsl:value-of select="//@username" />
</a>
<xsl:value-of select="$locale_strings[@id='separator']" />
<a>
<xsl:attribute name="href">
<xsl:value-of select="$site_strings[@id='page_logout']" />
</xsl:attribute>
<xsl:value-of select="$locale_strings[@id='logout']" />
</a>
</div>
</xsl:otherwise>
</xsl:choose>
<hr />
<xsl:if test="not(//frontpage)">
<xsl:call-template name="searchbar"/>
</xsl:if>
<xsl:if test="//message">
<xsl:call-template name="message"/>
</xsl:if>
</xsl:if>
<xsl:choose>
@ -188,28 +191,30 @@
</xsl:when>
</xsl:choose>
<div class="footer">
<a>
<xsl:attribute name="href">
<xsl:value-of select="$site_strings[@id='page_authors']" />
</xsl:attribute>
<xsl:value-of select="$locale_strings[@id='authors']" />
</a>
<xsl:value-of select="$locale_strings[@id='separator']" />
<a>
<xsl:attribute name="href">
<xsl:value-of select="$site_strings[@id='page_license']" />
</xsl:attribute>
<xsl:value-of select="$locale_strings[@id='license']" />
</a>
<xsl:value-of select="$locale_strings[@id='separator']" />
<a>
<xsl:attribute name="href">
<xsl:value-of select="$site_strings[@id='page_source-code']" />
</xsl:attribute>
<xsl:value-of select="$locale_strings[@id='source_code']" />
</a>
</div>
<xsl:if test="not(//@embed='true')">
<div class="footer">
<a>
<xsl:attribute name="href">
<xsl:value-of select="$site_strings[@id='page_authors']" />
</xsl:attribute>
<xsl:value-of select="$locale_strings[@id='authors']" />
</a>
<xsl:value-of select="$locale_strings[@id='separator']" />
<a>
<xsl:attribute name="href">
<xsl:value-of select="$site_strings[@id='page_license']" />
</xsl:attribute>
<xsl:value-of select="$locale_strings[@id='license']" />
</a>
<xsl:value-of select="$locale_strings[@id='separator']" />
<a>
<xsl:attribute name="href">
<xsl:value-of select="$site_strings[@id='page_source-code']" />
</xsl:attribute>
<xsl:value-of select="$locale_strings[@id='source_code']" />
</a>
</div>
</xsl:if>
</body>

View file

@ -7,10 +7,6 @@
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
>
<xsl:template name="video">
</xsl:template>
<xsl:template name="video">
<div class="video">
<xsl:choose>
@ -47,7 +43,14 @@
<div>
<a>
<xsl:attribute name="href">
<xsl:value-of select="concat(//video/rdf:RDF/cc:Work/dc:identifier, '/cortado=false')" />
<xsl:choose>
<xsl:when test="//@embed='true'">
<xsl:value-of select="concat(//video/rdf:RDF/cc:Work/dc:identifier, '/cortado=false&amp;embed=true')" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="concat(//video/rdf:RDF/cc:Work/dc:identifier, '/cortado=false')" />
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
Watch using Browser Video Plugin
</a>
@ -68,7 +71,14 @@
<div>
<a>
<xsl:attribute name="href">
<xsl:value-of select="//video/rdf:RDF/cc:Work/dc:identifier" />
<xsl:choose>
<xsl:when test="//@embed='true'">
<xsl:value-of select="concat(//video/rdf:RDF/cc:Work/dc:identifier, '/embed=true')" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="//video/rdf:RDF/cc:Work/dc:identifier" />
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
Watch using Cortado Java Applet
</a>
@ -77,184 +87,185 @@
</xsl:choose>
</div>
<div class="videodownload">
<a>
<xsl:attribute name="href">
<xsl:value-of select="//video/rdf:RDF/cc:Work/@rdf:about" />
</xsl:attribute>
<img src="/images/tango/document-save.png" />
</a>
<a>
<xsl:attribute name="href">
<xsl:value-of select="//video/rdf:RDF/cc:Work/@rdf:about" />
</xsl:attribute>
<xsl:if test="not(//@embed='true')">
<div class="videodownload">
<a>
<xsl:attribute name="href">
<xsl:value-of select="//video/rdf:RDF/cc:Work/@rdf:about" />
</xsl:attribute>
<img src="/images/tango/document-save.png" />
</a>
<a>
<xsl:attribute name="href">
<xsl:value-of select="//video/rdf:RDF/cc:Work/@rdf:about" />
</xsl:attribute>
<br />
<xsl:value-of select="$locale_strings[@id='download_video']" />
</a>
</div>
<div class="videoccdata">
<a>
<xsl:attribute name="href">
<xsl:value-of select="//video/rdf:RDF/cc:License/@rdf:about" />
</xsl:attribute>
<xsl:value-of select="$locale_strings[@id='license_conditions']" />:
</a>
<br />
<xsl:value-of select="$locale_strings[@id='download_video']" />
</a>
</div>
<a>
<xsl:attribute name="href">
<xsl:value-of select="//video/rdf:RDF/cc:License/@rdf:about" />
</xsl:attribute>
<!--
unfinished bizness
<xsl:value-of select="@rdf:about" />
<xsl:if test="true()">
<img src="./images/cc/somerights.png" />
</xsl:if>
-->
<xsl:for-each select="//video/rdf:RDF/cc:License/cc:permits">
<!--
since we are talking about digital media here, distribution actually /is/ reproduction
(also, i was too stupid to figure out how to test for both conditions).
<xsl:if test="@rdf:resource = 'http://web.resource.org/cc/Reproduction'">
<img src="./images/cc/cc-share.png" />
</xsl:if>
-->
<xsl:if test="@rdf:resource = 'http://web.resource.org/cc/Distribution'">
<img src="./images/cc/cc-share.png" />
</xsl:if>
<xsl:if test="@rdf:resource = 'http://web.resource.org/cc/DerivativeWorks'">
<img src="./images/cc/cc-remix.png" />
</xsl:if>
</xsl:for-each>
<xsl:for-each select="rdf:RDF/cc:License/cc:requires">
<xsl:if test="@rdf:resource = 'http://web.resource.org/cc/Notice'">
<img src="./images/cc/cc-by.png" />
</xsl:if>
<xsl:if test="@rdf:resource = 'http://web.resource.org/cc/ShareAlike'">
<img src="./images/cc/cc-sharealike.png" />
</xsl:if>
<!--
source code doesn't make much sense in video context.
still, this is preserved for potential future use.
<xsl:if test="@rdf:resource = 'http://web.resource.org/cc/SourceCode'">
SOURCE
</xsl:if>
-->
</xsl:for-each>
<xsl:for-each select="rdf:RDF/cc:License/cc:prohibits">
<xsl:if test="@rdf:resource = 'http://web.resource.org/cc/CommercialUse'">
<img src="./images/cc/cc-noncommercial.png" />
</xsl:if>
<xsl:if test="@rdf:resource = 'http://web.resource.org/cc/DerivativeWorks'">
<img src="./images/cc/cc-noderivatives.png" />
</xsl:if>
</xsl:for-each>
</a>
</div>
<div class="videoccdata">
<a>
<xsl:attribute name="href">
<xsl:value-of select="//video/rdf:RDF/cc:License/@rdf:about" />
</xsl:attribute>
<xsl:value-of select="$locale_strings[@id='license_conditions']" />:
</a>
<br />
<a>
<xsl:attribute name="href">
<xsl:value-of select="//video/rdf:RDF/cc:License/@rdf:about" />
</xsl:attribute>
<!--
unfinished bizness
<xsl:value-of select="@rdf:about" />
<xsl:if test="true()">
<img src="./images/cc/somerights.png" />
</xsl:if>
-->
<xsl:for-each select="//video/rdf:RDF/cc:License/cc:permits">
<!--
since we are talking about digital media here, distribution actually /is/ reproduction
(also, i was too stupid to figure out how to test for both conditions).
<xsl:if test="@rdf:resource = 'http://web.resource.org/cc/Reproduction'">
<img src="./images/cc/cc-share.png" />
</xsl:if>
-->
<xsl:if test="@rdf:resource = 'http://web.resource.org/cc/Distribution'">
<img src="./images/cc/cc-share.png" />
</xsl:if>
<xsl:if test="@rdf:resource = 'http://web.resource.org/cc/DerivativeWorks'">
<img src="./images/cc/cc-remix.png" />
</xsl:if>
</xsl:for-each>
<xsl:for-each select="rdf:RDF/cc:License/cc:requires">
<xsl:if test="@rdf:resource = 'http://web.resource.org/cc/Notice'">
<img src="./images/cc/cc-by.png" />
</xsl:if>
<xsl:if test="@rdf:resource = 'http://web.resource.org/cc/ShareAlike'">
<img src="./images/cc/cc-sharealike.png" />
</xsl:if>
<!--
source code doesn't make much sense in video context.
still, this is preserved for potential future use.
<xsl:if test="@rdf:resource = 'http://web.resource.org/cc/SourceCode'">
SOURCE
</xsl:if>
-->
</xsl:for-each>
<xsl:for-each select="rdf:RDF/cc:License/cc:prohibits">
<xsl:if test="@rdf:resource = 'http://web.resource.org/cc/CommercialUse'">
<img src="./images/cc/cc-noncommercial.png" />
</xsl:if>
<xsl:if test="@rdf:resource = 'http://web.resource.org/cc/DerivativeWorks'">
<img src="./images/cc/cc-noderivatives.png" />
</xsl:if>
</xsl:for-each>
</a>
</div>
<table class="videometadata">
<tr>
<td class="leftcell">
<xsl:value-of select="$locale_strings[@id='DC.Title']" />:
</td>
<td class="rightcell">
<xsl:value-of select="//video/rdf:RDF/cc:Work/dc:title" />
</td>
</tr>
<tr>
<td class="leftcell">
<xsl:value-of select="$locale_strings[@id='DC.Creator']" />:
</td>
<td class="rightcell">
<xsl:value-of select="//video/rdf:RDF/cc:Work/dc:creator" />
</td>
</tr>
<tr>
<td class="leftcell">
<xsl:value-of select="$locale_strings[@id='DC.Subject']" />:
</td>
<td class="rightcell">
<xsl:value-of select="//video/rdf:RDF/cc:Work/dc:subject" />
</td>
</tr>
<tr>
<td class="leftcell">
<xsl:value-of select="$locale_strings[@id='DC.Description']" />:
</td>
<td class="rightcell">
<xsl:value-of select="//video/rdf:RDF/cc:Work/dc:description" />
</td>
</tr>
<tr>
<td class="leftcell">
<xsl:value-of select="$locale_strings[@id='DC.Publisher']" />:
</td>
<td class="rightcell">
<xsl:value-of select="//video/rdf:RDF/cc:Work/dc:publisher" />
</td>
</tr>
<tr>
<td class="leftcell">
<xsl:value-of select="$locale_strings[@id='DC.Date']" />:
</td>
<td class="rightcell">
<xsl:value-of select="//video/rdf:RDF/cc:Work/dc:date" />
</td>
</tr>
<tr>
<td class="leftcell">
<xsl:value-of select="$locale_strings[@id='DC.Source']" />:
</td>
<td class="rightcell">
<xsl:value-of select="//video/rdf:RDF/cc:Work/dc:source" />
</td>
</tr>
<tr>
<td class="leftcell">
<xsl:value-of select="$locale_strings[@id='DC.Rights']" />:
</td>
<td class="rightcell">
<xsl:value-of select="//video/rdf:RDF/cc:Work/dc:rights" />
</td>
</tr>
</table>
<table class="referer">
<xsl:for-each select="//referers/referer">
<table class="videometadata">
<tr>
<td class="leftcell">
<xsl:value-of select="@count" />
<xsl:value-of select="$locale_strings[@id='DC.Title']" />:
</td>
<td class="rightcell">
<xsl:value-of select="@referer" />
<xsl:value-of select="//video/rdf:RDF/cc:Work/dc:title" />
</td>
</tr>
</xsl:for-each>
</table>
<tr>
<td class="leftcell">
<xsl:value-of select="$locale_strings[@id='DC.Creator']" />:
</td>
<td class="rightcell">
<xsl:value-of select="//video/rdf:RDF/cc:Work/dc:creator" />
</td>
</tr>
<tr>
<td class="leftcell">
<xsl:value-of select="$locale_strings[@id='DC.Subject']" />:
</td>
<td class="rightcell">
<xsl:value-of select="//video/rdf:RDF/cc:Work/dc:subject" />
</td>
</tr>
<tr>
<td class="leftcell">
<xsl:value-of select="$locale_strings[@id='DC.Description']" />:
</td>
<td class="rightcell">
<xsl:value-of select="//video/rdf:RDF/cc:Work/dc:description" />
</td>
</tr>
<tr>
<td class="leftcell">
<xsl:value-of select="$locale_strings[@id='DC.Publisher']" />:
</td>
<td class="rightcell">
<xsl:value-of select="//video/rdf:RDF/cc:Work/dc:publisher" />
</td>
</tr>
<tr>
<td class="leftcell">
<xsl:value-of select="$locale_strings[@id='DC.Date']" />:
</td>
<td class="rightcell">
<xsl:value-of select="//video/rdf:RDF/cc:Work/dc:date" />
</td>
</tr>
<tr>
<td class="leftcell">
<xsl:value-of select="$locale_strings[@id='DC.Source']" />:
</td>
<td class="rightcell">
<xsl:value-of select="//video/rdf:RDF/cc:Work/dc:source" />
</td>
</tr>
<tr>
<td class="leftcell">
<xsl:value-of select="$locale_strings[@id='DC.Rights']" />:
</td>
<td class="rightcell">
<xsl:value-of select="//video/rdf:RDF/cc:Work/dc:rights" />
</td>
</tr>
</table>
<xsl:call-template name="comments"/>
<table class="videometadata">
<xsl:for-each select="//referers/referer">
<tr>
<td class="leftcell">
<xsl:value-of select="@count" />
</td>
<td class="rightcell">
<xsl:value-of select="@referer" />
</td>
</tr>
</xsl:for-each>
</table>
<xsl:if test="not(//@username='')">
<div class="commentform">
<form method="post">
<xsl:attribute name="action">
<xsl:value-of select="//video/rdf:RDF/cc:Work/dc:identifier" />
</xsl:attribute>
<fieldset>
<br />
<textarea name="comment" cols="30" rows="3" />
<br />
<input type="submit" name="send">
<xsl:attribute name="value">
<xsl:value-of select="$locale_strings[@id='comment_post']" />
</xsl:attribute>
</input>
</fieldset>
</form>
</div>
<xsl:call-template name="comments"/>
<xsl:if test="not(//@username='')">
<div class="commentform">
<form method="post">
<xsl:attribute name="action">
<xsl:value-of select="//video/rdf:RDF/cc:Work/dc:identifier" />
</xsl:attribute>
<fieldset>
<br />
<textarea name="comment" cols="30" rows="3" />
<br />
<input type="submit" name="send">
<xsl:attribute name="value">
<xsl:value-of select="$locale_strings[@id='comment_post']" />
</xsl:attribute>
</input>
</fieldset>
</form>
</div>
</xsl:if>
</xsl:if>
</xsl:template>
<xsl:template name="comments">
@ -268,7 +279,7 @@
<div class="comment">
<a>
<xsl:attribute name="href">
./user/<xsl:value-of select="@username" />
/user/<xsl:value-of select="@username" />
</xsl:attribute>
<xsl:value-of select="@username" />
</a>: