summaryrefslogtreecommitdiff
path: root/pages
diff options
context:
space:
mode:
authorSascha Volkenandt <sascha (at) akv-soft (dot) de>2007-06-05 15:58:45 +0000
committerSascha Volkenandt <sascha (at) akv-soft (dot) de>2007-06-05 15:58:45 +0000
commitf10eb1fbd58a6d8c81b8bc73cd5b909bc30680b6 (patch)
treec883ef4996bac202c9d9c556a4fe457a36d05b52 /pages
parenta10425b9675b83be46a572ae2c64b504daf99e4a (diff)
downloadvdr-plugin-live-f10eb1fbd58a6d8c81b8bc73cd5b909bc30680b6.tar.gz
vdr-plugin-live-f10eb1fbd58a6d8c81b8bc73cd5b909bc30680b6.tar.bz2
- remove "more..." link if there is nothing more
Diffstat (limited to 'pages')
-rw-r--r--pages/whats_on.ecpp19
1 files 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;
+
</%pre>
<%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))
+ + "<br/><br/>" + tr("Click to view details.");
}>
% if (mode == "detail") {
<div class="event">
@@ -154,8 +159,10 @@ if (type == "now") {
% }
<div class="title"><$ (epgEvent->Title()) $></div>
<div class="short"><$ (epgEvent->ShortDescr()) $></div>
- <div class="description"><$ (StringWordTruncate(epgEvent->LongDescr(), 150, truncated)) $></div>
- <div class="more"<& tooltip.hint text=(StringEscapeAndBreak(StringWordTruncate(epgEvent->LongDescr(), 300, truncated)) + string("<br />") + string(tr("Click to view details."))) &><& tooltip.display domId=(epgEvent->Id()) &>><$ (string(tr("more")) + string(" ...")) $></div>
+ <div class="description"><$ truncDescription $></div>
+% if (truncated) {
+ <div class="more"<& tooltip.hint text=(longDescription) &><& tooltip.display domId=(epgEvent->Id()) &>><$ tr("more") $> ...</div>
+% }
</div>
</div>
</div>
@@ -177,7 +184,11 @@ if (type == "now") {
% }
</td>
<td>
- <div class="more"<& tooltip.hint text=(StringEscapeAndBreak(StringWordTruncate(epgEvent->LongDescr(), 300, truncated)) + string("<br />") + string(tr("Click to view details."))) &><& tooltip.display domId=(epgEvent->Id()) &>><strong><$ (epgEvent->Title()) $></strong></div><$ (epgEvent->ShortDescr()) $><br />
+ <div class="more"
+% if (!longDescription.empty()) {
+ <& tooltip.hint text=(longDescription) &><& tooltip.display domId=(epgEvent->Id()) &>
+% }
+ ><strong><$ (epgEvent->Title()) $></strong></div><$ (epgEvent->ShortDescr()) $><br />
</td>
<td><div class="station"><a href="schedule.html?channel=<$ Channel->Number() $>" <& tooltip.hint text=(tr("View the schedule of this channel")) &>><$ (epgEvent->Caption()) $></a></div></td>
<td style="border-right: 1px solid black">&nbsp;</td>