Skip to content

Commit

Permalink
bug 886331 - preserve version selection
Browse files Browse the repository at this point in the history
  • Loading branch information
rhelmer committed Jun 24, 2013
1 parent 5393199 commit 7172f0c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
11 changes: 10 additions & 1 deletion crashstats/crashstats/static/crashstats/js/socorro/nav.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,17 @@ $(document).ready(function () {
// Used to handle the selection of a specific report.
if ($("#report_select")) {
$("#report_select").change(function () {
product_version = $("#product_version_select").val();
report = $("#report_select").val();
window.location = report;
product = $("#products_select").val();
if (product_version === 'Current Versions') {
window.location = report;
} else if (report.indexOf('/daily') === 0) {
// FIXME this report uses a different URL structure
window.location = report + '&v=' + product_version;
} else {
window.location = report + '/versions/' + product_version;
}
});
}
});
5 changes: 5 additions & 0 deletions crashstats/crashstats/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,9 @@ def daily(request, default_context=None):
else:
return http.HttpResponseBadRequest(str(form.errors))

if len(params['versions']) > 0:
context['version'] = params['versions'][0]

context['form_selection'] = form_selection
context['product'] = params['product']

Expand Down Expand Up @@ -708,6 +711,8 @@ def topchangers(request, product=None, versions=None,
context['days'] = days
context['possible_days'] = possible_days
context['versions'] = versions
if len(versions) == 1:
context['version'] = versions[0]

context['product_versions'] = []
for version in versions:
Expand Down

0 comments on commit 7172f0c

Please sign in to comment.