{% if announcement %}
{{ _("Announcement") }}:
{% end %}
- <a href="/news/{{ item.slug }}">{{ item.title }}</a>
+ <a href="http://www.ipfire.org/news/{{ item.slug }}">{{ item.title }}</a>
</h2>
{% end %}
{% raw item.text %}
- </div>
-</div>
-<div class="row">
- <div class="col-lg-12 col-md-12">
- <p class="pull-right">
- <a href="/author/{{ item.author_id }}">{{ item.author }}</a> -
- {{ locale.format_date(item.published, full_format=True) }}
- </p>
+
+ <hr>
+
+ <small class="pull-right">
+ {{ _("Published by %(author)s, %(time)s") % { "author" : item.author, "time" : locale.format_date(item.published, full_format=True) } }}
+ </small>
</div>
</div>
<i class="glyphicon glyphicon-magnet"></i> {{ _("Magnet link") }},
<i class="glyphicon glyphicon-download-alt"></i> {{ _("Torrent download") }}
</p>
+
+ {% if release.news %}
+ <hr>
+
+ {% module NewsItem(release.news, show_heading=True, announcement=True) %}
+ {% end %}
{% else %}
<div class="alert alert-warning">
{{ _("There are no downloads available for this release.") }}
+++ /dev/null
-{% extends "planet-user.html" %}
-
-{% block title %}{{ author.cn }}{% end block %}
-
-{% block bodyA %}
- <div class="page-header">
- <h1>{{ _("%s's announcements") % author.cn }}</h1>
- </div>
-
- <div class="row">
- <div class="col-lg-9 col-md-9">
- {% if lang == "de" %}
- XXX GERMAN TEXT MISSING
- {% else %}
- <p>
- This is a list of all announcements made by {{ author.cn }}
- in reverse chronological order.
- </p>
- {% end %}
-
- <table class="table table-striped table-bordered">
- <tbody>
- {% for news in latest_news %}
- <tr>
- <td>
- <a href="/news/{{ news.slug }}">{{ news.title }}</a>
- </td>
- <td>
- {{ locale.format_date(news.date, full_format=True) }}
- </td>
- </tr>
- {% end %}
- </tbody>
- </table>
- </div>
- </div>
-{% end block %}
(r"/news", NewsIndexHandler),
(r"/news/year/([0-9]*)", NewsYearHandler),
(r"/news/(.*)", NewsItemHandler),
- (r"/author/(.*)", NewsAuthorHandler),
# Download sites
(r"/download", tornado.web.RedirectHandler, { "url" : "http://downloads.ipfire.org/latest" }),
def netboot_initrd(self):
return "http://downloads.ipfire.org/%s/images/instroot" % self.path
+ @property
+ def news_id(self):
+ return self.__data.news_id
+
+ @property
+ def news(self):
+ if not hasattr(self, "_news"):
+ self._news = self.backend.news.get(self.news_id)
+
+ return self._news
+
class Releases(Object):
def get_by_id(self, id):
# Find the name of the author
author = self.get_account(news.author_id)
if author:
- news.author = author.cn
+ news.author = author.name
else:
_ = self.locale.translate
news.author = _("Unknown author")
return self.render("news-item.html", item=news)
-
-
-class NewsAuthorHandler(BaseHandler):
- """
- This page displays information about the news author.
- """
- def get(self, author):
- author = self.get_account(author)
- if not author:
- raise tornado.web.HTTPError(404)
-
- latest_news = self.news.get_latest(author=author.uid,
- locale=self.locale, limit=10)
-
- self.render("news-author.html",
- author=author, latest_news=latest_news)
# Get name of author
author = self.accounts.find(author)
if author:
- return author.cn
+ return author.name
else:
_ = self.locale.translate
return _("Unknown author")