Added teacher interface in olympics

UI touch ups
This commit is contained in:
jacob 2010-10-14 17:51:56 +00:00
parent 4a3ea7dba9
commit 01d70abf74
6 changed files with 48 additions and 11 deletions

View File

@ -311,7 +311,14 @@ if(array_key_exists('users_id', $_SESSION)) {
</div>
<div id="main" class="clear">
<div id="topic-menu">
<?
if($_SESSION['nav']['tertiary']) {
$workAreaStyle = 'style="margin-left:230px;"';
}else{
$topicMenuStyle = 'style="display:none;"';
}
?>
<div id="topic-menu" <?=$topicMenuStyle?>>
<?
$q=mysql_query("SELECT * FROM rolestasks WHERE pid='{$_SESSION['nav']['secondary']}' AND level=2 AND conferencetype='{$conference['type']}' ORDER By ord,task");
echo "<ul class=\"topic-menu sfiab-menu\">";
@ -347,9 +354,12 @@ if(array_key_exists('users_id', $_SESSION)) {
if(!$_SESSION['nav']['secondary']) {
echo "$(\"#division-menu\").hide();\n";
}
if(!$_SESSION['nav']['tertiary']) {
/*
if($_SESSION['nav']['tertiary']) {
echo '$("#work-area").css({"margin-left":"230px"});';
}else{
echo "$(\"#topic-menu\").hide();\n";
}
}*/
?>
});
</script>
@ -389,7 +399,7 @@ if(substr(getcwd(),-6)!="/admin" && substr(getcwd(),-7)!="/config" && substr(get
}
*/
?>
<div id="work-area">
<div id="work-area" <?=$workAreaStyle?>>
<div id="main-title">
<?

View File

@ -1 +1 @@
214
215

17
db/db.update.215.sql Normal file
View File

@ -0,0 +1,17 @@
INSERT INTO `config` (
`var` ,
`val` ,
`category` ,
`type` ,
`type_values` ,
`ord` ,
`description` ,
`year` ,
`conferences_id` ,
`section` ,
`conferencetypes`
)
VALUES (
'teacher_registration_type', 'invite', 'Teacher Registration', 'enum', 'open=Open|invite=Invite', '100', 'The type of Teacher Registration to use', '-1', '-1', 'conference', 'sciencefair,scienceolympics'
);

View File

@ -751,6 +751,10 @@ function user_volunteer_registration_status()
return "open";
}
function user_teacher_registration_status(){
return "open";
}
function user_judge_registration_status()
{
global $config;

View File

@ -214,7 +214,6 @@ function draw_roles(){
<button style="width: 100px;" id="activate_<?=$role?>" <?=$a?> onclick="activate('<?=$role?>');return false;" ><?=i18n("Activate")?></button>
<button style="width: 100px;" id="deactivate_<?=$role?>" <?=$d?> onclick="deactivate('<?=$role?>');return false;" ><?=i18n("Deactivate")?></button>
<button style="width: 100px;" id="remove_<?=$role?>" <?=$d?> onclick="remove('<?=$role?>');return false;" ><?=i18n("Remove")?></button>
<button style="width: 100px;" id="settings_<?=$role?>" <?=$d?> onclick="location.href='user_edit.php?tab=<?=$role?>';return false;" ><?=i18n("Settings")?></button>
</td>
<?php
@ -263,6 +262,10 @@ function draw_signup_form($type){
$welcome_email = false;
break;
*/
case 'teacher':
$reg_open = user_teacher_registration_status();
$reg_mode = $config['teacher_registration_type'];
break;
case 'judge':
$reg_open = user_judge_registration_status();
$reg_mode = $config['judge_registration_type'];
@ -280,20 +283,22 @@ function draw_signup_form($type){
break;
*/
default:
echo "Not handled";
echo "Role type '$type' is not handled";
return;
}
if($reg_open == 'open'){
switch($reg_mode){
case 'open':
echo "\"$reg_mode\" registration is not yet handled";
echo '<p>' . i18n("Registration is open. Please click the 'Register' button if you wish to register.");
echo " &nbsp; <button onclick=\"register('" . $type . "');\">" . i18n('Register') . "</button>";
echo '</p>';
break;
case 'singlepassword':
echo '<p>';
echo i18n("{$roles[$type]['name']} Registration is protected by a password. You must know the <b>{$roles[$type]['name']} Registration Password</b> in order to register for this role. Please contact the committee to obtain the password if you wish to register.");
echo "</p><p>";
echo i18n("{$roles[$type]['name']} Password").":<input type=\"password\" size=\"20\" id=\"{$type}_password\" />";
echo "<button onclick=\"register('" . $type . "');\">Register</button>";
echo "<button onclick=\"register('" . $type . "');\">" . i18n('Register') . "</button>";
echo "</p>";
break;
case 'schoolpassword':

View File

@ -80,6 +80,7 @@ $translations = array(
eval(response);
if(schoolInfo != null){
$('#infobox').html(schoolInfo);
$('#infobox').css({'border':'solid'});
$('#instructions').html("<?=$translations['if_incorrect'];?>");
}else{
$('#instructions').html("<?=$translations['incorrect'];?>");
@ -94,7 +95,7 @@ $translations = array(
// draw the info area
echo "<h4>" . i18n("School Information") . "</h4>";
$currentSchool = $u['schools_id'];
if($currentSchool != null){
if($currentSchool){
echo i18n("You are currently listed as a member of") . "<br/>";
echo '<div id="infobox" style="margin:10px;padding:5px;border:solid;border-width:1px;font-weight:bold">';
$schoolData = mysql_fetch_assoc(mysql_query("SELECT school, address, city, province_code, postalcode, phone FROM schools WHERE id='$currentSchool'"));
@ -102,7 +103,7 @@ if($currentSchool != null){
echo '</div>';
echo '<p id="instructions">' . $translations['if_incorrect'] . "</p>";
}else{
echo '<div id="infobox" style="margin:10px;padding:5px;border:solid;border-width:1px;font-weight:bold"></div>';
echo '<div id="infobox" style="margin:10px;padding:5px;border:none;border-width:1px;font-weight:bold"></div>';
echo '<p id="instructions">' . $translations['not_associated'] . "</p>";
}