From 1db030b70d38863f6e5689d309700bf8ab7b70ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?An=C3=ADbal=20Lim=C3=B3n?= Date: Wed, 18 Feb 2015 16:57:14 +0000 Subject: [PATCH] rrs: Add support to display no update reason MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Display no update reason when upstream status filter is Can't be updated this helps to review the reason. Signed-off-by: Aníbal Limón --- rrs/views.py | 4 ++++ templates/rrs/recipes.html | 9 +++++++++ 2 files changed, 13 insertions(+) diff --git a/rrs/views.py b/rrs/views.py index 9b8551a..4352656 100644 --- a/rrs/views.py +++ b/rrs/views.py @@ -98,6 +98,7 @@ class RecipeList(): upstream_status = None upstream_version = None maintainer_name = None + no_update_reason = None def __init__(self, pk, name, summary): self.pk = pk @@ -130,6 +131,7 @@ def _get_recipe_list(milestone): upstream_version = '' upstream_status = '' + no_update_reason = '' if recipe_upstream_history: recipe_upstream = RecipeUpstream.get_by_recipe_and_history( recipe, recipe_upstream_history) @@ -153,6 +155,7 @@ def _get_recipe_list(milestone): if upstream_status == 'Downgrade': upstream_status = 'Unknown' # Downgrade is displayed as Unknown upstream_version = recipe_upstream.version + no_update_reason = recipe_upstream.no_update_reason maintainer = RecipeMaintainer.get_maintainer_by_recipe_and_history( recipe, recipe_maintainer_history) @@ -166,6 +169,7 @@ def _get_recipe_list(milestone): recipe_list_item.upstream_status = upstream_status recipe_list_item.upstream_version = upstream_version recipe_list_item.maintainer_name = maintainer_name + recipe_list_item.no_update_reason = no_update_reason recipe_list.append(recipe_list_item) return recipe_list diff --git a/templates/rrs/recipes.html b/templates/rrs/recipes.html index 6a8d1f8..c3719a1 100644 --- a/templates/rrs/recipes.html +++ b/templates/rrs/recipes.html @@ -75,6 +75,7 @@ Upstream status Maintainer Summary + No update reason @@ -96,6 +97,7 @@ {{ r.maintainer_name }} {{ r.summary }} + {{ r.no_update_reason }} {% endfor %} @@ -209,6 +211,12 @@ $(document).ready(function() { } function applyFilters() { + if (upstreamStatus == 'Can\'t be updated') { + $('.no_update_reason_column').show() + } else { + $('.no_update_reason_column').hide() + } + if (upstreamStatus == 'All') { upstreamStatusFilter = '' } else { @@ -269,6 +277,7 @@ $(document).ready(function() { 1: { sorter: false }, 2: { sorter: false }, 5: { sorter: false }, + 6: { sorter: false }, } }); {% endif %}