summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Krampf <johannes.krampf@gmail.com>2011-12-03 14:44:42 +0100
committerJohannes Krampf <johannes.krampf@gmail.com>2011-12-03 14:44:42 +0100
commit183c4d9cefa95f46c3fa3a6936f837542426eac2 (patch)
tree32b2af21ef05a6dee93546328120d0f9183578e2
parentf71f3e23eda8e1ff447340812025ab724aff14cb (diff)
Allow architecure selection for difference view
-rw-r--r--packages/views/__init__.py5
-rw-r--r--templates/packages/differences.html29
2 files changed, 32 insertions, 2 deletions
diff --git a/packages/views/__init__.py b/packages/views/__init__.py
index e3264161..bbfe7c9f 100644
--- a/packages/views/__init__.py
+++ b/packages/views/__init__.py
@@ -226,13 +226,14 @@ def download(request, name, repo, arch):
def arch_differences(request):
# TODO: we have some hardcoded magic here with respect to the arches.
- arch_a = Arch.objects.get(name='i686')
- arch_b = Arch.objects.get(name='x86_64')
+ arch_a = Arch.objects.get(name=request.GET.get('arch_a', 'i686'))
+ arch_b = Arch.objects.get(name=request.GET.get('arch_b', 'x86_64'))
differences = get_differences_info(arch_a, arch_b)
context = {
'arch_a': arch_a,
'arch_b': arch_b,
'differences': differences,
+ 'arches': Arch.objects.filter(agnostic=False)
}
return direct_to_template(request, 'packages/differences.html', context)
diff --git a/templates/packages/differences.html b/templates/packages/differences.html
index d9b5f088..0412f8c2 100644
--- a/templates/packages/differences.html
+++ b/templates/packages/differences.html
@@ -6,6 +6,35 @@
{% if differences %}
<div id="differences-filter" class="box filter-criteria">
<h2>Package Differences by Architecture</h2>
+ <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>&nbsp;</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>