Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r76800 - website/public_html/beta/site-tools/templates
From: dnljms_at_[hidden]
Date: 2012-01-30 18:49:12


Author: danieljames
Date: 2012-01-30 18:49:11 EST (Mon, 30 Jan 2012)
New Revision: 76800
URL: http://svn.boost.org/trac/boost/changeset/76800

Log:
Website: Some validity fixes.
Text files modified:
   website/public_html/beta/site-tools/templates/download-template.html | 12 +++++++-----
   website/public_html/beta/site-tools/templates/entry-template.html | 7 ++++---
   website/public_html/beta/site-tools/templates/history-template.html | 8 +++++---
   website/public_html/beta/site-tools/templates/index-src.html | 14 ++++++++------
   website/public_html/beta/site-tools/templates/news-template.html | 10 ++++++----
   5 files changed, 30 insertions(+), 21 deletions(-)

Modified: website/public_html/beta/site-tools/templates/download-template.html
==============================================================================
--- website/public_html/beta/site-tools/templates/download-template.html (original)
+++ website/public_html/beta/site-tools/templates/download-template.html 2012-01-30 18:49:11 EST (Mon, 30 Jan 2012)
@@ -1,8 +1,10 @@
- <div class="section-body">
+${
+from boost_site.util import htmlencode
+}$ <div class="section-body">
               <ul class="toc">
 ${
 for x in downloads:
- emit('<li><a href="#%s">%s</li>\n' % (x['anchor'], x['label']))
+ emit('<li>%s</li>\n' % (x['anchor'], x['label']))
 }$
                 <li>Old Boost Releases</li>
 
@@ -19,16 +21,16 @@
         emit(' <span class="brief"><span class="purpose">%s</span></span></p>\n\n' % entry.purpose_xml)
         emit(' <ul class="menu">\n')
         emit(' <li>\n')
- emit(' Details' % entry.location)
+ emit(' Details' % htmlencode(entry.location))
         emit('</li>\n')
         if(entry.download_item):
             emit('\n')
             emit(' <li>\n')
- emit(' Download</li>' % entry.download_item)
+ emit(' Download</li>' % htmlencode(entry.download_item))
         if(entry.documentation):
             emit('\n')
             emit(' <li>\n')
- emit(' Documentation</li>' % entry.documentation)
+ emit(' Documentation</li>' % htmlencode(entry.documentation))
         emit('\n')
         emit(' </ul>')
 }$

Modified: website/public_html/beta/site-tools/templates/entry-template.html
==============================================================================
--- website/public_html/beta/site-tools/templates/entry-template.html (original)
+++ website/public_html/beta/site-tools/templates/entry-template.html 2012-01-30 18:49:11 EST (Mon, 30 Jan 2012)
@@ -1,4 +1,6 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+${
+from boost_site.util import htmlencode
+}$<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 
 <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
@@ -50,8 +52,7 @@
               <p><span class=
               "news-date">${ emit(page.web_date()) }$</span></p>
 ${
-# TODO: Should encode this link. Although not a real problem.
-if (page.documentation): emit('<p>Documentation')
+if (page.documentation): emit('<p>Documentation')
 }$
               ${ emit(page.download_table()) }$
               <div class="news-description">

Modified: website/public_html/beta/site-tools/templates/history-template.html
==============================================================================
--- website/public_html/beta/site-tools/templates/history-template.html (original)
+++ website/public_html/beta/site-tools/templates/history-template.html 2012-01-30 18:49:11 EST (Mon, 30 Jan 2012)
@@ -1,19 +1,21 @@
 ${
+from boost_site.util import htmlencode
+
 title = 'Boost Version History'
 entries = pages.match_pages(['feed/history/*.qbk|released'])
 }$ <div class="section-body">
               ${
 for entry in entries:
     emit('\n')
- emit(' <h2 class="news-title">\n <a name="i%s" id="i%s"></a>%s</h2>\n\n' % (entry.id, entry.id, entry.location, entry.title_xml))
+ emit(' <h2 class="news-title">\n <a name="i%s" id="i%s"></a>%s</h2>\n\n' % (entry.id, entry.id, htmlencode(entry.location), entry.title_xml))
     emit(' <p class="news-date">%s</p>\n\n' % (entry.web_date()))
     emit(' <div class="news-description">\n')
     emit(' <span class="brief"><span class="purpose">%s</span></span>' % (entry.purpose_xml))
     emit(' </div>\n\n')
     emit(' <ul class="menu">\n')
     emit(' <li>\n')
- emit(' Details</li>\n\n' % (entry.location))
+ emit(' Details</li>\n\n' % (htmlencode(entry.location)))
     if(entry.download_item):
- emit(' <li>Download</li>\n' % (entry.download_item))
+ emit(' <li>Download</li>\n' % (htmlencode(entry.download_item)))
     emit(' </ul>')
 }$ </div>

Modified: website/public_html/beta/site-tools/templates/index-src.html
==============================================================================
--- website/public_html/beta/site-tools/templates/index-src.html (original)
+++ website/public_html/beta/site-tools/templates/index-src.html 2012-01-30 18:49:11 EST (Mon, 30 Jan 2012)
@@ -1,28 +1,31 @@
 ${
+from boost_site.util import htmlencode
+
 # TODO: This is duplicated from other places, should only be set once?
 news = pages.match_pages(['feed/news/*.qbk', 'feed/history/*.qbk|released'], 3)
 }$
                 <div class="directory-item" id="important-downloads">
                   <h2>Downloads</h2>
+ <div id="downloads">
 
 ${
 for x in downloads:
     label = x['label']
     entries = x['entries']
     emit('<h3>%s</h3>\n' % label)
- emit('<ul id="downloads">\n')
+ emit('<ul>\n')
     for entry in entries:
         emit('<li><span class="news-title">')
         if entry.download_item:
- emit('<a href="%s">' % entry.download_item)
+ emit('<a href="%s">' % htmlencode(entry.download_item))
         emit(entry.full_title_xml)
         if entry.download_item:
             emit('</a>')
- emit(' (release notes)</span>' % (entry.location))
+ emit(' (release notes)</span>' % (htmlencode(entry.location)))
         emit('<span class="news-date">%s</span></li>\n' % (entry.web_date()))
     emit('</ul>')
 }$
-
+ </div>
                   <p>More Downloads...
                   (RSS)</p>
                 </div>
@@ -34,7 +37,7 @@
                     ${
 for entry in news:
     emit('\n')
- emit(' <li><span class=\n "news-title">%s</span>\n' % (entry.location, entry.full_title_xml))
+ emit(' <li><span class=\n "news-title">%s</span>\n' % (htmlencode(entry.location), entry.full_title_xml))
     emit(' <span class=\n "news-description"><span class="brief"><span class="purpose">%s</span></span></span>\n' % entry.purpose_xml)
     emit(' <span class=\n "news-date">%s</span></li>' % (entry.web_date()))
 }$ </ul>
@@ -44,4 +47,3 @@
                 </div>
 
                 <div class="clear"></div>
- </div>

Modified: website/public_html/beta/site-tools/templates/news-template.html
==============================================================================
--- website/public_html/beta/site-tools/templates/news-template.html (original)
+++ website/public_html/beta/site-tools/templates/news-template.html 2012-01-30 18:49:11 EST (Mon, 30 Jan 2012)
@@ -1,4 +1,6 @@
 ${
+from boost_site.util import htmlencode
+
 entries = pages.match_pages(['feed/news/*.qbk', 'feed/history/*.qbk|released'], 5)
 }$ <div class="section-body">
               ${
@@ -6,12 +8,12 @@
 emit(' ')
 for entry in entries:
     emit('\n')
- emit(' <li><span class=\n "news-title">%s</span></li>' % (entry.id, entry.title_xml))
+ emit(' <li><span class=\n "news-title">%s</span></li>' % (htmlencode(entry.id), entry.title_xml))
 emit(' </ul>')
 for entry in entries:
     emit('\n')
     emit(' <h2 class="news-title">\n')
- emit(' <a name="i%s" id="i%s"></a>%s' % (entry.id, entry.id, entry.location, entry.title_xml))
+ emit(' <a name="i%s" id="i%s"></a>%s' % (entry.id, entry.id, htmlencode(entry.location), entry.title_xml))
     emit('</h2>\n\n')
     emit(' <p class="news-date">%s</p>\n\n' % (entry.web_date()))
     emit(' <div class="news-description">\n')
@@ -19,9 +21,9 @@
     emit(' </div>\n\n')
     emit(' <ul class="menu">\n')
     emit(' <li>\n')
- emit(' Details</li>' % entry.location)
+ emit(' Details</li>' % htmlencode(entry.location))
     if(entry.download_item):
         emit('\n\n')
- emit(' <li>Download</li>' % entry.download_item)
+ emit(' <li>Download</li>' % htmlencode(entry.download_item))
     emit('\n </ul>')
 }$ </div>


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk