diff options
author | Dieter Hametner <dh (plus) vdr (at) gekrumbel (dot) de> | 2007-06-11 23:14:27 +0000 |
---|---|---|
committer | Dieter Hametner <dh (plus) vdr (at) gekrumbel (dot) de> | 2007-06-11 23:14:27 +0000 |
commit | 735df57886b042ff3edc65a01b808476f7e20401 (patch) | |
tree | 4412a3acb001dda4264d260f95141e0a52b9ea5a | |
parent | 0a6f5eebc80a0301119ae16e79ba08814e748f77 (diff) | |
download | vdr-plugin-live-735df57886b042ff3edc65a01b808476f7e20401.tar.gz vdr-plugin-live-735df57886b042ff3edc65a01b808476f7e20401.tar.bz2 |
- Additional fixes for better styleability. Set class 'bottomrow' on
table cells which are followed by a spacer line.
-rw-r--r-- | css/styles.css | 6 | ||||
-rw-r--r-- | pages/edit_searchtimer.ecpp | 2 | ||||
-rw-r--r-- | pages/schedule.ecpp | 29 | ||||
-rw-r--r-- | pages/searchresults.ecpp | 44 | ||||
-rw-r--r-- | pages/searchtimers.ecpp | 30 | ||||
-rw-r--r-- | pages/timers.ecpp | 44 | ||||
-rw-r--r-- | pages/whats_on.ecpp | 150 | ||||
-rw-r--r-- | timers.cpp | 12 | ||||
-rw-r--r-- | timers.h | 8 |
9 files changed, 176 insertions, 149 deletions
diff --git a/css/styles.css b/css/styles.css index 174c9ec..e29b3a8 100644 --- a/css/styles.css +++ b/css/styles.css @@ -451,7 +451,7 @@ table th.toprow { } table td.bottomrow { - border-bottom: 1px solid black; + border-bottom: 1px solid black !important; } table td.leftcol { @@ -502,6 +502,7 @@ div.station div div { div.station div div div { background: url(bg_box_h.png) repeat-x; + line-height: 20px; vertical-align: middle; text-align: left; margin-right: 3px; @@ -613,7 +614,7 @@ table.listing { } table.listing tr td { - background: url(bg_line.png) bottom repeat-x; + background: transparent url(bg_line.png) bottom repeat-x; border-bottom: 1px solid #C0C1DA; } @@ -647,7 +648,6 @@ table.listing tr.description td { table.listing tr.spacer td { height: 10px; background: transparent; - border-top: 1px solid black; border-bottom: 0px; } diff --git a/pages/edit_searchtimer.ecpp b/pages/edit_searchtimer.ecpp index 0cf09e5..5404c1a 100644 --- a/pages/edit_searchtimer.ecpp +++ b/pages/edit_searchtimer.ecpp @@ -801,7 +801,7 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); </tr> <tr> - <td class="buttonpanel leftcol rightcol" colspan="2"> + <td class="buttonpanel leftcol rightcol bottomrow" colspan="2"> <div class="withmargin"> <button class="green" type="submit" name="test" value="test" onclick="return checksearch();"><$ tr("Test") $></button> <button class="green" type="submit" name="save" onclick="return checksearch();"><$ tr("Save") $></button> diff --git a/pages/schedule.ecpp b/pages/schedule.ecpp index b5d3286..b2faf89 100644 --- a/pages/schedule.ecpp +++ b/pages/schedule.ecpp @@ -90,6 +90,18 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); os << Event->EventID(); string strEventID = os.str(); bool truncated = false; + bool lastEventCurrentDay = false; + { + cEvent* NextEvent = Schedule->Events()->Next(Event); + if (!NextEvent) { + lastEventCurrentDay = true; + } + else { + string nday(NextEvent->StartTime() ? FormatDateTime(tr("%A, %b %d %Y"), NextEvent->StartTime()) : ""); + lastEventCurrentDay = (day != nday); + } + } + if (current_day != day) { if (current_day != "") { }> @@ -102,19 +114,14 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); <tr class="head"> <td colspan="5"><div class="boxheader"><div><div><$ day $></div></div></div></td> </tr> -% current_day = day; +% current_day = day; % } <tr> - <td class="action leftcol"><& pageelems.event_timer channelid=(channel_id) eventid=(event) &></td> - <td class="action"><%cpp>if (LiveFeatures<features::epgsearch>().Recent() ) { </%cpp><a href="searchresults.html?searchplain=<$ StringUrlEncode(title) $>"><img src="<$ LiveSetup().GetThemedLink("img", "search.png") $>" alt="" <& tooltip.hint text=(tr("Search for repeats.")) &>></img></a><%cpp> } else { </%cpp><img src="transparent.png" width="16" height="16"><%cpp> } </%cpp></td> - <td class="action"><a href="http://akas.imdb.com/Tsearch?title=<$ StringUrlEncode(title) $>"><img src="<$ LiveSetup().GetThemedLink("img", "imdb.png") $>" border="0" alt="" <& tooltip.hint text=(tr("Find more at the Internet Movie Database.")) &>></img></a></td> - <td class="topaligned"><div class="withmargin"><$ start $> - <$ end $></div></td> - <td class="<? (Event == PresentEvent) ? "current" ?> topaligned rightcol"><div class="more withmargin" <& tooltip.hint text=(StringEscapeAndBreak(StringWordTruncate(description, 300, truncated)) + "<br />" + tr("Click to view details.")) &><& tooltip.display domId=(epgEvent->Id()) &>><span class="title"><$ title $></span><br /><span class="short"><%cpp>if (short_description.empty()) { </%cpp> <%cpp> } </%cpp><$ short_description $></span></div></td> - </tr> -% } -% if (Schedule->Events()->Count() > 0) { - <tr class="spacer"> - <td colspan="5"/> + <td class="action leftcol <? lastEventCurrentDay ? "bottomrow" ?>"><& pageelems.event_timer channelid=(channel_id) eventid=(event) &></td> + <td class="action <? lastEventCurrentDay ? "bottomrow" ?>"><%cpp>if (LiveFeatures<features::epgsearch>().Recent() ) { </%cpp><a href="searchresults.html?searchplain=<$ StringUrlEncode(title) $>"><img src="<$ LiveSetup().GetThemedLink("img", "search.png") $>" alt="" <& tooltip.hint text=(tr("Search for repeats.")) &>></img></a><%cpp> } else { </%cpp><img src="transparent.png" width="16" height="16"><%cpp> } </%cpp></td> + <td class="action <? lastEventCurrentDay ? "bottomrow" ?>"><a href="http://akas.imdb.com/Tsearch?title=<$ StringUrlEncode(title) $>"><img src="<$ LiveSetup().GetThemedLink("img", "imdb.png") $>" border="0" alt="" <& tooltip.hint text=(tr("Find more at the Internet Movie Database.")) &>></img></a></td> + <td class="topaligned <? lastEventCurrentDay ? "bottomrow" ?>"><div class="withmargin"><$ start $> - <$ end $></div></td> + <td class="<? (Event == PresentEvent) ? "current" ?> topaligned rightcol <? lastEventCurrentDay ? "bottomrow" ?>"><div class="more withmargin" <& tooltip.hint text=(StringEscapeAndBreak(StringWordTruncate(description, 300, truncated)) + "<br />" + tr("Click to view details.")) &><& tooltip.display domId=(epgEvent->Id()) &>><span class="title"><$ title $></span><br /><span class="short"><%cpp>if (short_description.empty()) { </%cpp> <%cpp> } </%cpp><$ short_description $></span></div></td> </tr> % } </table> diff --git a/pages/searchresults.ecpp b/pages/searchresults.ecpp index 0343a2f..74a424e 100644 --- a/pages/searchresults.ecpp +++ b/pages/searchresults.ecpp @@ -21,10 +21,9 @@ using namespace std; bool logged_in(false); </%session> <%include>page_init.eh</%include> -<{ -if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); -}> <%cpp> + if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); + pageTitle = tr("Search results"); SearchResults results; if (!searchtimerid.empty()) @@ -59,7 +58,7 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); <$ tr("No search results") $> % } <table class="listing" cellspacing="0" callpadding="0"> -<{ +<%cpp> string current_day = ""; EpgEvents epgEvents; int evntNr = 0; @@ -74,51 +73,52 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); tChannelID channel_id(result->Channel()); string description = result->Description(); - string evntId("eventId_"); evntId += lexical_cast<std::string, int>(++evntNr); EpgEventPtr epgEvent(new EpgEvent(evntId, channelname, result->Title(), result->ShortText(), description, result->StartTime(), result->StopTime())); epgEvents.push_back(epgEvent); bool truncated = false; + bool bottom = false; + SearchResults::iterator nextResult = result; ++nextResult; + if (nextResult == results.end()) + bottom = true; + else { + string nextDay(nextResult->StartTime() ? FormatDateTime(tr("%A, %b %d %Y"), nextResult->StartTime()) : ""); + bottom = (day != nextDay); + } + if (current_day != day) { if (current_day != "") { -}> +</%cpp> <tr class="spacer"> <td colspan="4"/> </tr> -<{ - } -}> +% } <tr class="head"> <td colspan="4"><div class="boxheader"><div><div><$ day $></div></div></div></td> </tr> % current_day = day; % } <tr> - <td class="action leftcol"><& pageelems.event_timer channelid=(channel_id) eventid=(event)&></td> - <td class="topaligned"><div class="withmargin"><a href="schedule.html?channel=<$ channelnr $>"><$ channelname $></a></div></td> - <td class="topaligned"><div class="withmargin"><$ start $> - <$ end $></div></td> - <td class="topaligned rightcol"><div class="more withmargin"<& tooltip.hint text=(StringEscapeAndBreak(StringWordTruncate(description, 300, truncated)) + "<br />" + tr("Click to view details.")) &><& tooltip.display domId=(epgEvent->Id()) &>><span class="title"><$ result->Title() $></span><br /><span class="short"><%cpp>if (result->ShortText().empty()) { </%cpp> <%cpp> } </%cpp><$ result->ShortText() $></span></div></td> - </tr> -% } -% if (results.size() > 0) { - <tr class="spacer"> - <td colspan="4"/> + <td class="action leftcol <? bottom ? "bottomrow"?>"><& pageelems.event_timer channelid=(channel_id) eventid=(event)&></td> + <td class="topaligned <? bottom ? "bottomrow"?>"><div class="withmargin"><a href="schedule.html?channel=<$ channelnr $>"><$ channelname $></a></div></td> + <td class="topaligned <? bottom ? "bottomrow"?>"><div class="withmargin"><$ start $> - <$ end $></div></td> + <td class="topaligned rightcol <? bottom ? "bottomrow"?>"><div class="more withmargin"<& tooltip.hint text=(StringEscapeAndBreak(StringWordTruncate(description, 300, truncated)) + "<br />" + tr("Click to view details.")) &><& tooltip.display domId=(epgEvent->Id()) &>><span class="title"><$ result->Title() $></span><br /><span class="short"><%cpp>if (result->ShortText().empty()) { </%cpp> <%cpp> } </%cpp><$ result->ShortText() $></span></div></td> </tr> % } </table> </div> <div class="epg_data" style="display: none;"> -<{ +<%cpp> // create hidden div for the tooltip hints. for (vector<EpgEventPtr>::iterator i = epgEvents.begin(); i != epgEvents.end(); ++i) { EpgEventPtr epg = *i; -}> +</%cpp> <& pageelems.epg_tt_box boxId=(epg->Id()) caption=(epg->Caption()) time=(epg->StartTime(tr("%I:%M %p")) + string(" - ") + epg->EndTime(tr("%I:%M %p"))) title=(epg->Title()) short_descr=(epg->ShortDescr()) long_descr=(epg->LongDescr()) elapsed=(epg->Elapsed()) &> -<{ +<%cpp> } -}> +</%cpp> </div> </body> </html> diff --git a/pages/searchtimers.ecpp b/pages/searchtimers.ecpp index 8f4c437..5594293 100644 --- a/pages/searchtimers.ecpp +++ b/pages/searchtimers.ecpp @@ -18,9 +18,9 @@ using namespace std; bool logged_in(false); </%session> <%include>page_init.eh</%include> -<{ +<%cpp> if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); -}> +</%cpp> <%cpp> pageTitle = tr("Searchtimers"); SearchTimers timers; @@ -58,22 +58,24 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); <td><div class="withmargin"><$ tr("Starts between") $></div></td> <td class="rightcol" colspan="4"/> </tr> -<{ +<%cpp> for (SearchTimers::iterator timer = timers.begin(); timer != timers.end(); ++timer) { -}> + SearchTimers::iterator nextTimer = timer; ++nextTimer; + bool bottom = (nextTimer == timers.end()); +</%cpp> <tr> - <td class="action leftcol"><{ if(timer->UseAsSearchTimer()) { }><img src="<$ LiveSetup().GetThemedLink("img", "arrow.png") $>" alt=""></img><{ } }></td> - <td><div class="withmargin"><$ timer->Search() $></div></td> - <td><div class="withmargin"><$ timer->ChannelText() $></div></td> - <td><div class="withmargin"><? timer->UseTime() ? timer->StartTimeFormatted()+" - "+timer->StopTimeFormatted() ?></div></td> - <td class="action"><a href="searchtimers.html?searchtimerid=<$ timer->Id() $>&action=toggle"><img src="<$ LiveSetup().GetThemedLink("img", timer->UseAsSearchTimer() ? "active.png" : "inactive.png") $>" alt="<$ tr("Toggle search timer actions (in)active") $>" <& tooltip.hint text=(tr("Toggle search timer actions (in)active")) &>></img></a></td> - <td class="action"><a href="searchresults.html?searchtimerid=<$ timer->Id() $>"><img src="<$ LiveSetup().GetThemedLink("img", "search.png") $>" alt="<$ tr("Browse search timer results") $>" <& tooltip.hint text=(tr("Browse search timer results")) &>></img></a></td> - <td class="action"><a href="edit_searchtimer.html?searchtimerid=<$ timer->Id() $>"><img src="<$ LiveSetup().GetThemedLink("img", "edit.png") $>" alt="<$ tr("Edit search timer") $>" <& tooltip.hint text=(tr("Edit search timer")) &>></img></a></td> - <td class="action rightcol"><a href="searchtimers.html?searchtimerid=<$ timer->Id() $>&action=delete" onclick="return confirm('<$ tr("Delete this search timer?") $>')"><img src="<$ LiveSetup().GetThemedLink("img", "del.png") $>" alt="<$ tr("Delete search timer") $>" <& tooltip.hint text=(tr("Delete search timer")) &>></img></a></td> + <td class="action leftcol <? bottom ? "bottomrow" ?>"><%cpp> if(timer->UseAsSearchTimer()) { </%cpp><img src="<$ LiveSetup().GetThemedLink("img", "arrow.png") $>" alt=""></img><%cpp> } </%cpp></td> + <td class="<? bottom ? "bottomrow" ?>"><div class="withmargin"><$ timer->Search() $></div></td> + <td class="<? bottom ? "bottomrow" ?>"><div class="withmargin"><$ timer->ChannelText() $></div></td> + <td class="<? bottom ? "bottomrow" ?>"><div class="withmargin"><? timer->UseTime() ? timer->StartTimeFormatted()+" - "+timer->StopTimeFormatted() ?></div></td> + <td class="action <? bottom ? "bottomrow" ?>"><a href="searchtimers.html?searchtimerid=<$ timer->Id() $>&action=toggle"><img src="<$ LiveSetup().GetThemedLink("img", timer->UseAsSearchTimer() ? "active.png" : "inactive.png") $>" alt="<$ tr("Toggle search timer actions (in)active") $>" <& tooltip.hint text=(tr("Toggle search timer actions (in)active")) &>></img></a></td> + <td class="action <? bottom ? "bottomrow" ?>"><a href="searchresults.html?searchtimerid=<$ timer->Id() $>"><img src="<$ LiveSetup().GetThemedLink("img", "search.png") $>" alt="<$ tr("Browse search timer results") $>" <& tooltip.hint text=(tr("Browse search timer results")) &>></img></a></td> + <td class="action <? bottom ? "bottomrow" ?>"><a href="edit_searchtimer.html?searchtimerid=<$ timer->Id() $>"><img src="<$ LiveSetup().GetThemedLink("img", "edit.png") $>" alt="<$ tr("Edit search timer") $>" <& tooltip.hint text=(tr("Edit search timer")) &>></img></a></td> + <td class="action rightcol <? bottom ? "bottomrow" ?>"><a href="searchtimers.html?searchtimerid=<$ timer->Id() $>&action=delete" onclick="return confirm('<$ tr("Delete this search timer?") $>')"><img src="<$ LiveSetup().GetThemedLink("img", "del.png") $>" alt="<$ tr("Delete search timer") $>" <& tooltip.hint text=(tr("Delete search timer")) &>></img></a></td> </tr> -<{ +<%cpp> } -}> +</%cpp> <tr class="spacer"> <td colspan="8"/> </tr> diff --git a/pages/timers.ecpp b/pages/timers.ecpp index c78a4d0..bba08cd 100644 --- a/pages/timers.ecpp +++ b/pages/timers.ecpp @@ -1,4 +1,5 @@ <%pre> +#include <set> #include <vdr/i18n.h> #include "timers.h" #include "tools.h" @@ -58,14 +59,17 @@ using namespace vdrlive; % } else { <table class="listing" cellspacing="0" cellpadding="0"> <%cpp> + // output of the timer list: for (SortedTimers::iterator timer = timers.begin(); timer != timers.end(); ++timer) { - string currentDay = timer->WeekDays() > 0 ? -#if VDRVERSNUM < 10503 - *cTimer::PrintDay(0, timer->WeekDays()) : -#else - *cTimer::PrintDay(0, timer->WeekDays(), true) : -#endif - FormatDateTime(tr("%A, %x"), timer->Day()); + string currentDay = SortedTimers::GetTimerDays(*timer); + SortedTimers::iterator nextTimer = timer; ++nextTimer; + bool bottom = false; + if (nextTimer == timers.end()) + bottom = true; + else { + string nextDay = SortedTimers::GetTimerDays(*nextTimer); + bottom = (currentDay != nextDay); + } if (previousDay != currentDay) { if (!previousDay.empty()) { </%cpp> @@ -79,14 +83,7 @@ using namespace vdrlive; <tr class="head"> <td colspan="8"> <div class="boxheader"><div><div> - <$ timer->WeekDays() > 0 ? -#if VDRVERSNUM < 10503 - *cTimer::PrintDay(0, timer->WeekDays()) : -#else - *cTimer::PrintDay(0, timer->WeekDays(), true) : -#endif - - FormatDateTime(tr("%A, %x"), timer->Day()) $> + <$ currentDay $> </div></div></div> </td> </tr> @@ -109,20 +106,19 @@ using namespace vdrlive; timerStateImg = "arrow.png"; </%cpp> <tr> - <td class="leftcol"><img src="<$ LiveSetup().GetThemedLink("img", timerStateImg) $>" alt=""></img></td> - <td><div class="withmargin"><a href="schedule.html?channel=<$ timer->Channel()->Number()$>"><$ timer->Channel()->Name() $></a></div></td> - <td><div class="withmargin"><$ FormatDateTime(tr("%I:%M %p"), timer->StartTime()) $></div></td> - <td><div class="withmargin"><$ FormatDateTime(tr("%I:%M %p"), timer->StopTime()) $></div></td> - <td><div class="withmargin"><$ timer->File() $></div></td> - <td class="action"><a href="timers.html?timerid=<$ timers.GetTimerId(*timer) $>&action=toggle"><img src="<$ LiveSetup().GetThemedLink("img", (timer->Flags() & tfActive) ? "active.png" : "inactive.png") $>" alt="" <& tooltip.hint text=(tr("Toggle timer active/inactive")) &>></img></a></td> - <td class="action"><a href="edit_timer.html?timerid=<$ timers.GetTimerId(*timer) $>"><img src="<$ LiveSetup().GetThemedLink("img", "edit.png") $>" alt="" <& tooltip.hint text=(tr("Edit timer")) &>></img></a></td> - <td class="action rightcol"><a href="timers.html?timerid=<$ timers.GetTimerId(*timer) $>&action=delete"><img src="<$ LiveSetup().GetThemedLink("img", "del.png") $>" alt="" <& tooltip.hint text=(tr("Delete timer")) &>></img></a></td> + <td class="leftcol <? bottom ? "bottomrow" ?>"><img src="<$ LiveSetup().GetThemedLink("img", timerStateImg) $>" alt=""></img></td> + <td class="<? bottom ? "bottomrow" ?>"><div class="withmargin"><a href="schedule.html?channel=<$ timer->Channel()->Number()$>"><$ timer->Channel()->Name() $></a></div></td> + <td class="<? bottom ? "bottomrow" ?>"><div class="withmargin"><$ FormatDateTime(tr("%I:%M %p"), timer->StartTime()) $></div></td> + <td class="<? bottom ? "bottomrow" ?>"><div class="withmargin"><$ FormatDateTime(tr("%I:%M %p"), timer->StopTime()) $></div></td> + <td class="<? bottom ? "bottomrow" ?>"><div class="withmargin"><$ timer->File() $></div></td> + <td class="action <? bottom ? "bottomrow" ?>"><a href="timers.html?timerid=<$ timers.GetTimerId(*timer) $>&action=toggle"><img src="<$ LiveSetup().GetThemedLink("img", (timer->Flags() & tfActive) ? "active.png" : "inactive.png") $>" alt="" <& tooltip.hint text=(tr("Toggle timer active/inactive")) &>></img></a></td> + <td class="action <? bottom ? "bottomrow" ?>"><a href="edit_timer.html?timerid=<$ timers.GetTimerId(*timer) $>"><img src="<$ LiveSetup().GetThemedLink("img", "edit.png") $>" alt="" <& tooltip.hint text=(tr("Edit timer")) &>></img></a></td> + <td class="action rightcol <? bottom ? "bottomrow" ?>"><a href="timers.html?timerid=<$ timers.GetTimerId(*timer) $>&action=delete"><img src="<$ LiveSetup().GetThemedLink("img", "del.png") $>" alt="" <& tooltip.hint text=(tr("Delete timer")) &>></img></a></td> </tr> <%cpp> } } </%cpp> - <tr class="spacer"><td colspan="8"/></tr> </table> </div> </body> diff --git a/pages/whats_on.ecpp b/pages/whats_on.ecpp index 9af9ea2..1b3a012 100644 --- a/pages/whats_on.ecpp +++ b/pages/whats_on.ecpp @@ -35,7 +35,7 @@ string current_displaytime; </%request> <%include>page_init.eh</%include> -<{ +<%cpp> if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); @@ -73,7 +73,7 @@ if (type == "now") { head = tr("What's running at") + string(" ") + FormatDateTime(tr("%I:%M %p"), seektime) +string(" (") +FormatDateTime(tr("%a, %b %d"), seektime) + string(")"); } -}> +</%cpp> <& pageelems.doc_type &> <html> <head> @@ -104,38 +104,46 @@ if (type == "now") { <td colspan="7"><div class="boxheader"><div><div><$ head $></div></div></div></td> </tr> % } -<{ +<%cpp> EpgEvents epgEvents; ReadLock channelsLock( Channels ); if (channelsLock) { int evntNr = 0; for (cChannel *Channel = Channels.First(); Channel && Channel->Number() <= LiveSetup().GetLastChannel(); Channel = Channels.Next(Channel)) { - if (!Channel->GroupSep()) { - const cSchedule *Schedule = Schedules->GetSchedule(Channel); - if (Schedule) { - const cEvent *Event = NULL; - if (type == "now") - Event = Schedule->GetPresentEvent(); - else if (type == "next") - Event = Schedule->GetFollowingEvent(); - else if (type == "at") - Event = Schedule->GetEventAround(seektime); - - if (Event) { - string evntId("eventId_"); - evntId += lexical_cast<std::string, int>(++evntNr); - EpgEventPtr epgEvent(new EpgEvent(evntId, Event, Channel->Name())); - epgEvents.push_back(epgEvent); - tChannelID channel_id(Channel->GetChannelID()); - tEventID event = Event->EventID(); - - bool truncated = false; - string truncDescription = StringWordTruncate(epgEvent->LongDescr(), maximumTooltipHintLength, truncated); - string longDescription = StringEscapeAndBreak(StringWordTruncate(epgEvent->LongDescr(), maximumDescriptionLength)) - + "<br/><br/>" + tr("Click to view details."); -}> -% if (mode == "detail") { + if (Channel->GroupSep()) { + continue; + } + const cSchedule *Schedule = Schedules->GetSchedule(Channel); + if (!Schedule) { + continue; + } + const cEvent *Event = NULL; + if (type == "now") + Event = Schedule->GetPresentEvent(); + else if (type == "next") + Event = Schedule->GetFollowingEvent(); + else if (type == "at") + Event = Schedule->GetEventAround(seektime); + if (!Event) { + continue; + } + + string evntId("eventId_"); + evntId += lexical_cast<std::string, int>(++evntNr); + EpgEventPtr epgEvent(new EpgEvent(evntId, Event, Channel->Name())); + epgEvents.push_back(epgEvent); + tChannelID channel_id(Channel->GetChannelID()); + tEventID event = Event->EventID(); + + bool truncated = false; + string truncDescription = StringWordTruncate(epgEvent->LongDescr(), maximumTooltipHintLength, truncated); + string longDescription = StringEscapeAndBreak(StringWordTruncate(epgEvent->LongDescr(), maximumDescriptionLength)) + + "<br/><br/>" + tr("Click to view details."); + bool lastCurrentChanel = true; + + if (mode == "detail") { +</%cpp> <div class="event"> <div class="station"> <div><div><div><a href="schedule.html?channel=<$ Channel->Number() $>" <& tooltip.hint text=(tr("View the schedule of this channel")) &>><$ (epgEvent->Caption()) $></a></div></div></div> @@ -143,82 +151,82 @@ if (type == "now") { <div class="content"> <div class="tools"> <& pageelems.event_timer channelid=(channel_id) eventid=(event) &> -% if (type == "now") { +% if (type == "now") { <& pageelems.ajax_action_href action="switch_channel" tip=(tr("Switch to this channel.")) param=(channel_id) image="zap.png" alt="" &> -% } -% if ( LiveFeatures< features::epgsearch >().Recent() ) { +% } +% if ( LiveFeatures< features::epgsearch >().Recent() ) { <a href="searchresults.html?searchplain=<$ StringEscapeAndBreak(epgEvent->Title()) $>"><img src="<$ LiveSetup().GetThemedLink("img", "search.png") $>" alt="" <& tooltip.hint text=(tr("Search for repeats.")) &>></img></a> -% } +% } <a href="http://akas.imdb.com/Tsearch?title=<$ StringUrlEncode(epgEvent->Title()) $>"><img src="<$ LiveSetup().GetThemedLink("img", "imdb.png") $>" alt="" <& tooltip.hint text=(tr("Find more at the Internet Movie Database.")) &>></img></a> </div> <div> <div class="info"><$ (epgEvent->StartTime(tr("%I:%M %p"))) $> - <$ (epgEvent->EndTime(tr("%I:%M %p"))) $></div> -% if (epgEvent->Elapsed() >= 0) { +% if (epgEvent->Elapsed() >= 0) { <div class="progress"><div><& pageelems.progressbar progress=(epgEvent->Elapsed()) &></div></div> -% } +% } <div class="title withmargin"><$ (epgEvent->Title()) $></div> <div class="short withmargin"><$ (epgEvent->ShortDescr()) $></div> <div class="description withmargin"><$ truncDescription $></div> -% if (truncated) { +% if (truncated) { <div class="more withmargin"<& tooltip.hint text=(longDescription) &><& tooltip.display domId=(epgEvent->Id()) &>><$ tr("more") $> ...</div> -% } +% } </div> </div> </div> -% } else { // mode == "list" +<%cpp> + } + else { // mode == "list" + lastCurrentChanel = ((Channel->Number() == LiveSetup().GetLastChannel()) + || (!Channels.Next(Channel))); +</%cpp> <tr> - <td class="action leftcol"><& pageelems.event_timer channelid=(channel_id) eventid=(event) &></td> - <td class="action"><%cpp>if (type == "now") { </%cpp><& pageelems.ajax_action_href action="switch_channel" tip=(tr("Switch to this channel.")) param=(channel_id) image="zap.png" alt="" &><%cpp> } </%cpp> - <td class="action"><%cpp>if (LiveFeatures<features::epgsearch>().Recent() ) { </%cpp><a href="searchresults.html?searchplain=<$ StringUrlEncode(epgEvent->Title()) $>"><img src="<$ LiveSetup().GetThemedLink("img", "search.png") $>" border="0" alt="" <& tooltip.hint text=(tr("Search for repeats.")) &>></img></a><%cpp> } else { </%cpp><img src="transparent.png" width="16" height="16"><%cpp> } </%cpp></td> - <td class="action"><a href="http://akas.imdb.com/Tsearch?title=<$ StringUrlEncode(epgEvent->Title()) $>"><img src="<$ LiveSetup().GetThemedLink("img", "imdb.png") $>" border="0" alt="" <& tooltip.hint text=(tr("Find more at the Internet Movie Database.")) &>></img></a></td> - <td class="topaligned"> + <td class="action leftcol <? lastCurrentChanel ? "bottomrow"?>"><& pageelems.event_timer channelid=(channel_id) eventid=(event) &></td> + <td class="action <? lastCurrentChanel ? "bottomrow"?>"><%cpp>if (type == "now") { </%cpp><& pageelems.ajax_action_href action="switch_channel" tip=(tr("Switch to this channel.")) param=(channel_id) image="zap.png" alt="" &><%cpp> } </%cpp> + <td class="action <? lastCurrentChanel ? "bottomrow"?>"><%cpp>if (LiveFeatures<features::epgsearch>().Recent() ) { </%cpp><a href="searchresults.html?searchplain=<$ StringUrlEncode(epgEvent->Title()) $>"><img src="<$ LiveSetup().GetThemedLink("img", "search.png") $>" border="0" alt="" <& tooltip.hint text=(tr("Search for repeats.")) &>></img></a><%cpp> } else { </%cpp><img src="transparent.png" width="16" height="16"><%cpp> } </%cpp></td> + <td class="action <? lastCurrentChanel ? "bottomrow"?>"><a href="http://akas.imdb.com/Tsearch?title=<$ StringUrlEncode(epgEvent->Title()) $>"><img src="<$ LiveSetup().GetThemedLink("img", "imdb.png") $>" border="0" alt="" <& tooltip.hint text=(tr("Find more at the Internet Movie Database.")) &>></img></a></td> + <td class="topaligned <? lastCurrentChanel ? "bottomrow"?>"> <div class="withmargin"> <div class="nomargin"><$ (epgEvent->StartTime(tr("%I:%M %p"))) $> - <$ (epgEvent->EndTime(tr("%I:%M %p"))) $></div> -% if (epgEvent->Elapsed() >= 0) { +% if (epgEvent->Elapsed() >= 0) { <div class="progress"><div><& pageelems.progressbar progress=(epgEvent->Elapsed()) &></div></div> -% } +% } </div> </td> - <td class="topaligned"> + <td class="topaligned <? lastCurrentChanel ? "bottomrow"?>"> <div class="more withmargin" -% if (!longDescription.empty()) { +% if (!longDescription.empty()) { <& tooltip.hint text=(longDescription) &><& tooltip.display domId=(epgEvent->Id()) &> -% } +% } ><span class="title"><$ (epgEvent->Title()) $></span><br /><span class="short"><$ (epgEvent->ShortDescr()) $></span></div> </td> - <td class="topaligned rightcol"><div class="station withmargin"><a href="schedule.html?channel=<$ Channel->Number() $>" <& tooltip.hint text=(tr("View the schedule of this channel")) &>><$ (epgEvent->Caption()) $></a></div></td> + <td class="topaligned rightcol <? lastCurrentChanel ? "bottomrow"?>"><div class="station withmargin"><a href="schedule.html?channel=<$ Channel->Number() $>" <& tooltip.hint text=(tr("View the schedule of this channel")) &>><$ (epgEvent->Caption()) $></a></div></td> </tr> -% } -<{ - } - } - } - } +% } +<%cpp> + } } -}> +</%cpp> +% if (mode == "list") { + </table> +% } </div> <div class="epg_data" style="display: none;"> -<{ +<%cpp> // create hidden div for the tooltip hints. for (vector<EpgEventPtr>::iterator i = epgEvents.begin(); i != epgEvents.end(); ++i) { EpgEventPtr epg = *i; -}> +</%cpp> <& pageelems.epg_tt_box boxId=(epg->Id()) caption=(epg->Caption()) time=(epg->StartTime(tr("%I:%M %p")) + string(" - ") + epg->EndTime(tr("%I:%M %p"))) title=(epg->Title()) short_descr=(epg->ShortDescr()) long_descr=(epg->LongDescr()) elapsed=(epg->Elapsed()) &> -<{ +<%cpp> } -}> -% if (mode == "list") { - <tr class="spacer"> - <td colspan="7"/> - </tr> - </table> -% } +</%cpp> </div> - </body> </html> <%include>page_exit.eh</%include> +<# ------------------------------------------------------------------------- #> + <%def whats_on_actions> <a class="<? current_type == "now" ? "active" ?>" href="whats_on.html?type=now&mode=<$ current_mode $>" id="nowhref"><$ tr("Now") $></a> <span class="sep">|</span> @@ -227,15 +235,15 @@ if (type == "now") { <span class="<? current_type == "at" && current_fixtime != "" ? "active" ?>"><$ tr("What's on") $></span> <select name="userdeftimes" size="1" id="userdeftimes" onchange="showtime(this)"> <option value="0"/> -<{ +<%cpp> vector< string > parts = StringSplit( LiveSetup().GetTimes(), ';' ); vector< string >::const_iterator part = parts.begin(); for ( int i = 0; part != parts.end(); ++i, ++part ) { -}> - <option <{ reply.out() << ( (current_fixtime != "" && *part == current_displaytime) ? "selected=\"selected\"" : "" ); }> value="<$ *part $>"> <$ tr("at") + string(" ") + *part $></option> -<{ +</%cpp> + <option <%cpp> reply.out() << ( (current_fixtime != "" && *part == current_displaytime) ? "selected=\"selected\"" : "" ); </%cpp> value="<$ *part $>"> <$ tr("at") + string(" ") + *part $></option> +<%cpp> } -}> +</%cpp> </select> <span class="sep">|</span> <span class="<? current_type == "at" && current_fixtime == "" ? "active" ?>"><$ tr("at") $></span> @@ -75,6 +75,18 @@ void SortedTimers::ReloadTimers( bool initial ) sort(); } +string SortedTimers::GetTimerDays(cTimer const& timer) +{ + string currentDay = timer.WeekDays() > 0 ? +#if VDRVERSNUM < 10503 + *cTimer::PrintDay(0, timer.WeekDays()) : +#else + *cTimer::PrintDay(0, timer.WeekDays(), true) : +#endif + FormatDateTime(tr("%A, %x"), timer.Day()); + return currentDay; +} + TimerManager::TimerManager() { } @@ -20,13 +20,15 @@ public: cTimer* GetByTimerId( std::string const& timerid ); bool Modified() { return Timers.Modified( m_state ); } - + + static std::string GetTimerDays(cTimer const& timer); + private: SortedTimers(); SortedTimers( SortedTimers const& ); int m_state; - + void ReloadTimers( bool initial = false ); }; @@ -52,7 +54,7 @@ private: typedef std::pair< TimerPair, std::string > ErrorPair; typedef std::list< TimerPair > TimerList; typedef std::list< ErrorPair > ErrorList; - + TimerManager(); TimerManager( TimerManager const& ); |