diff options
author | Dieter Hametner <dh (plus) vdr (at) gekrumbel (dot) de> | 2007-01-14 01:04:48 +0000 |
---|---|---|
committer | Dieter Hametner <dh (plus) vdr (at) gekrumbel (dot) de> | 2007-01-14 01:04:48 +0000 |
commit | f03a93d1c22e3039fd053c321203d393c3e5a336 (patch) | |
tree | 3d7a8dad35c7a2dfcd8e33e57edc2be850a83487 | |
parent | 62ece78abdf89523121503b807c2ad6552bbd325 (diff) | |
download | vdr-plugin-live-f03a93d1c22e3039fd053c321203d393c3e5a336.tar.gz vdr-plugin-live-f03a93d1c22e3039fd053c321203d393c3e5a336.tar.bz2 |
Send detailed recordings information on the recordings page.
To make it visieble we still need to activate the tooltip javascript.
-rw-r--r-- | css/styles.css | 32 | ||||
-rw-r--r-- | pages/recordings.ecpp | 68 | ||||
-rw-r--r-- | recordings.cpp | 11 | ||||
-rw-r--r-- | recordings.h | 10 |
4 files changed, 108 insertions, 13 deletions
diff --git a/css/styles.css b/css/styles.css index 249711a..101962d 100644 --- a/css/styles.css +++ b/css/styles.css @@ -171,16 +171,16 @@ div.event div.station { div.station div { margin: 0; padding: 0; - background: url(/bg_box_l.png) top left no-repeat; + background: url(bg_box_l.png) top left no-repeat; height: 23px; } div.station div div { - background: url(/bg_box_r.png) top right no-repeat; + background: url(bg_box_r.png) top right no-repeat; } div.station div div div { - background: url(/bg_box_h.png) repeat-x; + background: url(bg_box_h.png) repeat-x; vertical-align: middle; text-align: left; margin-right: 3px; @@ -220,6 +220,7 @@ div.content { div.tools img { margin: 5px 2px; + border: 0px; } div.description { @@ -312,15 +313,15 @@ table.schedule tr.active { div.boxheader { margin: 0; padding: 0; - background: url(/bg_box_l.png) top left no-repeat; + background: url(bg_box_l.png) top left no-repeat; } div.boxheader div { - background: url(/bg_box_r.png) top right no-repeat; + background: url(bg_box_r.png) top right no-repeat; } div.boxheader div div { - background: url(/bg_box_h.png) repeat-x; + background: url(bg_box_h.png) repeat-x; vertical-align: middle; text-align: left; margin-right: 3px; @@ -330,6 +331,7 @@ div.boxheader div div { color: white; font-weight: bold; height: 21px; + line-height: 20px; } @@ -381,6 +383,24 @@ div.recording_item { margin-left: 3em; } +div.recordings_data { + width: 66%; +} + +.recordings_data div.re_shortdescr { + width: 50%; + height: 25%; +} + +.recordings_data div.re_longdescr { + width: 66%; + height: 50%; +} + +.recordings_data div.re_content { + border: 1px solid black; +} + /* ############################## # Remote Control Keypad diff --git a/pages/recordings.ecpp b/pages/recordings.ecpp index a8aa15d..6ed8467 100644 --- a/pages/recordings.ecpp +++ b/pages/recordings.ecpp @@ -12,6 +12,8 @@ using namespace vdrlive; </%args> <%request scope="page"> RecordingsTree recordingsTree; +const std::string lPref("long_"); +const std::string sPref("short_"); </%request> <%include>page_init.eh</%include> <%cpp> @@ -29,13 +31,15 @@ RecordingsTree recordingsTree; <& pageelems.logo &> <& menu active=("recordings") &> <div class="inhalt"> - <& pageelems.header_box content=(tr("Recordings")) &> % if (Recordings.Count() == 0) { Keine Aufnahmen vorhanden % } else { <div class="recordings"> <& recordings.recordings_item &> </div> + <div class="recordings_data" style="display: none;"> +<& recordings.recordings_data &> + </div> % } </div> </body> @@ -63,7 +67,7 @@ RecordingsTree::Map::iterator end = recordingsTree.end(path); }> <li class="recording"> <{ -for (iter = recordingsTree.begin(path); iter != end; iter++) { +for (iter = recordingsTree.begin(path); iter != end; ++iter) { RecordingsTree::RecordingsItemPtr recItem = iter->second; std::string folderimg("folder_closed.png"); std::string collapseimg("plus.png"); @@ -89,7 +93,7 @@ for (iter = recordingsTree.begin(path); iter != end; iter++) { callComp("recordings.recordings_item", request, reply, recItemParams); } } -for (iter = recordingsTree.begin(path); iter != end; iter++) { +for (iter = recordingsTree.begin(path); iter != end; ++iter) { RecordingsTree::RecordingsItemPtr recItem = iter->second; std::string folderimg("folder_closed.png"); std::string collapseimg("plus.png"); @@ -121,3 +125,61 @@ for (iter = recordingsTree.begin(path); iter != end; iter++) { }> </ul> </%def> + +<%def recordings_data> +<%args> +path[]; +int level = 0; +</%args> +<{ +RecordingsTree::Map::iterator iter; +RecordingsTree::Map::iterator end = recordingsTree.end(path); + +for (iter = recordingsTree.begin(path); iter != end; ++iter) { + RecordingsTree::RecordingsItemPtr recItem = iter->second; + if (recItem->IsDir()) { + cxxtools::QueryParams recItemParams(qparam, false); + for (path_type::const_iterator i = path.begin(); i != path.end(); ++i) { + recItemParams.add("path", *i); + } + recItemParams.add("path", recItem->Name()); + recItemParams.add("level", lexical_cast<std::string, int>(level + 1)); + callComp("recordings.recordings_data", request, reply, recItemParams); + } + else { + const cRecordingInfo* info = recItem->RecInfo(); + if (info) { + std::string start(FormatDateTime("%a,", recItem->StartTime()) + std::string(" ") + + FormatDateTime(tr("%b %d %y"), recItem->StartTime()) + std::string(" ") + + FormatDateTime(tr("%I:%M %p"), recItem->StartTime())); + std::string title(recItem->Name()); if (info->Title()) title = info->Title(); + std::string shortDescr; if (info->ShortText()) shortDescr = info->ShortText(); + std::string longDescr; if (info->Description()) longDescr = info->Description(); +}> + <div class="re_longdescr" id="<$ (lPref + recItem->Id()) $>"> + <div class="re_station"> + <div class="boxheader"><div><div><$ tr("Recording details") $></div></div></div> + </div> + <div class="re_content"> + <div class="info"><$ (start) $></div> + <div class="title"><$ (title) $></div> + <div class="description"> + <$ (longDescr) $> + </div> + </div> + </div> + <div class="re_shortdescr" id="<$ (sPref + recItem->Id()) $>"> + <div class="re_station"> + <div class="boxheader"><div><div><$ (title) $></div></div></div> + </div> + <div class="re_content"> + <div class="info"><$ (start) $></div> + <div class="short"><$ (shortDescr) $></div> + </div> + </div> +<{ + } + } +} +}> +</%def> diff --git a/recordings.cpp b/recordings.cpp index 8c80537..f8c09d6 100644 --- a/recordings.cpp +++ b/recordings.cpp @@ -1,5 +1,6 @@ #include <string> #include <boost/shared_ptr.hpp> +#include "tools.h" #include "recordings.h" namespace vdrlive { @@ -10,6 +11,7 @@ namespace vdrlive { m_recordingsLock(&Recordings) { + int recCount = 0; // esyslog("DH: ****** RecordingsTree::RecordingsTree() ********"); for ( cRecording* recording = Recordings.First(); recording != 0; recording = Recordings.Next( recording ) ) { if (m_maxLevel < recording->HierarchyLevels()) { @@ -46,7 +48,9 @@ namespace vdrlive { } else { string recName(name.substr(index, name.length() - index)); - RecordingsItemPtr recPtr (new RecordingsItemRec(recName, recording)); + string recId("recId_"); + recId += lexical_cast<string, int>(++recCount); + RecordingsItemPtr recPtr (new RecordingsItemRec(recId, recName, recording)); dir->m_entries.insert(pair< string, RecordingsItemPtr > (recName, recPtr)); // esyslog("DH: added rec: '%s'", recName.c_str()); } @@ -137,9 +141,10 @@ namespace vdrlive { { } - RecordingsTree::RecordingsItemRec::RecordingsItemRec(const string& name, cRecording* recording) : + RecordingsTree::RecordingsItemRec::RecordingsItemRec(const string& id, const string& name, cRecording* recording) : RecordingsItem(name), - m_recording(recording) + m_recording(recording), + m_id(id) { } diff --git a/recordings.h b/recordings.h index c2eea1b..d070271 100644 --- a/recordings.h +++ b/recordings.h @@ -31,6 +31,9 @@ namespace vdrlive { virtual time_t StartTime() const = 0; virtual bool IsDir() const = 0; virtual const string& Name() const { return m_name; } + virtual const string& Id() const = 0; + + virtual const cRecordingInfo* RecInfo() const { return 0; } protected: RecordingsItem(const string& name); @@ -50,6 +53,7 @@ namespace vdrlive { virtual time_t StartTime() const { return 0; } virtual bool IsDir() const { return true; } + virtual const string& Id() const { return ""; } private: int m_level; @@ -58,15 +62,19 @@ namespace vdrlive { class RecordingsItemRec : public RecordingsItem { public: - RecordingsItemRec(const string& name, cRecording* recording); + RecordingsItemRec(const string& id, const string& name, cRecording* recording); virtual ~RecordingsItemRec(); virtual time_t StartTime() const; virtual bool IsDir() const { return false; } + virtual const string& Id() const { return m_id; } + + virtual const cRecordingInfo* RecInfo() const { return m_recording->Info(); } private: cRecording *m_recording; + string m_id; }; RecordingsTree(); |