Changeset - 1bf6c5c1eb85
[Not reviewed]
default
0 3 0
Nathan Brink (binki) - 14 years ago 2011-10-24 17:38:13
ohnobinki@ohnopublishing.net
Generalize setting a CSS class based on the type of section on the input page, move cedarville-specific CSS to schools.d/cedarville.inc and add ILB to CSS. Fixes bug #121.
3 files changed with 31 insertions and 12 deletions:
0 comments (0 inline, 0 general)
school.d/cedarville.inc
Show inline comments
 
@@ -73,14 +73,34 @@ function cedarville_default_courses()
 
function cedarville_page_css($school)
 
{
 
  return <<<CSS
 
#container .lab .sectionIdentifier {
 
#container .type-lab .sectionIdentifier,
 
#container .type-ilb .sectionIdentifier
 
{
 
  background: none!important;
 
}
 
#container .lab .sectionIdentifier input {
 
#container .type-lab .sectionIdentifier input,
 
#container .type-ilb .sectionIdentifier input
 
{
 
  display: none;
 
}
 
#container .type-lab .deleteSection input,
 
#container .type-ilb .deleteSection
 
{
 
  display: none;
 
}
 
#container .lab .deleteSection input {
 
  display: none;
 

	
 
#container .section.type-lab td,
 
#container .section.type-ilb td
 
{
 
  background: #96acc4;
 
}
 
#container .type-lab .deleteSection:before
 
{
 
  content: "LAB";
 
}
 
#container .type-ilb .deleteSection:before
 
{
 
    content: "ILB";
 
}
 
CSS;
 
}
scripts/scheduleInput.js
Show inline comments
 
@@ -125,8 +125,13 @@ function add_section_n(cnum, name, synon
 
    var cssclasses = 'section class' + cnum + ' ' + safe_css_class('slot-' + slot);
 
    var last_tr;
 

	
 
    if(type == 'lab')
 
	cssclasses += ' lab';
 
	/*
 
	 * Add the type of the course to the CSS if it's a valid (and
 
	 * _clean-looking_ CSS class). Supports things like Cedarville's
 
	 * coloration of labs/ILB.
 
	 */
 
	if (/[a-z-]+/.exec(type) != null)
 
		cssclasses += ' type-' + type;
 

	
 
    var section_html = '<tr id="tr-section-' + String(snum) + '" class="' + cssclasses + '"><td class="none"></td>' +
 
	'<td class="sectionIdentifier center"><input type="text" size="1" class="required section-letter-entry" name="postData[' + cnum + '][' + snum + '][letter]" />' + 
styles/general.css
Show inline comments
 
@@ -138,18 +138,12 @@ a:hover {
 
#container .section:nth-child(odd) td {
 
  background: #CCC;
 
}
 
#container .section.lab td {
 
  background: #96acc4;
 
}
 
#container .none {
 
  background: none!important; 
 
}
 
#container .emptyCell, .removeCell {
 
  background: none!important; 
 
}
 
#container .lab .deleteSection:before {
 
  content: "LAB";
 
}
 

	
 
/* Input Formatting */
 

	
0 comments (0 inline, 0 general)