Use different colors for public/private comment widget
authorSverre Rabbelier <srabbelier@gmail.com>
Sun, 05 Apr 2009 19:37:56 +0000
changeset 2085 2f04b8ec3b96
parent 2084 93c8a683dc12
child 2086 c783b0d5d992
Use different colors for public/private comment widget Patch by: Dmitri Gaskin <dmitrig01@gmail.com>
app/soc/content/css/soc-090418.css
app/soc/templates/soc/student_proposal/review.html
app/soc/templates/soc/templatetags/_as_student_proposal_review.html
--- a/app/soc/content/css/soc-090418.css	Sun Apr 05 18:18:07 2009 +0000
+++ b/app/soc/content/css/soc-090418.css	Sun Apr 05 19:37:56 2009 +0000
@@ -499,10 +499,16 @@
   background: #d0f5a9;
 }
 
-.studentproposalreview .other {
+.studentproposalcomment-public,
+.studentproposalreview-public .other {
   background: #f5f6ce;
 }
 
+.studentproposalcomment-private,
+.studentproposalreview-private .other {
+  background: #D2EDF6;
+}
+
 /*
  * CUSTOM CLASSES
  */
--- a/app/soc/templates/soc/student_proposal/review.html	Sun Apr 05 18:18:07 2009 +0000
+++ b/app/soc/templates/soc/student_proposal/review.html	Sun Apr 05 19:37:56 2009 +0000
@@ -63,7 +63,7 @@
 <form method="POST">
 <b>Score and Review</b>
 
-<div class="box" style="border: 1px solid blue;">
+<div class="box">
   <table id="commentcommon">
     <!-- By default this is not displayed, so that all options work on non-javascript browsers -->
     <tr style="display: none;">
@@ -158,6 +158,8 @@
   var commentAdmin = document.getElementById("commentadmin");
 
   var publicCheckbox = document.getElementById("id_public");
+  var cssString = "studentproposalcomment-";
+  var cssRemoveString = "studentproposalcomment-";
 
   switch (type) {
     case "Public":
@@ -165,24 +167,31 @@
       commentPrivate.style.display = "none";
       commentAdmin.style.display = "none";
       publicCheckbox.value = true;
+      cssString += "public";
+      cssRemoveString += "private";
       break;
     case "Private":
       commentPublic.style.display = "";
       commentPrivate.style.display = "";
       commentAdmin.style.display = "none";
       publicCheckbox.value = false;
+      cssString += "private";
+      cssRemoveString += "public";
       break;
     case "Admin":
       commentPublic.style.display = "";
       commentPrivate.style.display = "";
       commentAdmin.style.display = "";
       publicCheckbox.value = false;
+      cssString += "private";
+      cssRemoveString += "public";
       break;
     default:
       alert("Unknown value");
       alert(type);
       break;
   }
+  $($('#commenttypeselector').parents('.box').get(0)).removeClass(cssRemoveString).addClass(cssString);
 }
 
 // Set the comment type selector to be displayed
--- a/app/soc/templates/soc/templatetags/_as_student_proposal_review.html	Sun Apr 05 18:18:07 2009 +0000
+++ b/app/soc/templates/soc/templatetags/_as_student_proposal_review.html	Sun Apr 05 19:37:56 2009 +0000
@@ -12,7 +12,7 @@
 limitations under the License.
 {% endcomment %}
 
-<div class="studentproposalreview">
+<div class="studentproposalreview studentproposalreview-{% if is_public %}public{% else %}private{% endif %}">
   <div class="title">
     On {{ created|date:"jS F Y H:i" }}
     {% if is_public %}