Commit 026773b5 by Arthur Barrett

fix pep8 warnings and add empty message to notes tab

parent 996b3513
...@@ -16,11 +16,9 @@ def notes(request, course_id): ...@@ -16,11 +16,9 @@ def notes(request, course_id):
raise Http404 raise Http404
notes = Note.objects.filter(course_id=course_id, user=request.user).order_by('-created', 'uri') notes = Note.objects.filter(course_id=course_id, user=request.user).order_by('-created', 'uri')
json_notes = json.dumps([n.as_dict() for n in notes])
context = { context = {
'course': course, 'course': course,
'notes': notes, 'notes': notes
'json_notes': json_notes
} }
return render_to_response('notes.html', context) return render_to_response('notes.html', context)
<%namespace name='static' file='static_content.html'/> <%namespace name='static' file='static_content.html'/>
<%inherit file="main.html" /> <%inherit file="main.html" />
<%!
from django.core.urlresolvers import reverse
%>
<%block name="headextra"> <%block name="headextra">
<%static:css group='course'/> <%static:css group='course'/>
...@@ -52,7 +55,7 @@ ...@@ -52,7 +55,7 @@
<section class="container"> <section class="container">
<div class="notes-wrapper"> <div class="notes-wrapper">
<h2>My Notes</h2> <h1>My Notes</h1>
% for note in notes: % for note in notes:
<div class="note"> <div class="note">
<blockquote>${note.quote|h}</blockquote> <blockquote>${note.quote|h}</blockquote>
...@@ -67,6 +70,9 @@ ...@@ -67,6 +70,9 @@
</ul> </ul>
</div> </div>
% endfor % endfor
% if notes is UNDEFINED or len(notes) == 0:
<p>You do not have any notes.</p>
% endif
</div> </div>
</section> </section>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment