Index: django_apps/running/templates/index.html
===================================================================
--- django_apps/running/templates/index.html	(revision 298)
+++ django_apps/running/templates/index.html	(revision 301)
@@ -1,5 +1,5 @@
 <ul>
 {% for user in user_list %} 
-<li><a href="{% url running.views.user_index user.name %}">{{ user }}</li>
+<li><a href="{% url running.views.user_index user.username %}">{{ user }}</li>
 {%endfor %}
 </ul>
Index: django_apps/running/templates/user_index.html
===================================================================
--- django_apps/running/templates/user_index.html	(revision 298)
+++ django_apps/running/templates/user_index.html	(revision 301)
@@ -20,12 +20,42 @@
   </head>
   <body>
-    <a href="{% url running.views.index %}">User Overview</a><p />
-    <h1>Welcome {{ user }}</h1>
+  <table>
+  <tr>
+  <td>
+    <a href="{% url running.views.index %}">User Overview</a>
+  </td>
+  <td>-</td>
+  <td>
+    {% if user.is_authenticated %}
+<form method="post" action="{% url logout %}">
+      <input type="submit" value="logout" />
+  {% csrf_token %}
+  <input type="hidden" name="next" value="{{ request.path }}" />
+</form>
+    {% else %}
+<form method="post" action="{% url login %}">
+  {% csrf_token %}
+  <table>
+  <tr>
+      <td><input type="text" name="username" /></td>
+      <td><input type="password" name="password" /></td>
+      <td><input type="submit" value="login" /></td>
+  </tr>
+  </table>
+  <input type="hidden" name="next" value="{{ request.path }}" />
+</form>
+{% endif %}
+</td>
+</tr>
+</table>
+   <h1>Welcome {{ user.username|default:"New User" }}</h1>
+   <a href="#results">Add new results</a>
+
     <div id="center">
-      <h3>Week totals</h3>
+      <h3>Week totals in KM</h3>
       <div id="fig2">
         <div id="week-statistics"> </div>
       </div>
-      <h3>Accumulated Totals</h3>
+      <h3>Accumulated Totals in KM</h3>
       <div id="fig">
         <div style="text-align:right;padding-right:20;">
@@ -35,5 +65,15 @@
         <div id="total-statistics"> </div>
       </div>
+      <h3>Avergage Speed in KM</h3>
+      <div id="fig">
+        <div style="text-align:right;padding-right:20;">
+          <input checked id="scale" type="checkbox" onchange="vis.render()"
+          ><label for="scale">Scale to fit</label>
+        </div>
+        <div id="speed-statistics"> </div>
+      </div>
     </div>
+    {% if user.is_authenticated %}
+    {% if user.id == runninguser.id %}
     <form method="post" action="">
     {% csrf_token %}
@@ -63,5 +103,11 @@
     <input type="submit" value="Submit Values"/>
     </form>
-    Beheer al je gegevens <a href="{% url admin:running_user_change user.id %}">hier</a>.
+    {% else %}
+      Bewerk je eigen gegevens <a href="{% url running.views.user_index user.username %}">hier</a>.
+    {% endif %}
+    {% else %}
+    Login om je gegevens toe te voegen.
+    {% endif %}
+    <a name="results" />
 
 
@@ -69,5 +115,5 @@
   // Graph Week totals
   var xhr = new XMLHttpRequest();
-  xhr.open('GET', '{% url running.views.json_user_column user.id %}', false);
+  xhr.open('GET', '{% url running.views.json_user_column runninguser.id %}', false);
   xhr.send(null);
   var myData = JSON.parse(xhr.responseText, function (key, value) {
@@ -81,5 +127,5 @@
   // Graph Year totals
   var xhr = new XMLHttpRequest();
-  xhr.open('GET', '{% url running.views.json_user_total user.id %}', false);
+  xhr.open('GET', '{% url running.views.json_user_total runninguser.id %}', false);
   xhr.send(null);
   
@@ -95,4 +141,23 @@
   yearTotalGraph(data, 'total-statistics');
 </script>
+
+
+<script type="text/javascript+protovis">
+  // Graph Average Speed
+  var xhr = new XMLHttpRequest();
+  xhr.open('GET', '{% url running.views.json_user_speed runninguser.id %}', false);
+  xhr.send(null);
+  
+  var data = JSON.parse(xhr.responseText, function (key, value) {
+      var type;
+      if ( value != null) {
+        if ( key === 'x') {
+           return new Date(value);
+        }
+      }
+      return value;
+  });
+  yearTotalGraph(data, 'speed-statistics');
+</script>
   </body>
 </html>
