Adjust overall CSS and format of pages
This commit is contained in:
1 parent
7d99373d6b
commit
7f99535b16
8 files changed
+69
-86
No files matched your search
+23
-18
@@ -60,7 +60,7 @@ a:link, a:visited, a:hover, a:active {
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
width: 290px;
|
||||
background-color: #A7D691;
|
||||
background-color: #00CCFF;
|
||||
color: black;
|
||||
border: none;
|
||||
border-radius: 8px;
|
||||
@@ -69,12 +69,12 @@ a:link, a:visited, a:hover, a:active {
|
||||
}
|
||||
|
||||
#content button:hover {
|
||||
background-color: #6AC63F;
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
|
||||
#content input[type=submit] {
|
||||
background-color: #15A049;
|
||||
color: white;
|
||||
background-color: #00CCFF;
|
||||
color: #000000;
|
||||
border: none;
|
||||
border-radius: 8px;
|
||||
cursor: pointer;
|
||||
@@ -83,7 +83,7 @@ a:link, a:visited, a:hover, a:active {
|
||||
}
|
||||
|
||||
#content input[type=submit]:hover {
|
||||
background-color: #4CAF50;
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
|
||||
#content input:read-only {
|
||||
@@ -99,6 +99,12 @@ a:link, a:visited, a:hover, a:active {
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
#content .summarytable th {
|
||||
padding-right: 10px;
|
||||
font-size: 20px;
|
||||
color: #00CCFF;
|
||||
}
|
||||
|
||||
#content .rawtable td {
|
||||
padding-right: 20px;
|
||||
}
|
||||
@@ -117,13 +123,17 @@ a:link, a:visited, a:hover, a:active {
|
||||
}
|
||||
|
||||
#content #actions .anchorbutton {
|
||||
color: black;
|
||||
color: #000000;
|
||||
padding: 8px 8px;
|
||||
border-radius: 4px;
|
||||
border-radius: 8px;
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
display: inline-block;
|
||||
width: 20%;
|
||||
width: 25%;
|
||||
}
|
||||
|
||||
#content #actions .anchorbutton a:hover {
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
|
||||
#content #actions #approvebutton {
|
||||
@@ -156,10 +166,10 @@ a:link, a:visited, a:hover, a:active {
|
||||
}
|
||||
|
||||
#content .datatable th {
|
||||
color: #EAEAEA;
|
||||
color: #FFFFFF;
|
||||
font-size: 20px;
|
||||
padding: 6px 12px;
|
||||
background-color: #15A049;
|
||||
background-color: #2A2A2A;
|
||||
}
|
||||
|
||||
#content .datatable td {
|
||||
@@ -183,14 +193,14 @@ a:link, a:visited, a:hover, a:active {
|
||||
|
||||
#content .datatable .embedded h2 {
|
||||
margin: 16px 0px 0px 0px;
|
||||
pading: 0px;
|
||||
color: #FFFFFF;
|
||||
color: #00CCFF;
|
||||
}
|
||||
|
||||
#content .datatable .statblock {
|
||||
line-height: 70%;
|
||||
color: black;
|
||||
background-color: #AAAAAA;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
#content .datatable .green {
|
||||
@@ -259,12 +269,7 @@ a:link, a:visited, a:hover, a:active {
|
||||
color: #00CCFF;
|
||||
}
|
||||
|
||||
#content form #left-settings {
|
||||
float: left;
|
||||
padding-bottom: 4px;
|
||||
}
|
||||
|
||||
#content form #right-settings {
|
||||
#content form .settings-column {
|
||||
float: left;
|
||||
padding-bottom: 4px;
|
||||
}
|
||||
|
||||
@@ -84,6 +84,13 @@ def testResultColour(test):
|
||||
return 'red'
|
||||
return ''
|
||||
|
||||
def sumAttributes(iterable, attribute):
|
||||
try: return sum([getattr(f, attribute) for f in iterable])
|
||||
except: return 0
|
||||
|
||||
def insertCommas(value):
|
||||
return '{:,}'.format(int(value))
|
||||
|
||||
register = template.Library()
|
||||
register.filter('oneDigitPrecision', oneDigitPrecision)
|
||||
register.filter('twoDigitPrecision', twoDigitPrecision)
|
||||
@@ -91,4 +98,6 @@ register.filter('gitDiffLink', gitDiffLink)
|
||||
register.filter('shortStatBlock', shortStatBlock)
|
||||
register.filter('longStatBlock', longStatBlock)
|
||||
register.filter('testResultColour', testResultColour)
|
||||
register.filter('sumAttributes', sumAttributes)
|
||||
register.filter('insertCommas', insertCommas)
|
||||
|
||||
@@ -309,6 +309,7 @@ def viewTest(request, id):
|
||||
# Build context dictionary for test template
|
||||
test = Test.objects.get(id=id)
|
||||
results = Result.objects.all().filter(test=test)
|
||||
results = results.order_by('machine_id')
|
||||
data = {'test' : test, 'results' : results}
|
||||
return render(request, 'viewTest.html', data)
|
||||
|
||||
|
||||
@@ -1,48 +1,27 @@
|
||||
{% extends "OpenBench/base.html" %}
|
||||
{% load mytags %}
|
||||
{% block content %}
|
||||
|
||||
<table class="datatable">
|
||||
{% if paging.page == 0 and greens == False %}
|
||||
<tr><td class="embedded" colspan='7'><h2>Pending</h2></td></tr>
|
||||
{% if pending %}
|
||||
<tr>
|
||||
<th>DATE</th>
|
||||
<th>ENGINE</th>
|
||||
<th>USER</th>
|
||||
<th>TEST</th>
|
||||
<th>DIFF</th>
|
||||
<th>TIME</th>
|
||||
<th>STATS</th>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% for test in pending %}
|
||||
<tr>
|
||||
<td>{{test.creation|date:"y-m-d"}}</td>
|
||||
<td class="numeric"><a href="/viewUser/{{test.author}}">{{test.author}}</a></td>
|
||||
<td>{{test.engine}}</td>
|
||||
<td><a href="/viewUser/{{test.author}}">{{test.author}}</a></td>
|
||||
<td><a href="/viewTest/{{test.id}}">{{test.dev.name}}</a></td>
|
||||
<td class="textcenter"><a href="{{test|gitDiffLink}}">diff</a></td>
|
||||
<td>{{test.timecontrol}}</td>
|
||||
<td class="statblock"><strong>{{test|shortStatBlock|linebreaksbr}}</strong></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
<tr><td class="embedded" colspan='7'><h2>Active - {{status}}</h2></td></tr>
|
||||
{% if active %}
|
||||
<tr>
|
||||
<th>DATE</th>
|
||||
<th>ENGINE</th>
|
||||
<th>USER</th>
|
||||
<th>TEST</th>
|
||||
<th>DIFF</th>
|
||||
<th>TIME</th>
|
||||
<th>STATS</th>
|
||||
</tr>
|
||||
<tr><td class="embedded" colspan='7'><h2>Active {{status}}</h2></td></tr>
|
||||
{% endif %}
|
||||
{% for test in active %}
|
||||
<tr>
|
||||
<td>{{test.creation|date:"y-m-d"}}</td>
|
||||
<td class="numeric"><a href="/viewUser/{{test.author}}">{{test.author}}</a></td>
|
||||
<td>{{test.engine}}</td>
|
||||
<td><a href="/viewUser/{{test.author}}">{{test.author}}</a></td>
|
||||
<td><a href="/viewTest/{{test.id}}">{{test.dev.name}}</a></td>
|
||||
<td class="textcenter"><a href="{{test|gitDiffLink}}">diff</a></td>
|
||||
<td>{{test.timecontrol}}</td>
|
||||
@@ -51,22 +30,10 @@
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
<tr><td class="embedded" colspan='7'><h2>Finished</h2></td></tr>
|
||||
{% if completed %}
|
||||
<tr>
|
||||
<th>DATE</th>
|
||||
<th>ENGINE</th>
|
||||
<th>USER</th>
|
||||
<th>TEST</th>
|
||||
<th>DIFF</th>
|
||||
<th>TIME</th>
|
||||
<th>STATS</th>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% for test in completed %}
|
||||
<tr>
|
||||
<td>{{test.creation|date:"y-m-d"}}</td>
|
||||
<td class="numeric"><a href="/viewUser/{{test.author}}">{{test.author}}</a></td>
|
||||
<td>{{test.engine}}</td>
|
||||
<td><a href="/viewUser/{{test.author}}">{{test.author}}</a></td>
|
||||
<td><a href="/viewTest/{{test.id}}">{{test.dev.name}}</a></td>
|
||||
<td class="textcenter"><a href="{{test|gitDiffLink}}">diff</a></td>
|
||||
<td>{{test.timecontrol}}</td>
|
||||
@@ -74,6 +41,7 @@
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
|
||||
<div id="pagebrowse">
|
||||
{% if paging.prev != paging.next %}
|
||||
<a class="page" href="/{{paging.url}}/{{paging.prev}}"><--</a>
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
{% block content %}
|
||||
<form method="POST" action="/newTest/">
|
||||
{% csrf_token %}
|
||||
<div id="left-settings">
|
||||
<div class="settings-column">
|
||||
<h3> Engine </h3>
|
||||
<label> Name </label>
|
||||
<select id="enginename" name="enginename" onchange="configure(testMode)">
|
||||
@@ -83,7 +83,7 @@
|
||||
<label> Options </label>
|
||||
<input id="baseoptions" name="baseoptions"></br>
|
||||
</div>
|
||||
<div id="right-settings">
|
||||
<div class="settings-column">
|
||||
<h3> Game Settings </h3>
|
||||
<label> Book </label>
|
||||
<select name="bookname">
|
||||
|
||||
@@ -9,11 +9,11 @@
|
||||
{% csrf_token %}
|
||||
<label>Username</label>
|
||||
<input name="username"></br>
|
||||
<label>Create Password</label>
|
||||
<label>Password</label>
|
||||
<input type="password" name="password1"></br>
|
||||
<label>Verify Password</label>
|
||||
<label>Password</label>
|
||||
<input type="password" name="password2"></br>
|
||||
<label>Email Address</label>
|
||||
<label>Email</label>
|
||||
<input name="email"></br>
|
||||
<input type="submit" name="submit" value="Create User">
|
||||
</form>
|
||||
|
||||
@@ -1,37 +1,36 @@
|
||||
{% extends "OpenBench/base.html" %}
|
||||
|
||||
{% load mytags %}
|
||||
|
||||
{% block style %}
|
||||
{% load static %}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<table class="summarytable">
|
||||
<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>
|
||||
<br>
|
||||
<table class="rawtable">
|
||||
<tr>
|
||||
<th>Username</th>
|
||||
<th>Last Seen On</th>
|
||||
<th>Last Seen</th>
|
||||
<th class="numeric">Games</th>
|
||||
<th class="numeric">Tests</th>
|
||||
<th>Enabled</th>
|
||||
<th>Approver</th>
|
||||
<th>Engine</th>
|
||||
<th>Repo</th>
|
||||
<th>Source Repository</th>
|
||||
</tr>
|
||||
{% for profile in profiles %}
|
||||
<tr>
|
||||
<td><a href="/viewUser/{{profile.user.username}}">{{profile.user.username}}</a></td>
|
||||
<td>{{profile.updated|date:'Y-m-d H:i'}}</td>
|
||||
<td>{{profile.updated|date:'Y-m-d'}}</td>
|
||||
<td class="numeric">{{profile.games}}</td>
|
||||
<td class="numeric">{{profile.tests}}</td>
|
||||
{% if profile.enabled %}
|
||||
<td class="numeric">X</td>
|
||||
{% else %}
|
||||
<td class="numeric"></td>
|
||||
{% endif %}
|
||||
{% if profile.approver %}
|
||||
<td class="numeric">X</td>
|
||||
{% else %}
|
||||
<td class="numeric"></td>
|
||||
{% endif %}
|
||||
<td>{{profile.engine}}</td>
|
||||
<td><a href="{{profile.repo}}">{{profile.repo}}</a></td>
|
||||
</tr>
|
||||
|
||||
@@ -144,30 +144,31 @@
|
||||
</form>
|
||||
</div>
|
||||
<br>
|
||||
|
||||
<div id="results">
|
||||
<table class="datatable">
|
||||
<tr>
|
||||
<th>User</th>
|
||||
<th>Machine</th>
|
||||
<th>Updated</th>
|
||||
<th>ID</th>
|
||||
<th>Owner</th>
|
||||
<th>Last Updated</th>
|
||||
<th>Games</th>
|
||||
<th>Win</th>
|
||||
<th>Loss</th>
|
||||
<th>Draw</th>
|
||||
<th>Crash</th>
|
||||
<th>Time</th>
|
||||
<th style="width: 60px">Win</th>
|
||||
<th style="width: 60px">Loss</th>
|
||||
<th style="width: 60px">Draw</th>
|
||||
<th style="width: 60px">Time</th>
|
||||
<th style="width: 60px">Crash</th>
|
||||
</tr>
|
||||
{% for result in results %}
|
||||
<tr>
|
||||
<td>{{result.machine.id}}</td>
|
||||
<td>{{result.machine.owner}}</td>
|
||||
<td>{{result.machine.osname}}</td>
|
||||
<td>{{result.updated|date:'Y-m-d H:i'}}</td>
|
||||
<td class="numeric">{{result.games}}</td>
|
||||
<td class="numeric">{{result.wins}}</td>
|
||||
<td class="numeric">{{result.losses}}</td>
|
||||
<td class="numeric">{{result.draws}}</td>
|
||||
<td class="numeric">{{result.crashes}}</td>
|
||||
<td class="numeric">{{result.timeloss}}</td>
|
||||
<td class="numeric">{{result.crashes}}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
|
||||
Reference in new issue
Block a user