Changeset 301 for django_apps/running/templates
- Timestamp:
- Apr 7, 2011, 8:56:04 PM (14 years ago)
- Location:
- django_apps/running/templates
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
django_apps/running/templates/index.html
r291 r301 1 1 <ul> 2 2 {% for user in user_list %} 3 <li><a href="{% url running.views.user_index user. name %}">{{ user }}</li>3 <li><a href="{% url running.views.user_index user.username %}">{{ user }}</li> 4 4 {%endfor %} 5 5 </ul> -
django_apps/running/templates/user_index.html
r298 r301 20 20 </head> 21 21 <body> 22 <a href="{% url running.views.index %}">User Overview</a><p /> 23 <h1>Welcome {{ user }}</h1> 22 <table> 23 <tr> 24 <td> 25 <a href="{% url running.views.index %}">User Overview</a> 26 </td> 27 <td>-</td> 28 <td> 29 {% if user.is_authenticated %} 30 <form method="post" action="{% url logout %}"> 31 <input type="submit" value="logout" /> 32 {% csrf_token %} 33 <input type="hidden" name="next" value="{{ request.path }}" /> 34 </form> 35 {% else %} 36 <form method="post" action="{% url login %}"> 37 {% csrf_token %} 38 <table> 39 <tr> 40 <td><input type="text" name="username" /></td> 41 <td><input type="password" name="password" /></td> 42 <td><input type="submit" value="login" /></td> 43 </tr> 44 </table> 45 <input type="hidden" name="next" value="{{ request.path }}" /> 46 </form> 47 {% endif %} 48 </td> 49 </tr> 50 </table> 51 <h1>Welcome {{ user.username|default:"New User" }}</h1> 52 <a href="#results">Add new results</a> 53 24 54 <div id="center"> 25 <h3>Week totals </h3>55 <h3>Week totals in KM</h3> 26 56 <div id="fig2"> 27 57 <div id="week-statistics"> </div> 28 58 </div> 29 <h3>Accumulated Totals </h3>59 <h3>Accumulated Totals in KM</h3> 30 60 <div id="fig"> 31 61 <div style="text-align:right;padding-right:20;"> … … 35 65 <div id="total-statistics"> </div> 36 66 </div> 67 <h3>Avergage Speed in KM</h3> 68 <div id="fig"> 69 <div style="text-align:right;padding-right:20;"> 70 <input checked id="scale" type="checkbox" onchange="vis.render()" 71 ><label for="scale">Scale to fit</label> 72 </div> 73 <div id="speed-statistics"> </div> 74 </div> 37 75 </div> 76 {% if user.is_authenticated %} 77 {% if user.id == runninguser.id %} 38 78 <form method="post" action=""> 39 79 {% csrf_token %} … … 63 103 <input type="submit" value="Submit Values"/> 64 104 </form> 65 Beheer al je gegevens <a href="{% url admin:running_user_change user.id %}">hier</a>. 105 {% else %} 106 Bewerk je eigen gegevens <a href="{% url running.views.user_index user.username %}">hier</a>. 107 {% endif %} 108 {% else %} 109 Login om je gegevens toe te voegen. 110 {% endif %} 111 <a name="results" /> 66 112 67 113 … … 69 115 // Graph Week totals 70 116 var xhr = new XMLHttpRequest(); 71 xhr.open('GET', '{% url running.views.json_user_column user.id %}', false);117 xhr.open('GET', '{% url running.views.json_user_column runninguser.id %}', false); 72 118 xhr.send(null); 73 119 var myData = JSON.parse(xhr.responseText, function (key, value) { … … 81 127 // Graph Year totals 82 128 var xhr = new XMLHttpRequest(); 83 xhr.open('GET', '{% url running.views.json_user_total user.id %}', false);129 xhr.open('GET', '{% url running.views.json_user_total runninguser.id %}', false); 84 130 xhr.send(null); 85 131 … … 95 141 yearTotalGraph(data, 'total-statistics'); 96 142 </script> 143 144 145 <script type="text/javascript+protovis"> 146 // Graph Average Speed 147 var xhr = new XMLHttpRequest(); 148 xhr.open('GET', '{% url running.views.json_user_speed runninguser.id %}', false); 149 xhr.send(null); 150 151 var data = JSON.parse(xhr.responseText, function (key, value) { 152 var type; 153 if ( value != null) { 154 if ( key === 'x') { 155 return new Date(value); 156 } 157 } 158 return value; 159 }); 160 yearTotalGraph(data, 'speed-statistics'); 161 </script> 97 162 </body> 98 163 </html>
Note:
See TracChangeset
for help on using the changeset viewer.