Add links to other branch recipes in recipe detail

Add links to the same recipe in other branches in the recipe detail page
(and RRS recipe detail page) so that you can see which versions are
available in other branches and drill down to the detail if you want to.

Implements [YOCTO #13019].

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
This commit is contained in:
Paul Eggleton 2018-12-06 09:13:05 +13:00
parent eeffb2d675
commit 0929289465
4 changed files with 57 additions and 0 deletions

View File

@ -974,6 +974,7 @@ class RecipeDetailView(DetailView):
if dep.path.endswith('.inc'):
extrafiles.append(dep)
context['extrafiles'] = extrafiles
context['otherbranch_recipes'] = Recipe.objects.filter(layerbranch__layer=recipe.layerbranch.layer, layerbranch__branch__comparison=False, pn=recipe.pn).order_by('layerbranch__branch__sort_priority')
return context

View File

@ -740,6 +740,8 @@ class RecipeDetailView(DetailView):
context['recipe_distros'] = RecipeDistro.get_distros_by_recipe(recipe)
context['otherbranch_recipes'] = Recipe.objects.filter(layerbranch__layer=recipe.layerbranch.layer, layerbranch__branch__comparison=False, pn=recipe.pn).order_by('layerbranch__branch__sort_priority')
return context
class MaintainerList():

View File

@ -222,6 +222,33 @@
{% endfor %}
</table>
{% endif %}
{% if otherbranch_recipes %}
<h2>Other branches</h2>
<p>This recipe in other branches of {{ recipe.layerbranch.layer.name }}:</p>
<table class="table table-bordered">
<thead>
<tr>
<th class="col-md-4">Branch</th>
<th>Recipe</th>
</tr>
</thead>
{% for other in otherbranch_recipes %}
<tr>
<td>
{{ other.layerbranch.branch }}
</td>
<td>
{% if other == recipe %}
{{ other.pn }} {{ other.pv }} (this recipe)
{% else %}
<a href="{% url 'recipe' other.id %}">{{ other.pn }} {{ other.pv }}</a>
{% endif %}
</td>
</tr>
{% endfor %}
</table>
{% endif %}
</div>
</div>

View File

@ -144,6 +144,33 @@
{% else %}
<p>None</p>
{% endif %}
{% if otherbranch_recipes %}
<h2>Other branches</h2>
<p>This recipe in other branches of {{ recipe.layerbranch.layer.name }}:</p>
<table class="table table-bordered">
<thead>
<tr>
<th class="col-md-4">Branch</th>
<th>Recipe</th>
</tr>
</thead>
{% for other in otherbranch_recipes %}
<tr>
<td>
{{ other.layerbranch.branch }}
</td>
<td>
{% if other == recipe %}
{{ other.pn }} {{ other.pv }} (this recipe)
{% else %}
<a href="{% url 'recipe' other.id %}">{{ other.pn }} {{ other.pv }}</a>
{% endif %}
</td>
</tr>
{% endfor %}
</table>
{% endif %}
</div>
<div class="col-md-4">