Difference between revisions of "Dev/Results"

(Got rid of colspans in the no-js/loading stuff, apparently DataTables hates colspan)
(Undid last 2 edits as this introduced some mystery error)
Line 6: Line 6:
  
 
<style type="text/css">
 
<style type="text/css">
#table_team th{
+
#table_team th, #table_team td {
 
text-align: center;
 
text-align: center;
 
font-size: larger;
 
font-size: larger;
padding: 7px;
 
}
 
#table_team td {
 
padding: 7px;
 
font-size: larger;
 
}
 
td.team-name-column {
 
text-align: right;
 
}
 
td.medal-column {
 
text-align: center;
 
}
 
td.award-column {
 
text-align: left;
 
 
}
 
}
 
#table_team tbody img {
 
#table_team tbody img {
Line 89: Line 75:
 
jQuery(document).ready(function() {
 
jQuery(document).ready(function() {
 
$("#title-year").html(currentYear);
 
$("#title-year").html(currentYear);
$("#table_team tbody").empty().append("<tr>Loading...</tr>");
+
$("#table_team tbody").empty().append("<tr><td colspan='3'>Loading...</td></tr>");
 
 
 
//Request team data
 
//Request team data
Line 128: Line 114:
 
'order': [[1, 'asc']], //I think this sorts by team-name by default
 
'order': [[1, 'asc']], //I think this sorts by team-name by default
 
'data': arrayOfTeamAwards,
 
'data': arrayOfTeamAwards,
'columnDefs': [
+
'columns': [
{ //Team Name Column
+
'targets': 0,
+
'className': 'team-name-column',
+
'data': function(row, type, val, meta) {
+
if (type == 'display') {
+
return "<a class='team-info-control' style='cursor: pointer;'>" + row.team_name + "</a>";
+
}
+
else {
+
return row.team_name;
+
}
+
}
+
},
+
 
{ //Medal Column
 
{ //Medal Column
'targets': '1',
 
'className': 'medal-column',
 
 
'width': "10%",
 
'width': "10%",
 
'data': function(row, type, val, meta) {
 
'data': function(row, type, val, meta) {
Line 181: Line 153:
 
else {
 
else {
 
return medals_info[row.medal].html;
 
return medals_info[row.medal].html;
 +
}
 +
}
 +
},
 +
{ //Team Name Column
 +
'data': function(row, type, val, meta) {
 +
if (type == 'display') {
 +
return "<a class='team-info-control' style='cursor: pointer;'>" + row.team_name + "</a>";
 +
}
 +
else {
 +
return row.team_name;
 
}
 
}
 
}
 
}
 
},
 
},
 
{ //Award Column
 
{ //Award Column
'targets': 2,
+
//'defaultContent': '',
'className': 'award-column',
+
 
'data': function(row, type, val, meta) {
 
'data': function(row, type, val, meta) {
 
if (type == 'sort') {
 
if (type == 'sort') {
Line 241: Line 222:
 
<THEAD>
 
<THEAD>
 
<TR>
 
<TR>
<TH>Team</TH>
 
 
<TH>Medal</TH>
 
<TH>Medal</TH>
 +
<TH>Team</TH>
 
<TH>Award</TH>
 
<TH>Award</TH>
 
</TR>
 
</TR>
Line 248: Line 229:
 
<TBODY>
 
<TBODY>
 
<tr>
 
<tr>
Please enable JavaScript in your browser to view results.
+
<td id="javascript-disabled" colspan="3">Please enable JavaScript in your browser to view results.</td>
 
</tr>
 
</tr>
 
</TBODY>
 
</TBODY>

Revision as of 21:36, 23 September 2015

Comprehensive Results from iGEM

View: [All Teams] [Award Winners] | [Africa] [Asia] [Europe] [Latin America][other?]

Medal Team Award
Please enable JavaScript in your browser to view results.