#from Plugins.Extensions.OpenWebif.local import tstrings
#for $channel in $channels
<div class="cht">
	<div class="fr">
		<div class="a">
		#if $channel.has_key('protection')
			#if $channel.protection == "0"
				#if $type == "radio"
					<a href="#" onclick="addTimer('','$channel.ref','$channel.name','')" title="$tstrings['add_timer']"><i class="fa fa-clock-o"></i></a>
				#end if
				#if '4097:' in $channel.ref
					#set $rname = ":" + $channel.name
					#set $lnk = $channel.ref.replace("4097:0:1:0:0:0:0:0:0:0:", "").replace("%3a", ":").replace($rname, "")
					<a target="_blank" href='$lnk' title="$tstrings['stream'] $channel.name"><i class="fa fa-desktop"></i></a>
				#else
					<a href="#" onclick="open_epg_dialog('$channel.ref','$channel.name')" title="$tstrings['show_epg_for'] $channel.name"><i class="fa fa-list-alt"></i></a>
					#if $transcoding
						<a href="#" onclick="jumper8001('$channel.ref', '$channel.name');" title="$tstrings['stream']: $channel.name"><i class="fa fa-desktop"></i></a>
						<a href="#" onclick="jumper8002('$channel.ref', '$channel.name');" title="$tstrings['stream'] ($tstrings['transcoded']): $channel.name"><i class="fa fa-mobile"></i></a>
					#else
						<a target="_blank" href='web/stream.m3u?ref=$channel.ref&name=$channel.name' title="$tstrings['stream'] $channel.name"><i class="fa fa-desktop"></i></a>
					#end if
				#end if
			#else
				<a target="_blank" href='#' title="$tstrings['locked']"><i class="fa fa-lock"></i></a>
			#end if
		#end if
		</div>

		<div class="b">
			#set $name =  $channel.name.replace("'", r"\'")
			<span class="channel-name">
			#if $channel.has_key('protection')
				#if $channel.protection == "0"
					<a href="#" onclick="zapChannel('$channel.ref', '$name'); return false" title="$tstrings['zap_to'] $channel.name">$channel.name</a>
				#else
					<a href="#" onclick="return false" title="$tstrings['locked']">$channel.name</a>
				#end if
			#else
				$channel.name
			#end if
			</span>
			#if $channel.has_key('ns')
				<span class="channel-tag ST-$channel.service_type">$channel.service_type</span><span class="channel-tag NS-$channel.ns">$channel.ns</span>
			#end if
		</div>
	</div>

	#if $channel.has_key('protection') and $channel.has_key('now_title') and $channel.protection == "0"
	<div>
		#if $showchannelpicon
			<div class="channel-picon">
				<img class="pic" src="$channel.picon" title="">
			</div>
		#else
			<div style="display:none;"></div>
		#end if
		<div class="channel-info">
			<div class="tt">
				<div class="a">
					$channel.now_begin &mdash; $channel.now_end &nbsp;&nbsp;&nbsp;
				</div>
				<div class="b">
					<a href='#' onClick="toggle_chan_des('$channel.now_ev_id', '$channel.ref', '$channel.now_idp'); return false" title="$channel.now_title">$channel.now_title</a>&nbsp;(+$channel.now_left min)
				</div>
			</div>
			<div class="tt">
				<div class="c">
					<div class="tcld ui-state-default" id="$channel.now_idp">$tstrings['no_description_available']</div>
				</div>
			</div>
			<div class="tt">
				<div class="c">
					<div class="ui-progressbar ui-corner-all ui-widget ui-widget-content">
						<div class="ui-progressbar-value ui-corner-left ui-widget-header" style="width: ${channel.progress}%;"></div>
					</div>
				</div>
			</div>
			<div class="tt">
				<div class="a">
					$channel.next_begin &mdash; $channel.next_end &nbsp;&nbsp;&nbsp;
				</div>
				<div class="b">
					<a href='#' onClick="toggle_chan_des('$channel.next_ev_id', '$channel.ref', '$channel.next_idp'); return false" title="$channel.next_title">$channel.next_title</a>&nbsp;($channel.next_duration min)
				</div>
			</div>
			<div class="tt">
				<div class="c">
					<div class="tcld ui-state-default" id="$channel.next_idp">$tstrings['no_description_available']</div>
				</div>
			</div>
		</div>
	</div>
	#end if
</div>
#end for
