From 735df57886b042ff3edc65a01b808476f7e20401 Mon Sep 17 00:00:00 2001 From: Dieter Hametner Date: Mon, 11 Jun 2007 23:14:27 +0000 Subject: - Additional fixes for better styleability. Set class 'bottomrow' on table cells which are followed by a spacer line. --- pages/edit_searchtimer.ecpp | 2 +- pages/schedule.ecpp | 29 +++++---- pages/searchresults.ecpp | 44 ++++++------- pages/searchtimers.ecpp | 30 ++++----- pages/timers.ecpp | 44 ++++++------- pages/whats_on.ecpp | 150 +++++++++++++++++++++++--------------------- 6 files changed, 156 insertions(+), 143 deletions(-) (limited to 'pages') 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"); - +
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");
<$ day $>
-% current_day = day; +% current_day = day; % } - <& pageelems.event_timer channelid=(channel_id) eventid=(event) &> - <%cpp>if (LiveFeatures().Recent() ) { " alt="" <& tooltip.hint text=(tr("Search for repeats.")) &>><%cpp> } else { <%cpp> } - " border="0" alt="" <& tooltip.hint text=(tr("Find more at the Internet Movie Database.")) &>> -
<$ start $> - <$ end $>
- topaligned rightcol">
" + tr("Click to view details.")) &><& tooltip.display domId=(epgEvent->Id()) &>><$ title $>
<%cpp>if (short_description.empty()) {  <%cpp> } <$ short_description $>
- -% } -% if (Schedule->Events()->Count() > 0) { - - + "><& pageelems.event_timer channelid=(channel_id) eventid=(event) &> + "><%cpp>if (LiveFeatures().Recent() ) { " alt="" <& tooltip.hint text=(tr("Search for repeats.")) &>><%cpp> } else { <%cpp> } + ">" border="0" alt="" <& tooltip.hint text=(tr("Find more at the Internet Movie Database.")) &>> + ">
<$ start $> - <$ end $>
+ topaligned rightcol ">
" + tr("Click to view details.")) &><& tooltip.display domId=(epgEvent->Id()) &>><$ title $>
<%cpp>if (short_description.empty()) {  <%cpp> } <$ short_description $>
% } 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); <%include>page_init.eh -<{ -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") $> % } -<{ +<%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(++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 != "") { -}> + -<{ - } -}> +% } % current_day = day; % } - - - - - -% } -% if (results.size() > 0) { - - + + + % }
<$ day $>
<& pageelems.event_timer channelid=(channel_id) eventid=(event)&>
<$ start $> - <$ end $>
" + tr("Click to view details.")) &><& tooltip.display domId=(epgEvent->Id()) &>><$ result->Title() $>
<%cpp>if (result->ShortText().empty()) {  <%cpp> } <$ result->ShortText() $>
+ "><& pageelems.event_timer channelid=(channel_id) eventid=(event)&>">">
<$ start $> - <$ end $>
">
" + tr("Click to view details.")) &><& tooltip.display domId=(epgEvent->Id()) &>><$ result->Title() $>
<%cpp>if (result->ShortText().empty()) {  <%cpp> } <$ result->ShortText() $>
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); <%include>page_init.eh -<{ +<%cpp> if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); -}> + <%cpp> pageTitle = tr("Searchtimers"); SearchTimers timers; @@ -58,22 +58,24 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html");
<$ tr("Starts between") $>
-<{ +<%cpp> for (SearchTimers::iterator timer = timers.begin(); timer != timers.end(); ++timer) { -}> + SearchTimers::iterator nextTimer = timer; ++nextTimer; + bool bottom = (nextTimer == timers.end()); + - <{ if(timer->UseAsSearchTimer()) { }>" alt=""><{ } }> -
<$ timer->Search() $>
-
<$ timer->ChannelText() $>
-
UseTime() ? timer->StartTimeFormatted()+" - "+timer->StopTimeFormatted() ?>
- UseAsSearchTimer() ? "active.png" : "inactive.png") $>" alt="<$ tr("Toggle search timer actions (in)active") $>" <& tooltip.hint text=(tr("Toggle search timer actions (in)active")) &>> - " alt="<$ tr("Browse search timer results") $>" <& tooltip.hint text=(tr("Browse search timer results")) &>> - " alt="<$ tr("Edit search timer") $>" <& tooltip.hint text=(tr("Edit search timer")) &>> - ')">" alt="<$ tr("Delete search timer") $>" <& tooltip.hint text=(tr("Delete search timer")) &>> + "><%cpp> if(timer->UseAsSearchTimer()) { " alt=""><%cpp> } + ">
<$ timer->Search() $>
+ ">
<$ timer->ChannelText() $>
+ ">
UseTime() ? timer->StartTimeFormatted()+" - "+timer->StopTimeFormatted() ?>
+ ">UseAsSearchTimer() ? "active.png" : "inactive.png") $>" alt="<$ tr("Toggle search timer actions (in)active") $>" <& tooltip.hint text=(tr("Toggle search timer actions (in)active")) &>> + ">" alt="<$ tr("Browse search timer results") $>" <& tooltip.hint text=(tr("Browse search timer results")) &>> + ">" alt="<$ tr("Edit search timer") $>" <& tooltip.hint text=(tr("Edit search timer")) &>> + ">')">" alt="<$ tr("Delete search timer") $>" <& tooltip.hint text=(tr("Delete search timer")) &>> -<{ +<%cpp> } -}> + 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 #include #include "timers.h" #include "tools.h" @@ -58,14 +59,17 @@ using namespace vdrlive; % } else { <%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()) { @@ -79,14 +83,7 @@ using namespace vdrlive; @@ -109,20 +106,19 @@ using namespace vdrlive; timerStateImg = "arrow.png"; - - - - - - - - + + + + + + + + <%cpp> } } -
- <$ 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 $>
" alt="">
<$ FormatDateTime(tr("%I:%M %p"), timer->StartTime()) $>
<$ FormatDateTime(tr("%I:%M %p"), timer->StopTime()) $>
<$ timer->File() $>
Flags() & tfActive) ? "active.png" : "inactive.png") $>" alt="" <& tooltip.hint text=(tr("Toggle timer active/inactive")) &>>" alt="" <& tooltip.hint text=(tr("Edit timer")) &>>" alt="" <& tooltip.hint text=(tr("Delete timer")) &>>">" alt="">">">
<$ FormatDateTime(tr("%I:%M %p"), timer->StartTime()) $>
">
<$ FormatDateTime(tr("%I:%M %p"), timer->StopTime()) $>
">
<$ timer->File() $>
">Flags() & tfActive) ? "active.png" : "inactive.png") $>" alt="" <& tooltip.hint text=(tr("Toggle timer active/inactive")) &>>">" alt="" <& tooltip.hint text=(tr("Edit timer")) &>>">" alt="" <& tooltip.hint text=(tr("Delete timer")) &>>
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; <%include>page_init.eh -<{ +<%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(")"); } -}> + <& pageelems.doc_type &> @@ -104,38 +104,46 @@ if (type == "now") {
<$ head $>
% } -<{ +<%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(++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)) - + "

" + 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(++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)) + + "

" + tr("Click to view details."); + bool lastCurrentChanel = true; + + if (mode == "detail") { +
@@ -143,82 +151,82 @@ if (type == "now") {
<& 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() ) { " alt="" <& tooltip.hint text=(tr("Search for repeats.")) &>> -% } +% } " alt="" <& tooltip.hint text=(tr("Find more at the Internet Movie Database.")) &>>
<$ (epgEvent->StartTime(tr("%I:%M %p"))) $> - <$ (epgEvent->EndTime(tr("%I:%M %p"))) $>
-% if (epgEvent->Elapsed() >= 0) { +% if (epgEvent->Elapsed() >= 0) {
<& pageelems.progressbar progress=(epgEvent->Elapsed()) &>
-% } +% }
<$ (epgEvent->Title()) $>
<$ (epgEvent->ShortDescr()) $>
<$ truncDescription $>
-% if (truncated) { +% if (truncated) {
<& tooltip.display domId=(epgEvent->Id()) &>><$ tr("more") $> ...
-% } +% }
-% } else { // mode == "list" +<%cpp> + } + else { // mode == "list" + lastCurrentChanel = ((Channel->Number() == LiveSetup().GetLastChannel()) + || (!Channels.Next(Channel))); + - <& pageelems.event_timer channelid=(channel_id) eventid=(event) &> - <%cpp>if (type == "now") { <& pageelems.ajax_action_href action="switch_channel" tip=(tr("Switch to this channel.")) param=(channel_id) image="zap.png" alt="" &><%cpp> } - <%cpp>if (LiveFeatures().Recent() ) { " border="0" alt="" <& tooltip.hint text=(tr("Search for repeats.")) &>><%cpp> } else { <%cpp> } - " border="0" alt="" <& tooltip.hint text=(tr("Find more at the Internet Movie Database.")) &>> - + "><& pageelems.event_timer channelid=(channel_id) eventid=(event) &> + "><%cpp>if (type == "now") { <& pageelems.ajax_action_href action="switch_channel" tip=(tr("Switch to this channel.")) param=(channel_id) image="zap.png" alt="" &><%cpp> } + "><%cpp>if (LiveFeatures().Recent() ) { " border="0" alt="" <& tooltip.hint text=(tr("Search for repeats.")) &>><%cpp> } else { <%cpp> } + ">" border="0" alt="" <& tooltip.hint text=(tr("Find more at the Internet Movie Database.")) &>> + ">
<$ (epgEvent->StartTime(tr("%I:%M %p"))) $> - <$ (epgEvent->EndTime(tr("%I:%M %p"))) $>
-% if (epgEvent->Elapsed() >= 0) { +% if (epgEvent->Elapsed() >= 0) {
<& pageelems.progressbar progress=(epgEvent->Elapsed()) &>
-% } +% }
- + ">
<& tooltip.display domId=(epgEvent->Id()) &> -% } +% } ><$ (epgEvent->Title()) $>
<$ (epgEvent->ShortDescr()) $>
- + "> -% } -<{ - } - } - } - } +% } +<%cpp> + } } -}> + +% if (mode == "list") { + +% }
- <%include>page_exit.eh +<# ------------------------------------------------------------------------- #> + <%def whats_on_actions> " href="whats_on.html?type=now&mode=<$ current_mode $>" id="nowhref"><$ tr("Now") $> | @@ -227,15 +235,15 @@ if (type == "now") { "><$ tr("What's on") $> | "><$ tr("at") $> -- cgit v1.2.3