mirror of
git://git.yoctoproject.org/layerindex-web.git
synced 2025-07-19 20:59:01 +02:00
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>
This commit is contained in:
parent
7666b94d4c
commit
573d2deb71
|
@ -39,7 +39,7 @@
|
||||||
</div>
|
</div>
|
||||||
<table class="table table-bordered table-hover" id="statistics-table">
|
<table class="table table-bordered table-hover" id="statistics-table">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr class="headerRow">
|
||||||
<th class="sorted">Maintainer</th>
|
<th class="sorted">Maintainer</th>
|
||||||
<th class="muted">Assigned recipes</th>
|
<th class="muted">Assigned recipes</th>
|
||||||
<th class="muted">Up-to-date</th>
|
<th class="muted">Up-to-date</th>
|
||||||
|
@ -59,34 +59,34 @@
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody id="statistics-table-body">
|
||||||
{% for ml in maintainer_list %}
|
{% for ml in maintainer_list %}
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
{{ ml.name }}
|
{{ ml.name }}
|
||||||
</td>
|
</td>
|
||||||
<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 }}
|
{{ ml.recipes_all }}
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
<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 }}
|
{{ ml.recipes_up_to_date }}
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
<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 }}
|
{{ ml.recipes_not_updated }}
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
<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 }}
|
{{ ml.recipes_cant_be_updated }}
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
<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 }}
|
{{ ml.recipes_unknown }}
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
|
@ -103,6 +103,26 @@
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tbody>
|
</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>
|
</table>
|
||||||
<style>
|
<style>
|
||||||
th.header {
|
th.header {
|
||||||
|
@ -130,6 +150,11 @@ th.headerSortDown {
|
||||||
<script>
|
<script>
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
statisticsTable = $('#statistics-table');
|
statisticsTable = $('#statistics-table');
|
||||||
|
var totals = []
|
||||||
|
$("#statistics-table th").each(function(i){
|
||||||
|
totals.push(0);
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
function updateMaintainerCount() {
|
function updateMaintainerCount() {
|
||||||
$('#statistics-table').show()
|
$('#statistics-table').show()
|
||||||
|
@ -150,6 +175,7 @@ $(document).ready(function() {
|
||||||
} else {
|
} else {
|
||||||
$('.badge').html((count - 1) + " maintainers")
|
$('.badge').html((count - 1) + " maintainers")
|
||||||
}
|
}
|
||||||
|
updateTotals()
|
||||||
}
|
}
|
||||||
|
|
||||||
$("#form-search").submit(function( event ) {
|
$("#form-search").submit(function( event ) {
|
||||||
|
@ -175,6 +201,31 @@ $(document).ready(function() {
|
||||||
clearSearch()
|
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 %}
|
{% if maintainer_count > 0 %}
|
||||||
$(statisticsTable).tablesorter({
|
$(statisticsTable).tablesorter({
|
||||||
sortList: [[0,0]],
|
sortList: [[0,0]],
|
||||||
|
|
Loading…
Reference in New Issue
Block a user