aboutsummaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorMariano Lopez <mariano.lopez@linux.intel.com>2015-04-08 14:59:07 -0500
committerPaul Eggleton <paul.eggleton@linux.intel.com>2018-05-04 23:57:52 +1200
commita2e5ef75ebfea65c87252369b00b32e07c31160c (patch)
treede966f0c597d08a03672703be9fb28017d4624eb /templates
parentab7f6443ace4816e4a6ef5901516f6e38e1cb7f1 (diff)
downloadopenembedded-core-contrib-a2e5ef75ebfea65c87252369b00b32e07c31160c.tar.gz
templates/rrs/maintainers.html: Added total row at the end of the table.
Added footer for the table and function updateTotals. Added class and/or id attributes to some existing html tags. Didn't modified existing class or id attributes for existing html tags. Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Diffstat (limited to 'templates')
-rw-r--r--templates/rrs/maintainers.html65
1 files changed, 58 insertions, 7 deletions
diff --git a/templates/rrs/maintainers.html b/templates/rrs/maintainers.html
index a3180ff05e..b4ef50b086 100644
--- a/templates/rrs/maintainers.html
+++ b/templates/rrs/maintainers.html
@@ -39,7 +39,7 @@
</div>
<table class="table table-bordered table-hover" id="statistics-table">
<thead>
- <tr>
+ <tr class="headerRow">
<th class="sorted">Maintainer</th>
<th class="muted">Assigned recipes</th>
<th class="muted">Up-to-date</th>
@@ -59,34 +59,34 @@
{% endfor %}
</tr>
</thead>
-<tbody>
+<tbody id="statistics-table-body">
{% for ml in maintainer_list %}
<tr>
<td>
{{ ml.name }}
</td>
<td>
- <a href="{% url 'recipes' release_name milestone_name %}?maintainer_name={{ ml.name|urlencode }}">
+ <a class="rowData" href="{% url 'recipes' release_name milestone_name %}?maintainer_name={{ ml.name|urlencode }}">
{{ ml.recipes_all }}
</a>
</td>
<td>
- <a href="{% url 'recipes' release_name milestone_name %}?upstream_status={{ "Up-to-date"|urlencode }}&maintainer_name={{ ml.name|urlencode }}">
+ <a class="rowData" href="{% url 'recipes' release_name milestone_name %}?upstream_status={{ "Up-to-date"|urlencode }}&maintainer_name={{ ml.name|urlencode }}">
{{ ml.recipes_up_to_date }}
</a>
</td>
<td>
- <a href="{% url 'recipes' release_name milestone_name %}?upstream_status={{ "Not updated"|urlencode }}&maintainer_name={{ ml.name|urlencode }}">
+ <a class="rowData" href="{% url 'recipes' release_name milestone_name %}?upstream_status={{ "Not updated"|urlencode }}&maintainer_name={{ ml.name|urlencode }}">
{{ ml.recipes_not_updated }}
</a>
</td>
<td>
- <a href="{% url 'recipes' release_name milestone_name %}?upstream_status={{ "Can't be updated"|urlencode }}&maintainer_name={{ ml.name|urlencode }}">
+ <a class="rowData" href="{% url 'recipes' release_name milestone_name %}?upstream_status={{ "Can't be updated"|urlencode }}&maintainer_name={{ ml.name|urlencode }}">
{{ ml.recipes_cant_be_updated }}
</a>
</td>
<td>
- <a href="{% url 'recipes' release_name milestone_name %}?upstream_status={{ "Unknown"|urlencode }}&maintainer_name={{ ml.name|urlencode }}">
+ <a class="rowData" href="{% url 'recipes' release_name milestone_name %}?upstream_status={{ "Unknown"|urlencode }}&maintainer_name={{ ml.name|urlencode }}">
{{ ml.recipes_unknown }}
</a>
</td>
@@ -103,6 +103,26 @@
</tr>
{% endfor %}
</tbody>
+<tfoot id="statistics-table-foot">
+ <tr class="totalRow">
+ <th id="totalCell">Total</th>
+ <th id="totalAssigned" class="totalCol"></th>
+ <th id="totalUptoDate" class="totalCol"></th>
+ <th class="totalCol"></th>
+ <th class="totalCol"></th>
+ <th class="totalCol"></th>
+ <th id="totalPercentage"></th>
+ {% for i in intervals %}
+ {% if current_interval == forloop.counter0 %}
+ <th class="current-wk">
+ {% else %}
+ <th class="totalCol">
+ {% endif %}
+ {{ i }}
+ </th>
+ {% endfor %}
+ </tr>
+</tfoot>
</table>
<style>
th.header {
@@ -130,6 +150,11 @@ th.headerSortDown {
<script>
$(document).ready(function() {
statisticsTable = $('#statistics-table');
+ var totals = []
+ $("#statistics-table th").each(function(i){
+ totals.push(0);
+ });
+
function updateMaintainerCount() {
$('#statistics-table').show()
@@ -150,6 +175,7 @@ $(document).ready(function() {
} else {
$('.badge').html((count - 1) + " maintainers")
}
+ updateTotals()
}
$("#form-search").submit(function( event ) {
@@ -175,6 +201,31 @@ $(document).ready(function() {
clearSearch()
});
+ function updateTotals() {
+ for (count=0; count<totals.length; count++) {
+ totals[count]=0
+ }
+ var $dataRows=$("#statistics-table-body tr:visible")
+ $dataRows.each(function() {
+ $(this).find('.rowData, .current-wk, .muted').each(function(i){
+ if ($(this).html().trim() != '') {
+ totals[i] += parseInt($(this).html())
+ }
+ })
+ })
+
+ var $totalRow=$("#statistics-table-foot tr.totalRow")
+ $totalRow.find('.totalCol, .current-wk').each(function(i) {
+ $(this).html(totals[i]);
+ })
+
+ tempInt1 = parseInt($("#totalUptoDate").html())
+ tempInt2 = parseInt($("#totalAssigned").html())
+ tempInt1 = ((tempInt1/tempInt2).toFixed(2))*100
+ $("#totalPercentage").html(tempInt1 +'%')
+
+ }
+
{% if maintainer_count > 0 %}
$(statisticsTable).tablesorter({
sortList: [[0,0]],