diff --git a/OpenBench/templatetags/mytags.py b/OpenBench/templatetags/mytags.py index 55ed3f7..ab01e26 100644 --- a/OpenBench/templatetags/mytags.py +++ b/OpenBench/templatetags/mytags.py @@ -42,8 +42,25 @@ def gitDiffLink(test): return "{0}/compare/{1}...{2}".format(repo, basesha[:8], devsha[:8]) +def statParagraph(test): + + tokens = test.devoptions.split(" ") + threads = tokens[0].split("=")[1] + hash = tokens[1].split("=")[1] + + lowerllr = twoDigitPrecision(test.lowerllr) + currentllr = twoDigitPrecision(test.currentllr) + upperllr = twoDigitPrecision(test.upperllr) + elolower = twoDigitPrecision(test.elolower) + eloupper = twoDigitPrecision(test.eloupper) + + return "SPRT @ {0}s Threads={1} Hash={2}MB
".format(test.timecontrol, threads, hash) \ + + "LLR: {0} ({1}, {2}) [{3}, {4}]
".format(lowerllr, currentllr, upperllr, elolower, eloupper) \ + + "Games: {0} W: {1} L: {2} D: {3}".format(test.games, test.wins, test.losses, test.draws) + register = template.Library() register.filter("oneDigitPrecision", oneDigitPrecision) register.filter("twoDigitPrecision", twoDigitPrecision) register.filter("gitDiffLink", gitDiffLink) +register.filter("statParagraph", statParagraph) diff --git a/OpenBench/views.py b/OpenBench/views.py index 228e2c3..d07bceb 100644 --- a/OpenBench/views.py +++ b/OpenBench/views.py @@ -163,7 +163,17 @@ def editTest(request, id): pass def viewTest(request, id): - pass + + try: + # Find Test and Results + test = Test.objects.get(id=id) + results = Results.objects.all().filter(test=test) + data = {'test' : test, 'results' : results} + return render(request, 'viewTest.html', data) + + # Unable to find test + except Exception as error: + return index(request, error=str(error)) @staff_member_required def approveTest(request, id): diff --git a/Templates/OpenBench/index.html b/Templates/OpenBench/index.html index 04b8f55..e6560e1 100644 --- a/Templates/OpenBench/index.html +++ b/Templates/OpenBench/index.html @@ -11,17 +11,13 @@ Index {% for test in pending %} - + - + {% autoescape off %} + + {% endautoescape %} {% endfor %} @@ -30,17 +26,13 @@ Index

Active

{{test.author}} {{test.dev.name}} diff - SPRT @ {{test.timecontrol}}s Threads={{test.threads}} Hash={{test.hashsize}}MB
- LLR: {{test.currentllr|twoDigitPrecision}} ({{test.lowerllr|twoDigitPrecision}}, - {{test.upperllr|twoDigitPrecision}}) [{{test.elolower|twoDigitPrecision}}, - {{test.eloupper|twoDigitPrecision}}]
Games: {{test.games}} - W: {{test.wins}} L: {{test.losses}} D: {{test.draws}} -
{{test|statParagraph}}approve
{% for test in active %} - + - + {% autoescape off %} + + {% endautoescape %} {% endfor %}
{{test.author}} {{test.dev.name}} diff - SPRT @ {{test.timecontrol}}s Threads={{test.threads}} Hash={{test.hashsize}}MB
- LLR: {{test.currentllr|twoDigitPrecision}} ({{test.lowerllr|twoDigitPrecision}}, - {{test.upperllr|twoDigitPrecision}}) [{{test.elolower|twoDigitPrecision}}, - {{test.eloupper|twoDigitPrecision}}]
Games: {{test.games}} - W: {{test.wins}} L: {{test.losses}} D: {{test.draws}} -
{{test|statParagraph}}
@@ -52,13 +44,9 @@ Index - + {% autoescape off %} + + {% endautoescape %} {% endfor %}
{{test.author}} {{test.dev.name}} diff - SPRT @ {{test.timecontrol}}s Threads={{test.threads}} Hash={{test.hashsize}}MB
- LLR: {{test.currentllr|twoDigitPrecision}} ({{test.lowerllr|twoDigitPrecision}}, - {{test.upperllr|twoDigitPrecision}}) [{{test.elolower|twoDigitPrecision}}, - {{test.eloupper|twoDigitPrecision}}]
Games: {{test.games}} - W: {{test.wins}} L: {{test.losses}} D: {{test.draws}} -
{{test|statParagraph}}
diff --git a/db.sqlite3 b/db.sqlite3 index b7996c6..48391c7 100644 Binary files a/db.sqlite3 and b/db.sqlite3 differ