From 130ff8e8030e038359ad38b379a69d8644096f5e Mon Sep 17 00:00:00 2001 From: Paul Eggleton Date: Mon, 9 Apr 2018 10:23:13 +1200 Subject: rrs: add patch listing to recipe list and detail Expose the newly added patch information in the RRS: * Add a table to the recipe detail listing the patches for the recipe * Add pending / total counts to the recipe list page Implements [YOCTO #7909]. Signed-off-by: Paul Eggleton --- rrs/views.py | 5 ++++- templates/rrs/recipedetail.html | 22 ++++++++++++++++++++++ templates/rrs/recipes.html | 2 ++ 3 files changed, 28 insertions(+), 1 deletion(-) diff --git a/rrs/views.py b/rrs/views.py index e98db9bd5c..ed05e8196e 100644 --- a/rrs/views.py +++ b/rrs/views.py @@ -10,7 +10,7 @@ from django.views.generic import ListView, DetailView, RedirectView from django.core.urlresolvers import resolve, reverse, reverse_lazy from django.db import connection -from layerindex.models import Recipe, StaticBuildDep +from layerindex.models import Recipe, StaticBuildDep, Patch from rrs.models import Release, Milestone, Maintainer, RecipeMaintainerHistory, \ RecipeMaintainer, RecipeUpstreamHistory, RecipeUpstream, \ RecipeDistro, RecipeUpgrade, MaintenancePlan @@ -468,6 +468,9 @@ def _get_recipe_list(milestone): recipe_list_item.upstream_status = upstream_status recipe_list_item.upstream_version = upstream_version recipe_list_item.outdated = outdated + patches = Patch.objects.filter(recipe__id=recipe['id']) + recipe_list_item.patches_total = patches.count() + recipe_list_item.patches_pending = patches.filter(status='P').count() recipe_list_item.maintainer_name = maintainer_name recipe_list_item.no_update_reason = no_update_reason recipe_list.append(recipe_list_item) diff --git a/templates/rrs/recipedetail.html b/templates/rrs/recipedetail.html index ac4c6463e5..e79852ce56 100644 --- a/templates/rrs/recipedetail.html +++ b/templates/rrs/recipedetail.html @@ -116,6 +116,28 @@ {% endif %} + +

Patches

+ {% if recipe.patch_set.exists %} + + + + + + + + + {% for patch in recipe.patch_set.all %} + + + + + {% endfor %} + +
PatchStatus
{{ patch.src_path }}{{ patch.get_status_display }} {{ patch.status_extra | urlize }}
+ {% else %} +

None

+ {% endif %}
diff --git a/templates/rrs/recipes.html b/templates/rrs/recipes.html index 8c4b29abd6..30db1bf32e 100644 --- a/templates/rrs/recipes.html +++ b/templates/rrs/recipes.html @@ -79,6 +79,7 @@ Upstream version Upstream status Last Updated + Patches Maintainer Summary No update reason @@ -102,6 +103,7 @@ {{ r.upstream_status }} {{r.outdated}} + {% if r.patches_total %}{{ r.patches_pending }} / {{ r.patches_total }}{% endif %} {{ r.maintainer_name }} {{ r.summary }} {{ r.no_update_reason }} -- cgit 1.2.3-korg