From 8f608826a1c9aa6024010a3970d61657c505c96a Mon Sep 17 00:00:00 2001
From: Dieter Hametner <dh (plus) vdr (at) gekrumbel (dot) de>
Date: Tue, 9 Jan 2007 00:36:09 +0000
Subject: fixed page layout (partly by Michi)

---
 pages/edit_timer.ecpp | 23 +++++++++++++----------
 pages/error.ecpp      |  3 +++
 pages/pageelems.ecpp  | 15 +++++++--------
 pages/remote.ecpp     |  3 +++
 pages/schedule.ecpp   | 37 ++++++++++++++++++++++---------------
 pages/timers.ecpp     |  3 +++
 6 files changed, 51 insertions(+), 33 deletions(-)

(limited to 'pages')

diff --git a/pages/edit_timer.ecpp b/pages/edit_timer.ecpp
index a97ed37..df26c6b 100644
--- a/pages/edit_timer.ecpp
+++ b/pages/edit_timer.ecpp
@@ -74,7 +74,7 @@ using namespace vdrlive;
 	string result;
 	if ( request.getMethod() == "POST" ) {
 		uint flags = ( active ? tfActive : 0 ) | ( vps ? tfVps : 0 );
-		string weekdays = string( wday_mon ? "M" : "-" ) + ( wday_tue ? "T" : "-" ) + ( wday_wed ? "W" : "-" ) 
+		string weekdays = string( wday_mon ? "M" : "-" ) + ( wday_tue ? "T" : "-" ) + ( wday_wed ? "W" : "-" )
 							  + ( wday_thu ? "T" : "-" ) + ( wday_fri ? "F" : "-" ) + ( wday_sat ? "S" : "-" )
 							  + ( wday_sun ? "S" : "-" );
 		int start = start_h * 100 + start_m;
@@ -85,6 +85,7 @@ using namespace vdrlive;
 		return reply.redirect("timers.html");
 	}
 </%cpp>
+<& pageelems.doc_type &>
 <html>
 	<head>
 		<title>VDR Live - <$ timer ? tr("Edit timer") : tr("New timer") $></title>
@@ -95,6 +96,7 @@ using namespace vdrlive;
 			<img src="logo.png" alt="VDR Live!" border="0" />
 <& menu >
 		</div>
+	<div class="right_area">
 		<div class="inhalt">
 <& pageelems.header_box content=(timer ? tr("Edit timer") : tr("New timer")) &>
 			<form method="POST" name="edit_timer">
@@ -114,18 +116,18 @@ using namespace vdrlive;
 <& channels_widget name=("channel") channelid=(true) selected=(channel) &>
 						</td>
 					</tr>
-					
+
 					<tr class="active">
 						<td class="label"><$ tr("Title" ) $>:</td>
 						<td><input type="text" name="title" value="<$ title $>" size="80" /></td>
 					</tr>
-					
-					
+
+
 					<tr>
 						<td class="label"><$ tr("Day") $>:</td>
 						<td><input type="text" name="day" value="<$ day $>" size="2" maxlength="2" /></td>
 					</tr>
-					
+
 					<tr class="active">
 						<td class="label"><$ tr("Weekday") $>:</td>
 						<td>
@@ -138,17 +140,17 @@ using namespace vdrlive;
 							<input type="checkbox" name="wday_sun" value="1" <{ reply.out() << ( wday_sun ? "checked=\"checked\"" : "" ); }>/> <$ tr("Sunday") $>
 						</td>
 					</tr>
-					
+
 					<tr>
 						<td class="label"><$ tr("Start") $>:</td>
 						<td><input type="text" size="2" maxlength="2" name="start_h" value="<$ start_h $>" /> : <input type="text" size="2" maxlength="2" name="start_m" value="<$ start_m $>" /></td>
 					</tr>
-					
+
 					<tr class="active">
 						<td class="label"><$ tr("Stop") $>:</td>
 						<td><input type="text" size="2" maxlength="2" name="end_h" value="<$ end_h $>" /> : <input type="text" size="2" maxlength="2" name="end_m" value="<$ end_m $>" /></td>
 					</tr>
-					
+
 					<tr>
 						<td class="label"><$ tr("Use VPS") $>:</td>
 						<td><input type="checkbox" name="vps" value="1" <{ reply.out() << ( vps ? "checked=\"checked\"" : "" ); }>/></td>
@@ -158,18 +160,19 @@ using namespace vdrlive;
 						<td class="label"><$ tr("Priority") $>:</td>
 						<td><input type="text" size="2" maxlength="2" name="priority" value="<$ priority $>" /></td>
 					</tr>
-					
+
 					<tr>
 						<td class="label"><$ tr("Lifetime") $>:</td>
 						<td><input type="text" size="2" maxlength="2" name="lifetime" value="<$ lifetime $>" /></td>
 					</tr>
-					
+
 					<tr class="active">
 						<td class="buttonpanel" colspan="2"><button name="submit" type="submit"><$ tr("Save") $></button></td>
 					</tr>
 				</table>
 			</form>
 		</div>
+	</div>
 	</body>
 </html>
 <%include>page_exit.eh</%include>
diff --git a/pages/error.ecpp b/pages/error.ecpp
index 196f147..2ca1333 100644
--- a/pages/error.ecpp
+++ b/pages/error.ecpp
@@ -7,6 +7,7 @@
 	errorTitle = tr("Page error");
 	errorMessage;
 </%args>
+<& pageelems.doc_type &>
 <html>
 	<head>
 		<title>VDR-Live - <$ pageTitle $></title>
@@ -17,10 +18,12 @@
 			<img src="logo.png" alt="VDR Live!" border="0" />
 			<& menu >
 		</div>
+		<div class="right_area">
 		<div class="inhalt">
 			<& pageelems.header_box content=(pageTitle) &>
 			<& error.error_widget errorTitle=(errorTitle) errorMessage=(errorMessage) &>
 		</div>
+		</div>
 	</body>
 </html>
 <%def error_widget>
diff --git a/pages/pageelems.ecpp b/pages/pageelems.ecpp
index 42fecb1..1ab95da 100644
--- a/pages/pageelems.ecpp
+++ b/pages/pageelems.ecpp
@@ -1,13 +1,10 @@
-<%pre>
-</%pre>
-<%args>
-</%args>
-<{
-}>
+<%def doc_type>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+</%def>
 <%def header_box>
 <%args>
 content[];
-htmlcode;
+component;
 </%args>
 <{
 }>
@@ -18,7 +15,9 @@ htmlcode;
 %							for(content_type::const_iterator it = content.begin(); it != content.end(); ++it) {
 								<$ *it $>
 %							}
-%							reply.out() << htmlcode;
+%							if (!component.empty()) {
+							<& (component) &>
+%							}
 						</td></tr></table>
 					</div>
 				</div>
diff --git a/pages/remote.ecpp b/pages/remote.ecpp
index cb6a97f..460d859 100644
--- a/pages/remote.ecpp
+++ b/pages/remote.ecpp
@@ -9,6 +9,7 @@ using namespace vdrlive;
 <%cpp>
 	pageTitle = tr("Remote control");
 </%cpp>
+<& pageelems.doc_type &>
 <html>
 	<head>
 		<script type="text/javascript"><!--
@@ -108,6 +109,7 @@ using namespace vdrlive;
 			<img src="logo.png" alt="VDR Live!" border="0" />
 <& menu >
 		</div>
+	<div class="right_area"
 		<div class="inhalt">
 			<& pageelems.header_box content=(pageTitle) &>
 			<div class="screenshot">
@@ -189,6 +191,7 @@ using namespace vdrlive;
 				</tr>
 			</table>
 		</div>
+	</div>
 	</body>
 </html>
 <%include>page_exit.eh</%include>
diff --git a/pages/schedule.ecpp b/pages/schedule.ecpp
index b43e660..416842c 100644
--- a/pages/schedule.ecpp
+++ b/pages/schedule.ecpp
@@ -13,6 +13,9 @@ using namespace vdrlive;
 <%args>
 	int channel = -1;
 </%args>
+<%request scope="page">
+cChannel* Channel;
+</%request>
 <%include>page_init.eh</%include>
 <%cpp>
 	pageTitle = tr("Schedule");
@@ -24,7 +27,7 @@ using namespace vdrlive;
 	if ( !channelsLock )
 		throw HtmlError( tr("Couldn't aquire access to channels, please try again later.") );
 
-	cChannel* Channel;
+	// cChannel* Channel; (see %request above)
 	if ( channel > 0 )
 		Channel = Channels.GetByNumber( channel );
 	else
@@ -37,6 +40,7 @@ using namespace vdrlive;
 	if ( Schedule == 0 )
 		throw HtmlError( tr("No schedules available for this channel.") );
 </%cpp>
+<& pageelems.doc_type &>
 <html>
 	<head>
 		<title>VDR Live - <$ pageTitle $></title>
@@ -47,21 +51,9 @@ using namespace vdrlive;
 			<img src="logo.png" alt="VDR Live!" border="0" />
 			<& menu >
 		</div>
+	<div class="right_area">
 		<div class="inhalt">
-			<div class="head_box">
-				<table>
-					<tr>
-						<td><? Channel ? Channel->Name() ?></td>
-						<td>
-							<form name="channels" id="channels">
-							<& channels_widget name=("channel") selected=(Channel ? *Channel->GetChannelID().ToString() : "") 
-									onchange=("document.forms.channels.submit()") &>
-							</form>
-						</td>
-					</tr>
-				</table>
-			</div>
-
+<&pageelems.header_box component=("schedule.channel_selection") &>
 			<table class="schedule" cellspacing="0" callpadding="0">
 <{
 				bool active_line = false;
@@ -95,6 +87,21 @@ using namespace vdrlive;
 %				}
 			</table>
 		</div>
+	</div>
 	</body>
 </html>
 <%include>page_exit.eh</%include>
+
+<%def channel_selection>
+				<table>
+					<tr>
+						<td><? Channel ? Channel->Name() ?></td>
+						<td>
+							<form name="channels" id="channels">
+							<& channels_widget name=("channel") selected=(Channel ? *Channel->GetChannelID().ToString() : "")
+									onchange=("document.forms.channels.submit()") &>
+							</form>
+						</td>
+					</tr>
+				</table>
+</%def>
diff --git a/pages/timers.ecpp b/pages/timers.ecpp
index e593833..e43ba7e 100644
--- a/pages/timers.ecpp
+++ b/pages/timers.ecpp
@@ -13,6 +13,7 @@ using namespace vdrlive;
 	cMutexLock timersLock( &LiveTimerManager() );
 	SortedTimers& timers = LiveTimerManager().GetTimers();
 </%cpp>
+<& pageelems.doc_type &>
 <html>
 	<head>
 		<title>VDR-Live - <$ pageTitle $></title>
@@ -23,6 +24,7 @@ using namespace vdrlive;
 			<img src="logo.png" alt="VDR Live!" border="0" />
 			<& menu >
 		</div>
+	<div class="right_area">
 		<div class="inhalt">
 			<& pageelems.header_box	content=(pageTitle) &>
 %			if (timers.size() == 0) {
@@ -60,6 +62,7 @@ using namespace vdrlive;
 }>
 			</table>
 		</div>
+	</div>
 	</body>
 </html>
 <%include>page_exit.eh</%include>
-- 
cgit v1.2.3