Permalink
Browse files

Prefill the checkboxes with the stored value

  • Loading branch information...
1 parent df58a6a commit 45d5c8bf1e81aebd845cc7451ab26e1e6040b6af @DFectuoso DFectuoso committed Apr 29, 2010
Showing with 3 additions and 0 deletions.
  1. +1 −0 main.py
  2. +2 −0 templates/base.html
View
@@ -147,6 +147,7 @@ def get(self):
login_url = users.create_login_url('/')
updates_query = Update.all().order('-created')
updates = updates_query.fetch(UPDATES_LIMIT)
+ profile = Profile.get_or_create()
self.response.out.write(template.render('templates/main.html', locals()))
def post(self):
View
@@ -34,6 +34,8 @@ <h2 style="font-size: x-large;">Log</h2>
</div>
</div>
<script type="text/javascript">
+ if("True" == "{{profile.emailNotification}}") $("#emailNotification")[0].checked=true;
+ if("True" == "{{profile.notifyIoNotification}}") $("#notifyIoNotification")[0].checked=true;
function updateEmailNotification(){
$.post('/notifications/email',{enable: $("#emailNotification")[0].checked});
}

0 comments on commit 45d5c8b

Please sign in to comment.