diff options
Diffstat (limited to 'templates/packages/differences.html')
-rw-r--r-- | templates/packages/differences.html | 179 |
1 files changed, 102 insertions, 77 deletions
diff --git a/templates/packages/differences.html b/templates/packages/differences.html index 2c1460ea..6220392c 100644 --- a/templates/packages/differences.html +++ b/templates/packages/differences.html @@ -1,34 +1,66 @@ {% extends "base.html" %} -{% block title %}Arch Linux - Package Differences by Architecture{% endblock %} +{% load cycle from future %} +{% load static from staticfiles %} +{% load package_extras %} + +{% block title %}{{ BRANDING_DISTRONAME }} - Package Differences Reports{% endblock %} {% block navbarclass %}anb-packages{% endblock %} {% block content %} -{% if differences %} -<div id="differences-filter" class="box filter-criteria"> +<div class="box"> <h2>Package Differences by Architecture</h2> - <h3>Filter Differences View</h3> - <form id="diff_filter" method="post" action="."> - <fieldset> - <legend>Select filter criteria</legend> - <div><label for="id_archonly" title="Limit packages to selected architecture">Architecture Limitation</label> - <select name="archonly" id="id_archonly"> - <option value="all">Show All</option> - <option value="both">Only In Both</option> - <option value="{{ arch_a.name }}">In {{ arch_a.name }} Only</option> - <option value="{{ arch_b.name }}">In {{ arch_b.name }} Only</option> - </select> - </div> - <div><label for="id_multilib" title="Show multilib packages"><tt>[multilib]</tt> Visible</label> - <input type="checkbox" name="multilib" id="id_multilib" value="multilib"/></div> - <div><label for="id_minor" title="Show minor version mismatches">Minor Version Mismatches</label> - <input type="checkbox" checked="checked" name="minor" id="id_minor" value="minor"/></div> - <div ><label> </label><input title="Reset search criteria" type="button" id="criteria_reset" value="Reset"/></div> - </fieldset> - </form> -</div> + <div class="filter-criteria"> + <h3>Select architectures</h3> + <form id="arch_selector" method="get" action="."> + <fieldset> + <legend>Select arches</legend> + <div><label for="arch_a" title="Architecture A">Architecture A</label> + <select name="arch_a" id="arch_a"> + {% for arch in arches %} + <option + {% if arch == arch_a %} + selected="selected" + {% endif %} + >{{ arch }}</option> + {% endfor %} + </select> + </div> + <div><label for="arch_b" title="Architecture B">Architecture B</label> + <select name="arch_b" id="arch_b"> + {% for arch in arches %} + <option + {% if arch == arch_b %} + selected="selected" + {% endif %} + >{{ arch }}</option> + {% endfor %} + </select> + </div> + <div><label> </label><input type="submit" title="Show difference between selected architectures"></div> + </fieldset> + </form> + <h3>Filter Differences View</h3> + <form id="diff_filter" method="post" action="."> + <fieldset> + <legend>Select filter criteria</legend> + <div><label for="id_archonly" title="Limit packages to selected architecture">Architecture Limitation</label> + <select name="archonly" id="id_archonly"> + <option value="all">Show All</option> + <option value="both" selected="selected">Only In Both</option> + <option value="{{ arch_a.name }}">In {{ arch_a.name }} Only</option> + <option value="{{ arch_b.name }}">In {{ arch_b.name }} Only</option> + </select> + </div> + <div><label for="id_multilib" title="Show multilib packages"><tt>[multilib]</tt> Visible</label> + <input type="checkbox" name="multilib" id="id_multilib" value="multilib"/></div> + <div><label for="id_minor" title="Show minor version mismatches">Minor Version Mismatches</label> + <input type="checkbox" name="minor" id="id_minor" value="minor"/></div> + <div ><label> </label><input title="Reset search criteria" type="button" id="criteria_reset" value="Reset"/></div> + </fieldset> + </form> + </div> -<div class="box"> - <table class="results"> + <table id="table_differences" class="results"> <thead> <tr> <th>Package Name</th> @@ -37,77 +69,70 @@ <th>{{ arch_b.name }} Version</th> </tr> </thead> - <tbody> + <tbody id="tbody_differences"> {% for diff in differences %} <tr class="{% cycle 'odd' 'even' %} {{ diff.classes }}"> <td>{{ diff.pkgname }}</td> <td>{{ diff.repo.name }}</td> {% if diff.pkg_a %} - <td><a href="{{ diff.pkg_a.get_absolute_url }}" - title="View package details for {{ diff.pkg_a.pkgname }}"> - <span{% if diff.pkg_a.flag_date %} class="flagged"{% endif %}>{{ diff.pkg_a.pkgver }}-{{ diff.pkg_a.pkgrel }}</span></a></td> + <td>{% pkg_details_link diff.pkg_a diff.pkg_a.full_version True %}</td> {% else %}<td>-</td>{% endif %} {% if diff.pkg_b %} - <td><a href="{{ diff.pkg_b.get_absolute_url }}" - title="View package details for {{ diff.pkg_b.pkgname }}"> - <span{% if diff.pkg_b.flag_date %} class="flagged"{% endif %}>{{ diff.pkg_b.pkgver }}-{{ diff.pkg_b.pkgrel }}</span></a></td> + <td>{% pkg_details_link diff.pkg_b diff.pkg_b.full_version True %}</td> {% else %}<td>-</td>{% endif %} </tr> {% endfor %} </tbody> </table> </div> -{% load cdn %}{% jquery %} -<script type="text/javascript" src="/media/jquery.tablesorter.min.js"></script> + +<div class="box"> + <h2>Multilib Differences to Main Packages</h2> + + <table id="table_multilib_differences" class="results"> + <thead> + <tr> + <th>Multilib Name</th> + <th>Multilib Version</th> + <th>i686 Version</th> + <th>i686 Name</th> + <th>i686 Repo</th> + <th>Multilib Last Updated</th> + <th>i686 Last Updated</th> + </tr> + </thead> + <tbody> + {% for pkg1, pkg2 in multilib_differences %} + <tr class="{% cycle 'odd' 'even' %}"> + <td>{% pkg_details_link pkg1 %}</td> + <td><span{% if pkg1.flag_date %} class="flagged"{% endif %}>{{ pkg1.full_version }}</span></td> + <td><span{% if pkg2.flag_date %} class="flagged"{% endif %}>{{ pkg2.full_version }}</span></td> + <td>{% pkg_details_link pkg2 %}</td> + <td>{{ pkg2.repo }}</td> + <td>{{ pkg1.last_update|date }}</td> + <td>{{ pkg2.last_update|date }}</td> + </tr> + {% endfor %} + </tbody> + </table> + +</div> +{% endblock %} + +{% block script_block %} +{% load cdn %}{% jquery %}{% jquery_tablesorter %} +<script type="text/javascript" src="{% static "archweb.js" %}"></script> <script type="text/javascript"> -filter_packages = function() { - // start with all rows, and then remove ones we shouldn't show - var rows = $(".results tbody tr"); - if(!$('#id_multilib').is(':checked')) { - rows = rows.not(".multilib"); - } - var arch = $("#id_archonly").val(); - if(arch !== "all") { - rows = rows.filter("." + arch); - } - if(!$('#id_minor').is(':checked')) { - // this check is done last because it is the most expensive - rows = rows.filter(function(index) { - // all this just to get the split version out of the table cell - var pat = /(.*)-(.+)/; - var ver_a = $('td:eq(2) span', this).text().match(pat); - var ver_b = $('td:eq(3) span', this).text().match(pat); - // did we match at all? - if(!ver_a || !ver_b) return true; - // first check pkgver - if(ver_a[1] !== ver_b[1]) return true; - // pkgver matched, so see if rounded pkgrel matches - if(Math.floor(parseFloat(ver_a[2])) == - Math.floor(parseFloat(ver_b[2]))) return false; - // pkgrel didn't match, so keep the row - return true; - }); - } - // hide all rows, then show the set we care about - $('.results tbody tr').hide(); - rows.show(); - // make sure we update the odd/even styling from sorting - $('.results').trigger("applyWidgets"); -}; -filter_reset = function() { - $('#id_archonly').val("all"); - $('#id_multilib').removeAttr("checked"); - $('#id_minor').attr("checked", "checked"); - filter_packages(); -}; $(document).ready(function() { - $('.results').tablesorter({widgets: ['zebra'], sortList: [[1,0], [0,0]]}); + $('#table_differences').tablesorter({widgets: ['zebra'], sortList: [[1,0], [0,0]]}); + $('#table_multilib_differences').tablesorter({widgets: ['zebra'], sortList: [[5, 0]]}); +}); +$(document).ready(function() { $('#diff_filter select').change(filter_packages); $('#diff_filter input').change(filter_packages); - $('#criteria_reset').click(filter_reset); + $('#criteria_reset').click(filter_packages_reset); // fire function on page load to ensure the current form selections take effect filter_packages(); }); </script> -{% endif %} {% endblock %} |