Skip to content
Snippets Groups Projects
Commit 76377958 authored by Tim Steiner's avatar Tim Steiner
Browse files

Various updates to public-view, made comment icons clickable.

parent 4289ed20
No related branches found
No related tags found
No related merge requests found
Showing
with 66 additions and 160 deletions
......@@ -398,6 +398,9 @@ class Courses_PublicViewController extends App_Controller_Action {
$offerings = Courses_ScheduleModel::fetchForCourses($course);
$controllerSession = new Zend_Session_Namespace(__CLASS__);
$this->view->recentSearchCriteria = $controllerSession->recentSearchCriteria;
$session = new Zend_Session_Namespace(__CLASS__ . __METHOD__);
// sort offerings
......
<?php $this->headLink()->appendStylesheet($this->baseUrl() . '/css/courses/public-view/results.css', 'all'); ?>
<?php $this->headScript()->appendFile($this->baseUrl() . '/javascript/courses/public-view/results.js'); ?>
<?php $this->layout()->breadcrumbs = array('Curriculum Search'); ?>
<?php $this->layout()->tagline = 'Curriculum Search'; ?>
<?php $this->layout()->hideMenu = true; ?>
......
......@@ -2,7 +2,7 @@
<?php $this->headScript()->appendFile($this->baseUrl() . '/javascript/courses/public-view/search-box.js'); ?>
<div class="helpText">
Begin your search by entering or selecting information in at least<br /> on of the following fields:
Begin your search by entering or selecting information in at least<br /> one of the following fields:
</div>
<?php if (!$this->searchBoxFull) { ?>
......
<?php $this->headLink()->appendStylesheet($this->baseUrl() . '/css/courses/public-view/search.css', 'all'); ?>
<?php $this->headScript()->appendFile($this->baseUrl() . '/javascript/courses/public-view/search.js'); ?>
<?php $this->layout()->breadcrumbs = array('Curriculum Search'); ?>
<?php $this->layout()->tagline = 'Curriculum Search'; ?>
<?php $this->layout()->hideMenu = true; ?>
......
......@@ -8,8 +8,10 @@
<div id="printAndBackButtons">
<button id="printButton">Print</button><br />
<button id="backToResultsButton">Back to Results</button><br />
<button id="returnToHistoryButton">Back to Request History</button>
<?php if ($this->recentSearchCriteria) { ?>
<button id="backToResultsButton" rel="<?php echo $this->url(array_merge($this->recentSearchCriteria, array('module' => 'courses', 'controller' => 'public-view', 'action' => 'search')), null, true); ?>">Search Results</button><br />
<?php } ?>
<button id="returnToHistoryButton">Request History</button>
</div>
<div id="courseDescription">
......
......@@ -203,7 +203,9 @@
}
if ($newCommentCount > 0) {
?>
<img src="<?php echo $this->baseUrl(); ?>/images/requests/commentIcon.png" alt="comments" />
<a class="requestLink<?php echo $linkClass; ?>" href="<?php echo $this->baseUrl(); ?>/requests/view/index/id/<?php echo $request->getId(); ?>">
<img src="<?php echo $this->baseUrl(); ?>/images/requests/commentIcon.png" alt="comments" />
</a>
<?php
echo $newCommentCount;
}
......@@ -353,7 +355,10 @@ foreach($this->roles as $roleData) {
}
if ($newCommentCount > 0) {
?>
<img src="<?php echo $this->baseUrl(); ?>/images/requests/commentIcon.png" alt="comments" />
<a class="requestLink<?php echo $linkClass; ?>"
href="<?php echo $this->baseUrl(); ?>/requests/view/index/id/<?php echo $request->getId(); ?>/role/<?php echo $role->getId(); ?>/list/normal">
<img src="<?php echo $this->baseUrl(); ?>/images/requests/commentIcon.png" alt="comments" />
</a>
<?php
echo $newCommentCount;
}
......@@ -435,7 +440,9 @@ foreach($this->roles as $roleData) {
}
if ($newCommentCount > 0) {
?>
<img src="<?php echo $this->baseUrl(); ?>/images/requests/commentIcon.png" alt="comments" />
<a class="requestLink<?php echo $linkClass; ?>" href="<?php echo $this->baseUrl(); ?>/requests/view/index/id/<?php echo $request->getId(); ?>/role/<?php echo $role->getId(); ?>/list/watching">
<img src="<?php echo $this->baseUrl(); ?>/images/requests/commentIcon.png" alt="comments" />
</a>
<?php
echo $newCommentCount;
}
......
......@@ -7,7 +7,6 @@
#instructions {display: none;}
}
#results table {color: #a00; text-align: center;}
#results table th {background-color: #aaa; padding: 0.3em 0.5em; white-space: nowrap;}
#results table tr.even {background-color: #ddd;}
#results table td {padding: 0.5em 0.5em;}
......
......@@ -18,7 +18,7 @@
#searchFormSmall #activity {width: 100px;}
#courseLetter {width: 45px;}
#aceOutcomes {height: 4em; vertical-align: top;}
#submit {height: 25px; padding: 0px 1em; color: #fff; font-size: 14px; background-image: url(../../../images/redBlackGrad.png); border: 1px solid #000; border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; margin: 0px auto; display: block;}
#submit {height: 25px; padding: 0px 1em; color: #fff; font-size: 14px; background-image: url(../../../images/redBlackGrad.png); border: 1px solid #000; border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; margin: 1em auto; display: block;}
#reset {display: block; margin: 0.5em auto; color: #c00; border: 0px solid #000; background-color: transparent; }
......
addLoadEvent(onLoadPublicViewSearch);
function onLoadPublicViewSearch()
{
if (document.getElementById('refineSearchLink')) {
document.getElementById('refineSearchLink').onclick = handleRefineSearchLinkClick;
}
document.getElementById('college').onchange = handleChangeSelectHierarchy;
document.getElementById('department').onchange = handleChangeSelectHierarchy;
handleChangeSelectHierarchy();
if (document.getElementById('printButton')) {
document.getElementById('printButton').onclick = function() {
window.print();
};
}
var helpLinks = getElementsByClassName('hoverHelp');
for (var i = 0; i < helpLinks.length; i++) {
helpLinks[i].onmouseover = displayHoverHelp;
helpLinks[i].onmouseout = hideHoverHelp;
helpLinks[i].onclick = function() {return false;};
}
document.getElementById('ace').onclick = function() {
document.getElementById('aceOutcomes').disabled = !this.checked;
var options = document.getElementById('aceOutcomes').getElementsByTagName('option');
for (var i = 0; i < options.length; i++) {
options[i].selected = this.checked;
}
document.getElementById('aceOutcomes').focus();
}
}
function handleRefineSearchLinkClick()
{
document.getElementById('searchSummary').style.display = 'none';
document.getElementById('searchForm').style.display = '';
}
function handleChangeSelectHierarchy()
{
var collegeSelect = document.getElementById('college');
var departmentSelect = document.getElementById('department');
var subjectSelect = document.getElementById('subject');
var selectedCollegeId = collegeSelect.options[collegeSelect.selectedIndex].value;
var options = departmentSelect.getElementsByTagName('option');
for (var i = options.length - 1; i >= 0; i--) {
if (options[i].getAttribute('rel') == selectedCollegeId || collegeSelect.value == 0 || options[i].value == 0) {
options[i].style.display = '';
} else {
options[i].style.display = 'none';
}
}
var selectedDepartment = departmentSelect.options[departmentSelect.selectedIndex];
if (selectedDepartment.style.display == 'none') {
departmentSelect.selectedIndex = 0;
}
var selectedDepartments = new Array();
if (departmentSelect.selectedIndex == 0) {
var options = departmentSelect.getElementsByTagName('option');
for (var i = options.length - 1; i >= 0; i--) {
if (options[i].style.display == 'none') {
continue;
}
selectedDepartments.push(options[i].value);
}
} else {
selectedDepartments.push(departmentSelect.options[departmentSelect.selectedIndex].value);
}
options = subjectSelect.getElementsByTagName('option');
for (var i = options.length - 1; i >= 0; i--) {
if (selectedDepartments.inArray(options[i].getAttribute('rel')) || options[i].value == 0) {
options[i].style.display = '';
} else {
options[i].style.display = 'none';
}
}
var selectedSubject = subjectSelect.options[subjectSelect.selectedIndex];
if (selectedSubject.style.display == 'none') {
subjectSelect.selectedIndex = 0;
}
}
function displayHoverHelp(e)
{
e = e || window.event;
var cursor = {x:0, y:0};
if (e.pageX || e.pageY) {
cursor.x = e.pageX;
cursor.y = e.pageY;
}
else {
cursor.x = e.clientX +
(document.documentElement.scrollLeft || document.body.scrollLeft) -
(document.documentElement.clientLeft || document.body.clientLeft);
cursor.y = e.clientY +
(document.documentElement.scrollTop || document.body.scrollTop) -
(document.documentElement.clientTop || document.body.clientTop);
}
var helpDiv, helpText;
if(!document.getElementById('floating_help_text_div')) {
helpDiv = document.createElement('div');
helpDiv.style.display = 'none';
helpDiv.id = 'floating_help_text_div';
helpText = document.createTextNode('');
helpDiv.style.position = 'absolute';
helpDiv.appendChild(helpText);
document.body.appendChild(helpDiv);
} else {
helpDiv = document.getElementById('floating_help_text_div');
}
if(getElementsByClassName('hoverHelpText', this, 'span')[0].childNodes[0]) {
helpDiv.childNodes[0].data = getElementsByClassName('hoverHelpText', this, 'span')[0].childNodes[0].data;
helpDiv.style.borderWidth = '1px';
if(document.body.clientWidth - cursor.x < cursor.x) {
helpDiv.style.left = '';
helpDiv.style.right = (document.body.clientWidth - cursor.x + 5) + 'px';
} else {
helpDiv.style.left = (cursor.x + 5) + 'px';
helpDiv.style.right = '';
}
helpDiv.style.top = (cursor.y + 5) + 'px';
helpDiv.style.display = 'block';
}
}
function hideHoverHelp()
{
if(document.getElementById('floating_help_text_div')) {
document.getElementById('floating_help_text_div').style.display = 'none';
}
}
......@@ -2,13 +2,9 @@ addLoadEvent(onLoadPublicView);
function onLoadPublicView()
{
if (document.getElementById('refineSearchLink')) {
document.getElementById('refineSearchLink').onclick = function() {
location.href = document.getElementById('refineSearchLink').getAttribute("rel");
};
if (document.getElementById('backToResultsButton')) {
document.getElementById('backToResultsButton').onclick = function() {
history.go(-1);
location.href = document.getElementById('backToResultsButton').getAttribute("rel");
};
}
......
......@@ -346,6 +346,49 @@ Array.prototype.inArray = function (value)
/* Code for the following function borrowed from http://www.electrictoolbox.com/javascript-clear-form/ */
function clearForm(ele) {
tags = ele.getElementsByTagName('input');
for(i = 0; i < tags.length; i++) {
switch(tags[i].type) {
case 'password':
case 'text':
tags[i].value = '';
break;
case 'checkbox':
case 'radio':
tags[i].checked = false;
break;
}
}
tags = ele.getElementsByTagName('select');
for(i = 0; i < tags.length; i++) {
if(tags[i].type == 'select-one') {
tags[i].selectedIndex = 0;
}
else {
for(j = 0; j < tags[i].options.length; j++) {
tags[i].options[j].selected = false;
}
}
}
tags = ele.getElementsByTagName('textarea');
for(i = 0; i < tags.length; i++) {
tags[i].value = '';
}
}
/* End borrowed code */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment