rrs: fix recipe count not showing up properly if no per-recipe maintainers

If a maintenance plan has no per-recipe maintainers then we don't show
the maintainer filtering drop-down, but we still had javascript code
that unconditionally tried to access it and of course that failed if it
wasn't there. Disable that as well without per-recipe maintainers.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
This commit is contained in:
Paul Eggleton 2018-09-05 11:39:20 +12:00
parent 549c5377db
commit 575b6bc180

View File

@ -223,6 +223,7 @@ $(document).ready(function() {
} }
function updateMaintainerSelected() { function updateMaintainerSelected() {
{% if maintplan.per_recipe_maintainers %}
$("#selected-maintainer strong").html(maintainer) $("#selected-maintainer strong").html(maintainer)
maintainerList = document.getElementById("select-maintainer").getElementsByTagName("li") maintainerList = document.getElementById("select-maintainer").getElementsByTagName("li")
@ -233,6 +234,7 @@ $(document).ready(function() {
$(maintainerList[i]).removeClass("active") $(maintainerList[i]).removeClass("active")
} }
} }
{% endif %}
} }
function applyFilters() { function applyFilters() {
@ -311,10 +313,12 @@ $(document).ready(function() {
clearSearch() clearSearch()
}); });
{% if maintplan.per_recipe_maintainers %}
$("#select-maintainer a").click(function() { $("#select-maintainer a").click(function() {
maintainer = this.text maintainer = this.text
clearSearch() clearSearch()
}); });
{% endif %}
$("#view-all-recipes").click(function() { $("#view-all-recipes").click(function() {
upstreamStatus = 'All' upstreamStatus = 'All'