Partial work cleaning up front & backends

This commit is contained in:
AndyGrant committed 2020-02-17 05:58:40 -05:00
1 parent 09cc9d1949
commit 9c488fb521
17 files changed
+483 -349

No files matched your search

+20
View File
@@ -1,3 +1,23 @@
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# #
# OpenBench is a chess engine testing framework authored by Andrew Grant. #
# <https://github.com/AndyGrant/OpenBench> <andrew@grantnet.us> #
# #
# OpenBench is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
# OpenBench is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with this program. If not, see <http://www.gnu.org/licenses/>. #
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
from __future__ import print_function from __future__ import print_function
import argparse, ast, hashlib, json, math, multiprocessing, os import argparse, ast, hashlib, json, math, multiprocessing, os
+27 -8
View File
@@ -1,9 +1,28 @@
from django.contrib import admin # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
from OpenBench.models import LogEvent, Engine, Profile, Machine, Result, Test # #
# OpenBench is a chess engine testing framework authored by Andrew Grant. #
# <https://github.com/AndyGrant/OpenBench> <andrew@grantnet.us> #
# #
# OpenBench is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
# OpenBench is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with this program. If not, see <http://www.gnu.org/licenses/>. #
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
admin.site.register(LogEvent) import django.contrib, OpenBench.models
admin.site.register(Engine)
admin.site.register(Profile) django.contrib.admin.site.register(OpenBench.models.Engine)
admin.site.register(Machine) django.contrib.admin.site.register(OpenBench.models.Profile)
admin.site.register(Result) django.contrib.admin.site.register(OpenBench.models.Machine)
admin.site.register(Test) django.contrib.admin.site.register(OpenBench.models.Result)
django.contrib.admin.site.register(OpenBench.models.Test)
django.contrib.admin.site.register(OpenBench.models.LogEvent)
+22 -2
View File
@@ -1,4 +1,24 @@
from django.apps import AppConfig # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# #
# OpenBench is a chess engine testing framework authored by Andrew Grant. #
# <https://github.com/AndyGrant/OpenBench> <andrew@grantnet.us> #
# #
# OpenBench is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
# OpenBench is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with this program. If not, see <http://www.gnu.org/licenses/>. #
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
class OpenbenchConfig(AppConfig): import django.apps
class OpenbenchConfig(django.apps.AppConfig):
name = 'OpenBench' name = 'OpenBench'
+105 -103
View File
@@ -1,122 +1,124 @@
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# #
# OpenBench is a chess engine testing framework authored by Andrew Grant. #
# <https://github.com/AndyGrant/OpenBench> <andrew@grantnet.us> #
# #
# OpenBench is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
# OpenBench is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with this program. If not, see <http://www.gnu.org/licenses/>. #
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# Workers will use FRAMEWORK_REPO_URL to determine the location OPENBENCH_CONFIG = {
# for the Cutechess binary and DLLs, as well as any of the books
# which are being used in the testing framework. The main OpenBench
# repo should suffice, but new books require this to be redirected.
FRAMEWORK_REPO_URL = 'http://github.com/AndyGrant/OpenBench/'
FRAMEWORK_DEFAULTS = { # Sidebar link, location of resources, and contact information
'framework' : 'http://github.com/AndyGrant/OpenBench/',
'corefiles' : 'http://github.com/AndyGrant/OpenBench/raw/master/CoreFiles/',
'serveradmin' : 'andrew@grantnet.us',
'config' : { # SPRT Elo bounds and type I/II errors
'sprt' : { 'elolower' : 0.00, 'eloupper' : 5.00, 'alpha' : 0.05, 'beta' : 0.05 },
# Controls the Link on the sidebar
'framework' : FRAMEWORK_REPO_URL,
# Email of OpenBench instance owner # Book confgiruation. When addding a book, follow the provided template.
'serveradmin' : 'andrew@grantnet.us', # The SHA is defined by hashlib.sha256(book).hexdigest(). OpenBench.py
# (Client File) has an example to show you how to find a hash digest
# SPRT Elo bounds and type I/II errors 'books' : {
'sprt' : {
'elolower' : 0.00, 'eloupper' : 5.00, '2moves_v1.pgn' : {
'alpha' : 0.05, 'beta' : 0.05, 'sha' : '46aed7f2696618b2b914942032957b7a97a8f343bf54ba83e20a47818f0d42e0',
'source' : 'http://github.com/AndyGrant/OpenBench/raw/master/Books/2moves_v1.pgn',
'default' : True,
}, },
# Engine Configuration. All engines must have a name, a source repo, '8moves_v3.pgn' : {
# a set of paramaters for each standard test type, as well as a scaled 'sha' : '04fcce1488a94f3b7795cef6f74d89016eb278328897c1018e6162c5967273f5',
# NPS value, which is used to normalize speed across all workers. 'source' : 'http://github.com/AndyGrant/OpenBench/raw/master/Books/8moves_v3.pgn',
'default' : False,
},
'engines' : { '3moves_FRC.pgn' : {
'Ethereal' : { 'sha' : '4c801140e3a52d3a306cb226ccd6225c47789409c5f2d0e1d7cf86152ea1f973',
'proto' : 'uci', 'source' : 'http://github.com/AndyGrant/OpenBench/raw/master/Books/3moves_FRC.pgn',
'nps' : 1275000, 'default' : False,
'name' : 'Ethereal', },
'source' : 'https://github.com/AndyGrant/Ethereal', },
'testmodes' : {
'stc' : { 'threads' : 1, 'hash' : 8, 'timecontrol' : '10.0+0.1' },
'ltc' : { 'threads' : 1, 'hash' : 64, 'timecontrol' : '60.0+0.6' },
'smpstc' : { 'threads' : 8, 'hash' : 64, 'timecontrol' : '5.0+0.05' },
'smpltc' : { 'threads' : 8, 'hash' : 256, 'timecontrol' : '20.0+0.2' },
},
},
'Laser' : {
'proto' : 'uci',
'nps' : 710000,
'name' : 'Laser',
'source' : 'https://github.com/jeffreyan11/uci-chess-engine',
'testmodes' : {
'stc' : { 'threads' : 1, 'hash' : 8, 'timecontrol' : '10.0+0.1' },
'ltc' : { 'threads' : 1, 'hash' : 64, 'timecontrol' : '60.0+0.6' },
'smpstc' : { 'threads' : 8, 'hash' : 64, 'timecontrol' : '5.0+0.05' },
'smpltc' : { 'threads' : 8, 'hash' : 256, 'timecontrol' : '20.0+0.2' },
},
},
'Weiss' : { # Engine Configuration. All engines must have a name, a source repo,
'proto' : 'uci', # a set of paramaters for each standard test type, as well as a scaled
'nps' : 2675000, # NPS value, which is used to normalize speed across all workers.
'name' : 'Weiss',
'source' : 'https://github.com/TerjeKir/weiss',
'testmodes' : {
'stc' : { 'threads' : 1, 'hash' : 32, 'timecontrol' : '10.0+0.1' },
'ltc' : { 'threads' : 1, 'hash' : 128, 'timecontrol' : '60.0+0.6' },
'smpstc' : { 'threads' : 8, 'hash' : 128, 'timecontrol' : '5.0+0.05' },
'smpltc' : { 'threads' : 8, 'hash' : 512, 'timecontrol' : '20.0+0.2' },
},
},
'Demolito' : { 'engines' : {
'proto' : 'uci',
'nps' : 1250000,
'name' : 'Demolito',
'source' : 'https://github.com/lucasart/Demolito',
'testmodes' : {
'stc' : { 'threads' : 1, 'hash' : 8, 'timecontrol' : '8.0+0.08' },
'ltc' : { 'threads' : 1, 'hash' : 32, 'timecontrol' : '32.0+0.32'},
'smpstc' : { 'threads' : 8, 'hash' : 32, 'timecontrol' : '4.0+0.04' },
'smpltc' : { 'threads' : 8, 'hash' : 128, 'timecontrol' : '16.0+0.16'},
},
},
'RubiChess' : { 'Ethereal' : {
'proto' : 'uci', 'proto' : 'uci',
'nps' : 1000000, 'nps' : 1275000,
'name' : 'RubiChess', 'source' : 'https://github.com/AndyGrant/Ethereal',
'source' : 'https://github.com/Matthies/RubiChess', 'testmodes' : {
'testmodes' : { 'stc' : { 'threads' : 1, 'hash' : 8, 'timecontrol' : '12.0+0.12' },
'stc' : { 'threads' : 1, 'hash' : 8, 'timecontrol' : '10.0+0.1' }, 'ltc' : { 'threads' : 1, 'hash' : 64, 'timecontrol' : '60.0+0.6' },
'ltc' : { 'threads' : 1, 'hash' : 64, 'timecontrol' : '60.0+0.6' }, 'smpstc' : { 'threads' : 8, 'hash' : 64, 'timecontrol' : '5.0+0.05' },
'smpstc' : { 'threads' : 8, 'hash' : 64, 'timecontrol' : '5.0+0.05' }, 'smpltc' : { 'threads' : 8, 'hash' : 256, 'timecontrol' : '20.0+0.2' },
'smpltc' : { 'threads' : 8, 'hash' : 256, 'timecontrol' : '20.0+0.2' }, },
}, },
'Laser' : {
'proto' : 'uci',
'nps' : 710000,
'source' : 'https://github.com/jeffreyan11/uci-chess-engine',
'testmodes' : {
'stc' : { 'threads' : 1, 'hash' : 8, 'timecontrol' : '10.0+0.1' },
'ltc' : { 'threads' : 1, 'hash' : 64, 'timecontrol' : '60.0+0.6' },
'smpstc' : { 'threads' : 8, 'hash' : 64, 'timecontrol' : '5.0+0.05' },
'smpltc' : { 'threads' : 8, 'hash' : 256, 'timecontrol' : '20.0+0.2' },
},
},
'Weiss' : {
'proto' : 'uci',
'nps' : 2675000,
'source' : 'https://github.com/TerjeKir/weiss',
'testmodes' : {
'stc' : { 'threads' : 1, 'hash' : 32, 'timecontrol' : '10.0+0.1' },
'ltc' : { 'threads' : 1, 'hash' : 128, 'timecontrol' : '60.0+0.6' },
'smpstc' : { 'threads' : 8, 'hash' : 128, 'timecontrol' : '5.0+0.05' },
'smpltc' : { 'threads' : 8, 'hash' : 512, 'timecontrol' : '20.0+0.2' },
}, },
}, },
# Book confgiruation. When addding a book, follow the provided template. 'Demolito' : {
# The SHA is defined by hashlib.sha256(book).hexdigest(). OpenBench.py 'proto' : 'uci',
# (Client File) has an example to show you how to find a hash digest 'nps' : 1250000,
'source' : 'https://github.com/lucasart/Demolito',
'books' : { 'testmodes' : {
'2moves_v1.pgn' : { 'stc' : { 'threads' : 1, 'hash' : 8, 'timecontrol' : '8.0+0.08' },
'name' : '2moves_v1.pgn', 'ltc' : { 'threads' : 1, 'hash' : 32, 'timecontrol' : '32.0+0.32'},
'sha' : '46aed7f2696618b2b914942032957b7a97a8f343bf54ba83e20a47818f0d42e0', 'smpstc' : { 'threads' : 8, 'hash' : 32, 'timecontrol' : '4.0+0.04' },
'source' : FRAMEWORK_REPO_URL + 'raw/master/Books/2moves_v1.pgn', 'smpltc' : { 'threads' : 8, 'hash' : 128, 'timecontrol' : '16.0+0.16'},
'default' : True,
},
'8moves_v3.pgn' : {
'name' : '8moves_v3.pgn',
'sha' : '04fcce1488a94f3b7795cef6f74d89016eb278328897c1018e6162c5967273f5',
'source' : FRAMEWORK_REPO_URL + 'raw/master/Books/8moves_v3.pgn',
'default' : False,
},
'3moves_FRC.pgn' : {
'name' : '3moves_FRC.pgn',
'sha' : '4c801140e3a52d3a306cb226ccd6225c47789409c5f2d0e1d7cf86152ea1f973',
'source' : FRAMEWORK_REPO_URL + 'raw/master/Books/3moves_FRC.pgn',
'default' : False,
}, },
}, },
}
'RubiChess' : {
'proto' : 'uci',
'nps' : 1000000,
'source' : 'https://github.com/Matthies/RubiChess',
'testmodes' : {
'stc' : { 'threads' : 1, 'hash' : 8, 'timecontrol' : '10.0+0.1' },
'ltc' : { 'threads' : 1, 'hash' : 64, 'timecontrol' : '60.0+0.6' },
'smpstc' : { 'threads' : 8, 'hash' : 64, 'timecontrol' : '5.0+0.05' },
'smpltc' : { 'threads' : 8, 'hash' : 256, 'timecontrol' : '20.0+0.2' },
},
},
},
} }
+20
View File
@@ -1,3 +1,23 @@
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# #
# OpenBench is a chess engine testing framework authored by Andrew Grant. #
# <https://github.com/AndyGrant/OpenBench> <andrew@grantnet.us> #
# #
# OpenBench is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
# OpenBench is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with this program. If not, see <http://www.gnu.org/licenses/>. #
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
from django.db.models import CharField, IntegerField, BooleanField, FloatField from django.db.models import CharField, IntegerField, BooleanField, FloatField
from django.db.models import ForeignKey, DateTimeField, OneToOneField from django.db.models import ForeignKey, DateTimeField, OneToOneField
from django.db.models import CASCADE, PROTECT, Model from django.db.models import CASCADE, PROTECT, Model
+50 -73
View File
@@ -1,7 +1,7 @@
body { body {
font-family: "Courier New"; font-family: "Courier New";
font-size: 16px; font-size: 18px;
background: #2A2A2A; background: #303030;
} }
a:link, a:visited, a:hover, a:active { a:link, a:visited, a:hover, a:active {
@@ -11,36 +11,36 @@ a:link, a:visited, a:hover, a:active {
#sidebar { #sidebar {
float: left; float: left;
margin: 20px; margin: 16px;
} }
#sidebar ul { #sidebar ul {
list-style-type: none; list-style-type: none;
padding: 0px; padding: 0px 16px;
} }
#sidebar li a { #sidebar li a {
font-size: 18px;
color: #A2A2A2; color: #A2A2A2;
} }
#sidebar .header { #sidebar .header {
font-weight: bold; font-size: 16px;
color: #00CCFF; color: #00AF00;
} }
#content { #content {
float: left; float: left;
padding: 20px 0px; margin-top: 32px;
color: #EAEAEA; color: #EAEAEA;
} }
#content label { #content label {
width: 120px; width: 128px;
padding-right: 10px; padding-right: 10px;
font-weight:bold;
text-align: right; text-align: right;
display: inline-block; display: inline-block;
color: #A2A2A2;
font-size: 16px;
} }
#content input, #content select { #content input, #content select {
@@ -62,32 +62,28 @@ a:link, a:visited, a:hover, a:active {
display: inline-block; display: inline-block;
vertical-align: middle; vertical-align: middle;
width: 290px; width: 290px;
background-color: #00CCFF; background-color: #777777;
color: black; color: black;
border: none; border: none;
border-radius: 8px; border-radius: 16px;
cursor: pointer; cursor: pointer;
font-weight: bold; font-weight: bold;
} }
#content button:hover { #content button:hover {
background-color: #FFFFFF; background-color: #00AF00;
} }
#content input[type=submit] { #content input[type=submit] {
background-color: #00CCFF; background-color: #00AF00;
color: #000000; color: #000000;
border: none; border: none;
border-radius: 8px; border-radius: 16px;
cursor: pointer; cursor: pointer;
width: 100%; width: 100%;
font-weight: bold; font-weight: bold;
} }
#content input[type=submit]:hover {
background-color: #FFFFFF;
}
#content input:read-only { #content input:read-only {
font-weight: bold; font-weight: bold;
} }
@@ -101,28 +97,8 @@ a:link, a:visited, a:hover, a:active {
margin-top: 20px; margin-top: 20px;
} }
#content .summarytable th {
padding-top: 20px;
padding-right: 10px;
padding-bottom: 20px;
font-size: 16px;
color: #00CCFF;
}
#content .rawtable td {
padding-right: 20px;
}
#content .rawtable th {
padding-right: 20px;
text-align: left;
}
#content .rawtable .numeric {
text-align: right;
}
#content #actions { #content #actions {
margin-left: 32px;
float: right; float: right;
} }
@@ -130,7 +106,7 @@ a:link, a:visited, a:hover, a:active {
color: #000000; color: #000000;
padding: 8px 8px; padding: 8px 8px;
margin: 0px 8px; margin: 0px 8px;
border-radius: 8px; border-radius: 16px;
font-weight: bold; font-weight: bold;
text-align: center; text-align: center;
display: inline-block; display: inline-block;
@@ -138,7 +114,7 @@ a:link, a:visited, a:hover, a:active {
} }
#content #actions .anchorbutton a:hover { #content #actions .anchorbutton a:hover {
background-color: #FFFFFF; background-color: #00AF00;
} }
#content #actions #approvebutton { #content #actions #approvebutton {
@@ -170,59 +146,59 @@ a:link, a:visited, a:hover, a:active {
width: 100%; width: 100%;
} }
#content .datatable th { #content .left-align {
color: #FFFFFF; text-align: left;
font-size: 20px;
padding: 6px 12px;
background-color: #2A2A2A;
} }
#content .datatable td { #content tr:hover {
background-color: #00AF00;
}
#content th {
color: #00AF00;
font-size: 16px;
padding: 6px 12px;
background-color: #000000;
}
#content td {
padding: 6px 12px; padding: 6px 12px;
} }
#content .datatable .numeric { #content .numeric {
text-align: right; text-align: right;
} }
#content .datatable tr { #content tr {
background-color: #212121; background-color: #1A1A1A;
} }
#content .datatable .embedded { #content .table-spacer th {
border: none; background: #303030;
text-align: left; height: 16px;
padding-left: 0px;
background: #2A2A2A;
} }
#content .datatable .embedded h2 { #content .statblock {
margin: 16px 0px 0px 0px;
color: #00CCFF;
}
#content .datatable .statblock {
line-height: 70%; line-height: 70%;
color: black; color: black;
background-color: #AAAAAA; background-color: #CCCCCC;
border-radius: 4px; border-radius: 4px;
} }
#content .datatable .green { #content .green {
background-color: #9DF779 background-color: #9DF779
} }
#content .datatable .yellow { #content .yellow {
background-color: #EEF788 background-color: #EEF788
} }
#content .datatable .red { #content .red {
background-color: #FA8E8E background-color: #FA8E8E
} }
#content #results { #content #results {
display: inline-block; display: inline-block;
margin-top: 50px;
width: inherit; width: inherit;
} }
@@ -244,7 +220,7 @@ a:link, a:visited, a:hover, a:active {
#content #pagebrowse { #content #pagebrowse {
text-align: center; text-align: center;
margin-top: 16px; margin: 16px 0px 16px 0px;
} }
#content .page { #content .page {
@@ -252,12 +228,12 @@ a:link, a:visited, a:hover, a:active {
display: inline-block; display: inline-block;
padding: 8px 0px; padding: 8px 0px;
width: 5%; width: 5%;
background-color: #212121; background-color: #1A1A1A;
border-radius: 8px; border-radius: 8px;
} }
#content .page:hover { #content .page:hover {
background-color: #AAAAAA; background-color: #00AF00;
} }
#error { #error {
@@ -269,14 +245,15 @@ a:link, a:visited, a:hover, a:active {
} }
#content form h3 { #content form h3 {
margin-left: 130px; margin-left: 140px;
margin-bottom: 0px; margin-bottom: 0px;
color: #00CCFF; font-size: 16px;
color: #00AF00;
} }
#content form .settings-column { #content form .settings-column {
float: left; float: left;
padding-bottom: 4px; padding-bottom: 16px;
} }
#content #test-mode-buttons button { #content #test-mode-buttons button {
-3
View File
@@ -1,3 +0,0 @@
from django.test import TestCase
# Create your tests here.
+55 -31
View File
@@ -1,41 +1,65 @@
from django.urls import path # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# #
# OpenBench is a chess engine testing framework authored by Andrew Grant. #
# <https://github.com/AndyGrant/OpenBench> <andrew@grantnet.us> #
# #
# OpenBench is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
# OpenBench is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with this program. If not, see <http://www.gnu.org/licenses/>. #
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
import OpenBench.views import django.urls, OpenBench.views
urlpatterns = [ urlpatterns = [
path(r'register/', OpenBench.views.register),
path(r'login/', OpenBench.views.login),
path(r'logout/', OpenBench.views.logout),
path(r'viewProfile/', OpenBench.views.viewProfile), # Links for account managment
path(r'editProfile/', OpenBench.views.editProfile), django.urls.path(r'register/', OpenBench.views.register),
django.urls.path(r'login/', OpenBench.views.login),
django.urls.path(r'logout/', OpenBench.views.logout),
django.urls.path(r'viewProfile/', OpenBench.views.viewProfile),
django.urls.path(r'editProfile/', OpenBench.views.editProfile),
path(r'index/', OpenBench.views.index), # Links for viewing test tables
path(r'index/<int:page>/', OpenBench.views.index), django.urls.path(r'index/', OpenBench.views.index),
path(r'greens/', OpenBench.views.greens), django.urls.path(r'index/<int:page>/', OpenBench.views.index),
path(r'greens/<int:page>/', OpenBench.views.greens), django.urls.path(r'greens/', OpenBench.views.greens),
path(r'search/', OpenBench.views.search), django.urls.path(r'greens/<int:page>/', OpenBench.views.greens),
path(r'viewUser/<str:username>/', OpenBench.views.viewUser), django.urls.path(r'search/', OpenBench.views.search),
path(r'viewUser/<str:username>/<int:page>/', OpenBench.views.viewUser), django.urls.path(r'viewUser/<str:username>/', OpenBench.views.viewUser),
django.urls.path(r'viewUser/<str:username>/<int:page>/', OpenBench.views.viewUser),
path(r'users/', OpenBench.views.users), # Links for viewing general information tables
path(r'machines/', OpenBench.views.machines), django.urls.path(r'users/', OpenBench.views.users),
path(r'eventLog/', OpenBench.views.eventLog), django.urls.path(r'machines/', OpenBench.views.machines),
path(r'eventLog/<int:page>/', OpenBench.views.eventLog), django.urls.path(r'eventLog/', OpenBench.views.eventLog),
django.urls.path(r'eventLog/<int:page>/', OpenBench.views.eventLog),
path(r'newTest/', OpenBench.views.newTest), # Links for viewing and managing tests
path(r'viewTest/<int:id>/', OpenBench.views.viewTest), django.urls.path(r'newTest/', OpenBench.views.newTest),
path(r'editTest/<int:id>/', OpenBench.views.editTest), django.urls.path(r'viewTest/<int:id>/', OpenBench.views.viewTest),
path(r'approveTest/<int:id>/', OpenBench.views.approveTest), django.urls.path(r'editTest/<int:id>/', OpenBench.views.editTest),
path(r'restartTest/<int:id>/', OpenBench.views.restartTest), django.urls.path(r'approveTest/<int:id>/', OpenBench.views.approveTest),
path(r'stopTest/<int:id>/', OpenBench.views.stopTest), django.urls.path(r'restartTest/<int:id>/', OpenBench.views.restartTest),
path(r'deleteTest/<int:id>/', OpenBench.views.deleteTest), django.urls.path(r'stopTest/<int:id>/', OpenBench.views.stopTest),
django.urls.path(r'deleteTest/<int:id>/', OpenBench.views.deleteTest),
path(r'getFiles/', OpenBench.views.getFiles), # Links for the Client to update the Server
path(r'getWorkload/', OpenBench.views.getWorkload), django.urls.path(r'getFiles/', OpenBench.views.getFiles),
path(r'wrongBench/', OpenBench.views.wrongBench), django.urls.path(r'getWorkload/', OpenBench.views.getWorkload),
path(r'submitNPS/', OpenBench.views.submitNPS), django.urls.path(r'wrongBench/', OpenBench.views.wrongBench),
path(r'submitResults/', OpenBench.views.submitResults), django.urls.path(r'submitNPS/', OpenBench.views.submitNPS),
django.urls.path(r'submitResults/', OpenBench.views.submitResults),
path(r'', OpenBench.views.index), # Redirect anything else to the Index
django.urls.path(r'', OpenBench.views.index),
] ]
+24 -4
View File
@@ -1,3 +1,23 @@
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# #
# OpenBench is a chess engine testing framework authored by Andrew Grant. #
# <https://github.com/AndyGrant/OpenBench> <andrew@grantnet.us> #
# #
# OpenBench is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
# OpenBench is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with this program. If not, see <http://www.gnu.org/licenses/>. #
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
import math, requests, random import math, requests, random
from django.utils import timezone from django.utils import timezone
@@ -61,12 +81,12 @@ def newTest(request):
# Extract Development Fields # Extract Development Fields
devname = request.POST['devbranch'] devname = request.POST['devbranch']
devbench = int(request.POST['devbench']) devbench = int(request.POST['devbench'])
devprotocol = FRAMEWORK_DEFAULTS['config']['engines'][test.engine]['proto'] devprotocol = OPENBENCH_CONFIG['engines'][test.engine]['proto']
# Extract Base Fields # Extract Base Fields
basename = request.POST['basebranch'] basename = request.POST['basebranch']
basebench = int(request.POST['basebench']) basebench = int(request.POST['basebench'])
baseprotocol = FRAMEWORK_DEFAULTS['config']['engines'][test.engine]['proto'] baseprotocol = OPENBENCH_CONFIG['engines'][test.engine]['proto']
# Extract test configuration # Extract test configuration
test.source = request.POST['source'] test.source = request.POST['source']
@@ -206,8 +226,8 @@ def workloadDictionary(machine, result, test):
'result' : { 'id' : result.id, }, 'result' : { 'id' : result.id, },
'test' : { 'test' : {
'id' : test.id, 'id' : test.id,
'nps' : FRAMEWORK_DEFAULTS['config']['engines'][test.engine]['nps'], 'nps' : OPENBENCH_CONFIG['engines'][test.engine]['nps'],
'book' : FRAMEWORK_DEFAULTS['config']['books'][test.bookname], 'book' : OPENBENCH_CONFIG['books'][test.bookname],
'timecontrol' : test.timecontrol, 'timecontrol' : test.timecontrol,
'engine' : test.engine, 'engine' : test.engine,
'dev' : { 'dev' : {
+80 -47
View File
@@ -1,12 +1,32 @@
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# #
# OpenBench is a chess engine testing framework authored by Andrew Grant. #
# <https://github.com/AndyGrant/OpenBench> <andrew@grantnet.us> #
# #
# OpenBench is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
# OpenBench is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with this program. If not, see <http://www.gnu.org/licenses/>. #
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#from django.shortcuts import render as djangoRender
import django.shortcuts
import django.contrib.auth
from django.db.models import F from django.db.models import F
from django.shortcuts import render as djangoRender
from django.http import HttpResponse, HttpResponseRedirect from django.http import HttpResponse, HttpResponseRedirect
from django.contrib.auth import authenticate
from django.contrib.auth import login as loginUser
from django.contrib.auth import logout as logoutUser
from django.contrib.auth.models import User from django.contrib.auth.models import User
from django.contrib.auth.decorators import login_required from django.contrib.auth.decorators import login_required
from django.contrib.admin.views.decorators import staff_member_required
from django.views.decorators.csrf import csrf_exempt from django.views.decorators.csrf import csrf_exempt
from django.utils.timezone import utc from django.utils.timezone import utc
from htmlmin.decorators import not_minified_response from htmlmin.decorators import not_minified_response
@@ -18,71 +38,83 @@ from OpenBench.utils import pagingContext
import OpenBench.utils, datetime import OpenBench.utils, datetime
def render(request, template, data): def render(request, template, data={}):
# Always provde the Configuration # Provide Configuration & User information
data.update(FRAMEWORK_DEFAULTS) data.update({'config' : OPENBENCH_CONFIG})
# Send User data when logged in
if request.user.is_authenticated: if request.user.is_authenticated:
data.update({'profile' : Profile.objects.get(user=request.user)}) data.update({'profile' : Profile.objects.get(user=request.user)})
# Final wrap of Django's rendering funtion # Wrapper to simplify django's rendering function
return djangoRender(request, 'OpenBench/{0}'.format(template), data) return django.shortcuts.render(request, 'OpenBench/{0}'.format(template), data)
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# Administrative Views #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# #
# GET : #
# #
# POST : #
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
def register(request): def register(request):
# User trying to view the registration page # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# #
# GET : Return the HTML template used for registering a new User #
# #
# POST : Enforce matching alpha-numeric passwords, and then attempt to #
# generate a new User and Profile. Return to the homepage after #
# after logging the User in. Share any errors with the viewer #
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
if request.method == 'GET': if request.method == 'GET':
return render(request, 'register.html', {}) return render(request, 'register.html')
try: if request.POST['password1'] != request.POST['password2']:
# Verify that the passwords are matching return index(request, error='Passwords Do Not Match')
if request.POST['password1'] != request.POST['password2']:
raise Exception('Passwords Do Not Match')
# Force alpha numeric usernames if not request.POST['username'].isalnum():
if not request.POST['username'].isalnum(): return index(request, error='Alpha Numeric Usernames Only')
raise Exception('Alpha Numeric Usernames Only')
# Create new User and Profile if User.objects.filter(username=request.POST['username']):
Profile.objects.create( return index(request, error='That Username is taken')
user=User.objects.create_user(
request.POST['username'],
request.POST['email'],
request.POST['password1']))
# Log the User in now
loginUser(request, User.objects.get(username=request.POST['username']))
# Kick back to index email = request.POST['email']
return HttpResponseRedirect('/index/') username = request.POST['username']
password = request.POST['password1']
# Bad data, kick back to index with error user = User.objects.create_user(username, email, password)
except Exception as error: Profile.objects.create(user=user)
return index(request, error=str(error)) django.contrib.auth.login(request, user)
return HttpResponseRedirect('/index/')
def login(request): def login(request):
# User trying to view the login page
if request.method == 'GET': if request.method == 'GET':
return render(request, 'login.html', {}) return render(request, 'login.html')
try: try:
# Attempt to login the user, and return to index django.contrib.auth.login(request,
loginUser(request, authenticate( django.contrib.auth.authenticate(
username=request.POST['username'], username=request.POST['username'],
password=request.POST['password'])) password=request.POST['password']))
return HttpResponseRedirect('/index/') return HttpResponseRedirect('/index/')
# Bad data, kick back to index with error
except Exception as error: except Exception as error:
return index(request, error='Invalid Login Credentials') return index(request, error='Unable to Authenticate User')
def logout(request): def logout(request):
# Logout the user and return to index django.contrib.auth.logout(request)
logoutUser(request)
return HttpResponseRedirect('/index/') return HttpResponseRedirect('/index/')
@login_required(login_url='/login/') @login_required(login_url='/login/')
@@ -115,6 +147,8 @@ def editProfile(request):
# Send back to see the homepage # Send back to see the homepage
return HttpResponseRedirect('/index/') return HttpResponseRedirect('/index/')
def index(request, page=1, pageLength=24, greens=False, username=None, error=''): def index(request, page=1, pageLength=24, greens=False, username=None, error=''):
# Get tests pending approval # Get tests pending approval
@@ -259,7 +293,7 @@ def machines(request):
data = {'machines' : Machine.objects.filter(updated__gte=target)} data = {'machines' : Machine.objects.filter(updated__gte=target)}
return render(request, 'machines.html', data) return render(request, 'machines.html', data)
def eventLog(request, page=1, pageLength=50): def eventLog(request, page=1, pageLength=24):
# Choose events within the given page, if any # Choose events within the given page, if any
events = LogEvent.objects.all().order_by('-id') events = LogEvent.objects.all().order_by('-id')
@@ -477,8 +511,7 @@ def deleteTest(request, id):
def getFiles(request): def getFiles(request):
# Core Files should be sitting in framework's repo # Core Files should be sitting in framework's repo
source = FRAMEWORK_REPO_URL + 'raw/master/CoreFiles/' return HttpResponse(OPENBENCH_CONFIG['corefiles'])
return HttpResponse(source)
@csrf_exempt @csrf_exempt
@not_minified_response @not_minified_response
+2 -2
View File
@@ -54,15 +54,15 @@
<ul> <ul>
<li class="header">INFO</li> <li class="header">INFO</li>
<li><a href="/users">Users</a></li> <li><a href="/users">Users</a></li>
<li><a href="/eventLog">Events</a></li>
<li><a href="/machines">Machines</a></li> <li><a href="/machines">Machines</a></li>
<li><a href="/eventLog">EventLog</a></li>
<li><a href="{{config.framework}}">OpenBench</a></li> <li><a href="{{config.framework}}">OpenBench</a></li>
</ul> </ul>
<ul> <ul>
<li class="header">ENGINES</li> <li class="header">ENGINES</li>
{% for engine, data in config.engines.items|dictsort:"0.lower" %} {% for engine, data in config.engines.items|dictsort:"0.lower" %}
<li><a href="{{data.source}}">{{data.name}}</a></li> <li><a href="{{data.source}}">{{engine}}</a></li>
{% endfor %} {% endfor %}
</ul> </ul>
+7 -5
View File
@@ -2,13 +2,14 @@
{% block content %} {% block content %}
<table class="rawtable"> <table>
<tr> <tr>
<th>Date</th> <th>DATE</th>
<th>User</th> <th>USER</th>
<th>Test</th> <th>TEST</th>
<th>Action</th> <th>TIME</th>
<th>ACTION</th>
</tr> </tr>
{% for event in events %} {% for event in events %}
@@ -16,6 +17,7 @@
<td>{{event.creation|date:'Y-m-d H:i:s'}}</td> <td>{{event.creation|date:'Y-m-d H:i:s'}}</td>
<td>{{event.author}}</td> <td>{{event.author}}</td>
<td><a href="/viewTest/{{event.test.id}}">{{event.test.dev.name}}</a></td> <td><a href="/viewTest/{{event.test.id}}">{{event.test.dev.name}}</a></td>
<td>{{event.test.timecontrol}}</td>
<td>{{event.data}}</td> <td>{{event.data}}</td>
</tr> </tr>
{% endfor %} {% endfor %}
+14 -12
View File
@@ -8,25 +8,27 @@
{% if paging.page == 1 and greens == False %} {% if paging.page == 1 and greens == False %}
<!-- Currently Pending tests (Waiting to be approved) --> <!-- Currently Pending tests (Waiting to be approved) -->
<tr><td class="embedded" colspan='6'><h2>Pending</h2></td></tr> {% if pending %}
{% for test in pending %} <tr><th colspan='6'>Pending</th></tr>
{% include "OpenBench/Blocks/testsummary.html" %} {% for test in pending %}
{% endfor %} {% include "OpenBench/Blocks/testsummary.html" %}
{% endfor %}
<!-- Show Worker information when running a test --> <tr class="table-spacer"><th></th></tr>
{% if active %}
<tr><td class="embedded" colspan='6'><h2>Active {{status}}</h2></td></tr>
{% endif %} {% endif %}
<!-- Currently Running tests (Waiting to be completed) --> <!-- Currently Running tests (Waiting to be completed) -->
{% for test in active %} {% if active %}
{% include "OpenBench/Blocks/testsummary.html" %} <tr><th colspan='6'>Active {{status}}</th></tr>
{% endfor %} {% for test in active %}
{% include "OpenBench/Blocks/testsummary.html" %}
{% endfor %}
<tr class="table-spacer"><th></th></tr>
{% endif %}
{% endif %} {% endif %}
<!-- Tests which have already finished --> <!-- Tests which have already finished -->
<tr><td class="embedded" colspan='6'><h2>Finished</h2></td></tr> <tr><th colspan='6'>Finished</th></tr>
{% for test in completed %} {% for test in completed %}
{% include "OpenBench/Blocks/testsummary.html" %} {% include "OpenBench/Blocks/testsummary.html" %}
{% endfor %} {% endfor %}
+7 -7
View File
@@ -1,18 +1,18 @@
{% extends "OpenBench/base.html" %} {% extends "OpenBench/base.html" %}
{% load mytags %} <!-- For twoDigitPrecision() --> {% load mytags %}
{% block content %} {% block content %}
<table class="rawtable"> <table>
<tr> <tr>
<th>ID</th> <th>ID</th>
<th>User</th> <th>USER</th>
<th>System</th> <th>SYSTEM</th>
<th>Updated</th> <th>UPDATED</th>
<th>Workload</th> <th>WORKLOAD</th>
<th>Threads</th> <th>THREADS</th>
<th>MNPS</th> <th>MNPS</th>
</tr> </tr>
+2 -2
View File
@@ -75,9 +75,9 @@
<label> Book </label> <select name="bookname"> <label> Book </label> <select name="bookname">
{% for name, data in config.books.items %} {% for name, data in config.books.items %}
{% if data.default %} {% if data.default %}
<option selected value="{{name}}">{{data.name}}</option> <option selected value="{{name}}">{{name}}</option>
{% else %} {% else %}
<option value="{{name}}">{{data.name}}</option> <option value="{{name}}">{{name}}</option>
{% endif %} {% endif %}
{% endfor %} {% endfor %}
</select><br> </select><br>
+16 -20
View File
@@ -1,42 +1,38 @@
{% extends "OpenBench/base.html" %} {% extends "OpenBench/base.html" %}
{% load mytags %} <!-- For sumAttributes() & insertCommas() --> {% load mytags %}
{% block content %} {% block content %}
<table class="summarytable"> <table>
<tr>
<th class="numeric"> OVERALL </th>
<th class="numeric">| USERS {{ profiles|length }} </th>
<th class="numeric">| TESTS {{ profiles|sumAttributes:"tests"|insertCommas }}</th>
<th class="numeric">| GAMES {{ profiles|sumAttributes:"games"|insertCommas }}</th>
</tr>
</table>
<table class="rawtable">
<tr> <tr>
<th>Username</th> <th>USERNAME</th>
<th>Last Seen</th> <th>GAMES</th>
<th class="numeric">Games</th> <th>TESTS</th>
<th class="numeric">Tests</th> <th>ENGINE</th>
<th>Engine</th> <th>SOURCE REPOSITORY</th>
<th>Source Repository</th>
</tr> </tr>
{% for profile in profiles %} {% for profile in profiles %}
{% if profile.enabled %} {% if profile.enabled %}
<tr> <tr>
<td><a href="/viewUser/{{profile.user.username}}">{{profile.user.username}}</a></td> <td><a href="/viewUser/{{profile.user.username}}">{{profile.user.username}}</a></td>
<td>{{profile.updated|date:'Y-m-d'}}</td> <td style="text-align: right">{{profile.games|insertCommas}}</td>
<td class="numeric">{{profile.games}}</td> <td style="text-align: right">{{profile.tests|insertCommas}}</td>
<td class="numeric">{{profile.tests}}</td>
<td>{{profile.engine}}</td> <td>{{profile.engine}}</td>
<td><a href="{{profile.repo}}">{{profile.repo}}</a></td> <td><a href="{{profile.repo}}">{{profile.repo}}</a></td>
</tr> </tr>
{% endif %} {% endif %}
{% endfor %} {% endfor %}
<tr style="font-weight: bold">
<th>OVERALL</th>
<th>{{profiles|sumAttributes:"games"|insertCommas}}</th>
<th>{{profiles|sumAttributes:"tests"|insertCommas}}</th>
<th></th><th></th>
</tr>
</table> </table>
{% endblock %} {% endblock %}
+32 -30
View File
@@ -9,25 +9,23 @@
{% block content %} {% block content %}
<div id="configuration"> <div id="configuration">
<table class="rawtable"> <table class="datatable left-align">
<tr><td>Engine</td><td>{{test.engine}}</td></tr> <tr><th>Engine</th><td>{{test.engine}}</td></tr>
<tr><td>Dev Branch</td><td>{{test.dev.name}}</td></tr> <tr><th>Dev Branch</th><td>{{test.dev.name}}</td></tr>
<tr><td>Dev Bench</td><td>{{test.dev.bench}}</td></tr> <tr><th>Dev Bench</th><td>{{test.dev.bench}}</td></tr>
<tr><td>Dev Options</td><td>{{test.devoptions}}</td></tr> <tr><th>Dev Options</th><td>{{test.devoptions}}</td></tr>
<tr><td>Dev Protocol</td><td>{{test.dev.protocol}}</td></tr> <tr><th>Dev Sha</th><td>{{test.dev.sha}}</td></tr>
<tr><td>Dev Sha</td><td>{{test.dev.sha}}</td></tr> <tr><th>Base Branch</th><td>{{test.base.name}}</td></tr>
<tr><td>Base Branch</td><td>{{test.base.name}}</td></tr> <tr><th>Base Bench</th><td>{{test.base.bench}}</td></tr>
<tr><td>Base Bench</td><td>{{test.base.bench}}</td></tr> <tr><th>Base Options</th><td>{{test.baseoptions}}</td></tr>
<tr><td>Base Options</td><td>{{test.baseoptions}}</td></tr> <tr><th>Base Sha</th><td>{{test.base.sha}}</td></tr>
<tr><td>Base Protocol</td><td>{{test.base.protocol}}</td></tr> <tr><th>Source Repo</th><td>{{test.source}}</td></tr>
<tr><td>Base Sha</td><td>{{test.base.sha}}</td></tr> <tr><th>Opening Book</th><td>{{test.bookname}}</td></tr>
<tr><td>Source Repo</td><td>{{test.source}}</td></tr> <tr><th>Time Control</th><td>{{test.timecontrol}}s</td></tr>
<tr><td>Opening Book</td><td>{{test.bookname}}</td></tr> <tr><th>Elo Bounds</th><td>[{{test.elolower}}, {{test.eloupper}}]</td></tr>
<tr><td>Time Control</td><td>{{test.timecontrol}}s</td></tr> <tr><th>SPRT Bounds</th><td>({{test.lowerllr|twoDigitPrecision}}, {{test.upperllr|twoDigitPrecision}})</td></tr>
<tr><td>Elo Bounds</td><td>[{{test.elolower}}, {{test.eloupper}}]</td></tr> <tr><th>Creation</th><td>{{test.creation|date:'Y-m-d H:i:s'}}</td></tr>
<tr><td>SPRT Bounds</td><td>({{test.lowerllr|twoDigitPrecision}}, {{test.upperllr|twoDigitPrecision}})</td></tr> <tr><th>Author</th><td>{{test.author}}</td></tr>
<tr><td>Creation</td><td>{{test.creation|date:'Y-m-d H:i:s'}}</td></tr>
<tr><td>Author</td><td>{{test.author}}</td></tr>
</table> </table>
</div> </div>
@@ -77,16 +75,20 @@
<!-- ELO, SPRT, LLR, Games --> <!-- ELO, SPRT, LLR, Games -->
<pre>{{test|longStatBlock|linebreaksbr}}</pre> <pre>{{test|longStatBlock|linebreaksbr}}</pre>
<!-- Forum to modify the Priority or Throughput -->
<form method="POST" action="/editTest/{{test.id}}/"> <form method="POST" action="/editTest/{{test.id}}/">
{% csrf_token %} {% csrf_token %}
<label>Priority</label><input value="{{test.priority}}" name="priority"><br> <label>Priority</label><input value="{{test.priority}}" name="priority"><br>
<label>Throughput</label><input value="{{test.throughput}}" name="throughput"><br> <label>Throughput</label><input value="{{test.throughput}}" name="throughput"><br>
<!-- Edit Button: For Approvers or Test Authors -->
{% if profile.approver or profile.user.username == test.author %} {% if profile.approver or profile.user.username == test.author %}
<input type="submit" name="submit" value="Modify"> <input type="submit" name="submit" value="Modify">
{% else %} {% else %}
<input class="deadbutton" type="submit" name="submit" value="Modify"> <input class="deadbutton" type="submit" name="submit" value="Modify">
{% endif %} {% endif %}
</form> </form>
@@ -101,21 +103,21 @@
<tr> <tr>
<th>ID</th> <th>ID</th>
<th>Owner</th> <th>USER</th>
<th>System</th> <th>OS</th>
<th>Last Updated</th> <th>Last Updated</th>
<th style="width: 60px">Games</th> <th style="width: 60px">GAMES</th>
<th style="width: 60px">Won</th> <th style="width: 60px">WON</th>
<th style="width: 60px">Lost</th> <th style="width: 60px">LOST</th>
<th style="width: 60px">Drawn</th> <th style="width: 60px">DRAWN</th>
<th style="width: 60px">Time</th> <th style="width: 60px">TIME</th>
<th style="width: 60px">Crash</th> <th style="width: 60px">CRASH</th>
</tr> </tr>
{% for result in results %} {% for result in results %}
<tr> <tr>
<td>{{result.machine.id}}</td> <td>{{result.machine.id}}</td>
<td>{{result.machine.owner}}</td> <td>{{result.machine.owner|slice:"6"}}</td>
<td>{{result.machine.osname|truncatewords:1|slice:":-4"}}</td> <td>{{result.machine.osname|truncatewords:1|slice:":-4"}}</td>
<td>{{result.updated|date:'Y-m-d H:i'}}</td> <td>{{result.updated|date:'Y-m-d H:i'}}</td>
<td class="numeric">{{result.games}}</td> <td class="numeric">{{result.games}}</td>