app/soc/templates/soc/student_proposal/review.html
changeset 2085 2f04b8ec3b96
parent 2051 cecbef1289a5
child 2088 353d73af0ba6
equal deleted inserted replaced
2084:93c8a683dc12 2085:2f04b8ec3b96
    61 
    61 
    62 <hr />
    62 <hr />
    63 <form method="POST">
    63 <form method="POST">
    64 <b>Score and Review</b>
    64 <b>Score and Review</b>
    65 
    65 
    66 <div class="box" style="border: 1px solid blue;">
    66 <div class="box">
    67   <table id="commentcommon">
    67   <table id="commentcommon">
    68     <!-- By default this is not displayed, so that all options work on non-javascript browsers -->
    68     <!-- By default this is not displayed, so that all options work on non-javascript browsers -->
    69     <tr style="display: none;">
    69     <tr style="display: none;">
    70       <td class="formfieldlabel">
    70       <td class="formfieldlabel">
    71         Comment Type:
    71         Comment Type:
   156   var commentPublic = document.getElementById("commentpublic");
   156   var commentPublic = document.getElementById("commentpublic");
   157   var commentPrivate = document.getElementById("commentprivate");
   157   var commentPrivate = document.getElementById("commentprivate");
   158   var commentAdmin = document.getElementById("commentadmin");
   158   var commentAdmin = document.getElementById("commentadmin");
   159 
   159 
   160   var publicCheckbox = document.getElementById("id_public");
   160   var publicCheckbox = document.getElementById("id_public");
       
   161   var cssString = "studentproposalcomment-";
       
   162   var cssRemoveString = "studentproposalcomment-";
   161 
   163 
   162   switch (type) {
   164   switch (type) {
   163     case "Public":
   165     case "Public":
   164       commentPublic.style.display = "";
   166       commentPublic.style.display = "";
   165       commentPrivate.style.display = "none";
   167       commentPrivate.style.display = "none";
   166       commentAdmin.style.display = "none";
   168       commentAdmin.style.display = "none";
   167       publicCheckbox.value = true;
   169       publicCheckbox.value = true;
       
   170       cssString += "public";
       
   171       cssRemoveString += "private";
   168       break;
   172       break;
   169     case "Private":
   173     case "Private":
   170       commentPublic.style.display = "";
   174       commentPublic.style.display = "";
   171       commentPrivate.style.display = "";
   175       commentPrivate.style.display = "";
   172       commentAdmin.style.display = "none";
   176       commentAdmin.style.display = "none";
   173       publicCheckbox.value = false;
   177       publicCheckbox.value = false;
       
   178       cssString += "private";
       
   179       cssRemoveString += "public";
   174       break;
   180       break;
   175     case "Admin":
   181     case "Admin":
   176       commentPublic.style.display = "";
   182       commentPublic.style.display = "";
   177       commentPrivate.style.display = "";
   183       commentPrivate.style.display = "";
   178       commentAdmin.style.display = "";
   184       commentAdmin.style.display = "";
   179       publicCheckbox.value = false;
   185       publicCheckbox.value = false;
       
   186       cssString += "private";
       
   187       cssRemoveString += "public";
   180       break;
   188       break;
   181     default:
   189     default:
   182       alert("Unknown value");
   190       alert("Unknown value");
   183       alert(type);
   191       alert(type);
   184       break;
   192       break;
   185   }
   193   }
       
   194   $($('#commenttypeselector').parents('.box').get(0)).removeClass(cssRemoveString).addClass(cssString);
   186 }
   195 }
   187 
   196 
   188 // Set the comment type selector to be displayed
   197 // Set the comment type selector to be displayed
   189 var commentTypeSelector = document.getElementById("commenttypeselector");
   198 var commentTypeSelector = document.getElementById("commenttypeselector");
   190 commentTypeSelector.parentNode.parentNode.style.display = "";
   199 commentTypeSelector.parentNode.parentNode.style.display = "";