Files
edx-platform/profile.html
Kyle Fiedler 340f4ffca4 Cleaned markup up more
--HG--
branch : kf-refactor
2012-01-04 11:14:37 -05:00

112 lines
3.6 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, "+
"&quot;Cambridge, Massachusetts, USA&quot;), 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() {
postJSON('/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() {
postJSON('/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>
<%include file="navigation.html" />
<section>
<h1>${name} </h1>
<ul>
<li>Forum name: ${username}</li>
<li>E-mail: ${email}</li>
<li>Location: ${location}</li>
<li>Language: ${language}</li>
<li>Password: ********</li>
</ul>
<div><a href="#change_password_pop">Reset password</a></div> <!-- hidden trigger for password -->
<div id="description"></div>
<section>
<h1>Course Progress</h1>
% for hw in homeworks:
<li>
<p>${ hw['chapter'] }</p>
<p>${ hw['section'] }</p>
<ul>
% for score in hw['scores']:
<li>${ score[0] }/${ score[1] }</li>
% endfor
</ul>
</li>
% endfor
</section>
<div id="change_password_pop">
<h1>Password reset</h1>
<p>We'll e-mail you a password reset link at ${email}.</p>
<input id="id_email" type="hidden" name="email" maxlength="75" value="${email}" />
<input type="button" id="pwd_reset_button" value="E-mail me" />
</div>
</section>