new service screen

git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1788 2a923420-c742-0410-a762-8d5b09965624
This commit is contained in:
hummypkg 2014-02-20 00:51:02 +00:00
parent 23cc31a02a
commit 8c4449ee36
6 changed files with 254 additions and 49 deletions

View File

@ -1,10 +1,10 @@
Package: webif
Priority: optional
Section: web
Version: 1.0.8-6
Version: 1.0.8-7
Architecture: mipsel
Maintainer: af123@hummypkg.org.uk
Depends: webif-channelicons(>=1.1.8),mongoose(>=3.0-9),jim(>=0.74-4),jim-oo,jim-sqlite3(>=0.74-1),jim-cgi(>=0.7),jim-binary,service-control(>=1.2),busybox(>=1.20.2-1),lsof,epg(>=1.0.13),hmt(>=1.1.14),ssmtp,anacron,trm(>=1.1),openssl-command,nicesplice,id3v2,file,rsvsync(>=1.0.2),webif-charts(>=1.2),stripts(>=1.2.5-3),smartmontools,tmenu(>=1.05),ffmpeg,id3v2,multienv(>=1.6)
Suggests:
Description: An evolving web interface for the Humax.
Description: An evolving web interface for the Humax. [Replacement single-channel view screen (in-progress).]
Tags: http://hummy.tv/forum/threads/webif-version-1-0-8-released.4553/

View File

@ -0,0 +1,68 @@
table.weekview
{
width: 100%;
border: 1px solid red;
}
th.day, th.hour, td.dayhour
{
border: solid 1px #d3d3d3;
}
th.day, th.hour
{
background: #ccff99;
color: black;
}
th.day
{
text-align: center;
font-size: 1.2em;
width: 13%;
}
th.hour
{
vertical-align: top;
text-align: center;
font-size: 1.3em;
padding: 8px 0;
}
td.dayhour
{
vertical-align: top;
background: #ffffcc;
}
div.prog
{
margin: 5px;
}
div.progp
{
padding-top: 1em;
}
div.time
{
font-size: 1.3em;
opacity: 0.6;
margin-bottom: 0.4em;
}
div.title
{
font-size: 1.1em;
text-weight: bold;
margin-bottom: 0.4em;
}
div.synopsis
{
font-size: 0.9em;
}

View File

@ -16,52 +16,117 @@ require totop
require epg_popup
set service [cgi_get service 4351]
set records [epg fetch dump -service $service]
set service [cgi_get service 4170]
set records [epg dbfetch dump \
-service $service \
-sort "strftime('%%H%%J', start, 'unixepoch'), strftime('%%M', start, 'unixepoch')" \
-debug 0
]
if {[llength $records] == 0} {
puts "No data for service.."
exit
}
# Load the channel information from the first entry
set tr [lindex $records 0]
$tr get_channel_info
set channel_num [$tr get channel_num]
set channel_name [$tr get channel_name]
puts "
<link type=text/css rel=Stylesheet href=service.css />
<div style=\"margin: 0 1em 1em 1em\">
[$tr channel_icon 80 {vertical-align:middle}]
[$tr channel_icon 40 {vertical-align:middle}]
<span style=\"vertical-align: middle\">
$channel_num - $channel_name
</span>
</div>
"
puts {
<table class=borders>
<tr>
<th></th>
<th>Date</th>
<th>Time</th>
<th>Programme</th>
<th>Synopsis</th>
</tr>
puts "
<div class=weekview>
<table class=weekview>
<thead>
<tr>
<th class=hour></th>
"
set t [clock seconds]
set firstday [clock format $t -format {%Y%m%d}]
set daymap {}
loop i 0 7 {
puts "<th class=\"day day-$i\">[clock format $t -format {%a}]<br>"
puts "[clock format $t -format {%e %b}]</th>"
set daymap([clock format $t -format {%Y%m%d}]) $i
incr t 86400
}
puts "
</tr>
</thead>
<tbody>
"
set currhour -1
set currday -1
foreach e $records {
set start [$e get start]
set day [clock format $start -format "%Y%m%d"]
if {$day ni $daymap} continue
set hour [clock format $start -format "%H"]
if {$hour != $currhour} {
if {$currhour ne "-1"} {
loop i $daymap($currday) 6 {
puts "</td><td class=\"dayhour\">"
}
puts -nonewline "</td></tr>"
}
puts "
<tr class=\"hour\">
<th class=hour>$hour:00</th>
<td class=\"dayhour\">
"
set currhour $hour
set currday $firstday
set newcell 1
}
if {$day ne $currday} {
loop i $daymap($currday) $daymap($day) {
puts "</td><td class=\"dayhour\">"
}
set currday $day
set newcell 1
}
set class "prog"
if {!$newcell} { set class "prog progp" }
if {[$e get series_crid] ne ""} {
set ro 2
} else {
set ro 1
}
set st [$e scheduled]
puts "
<div class=\"$class\">
<div class=time>
[clock format $start -format {%H:%M}]-[clock format [$e end] -format {%H:%M}]
</div>
<div class=title>
<a class=event href=# xs=$service xe=[$e get event_id] sch=$st rec=$ro>
[$e get name]
</a>
</div>
<div class=synopsis>[$e get text] [join [$e icon_set 14] '']</div>
</div>
"
set newcell 0
}
set i 0
foreach record $records {
altrow
#$record get_channel_info
set ended [$record ended]
if {[$record showing]} {
puts "<td><img src=/images/111_1_00_Cursor_2R_Arrow.png></td>"
} else { puts "<td></td>" }
if $ended { puts "<td nowrap class=blood>" } else { puts "<td nowrap>" }
puts "[clock format [$record get start] -format "%a %d %b %Y"]</td>"
if $ended { puts "<td nowrap class=blood>" } else { puts "<td nowrap>" }
puts "[clock format [$record get start] -format "%H:%M"]</td>"
puts [$record cell]
puts "<td>[$record get text]</td>"
puts "<td>[$record get warning]</td>"
puts "</tr>"
}
puts "</table>"
puts "
</td>
</tr>
</tbody>
</table>
</div>
"
epg cleanup
footer

View File

@ -0,0 +1,68 @@
#!/mod/bin/jimsh
package require cgi
source /mod/webif/lib/setup
require epg.class spinner.class altrow
header
require totop
[spinner new {
text "Loading EPG Data..."
size "1.2em"
style "margin: 1em;"
}] start
require epg_popup
set service [cgi_get service 4351]
set records [epg fetch dump -service $service]
set tr [lindex $records 0]
$tr get_channel_info
set channel_num [$tr get channel_num]
set channel_name [$tr get channel_name]
puts "
<div style=\"margin: 0 1em 1em 1em\">
[$tr channel_icon 80 {vertical-align:middle}]
<span style=\"vertical-align: middle\">
$channel_num - $channel_name
</span>
</div>
"
puts {
<table class=borders>
<tr>
<th></th>
<th>Date</th>
<th>Time</th>
<th>Programme</th>
<th>Synopsis</th>
</tr>
}
set i 0
foreach record $records {
altrow
#$record get_channel_info
set ended [$record ended]
if {[$record showing]} {
puts "<td><img src=/images/111_1_00_Cursor_2R_Arrow.png></td>"
} else { puts "<td></td>" }
if $ended { puts "<td nowrap class=blood>" } else { puts "<td nowrap>" }
puts "[clock format [$record get start] -format "%a %d %b %Y"]</td>"
if $ended { puts "<td nowrap class=blood>" } else { puts "<td nowrap>" }
puts "[clock format [$record get start] -format "%H:%M"]</td>"
puts [$record cell]
puts "<td>[$record get text]</td>"
puts "<td>[$record get warning]</td>"
puts "</tr>"
}
puts "</table>"
epg cleanup
footer

View File

@ -50,21 +50,9 @@ class epg {
}
epg method _parse {line} {
set vars [split $line "\t"]
set service_id [lindex $vars 0]
set event_id [lindex $vars 1]
set start [lindex $vars 2]
set duration [lindex $vars 3]
set encrypted [lindex $vars 4]
set name [lindex $vars 5]
set text [lindex $vars 6]
set warning [lindex $vars 7]
set content_code [lindex $vars 8]
set content_type [lindex $vars 9]
set event_crid [lindex $vars 10]
set series_crid [lindex $vars 11]
set rec_crid [lindex $vars 12]
lassign [split $line "\t"] \
service_id event_id start duration encrypted name text warning \
content_code content_type event_crid series_cris rec_crid
}
epg method percent {} {
@ -97,6 +85,10 @@ epg method remaining {} {
return [expr $duration - [$self elapsed]]
}
epg method end {} {
return $($start + $duration)
}
epg method type_icon {} {
set img ""
switch -- $content_code {
@ -371,6 +363,7 @@ proc {epg dbfetch} {mode args} {
set records {}
set extra ""
set params {}
set debug 0
set select "
select distinct *,
@ -393,6 +386,7 @@ proc {epg dbfetch} {mode args} {
if {[string first "-" $arg] == 0} {
set v $args($arg)
switch -- $arg {
-debug { set debug $v }
-crid { append q \
"and e.event_crid = '$v' " }
-scrid { append q \
@ -407,6 +401,9 @@ proc {epg dbfetch} {mode args} {
"and e.start < $v and e.end > $v " }
-after { append q \
"and e.end >= $v " }
-before { append q \
"and e.start < $v " }
-sort { set sort "order by $v" }
-trange {
lassign [split $v :] stt ett
append q "and (
@ -433,6 +430,7 @@ proc {epg dbfetch} {mode args} {
}
append q ") "
}
-param { lappend params $v }
default { error "Invalid option, $arg" }
}
}
@ -440,7 +438,10 @@ proc {epg dbfetch} {mode args} {
set query "$select $from $q $sort"
#puts "QUERY -$query-"
if ($debug) {
puts "QUERY -$query-"
puts "PARAMS -$params-"
}
set records {}
if {[catch {

View File

@ -55,7 +55,10 @@ $(document).ready(function() {
var url = '/cgi-bin/epg/info.jim?service=' +
o.attr('xs') + '&event=' +
o.attr('xe') + '&bare=1';
$('#dialogue').load(url, function() {
$('#dialogue')
.html('<img src=/img/loading.gif> Loading details...' +
' Please wait...')
.load(url, function() {
$('#dialogue a.event').click(function(e) {
epgpopup(e, $(this));
});