Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r81411 - in website/public_html/beta: feed feed/history site-tools/boost_site site-tools/templates
From: dnljms_at_[hidden]
Date: 2012-11-18 10:15:59


Author: danieljames
Date: 2012-11-18 10:15:58 EST (Sun, 18 Nov 2012)
New Revision: 81411
URL: http://svn.boost.org/trac/boost/changeset/81411

Log:
Website: Implement notice for front page.

Text files modified:
   website/public_html/beta/feed/ext.qbk | 5 +++++
   website/public_html/beta/feed/history/boost_1_52_0.qbk | 2 ++
   website/public_html/beta/site-tools/boost_site/boostbook_parser.py | 11 +++++++++++
   website/public_html/beta/site-tools/boost_site/pages.py | 7 +++++++
   website/public_html/beta/site-tools/templates/index-template.py | 6 ++++++
   5 files changed, 31 insertions(+), 0 deletions(-)

Modified: website/public_html/beta/feed/ext.qbk
==============================================================================
--- website/public_html/beta/feed/ext.qbk (original)
+++ website/public_html/beta/feed/ext.qbk 2012-11-18 10:15:58 EST (Sun, 18 Nov 2012)
@@ -39,3 +39,8 @@
     Link to the ticket number
 ]
 [template ticket[number]'''<ulink url="https://svn.boost.org/trac/boost/ticket/'''[number]'''">'''#[number]'''</ulink>''']
+
+[/ notice[link..text]
+ Prominent link to a special notice.
+]
+[template notice[href text]'''<notice url="'''[href]'''">'''[text]'''</notice>''']

Modified: website/public_html/beta/feed/history/boost_1_52_0.qbk
==============================================================================
--- website/public_html/beta/feed/history/boost_1_52_0.qbk (original)
+++ website/public_html/beta/feed/history/boost_1_52_0.qbk 2012-11-18 10:15:58 EST (Sun, 18 Nov 2012)
@@ -13,6 +13,8 @@
 [status released]
 [download http://sourceforge.net/projects/boost/files/boost/1.52.0/]
 [documentation /doc/libs/1_52_0/]
+[notice /users/news/a_special_note_for_boost_1_52_0_and_higher.html
+ IMPORTANT: See here for a special note about this release.]
 
 [section Updated Libraries]
 

Modified: website/public_html/beta/site-tools/boost_site/boostbook_parser.py
==============================================================================
--- website/public_html/beta/site-tools/boost_site/boostbook_parser.py (original)
+++ website/public_html/beta/site-tools/boost_site/boostbook_parser.py 2012-11-18 10:15:58 EST (Sun, 18 Nov 2012)
@@ -34,6 +34,13 @@
             *self.x_children(article_node.getElementsByTagName('title')[0])
         )
 
+ notice_xhtml = None
+ notice_url = None
+ notice_node = article_node.getElementsByTagName('notice')
+ if notice_node:
+ notice_xhtml = self.new_fragment(*self.x_children(notice_node[0]))
+ notice_url = notice_node[0].getAttribute('url')
+
         download_item = None
         download_node = article_node.getElementsByTagName('download')
         if download_node:
@@ -64,6 +71,8 @@
             'title_fragment' : title_xhtml,
             'purpose_fragment' : brief_xhtml,
             'description_fragment' : description_xhtml,
+ 'notice_url' : notice_url,
+ 'notice_fragment' : notice_xhtml,
             'pub_date' : pub_date,
             'last_modified' : last_modified,
             'download_item' : download_item,
@@ -101,6 +110,8 @@
                 continue
             if self.get_child(body_item, tag = 'status'):
                 continue
+ if self.get_child(body_item, tag = 'notice'):
+ continue
             if self.get_child(body_item, tag = 'documentation'):
                 continue
             description_xhtml.appendChild(self.x(body_item))

Modified: website/public_html/beta/site-tools/boost_site/pages.py
==============================================================================
--- website/public_html/beta/site-tools/boost_site/pages.py (original)
+++ website/public_html/beta/site-tools/boost_site/pages.py 2012-11-18 10:15:58 EST (Sun, 18 Nov 2012)
@@ -190,6 +190,8 @@
         self.id = attrs.get('id', None)
         self.title_xml = attrs.get('title', None)
         self.purpose_xml = attrs.get('purpose', None)
+ self.notice_xml = attrs.get('notice', None)
+ self.notice_url = attrs.get('notice_url', None)
         self.last_modified = attrs.get('last_modified')
         self.pub_date = attrs.get('pub_date')
         self.download_item = attrs.get('download')
@@ -231,6 +233,8 @@
             'id' : self.id,
             'title': self.title_xml,
             'purpose': self.purpose_xml,
+ 'notice': self.notice_xml,
+ 'notice_url': self.notice_url,
             'last_modified': self.last_modified,
             'pub_date': self.pub_date,
             'download': self.download_item,
@@ -245,6 +249,9 @@
     
         self.title_xml = boost_site.util.fragment_to_string(values['title_fragment'])
         self.purpose_xml = boost_site.util.fragment_to_string(values['purpose_fragment'])
+ self.notice_xml = boost_site.util.fragment_to_string(values['notice_fragment']) \
+ if values['notice_fragment'] else None
+ self.notice_url = values['notice_url']
 
         self.pub_date = values['pub_date']
         self.last_modified = values['last_modified']

Modified: website/public_html/beta/site-tools/templates/index-template.py
==============================================================================
--- website/public_html/beta/site-tools/templates/index-template.py (original)
+++ website/public_html/beta/site-tools/templates/index-template.py 2012-11-18 10:15:58 EST (Sun, 18 Nov 2012)
@@ -27,6 +27,12 @@
             emit(' | ')
             emit('Documentation' % (htmlencode(entry.documentation)))
         emit('</div>')
+ if entry.notice_xml:
+ if entry.notice_url:
+ emit('<div class="news-notice"><a class="news-notice-link" href="%s">%s</a></div>' %
+ (htmlencode(entry.notice_url), entry.notice_xml))
+ else:
+ emit('<div class="news-notice">%s</div>' % entry.notice_xml)
         emit('<div class="news-date">%s</div>' % (entry.web_date()))
         emit('</li>\n')
     emit('</ul>\n')


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