Commit 6a12952d authored by ale's avatar ale

show the feed from news.ngvision.org in homepage

parent 31850094
......@@ -12,7 +12,7 @@ class HomeController(BaseController):
homepage_group = model.Group.query.filter_by(name='homepage').one()
c.homepage_videos = homepage_group.videos
c.feeds = {
'v2v': model.Feed.get('http://www.v2v.cc/node/feed'),
'ngv': model.Feed.get('http://news.ngvision.org/atom/'),
}
return render('/home.html')
if h.logged_in():
......
......@@ -60,15 +60,8 @@ onload="document.forms[0].q.focus();"
</td>
<td valign="top" width="33%" rowspan="2">
<h3>News</h3>
## <p>
## Bla bla bla blah blah bla blah bla bla
## bla bla bla bla h blah bla bl ah bla bla
## bla bla bla blah blah bla b lah bla bla
## bla bl a bla b lah blah bla blah bla bla
## bla bla bla blah blah bla bl ah bla bla.
## </p>
${self.snippets.feed(c.feeds['v2v'])}
${self.snippets.feed(c.feeds['ngv'], show_title=False, strip_html=False)}
</td>
</tr>
......
......@@ -16,6 +16,7 @@ local.commands = {}
local.command_sections = []
## setup all the basic commands
add_command('main', 'Home', h.url_for('home'))
add_command('main', 'News', 'http://news.ngvision.org/')
add_command('main', 'Documentation', h.url_for(controller='/docs'))
add_command('main', 'Search', h.url_for(controller='/video', action='search'))
if h.logged_in():
......
......@@ -22,7 +22,7 @@ ${self.setup_commands()}
<div id="extContainer">
<div id="leftBox">
<a href="/"><img src="/images/ngv_small.png" alt="New Global Vision" /></a>
<a href="/"><img src="/images/ngv_small.png" width="140" height="60" alt="New Global Vision" /></a>
${self.leftbox()}
</div>
......
......@@ -160,26 +160,30 @@ ${h.link_to(v.title, url=h.url_for(controller='/video', id=(v.slug or v.public_i
## pretty-print a feed
<%def name="feed(info, num_items=3)">
<%def name="feed(info, num_items=3, show_title=True, strip_html=True)">
% if info.feed:
<div class="rssfeed">
% if show_title:
<h4>${info.feed.title}<br />
<small>${h.link_to(info.feed.link, url=info.feed.link)}</small>
</h4>
% endif
% for item in info.entries[:num_items]:
<!-- ${item.id} -->
<p>
##${button(item.link, 'document')}
<strong>${h.link_to(item.title, url=item.link)}</strong><br />
<small>
${h.sanitize_html(item.summary)}
% if item.enclosures:
% if strip_html:
${h.sanitize_html(item.summary)}
% else:
${item.summary}
% endif
% if 'enclosures' in item and item.enclosures:
% for enc in item.enclosures:
<br />
${h.link_to('Download (%s)' % enc.type, url=enc.href)}
% endfor
% endif
</small>
</p>
% endfor
</div>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment