@login_required
def edxnotes(request, course_id):
 course_key = CourseKey.from_string(course_id)
 course = get_course_with_access(request.user, 'load', course_key)
 if (not is_feature_enabled(course)):
  raise Http404
 notes_info = get_notes(request, course)
 has_notes = (len(notes_info.get('results')) > 0)
 context = {'course': course, 'notes_endpoint': reverse('notes', kwargs={'course_id': course_id}), 'notes': notes_info, 'page_size': DEFAULT_PAGE_SIZE, 'debug': settings.DEBUG, 'position': None, 'disabled_tabs': settings.NOTES_DISABLED_TABS, 'has_notes': has_notes}
 if (not has_notes):
  field_data_cache = FieldDataCache.cache_for_descriptor_descendents(course.id, request.user, course, depth=2)
  course_module = get_module_for_descriptor(request.user, request, course, field_data_cache, course_key, course=course)
  position = get_course_position(course_module)
  if position:
   context.update({'position': position})
 return render_to_response('edxnotes/edxnotes.html', context)

@ login_required def edxnotes ( request , course_id ) : course_key = CourseKey . from_string ( course_id ) course = get_course_with_access ( request . user , 'load' , course_key ) if ( not is_feature_enabled ( course ) ) : raise Http404 notes_info = get_notes ( request , course ) has_notes = ( len ( notes_info . get ( 'results' ) ) > 0 ) context = { 'course' : course , 'notes_endpoint' : reverse ( 'notes' , kwargs = { 'course_id' : course_id } ) , 'notes' : notes_info , 'page_size' : DEFAULT_PAGE_SIZE , 'debug' : settings . DEBUG , 'position' : None , 'disabled_tabs' : settings . NOTES_DISABLED_TABS , 'has_notes' : has_notes } if ( not has_notes ) : field_data_cache = FieldDataCache . cache_for_descriptor_descendents ( course . id , request . user , course , depth = 2 ) course_module = get_module_for_descriptor ( request . user , request , course , field_data_cache , course_key , course = course ) position = get_course_position ( course_module ) if position : context . update ( { 'position' : position } ) return render_to_response ( 'edxnotes/edxnotes.html' , context )
decorator that makes components annotatable .