140 lines
4.9 KiB
HTML
140 lines
4.9 KiB
HTML
<%inherit file="main.html" />
|
|
|
|
<script>
|
|
var loc=true; // Activate on clicks? Not if already clicked.
|
|
var lang=true;
|
|
$(function() {
|
|
$("#change_location").click(function() {
|
|
log_event("profile", {"type":"location_show", "old":$("#location_sub").text()});
|
|
|
|
if(loc) {
|
|
$("#description").html('<div style="color:#FF0000">'+
|
|
"Preferred format is city, state, country (so for us, "+
|
|
""Cambridge, Massachusetts, USA"), but give "+
|
|
"as much or as little detail as you want. </div>");
|
|
|
|
loc=false;
|
|
$("#location_sub").html('<input id="id_loc_text" type="text" name="loc_text" />'+
|
|
'<input type="button" id="change_loc_button" value="Change" />');
|
|
$("#change_loc_button").click(function() {
|
|
$.getJSON('/change_setting', {'location':$("#id_loc_text").attr("value")}, function(json) {
|
|
$("#location_sub").text(json.location);
|
|
loc=true;
|
|
$("#description").html("");
|
|
log_event("profile", {"type":"location_change", "new":json.location});
|
|
});
|
|
});
|
|
}
|
|
});
|
|
|
|
$("#change_language").click(function() {
|
|
log_event("profile", {"type":"language_show", "old":$("#language_sub").text()});
|
|
|
|
if(lang) {
|
|
lang=false;
|
|
$("#language_sub").html('<input id="id_lang_text" type="text" name="lang_text" />'+
|
|
'<input type="button" id="change_lang_button" value="Change" />');
|
|
$("#change_lang_button").click(function() {
|
|
$.getJSON('/change_setting', {'language':$("#id_lang_text").attr("value")}, function(json) {
|
|
$("#language_sub").text(json.language);
|
|
lang=true;
|
|
$("#description").html("");
|
|
log_event("profile", {"type":"language_change", "new":json.language});
|
|
});
|
|
});
|
|
}
|
|
});
|
|
|
|
$("a#inline").fancybox({
|
|
'hideOnContentClick': false
|
|
});
|
|
|
|
$('#change_password').click(function(){
|
|
$('#inline').trigger('click');
|
|
log_event("profile", {"type":"password_show"});
|
|
});
|
|
|
|
$('#pwd_reset_button').click(function() {
|
|
$.post('/password_reset/',{ "csrfmiddlewaretoken" : "${ csrf }",
|
|
"email" : $('#id_email').val()}, function(data){
|
|
$('#pwd_reset').html(data);
|
|
log_event("profile", {"type":"password_send"});
|
|
});
|
|
});
|
|
})
|
|
|
|
</script>
|
|
|
|
<div align="right" id="coursenav"><div align=right><table><tr><td align=right valign=top>
|
|
<a href="/book">Textbook</a>
|
|
<span class="ui-icon ui-icon-bullet" style="display:inline-block;"></span>
|
|
<a href="/courseware">Courseware</a>
|
|
<span class="ui-icon ui-icon-bullet" style="display:inline-block;"></span>
|
|
<a href="/discussion">Discussion</a>
|
|
<span class="ui-icon ui-icon-bullet" style="display:inline-block;"></span>
|
|
<a href="/wiki">Wiki</a>
|
|
<span class="ui-icon ui-icon-bullet" style="display:inline-block;"></span>
|
|
<a href="/profile"><b>Profile</b></a>
|
|
<span class="ui-icon ui-icon-bullet" style="display:inline-block;"></span>
|
|
<a href="/help">Help</a> <span class="ui-icon ui-icon-bullet" style="display:inline-block;"></span>
|
|
<a href="/logout">Log out</a>
|
|
</td></tr><tr><td valign=top>
|
|
</td></tr></table>
|
|
</div></div>
|
|
<center>
|
|
<br><br><br><br>
|
|
<h1> ${name} </h1>
|
|
<table><td align=right>Forum name:</td><td>${username}</td></tr>
|
|
<td align=right>E-mail:</td><td>${email}</td></tr>
|
|
<tr id="change_location"> <td align=right>Location:</a></td><td><div class="bordered" id="location_sub">${location} </div></td></tr>
|
|
<tr id="change_language"><td align=right><div id="change_language">Language:</a></td><td><div id="language_sub" class="bordered">${language} </div></td></tr>
|
|
<tr id="change_password"><td align=right><div>Password:</a></td><td><div id="change_password" class="bordered">********</a></td></tr></table>
|
|
|
|
<div><a id="inline" href="#change_password_pop"></a></div> <!-- hidden trigger for password -->
|
|
|
|
<div id="description"></div>
|
|
|
|
<h1> Course Progress </h1>
|
|
<table>
|
|
% for hw in homeworks:
|
|
<tr><td> ${ hw['chapter'] }</td><td>/</td> <td> ${ hw['section'] } </td><td> </td><td>
|
|
% for score in hw['scores']:
|
|
${ score[0] }/${ score[1] }
|
|
% endfor
|
|
</td></tr>
|
|
% endfor
|
|
</table>
|
|
</center>
|
|
|
|
<div style="display:none"><div id="change_password_pop">
|
|
<div id="pwd_reset">
|
|
<table width=400><tr><td> <h1>Password reset</h1>
|
|
|
|
<p>Hit the button below, and we'll e-mail you a password reset link at ${email}.</p>
|
|
|
|
<p>
|
|
<div align=right>
|
|
<input id="id_email" type="hidden" name="email" maxlength="75" value="${email}" />
|
|
<input type="button" id="pwd_reset_button" value="E-mail me" /></p>
|
|
</div>
|
|
</td></tr></table>
|
|
</div>
|
|
</div></div>
|
|
|
|
|
|
<br>
|
|
<br>
|
|
<br>
|
|
<br>
|
|
<br>
|
|
<br>
|
|
<br>
|
|
<br>
|
|
<br>
|
|
<br>
|
|
<br>
|
|
<br>
|
|
<br>
|
|
<br>
|
|
<br>
|