diff options
Diffstat (limited to 'templates')
-rw-r--r-- | templates/todolists/view.html | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/templates/todolists/view.html b/templates/todolists/view.html index ce191fb..b85a426 100644 --- a/templates/todolists/view.html +++ b/templates/todolists/view.html @@ -1,4 +1,5 @@ {% extends "base.html" %} + {% block content %} <div class="greybox"> <div style="float:right"> @@ -44,4 +45,24 @@ {{list.description|linebreaks}} </div> </div> + + <script type="text/javascript" src="/media/jquery-1.4.1.min.js"></script> + <script type="text/javascript"> + $(function() { + // Allow flagging of ToDo items using AJAX + $('a[href*=todo/flag]').click(function() { + var link = this; + + $.getJSON(link.href, function(data) { + if (data.complete) { + $(link).text('Complete').css('color', 'blue'); + } else { + $(link).text('Incomplete').css('color', 'red'); + } + }); + + return false; + }); + }); + </script> {% endblock %} |