Commit f47c431f by Vik Paruchuri

Fix templating

parent 8602e159
...@@ -45,6 +45,7 @@ class ControllerQueryService(GradingService): ...@@ -45,6 +45,7 @@ class ControllerQueryService(GradingService):
'user_is_staff' : user_is_staff, 'user_is_staff' : user_is_staff,
'last_time_viewed' : last_time_viewed, 'last_time_viewed' : last_time_viewed,
} }
log.debug(self.combined_notifications_url)
response = self.get(self.combined_notifications_url,params) response = self.get(self.combined_notifications_url,params)
return response return response
......
...@@ -39,11 +39,14 @@ it does not exist yet ...@@ -39,11 +39,14 @@ it does not exist yet
""" """
def _reverse_with_slash(url_name, course_id): def _reverse_with_slash(url_name, course_id):
ajax_url = reverse(url_name, kwargs={'course_id': course_id}) ajax_url = _reverse_without_slash(url_name, course_id)
if not ajax_url.endswith('/'): if not ajax_url.endswith('/'):
ajax_url += '/' ajax_url += '/'
return ajax_url return ajax_url
def _reverse_without_slash(url_name, course_id):
ajax_url = reverse(url_name, kwargs={'course_id': course_id})
return ajax_url
@cache_control(no_cache=True, no_store=True, must_revalidate=True) @cache_control(no_cache=True, no_store=True, must_revalidate=True)
def staff_grading(request, course_id): def staff_grading(request, course_id):
...@@ -178,7 +181,7 @@ def combined_notifications(request, course_id): ...@@ -178,7 +181,7 @@ def combined_notifications(request, course_id):
if tag in response: if tag in response:
url_name = notification_tuples[response_num][1] url_name = notification_tuples[response_num][1]
human_name = notification_tuples[response_num][2] human_name = notification_tuples[response_num][2]
url = _reverse_with_slash(url_name, course_id) url = _reverse_without_slash(url_name, course_id)
has_img = response[tag] has_img = response[tag]
img_path = "/static/images/slider-handle.png" img_path = "/static/images/slider-handle.png"
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
%for notification in notification_list: %for notification in notification_list:
<li> <li>
<a href="${notification['url']}"> <a href="${notification['url']}">
{notification['name']} ${notification['name']}
% if notification['has_img'] == True: % if notification['has_img'] == True:
<img src="${notification['img']}"/> <img src="${notification['img']}"/>
%endif %endif
......
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