On Wed, 09 Jul 2014, Christophe Siraut wrote:
> > Is there a better way to present this information?
> 
> We could simply have a text link in the links panel, but as we already
> use icons for versions and bugs I'd stick to what we had.
> 
> Please review the attached patch,

I added a test on top of your patch. Unfortunately it doesn't seem to
work, I don't see the icon in the browser. icon-rss is not supported
by the version of bootstrap that we currently use. Maybe we should upgrade
bootstrap or maybe we should just use a real picture.

Upgrading bootstrap might require further changes though...

Updated patch attached.

Cheers,
-- 
Raphaël Hertzog ◈ Debian Developer

Discover the Debian Administrator's Handbook:
→ http://debian-handbook.info/get/
>From 4584484d6cca411369b6d02dd4f5d89d7fe2cadf Mon Sep 17 00:00:00 2001
From: Christophe Siraut <d...@tobald.eu.org>
Date: Wed, 9 Jul 2014 18:05:07 +0200
Subject: [PATCH] core/templates: add an RSS feed icon in the news panel
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

[hert...@debian.org:
- Add a unit test for the change
]

Signed-off-by: Raphaël Hertzog <hert...@debian.org>
---
 distro_tracker/core/templates/core/panels/news.html | 13 +++++++++++++
 distro_tracker/core/tests/tests_news_feed.py        | 16 ++++++++++++++++
 2 files changed, 29 insertions(+)

diff --git a/distro_tracker/core/templates/core/panels/news.html b/distro_tracker/core/templates/core/panels/news.html
index 1dbea47..577ac83 100644
--- a/distro_tracker/core/templates/core/panels/news.html
+++ b/distro_tracker/core/templates/core/panels/news.html
@@ -1,5 +1,18 @@
 {% extends 'core/panels/panel.html' %}
 
+{% block panel-header %}
+<div class="row-fluid">
+<div class="pull-left">
+    <span>{{ panel.title }}</span>
+</div>
+<div class="pull-right">
+    <a title="rss feed" href="{% url 'dtracker-package-rss-news-feed' package.name %}">
+        <i class="icon-rss"></i>
+    </a>
+</div>
+</div>
+{% endblock %}
+
 {% block panel-body %}
 <ul class="list-group list-group-flush">
     <div class="scrollable">
diff --git a/distro_tracker/core/tests/tests_news_feed.py b/distro_tracker/core/tests/tests_news_feed.py
index a292f96..3e7513d 100644
--- a/distro_tracker/core/tests/tests_news_feed.py
+++ b/distro_tracker/core/tests/tests_news_feed.py
@@ -321,3 +321,19 @@ class NewsFeedTests(TestCase):
             response,
             self.get_package_news_feed_url(self.package.name),
             status_code=301)
+
+    def test_package_page_contains_news_feed_url(self):
+        pkg_url = reverse('dtracker-package-page', kwargs={
+            'package_name': self.package.name
+        })
+        rss_url = self.get_package_news_feed_url(self.package.name)
+        News.objects.create(
+            title="Hello world",
+            content="Hello world",
+            package=self.package
+        )
+
+        response = self.client.get(pkg_url)
+
+        self.assertIn('<a title="rss feed" href="{}">'.format(rss_url),
+                      response.content.decode('utf8'))
-- 
2.0.1

Reply via email to