diff options
Diffstat (limited to 'pages/whats_on.ecpp')
-rw-r--r-- | pages/whats_on.ecpp | 67 |
1 files changed, 43 insertions, 24 deletions
diff --git a/pages/whats_on.ecpp b/pages/whats_on.ecpp index 9944e21..a902ae6 100644 --- a/pages/whats_on.ecpp +++ b/pages/whats_on.ecpp @@ -202,7 +202,18 @@ if (type == "now") { curresults.GetByID(timer->Id()); results.merge(curresults); } + time_t now = time(NULL); for (SearchResults::iterator result = results.begin(); result != results.end(); ++result) { + long diff = result->StartTime() - now; + long absdiff = labs(diff); + if (absdiff >= 24*60*60) continue; // skip broadcasts more than a day away + + string diffstring = string((diff > 0) ? tr("in") : tr("since")) + " "; + if (absdiff >= (60 * 60)) + diffstring += lexical_cast<std::string>(long(absdiff / (60*60))) + " " + tr("hours"); + else + diffstring += lexical_cast<std::string>(long(absdiff / 60)) + " " + tr("minutes"); + string epgId = EpgEvents::EncodeDomId(result->Channel(), result->EventId()); string channelname = Channels.GetByChannelID(result->Channel())->Name(); int channelnr = Channels.GetByChannelID(result->Channel())->Number(); @@ -212,31 +223,16 @@ if (type == "now") { + "<br/><br/>" + tr("Click to view details."); // last result? - bool bottom = false; SearchResults::iterator nextres = result; - nextres++; - if (nextres == results.end()) bottom = true; - - time_t now = time(NULL); - long diff = result->StartTime() - now; - long absdiff = labs(diff); - if (absdiff >= 24*60*60) continue; // skip broadcasts more than a day away - string diffstring; - if (absdiff >= (60 * 60)) - diffstring = lexical_cast<std::string>(long(absdiff / (60*60))) + " hours"; - else - diffstring = lexical_cast<std::string>(long(absdiff / 60)) + " minutes"; - if (diff > 0) - diffstring = "in " + diffstring; - else - diffstring = "since " + diffstring; + bool bottom = (++nextres == results.end()); + if (mode == "list") { </%cpp> <tr> <& pageelems.epg_tool_box detail=(0) epgid=(epgId) title=(result->Title()) startTime=(result->StartTime()) endTime=(result->StopTime()) lastCurrentChanel=(bottom ? 1 : 0) &> <td class="topaligned <? bottom ? "bottomrow"?>"> <div class="withmargin"> <div class="nomargin"><$ (FormatDateTime(tr("%I:%M %p"), result->StartTime())) $> - <$ (FormatDateTime(tr("%I:%M %p"), result->StopTime())) $></div> - <$ diffstring $> minutes + <$ diffstring $> </div> </td> <td class="topaligned <? bottom ? "bottomrow"?>"> @@ -244,14 +240,35 @@ if (type == "now") { % if (!longDescription.empty()) { <& tooltip.hint text=(longDescription) &><& tooltip.display domId=(epgId) &> % } - ><span class="title"><$ (result->Title()) $></span><br /><span class="short"><$ (result->ShortText()) $></span></a></div> - </td> + ><span class="title"><$ (result->Title()) $></span><br /><span class="short"><$ (result->ShortText()) $></span></a></div> + </td> <td class="topaligned rightcol <? bottom ? "bottomrow"?>"><div class="station withmargin"><a href="schedule.html?channel=<$ channelnr $>" <& tooltip.hint text=(tr("View the schedule of this channel")) &>><$ (channelname) $></a></div></td> - </tr> -% } -<%cpp> + </tr> +% } else { + <div class="event"> + <div class="station"> + <div><div><div><a href="schedule.html?channel=<$ channelnr $>" <& tooltip.hint text=(tr("View the schedule of this channel")) &>><$ channelname $></a></div></div></div> + </div> + <div class="content"> + <div class="tools"> + <& pageelems.epg_tool_box detail=(1) epgid=(epgId) title=(result->Title()) startTime=(result->StartTime()) endTime=(result->StopTime()) &> + </div> + <div> + <div class="info"><$ (FormatDateTime(tr("%I:%M %p"), result->StartTime())) $> - <$ (FormatDateTime(tr("%I:%M %p"), result->StopTime())) $></div> + <div class="info"><$ diffstring $></div> + <div class="title withmargin"><$ (result->Title()) $></div> + <div class="short withmargin"><$ (result->ShortText()) $></div> + <div class="description withmargin"><$ truncDescription $></div> +% if (truncated) { + <div class="more withmargin"><a <& tooltip.hint text=(longDescription) &><& tooltip.display domId=(epgId) &>><$ tr("more") $> ...</a></div> +% } + </div> + </div> + </div> +<%cpp> } + } } - </%cpp> +</%cpp> % if (mode == "list") { </table> % } @@ -284,8 +301,10 @@ if (type == "now") { <span class="<? current_type == "at" && current_fixtime == "" ? "active" ?>"><$ tr("at") $></span> <input type="text" size="6" name="spectime" id="spectime" value = "<? current_attime != "" ? current_displaytime ?>" onchange="showspectime(this)"/> <span class="sep">|</span> +% if ( LiveFeatures< features::epgsearch >().Recent() ) { <a class="<? current_type == "favs" ? "active" ?>" href="whats_on.html?type=favs&mode=<$ current_mode $>"><$ tr("Favorites") $></a> <span class="sep">|</span> +% } % if ( current_mode == "list" ) { <a href="whats_on.html?mode=detail&type=<$ current_type $>&attime=<$ current_attime $>&fixtime=<$ current_fixtime $>"><$ tr("Details view") $></a> % } else { |