From 40bfdf4152c5bd6ef6d3b3b0e726ca5371f5a582 Mon Sep 17 00:00:00 2001
From: Christian Wieninger <cwieninger (at) gmx (dot) de>
Date: Wed, 23 May 2007 09:34:30 +0000
Subject: - summary for search results

---
 pages/searchresults.ecpp | 36 ++++++++++++++++++++++++++++++++----
 1 file changed, 32 insertions(+), 4 deletions(-)

(limited to 'pages')

diff --git a/pages/searchresults.ecpp b/pages/searchresults.ecpp
index 22fbbc2..a900061 100644
--- a/pages/searchresults.ecpp
+++ b/pages/searchresults.ecpp
@@ -5,6 +5,7 @@
 #include "epgsearch.h"
 #include "tools.h"
 #include "setup.h"
+#include "epg_events.h"
 
 using namespace vdrlive;
 using namespace std;
@@ -49,14 +50,26 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html");
 <{
 				string current_day = "";
 				bool active_line = false;
-         		for (SearchResults::iterator result = results.begin(); result != results.end(); ++result) {
-//                    active_line = !active_line;
-                    string channelname = Channels.GetByChannelID(result->Channel())->Name();
+				EpgEvents epgEvents;
+				int evntNr = 0;
+
+				for (SearchResults::iterator result = results.begin(); result != results.end(); ++result) {
+//					active_line = !active_line;
+					string channelname = Channels.GetByChannelID(result->Channel())->Name();
 					string start(result->StartTime() ? FormatDateTime(tr("%I:%M %p"), result->StartTime()) : "");
 					string end(result->StopTime() ? FormatDateTime(tr("%I:%M %p"), result->StopTime()) : "");
 					string day(result->StartTime() ? FormatDateTime(tr("%A, %b %d %Y"), result->StartTime()) : "");
 					tEventID event = result->EventId();
 					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;
+
 					if (current_day != day) {
 						if (current_day != "") {
 }>
@@ -75,7 +88,11 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html");
 						<td style="border-left: 1px solid black"><& pageelems.event_timer channelid=(channel_id) eventid=(event)&></td>
 						<td><$ channelname $></td>
 						<td><$ start $> - <$ end $></td>
-						<td><strong><$ result->Title() $></strong><br /><$ result->ShortText() $><br /></td>
+
+						<td>
+							<div class="more"<& tooltip.hint text=(StringEscapeAndBreak(StringWordTruncate(description, 300, truncated)) + string("<br />") + string(tr("Click to view details."))) &><& tooltip.display domId=(epgEvent->Id()) &>><strong><$ result->Title() $></strong></div><$ result->ShortText() $><br />
+						</td>
+						
 						<td style="border-right: 1px solid black">&nbsp;</td>
 					</tr>
 %				}
@@ -86,6 +103,17 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html");
 %				}
 			</table>
 		</div>
+		<div class="epg_data" style="display: none;">
+<{
+		// create hidden div for the tooltip hints.
+		for (vector<EpgEventPtr>::iterator i = epgEvents.begin(); i != epgEvents.end(); ++i) {
+			EpgEventPtr epg = *i;
+}>
+			<& 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()) &>
+<{
+		}
+}>
+		</div>
 	</body>
 </html>
 
-- 
cgit v1.2.3