#from urllib import quote
#from Plugins.Extensions.OpenWebif.local import tstrings
<body> 
	<div data-role="page">
		<div id="header">
			<div class="button" onClick="history.back()">$tstrings['back']</div>
			<h1><a style="color:#FFF;text-decoration:none;" href='/mobile'>OpenWebif</a></h1>
			#set $link=quote($channelinfo.sref, safe=' ~@#$&()*!+=:;,.?/\'')
			<div class="button" style="right:5px;left:auto;" onClick="zapChannel('$link');return false;">$tstrings['zap']</div>
		</div>
		<div id="mainContent" class="ui-corner-all">
			<table width="100%" border="0" cellspacing="1" cellpadding="5">
						<tr>
							<th colspan="3" class="ui-btn-up-b" style="text-align: left;">$tstrings['service']</th>
						</tr>
						<tr style="background-color:  #f0f7fc;">
							<td width="200"><img src="$channelinfo.picon" border="0" alt="" style="max-width:100px"></td>
							<td width="100%" valign="top">
							<strong>$channelinfo.sname</strong><br />
							#if $channelinfo.title
								$channelinfo.title<br />
								$channelinfo.begin-$channelinfo.end ($channelinfo.duration min)<br />
							#end if
							</td>
						</tr>
						<tr>
							<th colspan="2" class="ui-btn-up-b" style="text-align: left;">$tstrings['current_event']</th>
						</tr>
						#if $channelinfo.has_key('shortdesc')
						<tr style="background-color:  #f0f7fc;">
							<td colspan="2">$channelinfo.shortdesc</td>
						</tr>
						#end if
						#if $channelinfo.has_key('longdesc')
						<tr style="background-color:  #f0f7fc;">
							<td colspan="2">$channelinfo.longdesc</td>
						</tr>
						#end if
			</table>
		</div>
		#if $channelepg
		<div id="contentContainer">
			<ul data-role="listview" data-inset="true" data-theme="d">
				<li data-role="list-divider" role="heading" data-theme="b">$tstrings['upcoming_events']</li>
				#set $date=""
				#for $event in $channelepg
					#if $date <> $event.date
						<li data-role="list-divider" role="heading" data-theme="b">$event.date</li>
						#set $date = $event.date
					#end if
				<li style="padding: 3px;">
					<a href="/mobile/eventview?eventid=$event.id&eventref=$event.sref" style="padding: 3px;">
						<h3>$event.title</h3>
						<p>$event.begin - $event.end</p>
					</a>
				</li>
				#end for
			</ul>
		</div>
		#end if
		<div id="footer">
			<p>OpenWebif Mobile</p>
			<a onclick="document.location.href='/index?mode=fullpage';return false;" href="#">$tstrings['show_full_openwebif']</a>
		</div>
<script>
#raw
function zapChannel(sref) {
	$.ajax('/api/zap?sRef=' + escape(sref));
}
</script>
#end raw
</div>
</body>
</html>
