rrs: show link to other distro comparison pages

If other distro comparison package(s) exist for a recipe being shown in
the RRS recipe detail page, link to the page for each package as well as
any extra URLs.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
This commit is contained in:
Paul Eggleton 2018-05-15 09:30:51 +12:00
parent 383d043f1e
commit 99c7f0b916
3 changed files with 15 additions and 3 deletions

2
TODO
View File

@ -62,5 +62,3 @@ RRS:
* We only list recipes that have upgrade info (an earlier design decision) - should we list all?
* Replace "All" with "(all)" and "No maintainer" with "(no maintainer)"?
* Link to upstream changelogs? (will require per-recipe variable)
* Link to other distro comparisons?
* Link to other distro package info pages?

View File

@ -465,6 +465,9 @@ class Recipe(models.Model):
eu = ExtraURL(name=item.name, url=item.render_url(self))
yield eu
def comparison_recipes(self):
return ClassicRecipe.objects.filter(cover_layerbranch=self.layerbranch).filter(cover_pn=self.pn)
def __str__(self):
return os.path.join(self.filepath, self.filename)

View File

@ -215,10 +215,21 @@
</dd>
{% endif %}
{% if recipe_distros %}
{% if recipe_distros or recipe.comparison_recipes.exists %}
<dt>Distributions</dt>
<dd>
<ul class="unstyled">
{% for cr in recipe.comparison_recipes %}
<li><a href="{% url 'comparison_recipe' cr.id %}">{{ cr.layerbranch.branch }} - {{ cr.pn }}</a>
{% if cr.extra_urls %}
<ul>
{% for extra_url in cr.extra_urls %}
<li><a href="{{ extra_url.url }}">{{ extra_url.name }}</a></li>
{% endfor %}
</ul>
{% endif %}
</li>
{% endfor %}
{% for d in recipe_distros %}
<li>{{ d }}</li>
{% endfor %}