# HG changeset patch # User Nathan Phillip Brink # Date 2013-10-30 01:22:00 # Node ID 143f48e9e1613a57a64ea99143d85fa84bcfa28d # Parent 136360f35050664c32e6a06653adaca6277617c3 Add description blurbs that happen to be picked up by facebook’s link blurb generator, somewhat addresses bug #90. We have per-tab blurbs expanding the sections and a page-wide blurb listing the courses. diff --git a/inc/class.schedule.php b/inc/class.schedule.php --- a/inc/class.schedule.php +++ b/inc/class.schedule.php @@ -592,6 +592,23 @@ class Schedule if ($have_saturday) $dayloop_max = 6; + /* + * Something to describe the whole page to a link-blurb + * generator (like Facebook’s link-sharer), so per-course. + */ + echo '

' . PHP_EOL; + foreach ($this->courses as $course_j => $course) + { + if ($course_j) + echo ';' . PHP_EOL; + $title = $course->title_get(); + echo ' ' . page::entities( + $course->getName() + . (empty($title) ? '' : ': ' . $title)); + } + echo '. There are ' . $this->nPermutations . ' valid permutation' . ($this->nPermutations == 1 ? '' : 's') . ' for these courses.' . PHP_EOL; + echo '

' . PHP_EOL; + echo '
' . PHP_EOL . '
' . PHP_EOL . '

' . PHP_EOL @@ -685,8 +702,37 @@ class Schedule $have_credit_hours = FALSE; echo '

\n"; - - // Beginning of table + + /* + * A description readable by link blurb-generators (like + * facebook’s link sharer) per permutation (so + * section-specific). This gets picked up by the + * blurb-generators because they respect fragments in + * URIs. + */ + echo '

' . PHP_EOL; + foreach ($this->courses as $course_j => $course) + { + foreach ($course as $course_slot) + { + $section = $course_slot->section_get_i($this->storage[$i][$course_j]); + if ($course_j) + echo ';' . PHP_EOL; + $instructors = array(); + foreach ($section as $section_meeting) + if ($instructor = $section_meeting->instructor_get()) + $instructors[$instructor] = TRUE; + $title = $course->title_get(); + echo ' ' . page::entities( + $course->getName() . '-' . $section->getLetter() + . (empty($title) ? '' : ': ' . $title) + . (empty($instructors) ? '' : ' with ' . implode(', ', array_keys($instructors)))); + } + } + echo '.' . PHP_EOL; + echo '

' . PHP_EOL; + + // Beginning of table echo " \n"; // Header row diff --git a/styles/output.css b/styles/output.css --- a/styles/output.css +++ b/styles/output.css @@ -199,6 +199,13 @@ td{ { float: right; } +/* + * For link-blurb generators to read, not humans to directly see. + */ +.sectionList, #courseList +{ + display: none; +} table { border-radius: 5px;