Author: duncan
Date: Wed Dec 27 00:23:37 2006
New Revision: 8817
Modified:
branches/rel-1-6/freevo/src/www/htdocs/genre.rpy
branches/rel-1-6/freevo/src/www/web_types.py
Log:
[ 1622456 ] genre.rpy produces invalid html
There is still quite a few problems with the generated html :(
The problems are reduced by changing the document type to XHTML 1.0 Transitional
The img src are missing alt="" and trailing slash, the form is missing
action="",
script is missing type="text/JavaScript", a "<tr>" is terminated with a "</td>",
etc, etc...
Modified: branches/rel-1-6/freevo/src/www/htdocs/genre.rpy
==============================================================================
--- branches/rel-1-6/freevo/src/www/htdocs/genre.rpy (original)
+++ branches/rel-1-6/freevo/src/www/htdocs/genre.rpy Wed Dec 27 00:23:37 2006
@@ -1,6 +1,4 @@
#!/usr/bin/python
-
-#if 0 /*
# -----------------------------------------------------------------------
# genre.rpy - Show what is on for today for a particular category
# -----------------------------------------------------------------------
@@ -10,35 +8,6 @@
# Todo:
#
# -----------------------------------------------------------------------
-# $Log$
-# Revision 1.9.2.1 2004/08/11 00:12:33 outlyer
-# Patch from Jason; major performance improvement in the web based program
-# guide.
-#
-# Revision 1.9 2004/03/05 02:37:05 rshortt
-# Lets add in prog.desc to fill up some of this area.
-#
-# Revision 1.8 2004/02/23 08:33:21 gsbarbieri
-# i18n: help translators job.
-#
-# Revision 1.7 2004/02/22 07:13:27 gsbarbieri
-# Fix bugs introduced by i18n changes.
-#
-# Revision 1.6 2004/02/19 04:57:59 gsbarbieri
-# Support Web Interface i18n.
-# To use this, I need to get the gettext() translations in unicode, so some
changes are required to files that use "print _('string')", need to make them
"print String(_('string'))".
-#
-# Revision 1.5 2003/09/07 13:34:10 mikeruelle
-# show info message if we don't find any matching categories
-#
-# Revision 1.2 2003/09/05 02:48:13 rshortt
-# Removing src/tv and src/www from PYTHONPATH in the freevo script. Therefore
any module that was imported from src/tv/ or src/www that didn't have a leading
'tv.' or 'www.' needed it added. Also moved tv/tv.py to tv/tvmenu.py to avoid
namespace conflicts.
-#
-# Revision 1.1 2003/08/24 21:41:44 mikeruelle
-# adding a new page to see shows of a certain category
-#
-#
-# -----------------------------------------------------------------------
# Freevo - A Home Theater PC framework
# Copyright (C) 2002 Krister Lagerstrom, et al.
# Please see the file freevo/Docs/CREDITS for a complete list of authors.
@@ -57,8 +26,7 @@
# with this program; if not, write to the Free Software Foundation, Inc.,
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
-# ----------------------------------------------------------------------- */
-#endif
+# -----------------------------------------------------------------------
import sys, time, string
@@ -81,7 +49,7 @@
cat = Unicode( cat )
retval += u'<option value="%s" ' % cat
if cat == category:
- retval += u'SELECTED '
+ retval += u'SELECTED'
retval += u'>%s</option>\n' % cat
retval += u'</select>\n'
return retval
@@ -133,19 +101,25 @@
stime=''
if mfrguideinput:
- stime='<input name="stime" type="hidden" value="%i">' %
int(mfrguideinput)
+ stime='<input name="stime" type="hidden" value="%i"/>' %
int(mfrguideinput)
keepcat = ''
if category:
keepcat = '&category=%s' % category
bforcell=''
acelltime=mfrnextguide + 60
- aftercell=' <a href="genre.rpy?stime=%i%s"><img
src="images/RightArrow.png" border="0"></a>' % (acelltime, keepcat)
+ aftercell=' <a href="genre.rpy?stime=%i%s">'\
+ +'<img src="images/RightArrow.png" alt="right" border="0"/></a>'\
+ % (acelltime, keepcat)
if mfrprevguide > 0:
- bforcell='<a href="genre.rpy?stime=%i%s"><img
src="images/LeftArrow.png" border="0"></a> ' % (mfrprevguide,
keepcat)
+ bforcell='<a href="genre.rpy?stime=%i%s">'\
+ +'<img src="images/LeftArrow.png" alt="left"
border="0"/></a> '\
+ % (mfrprevguide, keepcat)
fv.tableOpen('border="0" cellpadding="4" cellspacing="1" width="100%"')
fv.tableRowOpen('class="chanrow"')
-
fv.tableCell('<form>'+bforcell+_('Show')+' '+_('Category')+': ' +
self.makecategorybox(allcategories, category)+stime+'<input type=submit
value="'+_('Change')+'">'+aftercell+'</form>', 'class="guidehead"')
+ fv.tableCell('<form
action="">'+bforcell+_('Show')+' '+_('Category')+': '\
+ +self.makecategorybox(allcategories, category)+stime+'<input
type="submit" value="'+_('Change')+'"/>'\
+ +aftercell+'</form>', 'class="guidehead"')
fv.tableRowClose()
fv.tableClose()
@@ -194,7 +168,8 @@
fv.tableCell(chan.displayname, 'class="channel"')
popid = '%s:%s' % (prog.channel_id, prog.start)
- fv.tableCell(prog.title + ' - ' +
prog.desc, 'class="'+status+'" onclick="guide_click(this, event)" id="%s"
width="80%%"' % popid )
+
fv.tableCell(prog.title+' - '+prog.desc,
'class="'+status+'" \
+ onclick="guide_click(this, event)" id="%s"
width="80%%"' % popid )
fv.tableCell(time.strftime('%H:%M',
time.localtime(prog.start)), 'class="channel"')
fv.tableCell(time.strftime('%H:%M',
time.localtime(prog.stop)), 'class="channel"')
fv.tableRowClose()
@@ -225,12 +200,12 @@
u" </td>\n"\
u" </tr>\n"\
u" <tr>\n"\
- u" <td class=\"progtime\">\n"\
- u" <b>"+_('Start')+u":</b> <span
id=\"program-start\"></span>, \n"\
- u" <b>"+_('Stop')+u":</b> <span
id=\"program-end\"></span>, \n"\
- u" <b>"+_('Runtime')+u":</b> <span
id=\"program-runtime\"></span> min\n"\
+ u" <td class=\"progtime\">\n"\
+ u" <b>"+_('Start')+u":</b> <span
id=\"program-start\"></span>, \n"\
+ u" <b>"+_('Stop')+u":</b> <span
id=\"program-end\"></span>, \n"\
+ u" <b>"+_('Runtime')+u":</b> <span
id=\"program-runtime\"></span> min\n"\
u" </td>\n"\
- u" </td>\n"\
+ u" </tr>\n"\
u" </tbody>\n"\
u" <tfoot>\n"\
u" <tr>\n"\
Modified: branches/rel-1-6/freevo/src/www/web_types.py
==============================================================================
--- branches/rel-1-6/freevo/src/www/web_types.py (original)
+++ branches/rel-1-6/freevo/src/www/web_types.py Wed Dec 27 00:23:37 2006
@@ -106,20 +106,22 @@
self.res += 'Content-type: %s\n\n' % content_type
- def printHeader(self, title='unknown page', style=None, script=None,
selected='Help',prefix=0):
+ def printHeader(self, title='unknown page', style=None, script=None,
selected='Help', prefix=0):
strprefix = '../' * prefix
self.res += '<?xml version="1.0" encoding="'+ config.encoding +'"?>\n'
- self.res += '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Strict//EN"\n'
- self.res += '"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">'
+ self.res += '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN" '
+ self.res +=
'"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\n'
+ #self.res += '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Strict//EN"\n'
+ #self.res += '"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">'
self.res += '<html>\n\t<head>\n'
self.res += '\t<title>Freevo | '+title+'</title>\n'
self.res += '\t<meta http-equiv="Content-Type" content= "text/html;
charset='+ config.encoding +'"/>\n'
if style != None:
self.res += '\t<link rel="stylesheet" href="styles/main.css"
type="text/css" />\n'
if script != None:
- self.res += '\t<script language="JavaScript"
src="'+script+'"></script>\n'
+ self.res += '\t<script language="JavaScript"
type="text/JavaScript" src="'+script+'"></script>\n'
self.res += '</head>\n'
self.res += '\n\n\n\n<body>\n'
# Header
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog