diff --git a/lms/djangoapps/notes/api.py b/lms/djangoapps/notes/api.py index bb6ca9d26a..de23f78819 100644 --- a/lms/djangoapps/notes/api.py +++ b/lms/djangoapps/notes/api.py @@ -1,6 +1,6 @@ from django.contrib.auth.decorators import login_required from django.http import HttpResponse, Http404 -from django.core.exceptions import ValidationError +from django.core.exceptions import ValidationError from notes.models import Note from notes.utils import notes_enabled_for_course diff --git a/lms/djangoapps/notes/models.py b/lms/djangoapps/notes/models.py index 7d9ac75458..7c9db7dc28 100644 --- a/lms/djangoapps/notes/models.py +++ b/lms/djangoapps/notes/models.py @@ -12,9 +12,9 @@ class Note(models.Model): uri = models.CharField(max_length=1024, db_index=True) text = models.TextField(default="") quote = models.TextField(default="") - range_start = models.CharField(max_length=2048) # xpath string + range_start = models.CharField(max_length=2048) # xpath string range_start_offset = models.IntegerField() - range_end = models.CharField(max_length=2048) # xpath string + range_end = models.CharField(max_length=2048) # xpath string range_end_offset = models.IntegerField() tags = models.TextField(default="") # comma-separated string created = models.DateTimeField(auto_now_add=True, null=True, db_index=True) diff --git a/lms/djangoapps/notes/views.py b/lms/djangoapps/notes/views.py index cf125781d0..654d7fb31d 100644 --- a/lms/djangoapps/notes/views.py +++ b/lms/djangoapps/notes/views.py @@ -16,11 +16,9 @@ def notes(request, course_id): raise Http404 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 = { 'course': course, - 'notes': notes, - 'json_notes': json_notes + 'notes': notes } return render_to_response('notes.html', context) diff --git a/lms/templates/notes.html b/lms/templates/notes.html index 8884fe2ded..3fea6faa3e 100644 --- a/lms/templates/notes.html +++ b/lms/templates/notes.html @@ -1,5 +1,8 @@ <%namespace name='static' file='static_content.html'/> <%inherit file="main.html" /> +<%! + from django.core.urlresolvers import reverse +%> <%block name="headextra"> <%static:css group='course'/> @@ -52,7 +55,7 @@
-

My Notes

+

My Notes

% for note in notes:
${note.quote|h}
@@ -67,6 +70,9 @@
% endfor + % if notes is UNDEFINED or len(notes) == 0: +

You do not have any notes.

+ % endif