diff options
author | jasplin <qt-info@nokia.com> | 2011-02-09 10:01:29 +0100 |
---|---|---|
committer | jasplin <qt-info@nokia.com> | 2011-02-09 10:01:29 +0100 |
commit | d70215a964367fa8547774d14be5e41ff1cfd541 (patch) | |
tree | 0667091a5977d6840b30e78250046330d577fe43 | |
parent | 5d844a9639c55b50f7571d58a31f6212a17f1169 (diff) |
Disable 'Show rankings' button when no rankings exist.
-rw-r--r-- | web/getstats/index.html | 6 | ||||
-rw-r--r-- | web/getstats/main.js | 26 |
2 files changed, 21 insertions, 11 deletions
diff --git a/web/getstats/index.html b/web/getstats/index.html index ede3ee5..43fb3e5 100644 --- a/web/getstats/index.html +++ b/web/getstats/index.html @@ -64,7 +64,11 @@ "criteria.<br /><br />The idea is to prioritize benchmarks " + "that deserve attention (either because they reflect stable " + "changes in Qt, or because they need to improve their own " + - "quality)."); + "quality)." + + "<br /><br /><b>Note:</b> This action is enabled iff " + + "an 'R' is indicated for the snapshot of Context 1, " + + "thus indicating availability of rankings in the " + + "database."); </script> </td> <td id="max_rank_size_lead">Maximum size: diff --git a/web/getstats/main.js b/web/getstats/main.js index e5a1f65..d5a0b09 100644 --- a/web/getstats/main.js +++ b/web/getstats/main.js @@ -155,16 +155,21 @@ function updateActions() { url_stats1 += "&testcasefilter=" + testCaseFilter; // --- rankings --- - url_rankings = "rankings.shtml"; - url_rankings += "?db=" + $('#database').val(); - url_rankings += "&cmd=rankings"; - url_rankings += "&host=" + encodeURIComponent(context1_["host"]); - url_rankings += "&platform=" + encodeURIComponent(context1_["platform"]); - url_rankings += "&branch=" + encodeURIComponent(context1_["branch"]); - url_rankings += "&sha1=" + context1_["sha1"]; - url_rankings += "&maxsize=" + $("#max_rank_size option:selected").val(); - // ### Test case filter unsupported for now: - //url_rankings += "&testcasefilter=" + testCaseFilter; + if (context1_["rankingsExist"]) { + url_rankings = "rankings.shtml"; + url_rankings += "?db=" + $('#database').val(); + url_rankings += "&cmd=rankings"; + url_rankings += "&host=" + encodeURIComponent(context1_["host"]); + url_rankings += "&platform=" + + encodeURIComponent(context1_["platform"]); + url_rankings += "&branch=" + encodeURIComponent(context1_["branch"]); + url_rankings += "&sha1=" + context1_["sha1"]; + url_rankings += "&maxsize=" + $("#max_rank_size option:selected").val(); + // ### Test case filter unsupported for now: + //url_rankings += "&testcasefilter=" + testCaseFilter; + } else { + url_rankings = ""; + } // --- stats2 --- if (context2_["host"] != "") { @@ -260,6 +265,7 @@ function context1() { var snapshot = tr.find("select[name = 'snapshot'] option:selected"); context["sha1"] = snapshot.attr("value"); context["snapshotIndex"] = snapshot.index(); + context["rankingsExist"] = (snapshot.attr("text")[0] == 'R'); return context; } |