<!doctype html>
<title>{{COURSE}} - Techela in a flask Gradebook</title>
<head>
<script type="text/javascript" src="{{url_for('static', filename='jquery-latest.js')}}/"></script>
<script type="text/javascript" src="{{url_for('static', filename='jquery.tablesorter.js')}}"></script>

<script>
  $(document).ready(function()
    {
        $("#gradesheet").tablesorter({widgets:['zebra'], sortList:[[0, 0]]});
    }
  );
</script>

<link rel="stylesheet" href="{{url_for('static', filename='themes/blue/style.css')}}" type="text/css" media="print, projection, screen" />


</head>

<h1>{{COURSE}} - Gradesheet for {{name}} ({{andrewid}})</h1>
<br>
<h2>Current overall grade is {{course_overall_grade}}.</h2>
<a href="/admin">admin</a> <a href="/">Home</a>

<style> .red {background: "red"}</style>
<table id="gradesheet" border="1" class=tablesorter>
  <thead>
    <th>Label</th>
    <th>Technical</th>
    <th>Presentation</th>
    <th>Overall</th>
    <th>Category</th>
    <th>Points</th>
  </thead>
  <tbody>
    {% for key in assignment_labels %}
    {% if grades.get(key, None) %}
    <tr>
    {% if grades[key].get('overall') %}
    <td><a href="/grade/{{andrewid}}/{{key}}">{{key}}</a></td>
    {% else %}
    <td>{{key}}</td>
    {% endif %}
    <td>{{grades[key]['technical']}}</td>
    <td>{{grades[key]['presentation']}}</td>
    <td {% if grades[key]['overall'] is none %}
	style="background: #ff4d4d" {# a reddish color #}
	{% elif grades[key]['overall'] < 0.65 %}
	style="background: #ffb84d" {# an orangish color #}
	{% endif %}>{{grades[key]['overall']}}</td>
    <td>{{grades[key]['category']}}</td>
    <td>{{grades[key]['points']}}</td>
</tr>
{% endif %}
  {% endfor %}
  </tbody>
</table>
