From f10eb1fbd58a6d8c81b8bc73cd5b909bc30680b6 Mon Sep 17 00:00:00 2001 From: Sascha Volkenandt Date: Tue, 5 Jun 2007 15:58:45 +0000 Subject: - remove "more..." link if there is nothing more --- pages/whats_on.ecpp | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/pages/whats_on.ecpp b/pages/whats_on.ecpp index 09bb560..e7c5dcf 100644 --- a/pages/whats_on.ecpp +++ b/pages/whats_on.ecpp @@ -12,6 +12,9 @@ using namespace std; using namespace vdrlive; +static const size_t maximumDescriptionLength = 300; +static const size_t maximumTooltipHintLength = 150; + <%args> type = "now"; @@ -129,7 +132,9 @@ if (type == "now") { tEventID event = Event->EventID(); bool truncated = false; - string description(); + string truncDescription = StringWordTruncate(epgEvent->LongDescr(), maximumTooltipHintLength, truncated); + string longDescription = StringEscapeAndBreak(StringWordTruncate(epgEvent->LongDescr(), maximumDescriptionLength)) + + "

" + tr("Click to view details."); }> % if (mode == "detail") {
@@ -154,8 +159,10 @@ if (type == "now") { % }
<$ (epgEvent->Title()) $>
<$ (epgEvent->ShortDescr()) $>
-
<$ (StringWordTruncate(epgEvent->LongDescr(), 150, truncated)) $>
-
LongDescr(), 300, truncated)) + string("
") + string(tr("Click to view details."))) &><& tooltip.display domId=(epgEvent->Id()) &>><$ (string(tr("more")) + string(" ...")) $>
+
<$ truncDescription $>
+% if (truncated) { +
<& tooltip.display domId=(epgEvent->Id()) &>><$ tr("more") $> ...
+% }
@@ -177,7 +184,11 @@ if (type == "now") { % } -
LongDescr(), 300, truncated)) + string("
") + string(tr("Click to view details."))) &><& tooltip.display domId=(epgEvent->Id()) &>><$ (epgEvent->Title()) $>
<$ (epgEvent->ShortDescr()) $>
+
<& tooltip.display domId=(epgEvent->Id()) &> +% } + ><$ (epgEvent->Title()) $>
<$ (epgEvent->ShortDescr()) $>
><$ (epgEvent->Caption()) $>
  -- cgit v1.2.3