From 1f56ac9e60e7f13d10d9b29376c2ed11a85e25b2 Mon Sep 17 00:00:00 2001 From: Jessica McKellar Date: Wed, 29 Aug 2012 12:53:03 -0400 Subject: [PATCH] Make the zephyr highlighting for new zephyrs consistent with those on page load. (imported from commit 28dbdb564b4dff479af1f71551a393f8dd54d597) --- zephyr/static/js/zephyr.js | 25 +++++++++++++++++-------- zephyr/views.py | 1 + 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/zephyr/static/js/zephyr.js b/zephyr/static/js/zephyr.js index 153a510e6f..1e1738ab8d 100644 --- a/zephyr/static/js/zephyr.js +++ b/zephyr/static/js/zephyr.js @@ -128,14 +128,23 @@ $(function() { }); function add_message(index, zephyr) { - var new_str = " \ -

\ - \ -

" + zephyr.display_recipient + -" / " + zephyr.instance + " / " + zephyr.sender + "
" + -zephyr.content + -"

\ -" + var recipient_color; + if (zephyr.type == "class") { + recipient_color = "yellow"; + } else { + recipient_color = "magenta"; + } + + var new_str = "" + + "

" + + "" + + "

" + zephyr.display_recipient + + " / " + + zephyr.instance + " / " + zephyr.sender + "
" + + zephyr.content + + "

" + + "" + alert(new_str); $("#table tr:last").after(new_str); } diff --git a/zephyr/views.py b/zephyr/views.py index b190b1509f..06343d1422 100644 --- a/zephyr/views.py +++ b/zephyr/views.py @@ -87,6 +87,7 @@ def get_updates(request): for zephyr in new_zephyrs: new_zephyr_list.append({"id": zephyr.id, "sender": zephyr.sender.user.username, + "type": zephyr.recipient.type, "display_recipient": get_display_recipient(zephyr.recipient), "instance": zephyr.instance, "content": zephyr.content