aboutsummaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorAníbal Limón <anibal.limon@linux.intel.com>2015-02-06 17:52:10 -0600
committerPaul Eggleton <paul.eggleton@linux.intel.com>2018-05-04 23:57:51 +1200
commit9a869735db922617d1b9b606df9bd0d33c9587e7 (patch)
treee2c34e71fe7ad15cf6315932feda4aa1e79695eb /templates
parent831464466c7b3087c237049f24f700d0d803dc9f (diff)
downloadopenembedded-core-contrib-9a869735db922617d1b9b606df9bd0d33c9587e7.tar.gz
rrs: Maintainers page fix maintainer count
Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Diffstat (limited to 'templates')
-rw-r--r--templates/rrs/maintainers.html39
-rw-r--r--templates/rrs/recipes.html3
2 files changed, 36 insertions, 6 deletions
diff --git a/templates/rrs/maintainers.html b/templates/rrs/maintainers.html
index acc7c4c201..4dca3eeea5 100644
--- a/templates/rrs/maintainers.html
+++ b/templates/rrs/maintainers.html
@@ -21,7 +21,7 @@
<div class="navbar-inner table-controls">
<ul class="nav">
<li class="dropdown">
- <span class="badge" style="margin-top:11px;">{{ maintainer_count }} maintainers</span>
+ <span class="badge" style="margin-top:11px;"></span>
</li>
</ul>
<form class="navbar-form pull-right">
@@ -30,9 +30,9 @@
</div>
</div>
-{% if maintainer_count == 0 %}
-<div class="alert"> No maintainers found</div>
-{% else %}
+<div id="no_maintainers_alert" class="alert">
+ No maintainers found <a href="#" id="view-all-maintainers" style="margin-left:10px;">View all maintainers</a>
+</div>
<table class="table table-bordered table-hovere" id="statistics-table">
<thead>
<tr>
@@ -100,7 +100,6 @@
{% endfor %}
</tbody>
</table>
-{% endif %}
{% endblock %}
{% block scripts %}
@@ -111,6 +110,27 @@
$(document).ready(function() {
statisticsTable = $('#statistics-table');
+ function updateMaintainerCount() {
+ $('#statistics-table').show()
+ $('#no_maintainers_alert').hide()
+
+ count = 0
+ $('tr:visible').each(function() {
+ count++
+ });
+
+ if (count == 1) {
+ $('#statistics-table').hide()
+ $('#no_maintainers_alert').show()
+ }
+
+ if (count == 2) {
+ $('.badge').html("1 maintainer");
+ } else {
+ $('.badge').html((count - 1) + " maintainers")
+ }
+ }
+
$(statisticsTable).tablesorter({
sortList: [[0,0]],
headers: {
@@ -133,7 +153,16 @@ $(document).ready(function() {
$("#filter").keyup(function() {
$.uiTableFilter(statisticsTable, this.value);
+ updateMaintainerCount()
});
+
+ $("#view-all-maintainers").click(function() {
+ $.uiTableFilter(statisticsTable, '');
+ $("#filter").val('')
+ updateMaintainerCount()
+ });
+
+ updateMaintainerCount()
});
</script>
{% endif %}
diff --git a/templates/rrs/recipes.html b/templates/rrs/recipes.html
index cdb9c52767..6c86a55641 100644
--- a/templates/rrs/recipes.html
+++ b/templates/rrs/recipes.html
@@ -246,8 +246,9 @@ $(document).ready(function() {
upstreamStatus = 'All'
maintainer = 'All'
applyFilters()
+ $("#filter").val('')
updateRecipeCount()
- })
+ });
applyFilters()
updateRecipeCount()