Commit 6b7ba379 by Vik Paruchuri

Combined notification view

parent 22a2bdaa
...@@ -7,6 +7,12 @@ from student.models import unique_id_for_user ...@@ -7,6 +7,12 @@ from student.models import unique_id_for_user
import open_ended_util import open_ended_util
from courseware.models import StudentModule from courseware.models import StudentModule
NOTIFICATION_TYPES = (
('student_needs_to_peer_grade', 'peer_grading', 'Peer Grading'),
('staff_needs_to_grade', 'staff_grading', 'Staff Grading'),
('overall_need_to_check', 'open_ended_problems', 'Problems you have submitted')
)
def staff_grading_notifications(course_id): def staff_grading_notifications(course_id):
staff_gs = StaffGradingService(settings.STAFF_GRADING_INTERFACE) staff_gs = StaffGradingService(settings.STAFF_GRADING_INTERFACE)
pending_grading=False pending_grading=False
......
...@@ -168,6 +168,31 @@ def combined_notifications(request, course_id): ...@@ -168,6 +168,31 @@ def combined_notifications(request, course_id):
user = request.user user = request.user
notifications = open_ended_notifications.combined_notifications(course_id, user) notifications = open_ended_notifications.combined_notifications(course_id, user)
response = notifications['response'] response = notifications['response']
notificaton_tuples=open_ended_notifications.NOTIFICATION_TYPES
notification_list = []
for response_num in xrange(0,len(notification_tuples)):
tag=notification_tuples[response_num][0]
if tag in response:
url_name = notification_tuples[response_num][1]
human_name = notification_tuples[response_num][2]
url = _reverse_with_slash(url_name, course_id)
has_img = response[tag]
img_path = "/static/images/slider-handle.png"
notification_item = {
'url' : url,
'name' : human_name,
'has_img' : has_img,
'img' : img_path,
}
notification_list.append(notification_item)
combined_dict = {
'error_text' : "",
'notification_list' : notification_list,
}
return combined_dict
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
<h2>Instructions</h2> <h2>Instructions</h2>
<p>Here are items that could potentially need your attention.</p> <p>Here are items that could potentially need your attention.</p>
% if success: % if success:
% if len(item_list) == 0: % if len(notification_list) == 0:
<div class="message-container"> <div class="message-container">
No items require attention at the moment. No items require attention at the moment.
</div> </div>
...@@ -28,8 +28,8 @@ ...@@ -28,8 +28,8 @@
<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
</a> </a>
</li> </li>
......
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