From 81d82b13077a5a5473abc0cfad11c044d0836f66 Mon Sep 17 00:00:00 2001 From: Barry Luong Date: Tue, 13 Aug 2002 22:35:12 +0000 Subject: [PATCH] edited the preferences page svn path=/trunk/boinc/; revision=315 --- html/user/db_name | 2 +- html/user/prefs.inc | 78 ++++++++++++++++++------------ html/user/prefs.php | 31 ++++++------ html/user/prefs_delete_project.php | 2 +- html/user/prefs_edit_disk_form.php | 2 +- html/user/prefs_edit_projects.php | 2 +- html/user/prefs_edit_work_form.php | 2 +- html/user/team.inc | 12 ++--- 8 files changed, 73 insertions(+), 58 deletions(-) diff --git a/html/user/db_name b/html/user/db_name index 158deb63ab..046de4dba2 100644 --- a/html/user/db_name +++ b/html/user/db_name @@ -1 +1 @@ -boinc_cecile +boinc_barry diff --git a/html/user/prefs.inc b/html/user/prefs.inc index d4c14a0b93..6d1948eee9 100644 --- a/html/user/prefs.inc +++ b/html/user/prefs.inc @@ -150,55 +150,70 @@ function prefs_parse($prefs_xml) { // Functions to display preference subsets, with Edit buttons // function prefs_show_work($prefs) { - echo "

Work preferences

\n"; + + echo "

"; + echo TABLE2."\n"; + echo "".TD2.LG_FONT."Work preferences:\n"; if ($prefs->dont_run_on_batteries) { - echo "
Don't do work if running on batteries"; + $batteries = "No"; } else { - echo "
Do work even if running on batteries"; + $batteries = "Yes"; } if ($prefs->dont_run_if_user_active) { - echo "
Don't do work if computers is in use"; + $in_use = "No"; } else { - echo "
Do work even if computer is in user"; + $in_use = "Yes"; } if ($prefs->confirm_before_connecting) { - echo "
Confirm before connecting to network"; + $confirm = "Yes"; } else { - echo "
Don't confirm before connecting to network"; + $confirm = "No"; } - echo "
Buffer at least $prefs->low_water_days hours of work\n"; - echo "
Buffer at most $prefs->high_water_days hours of work\n"; - echo "
Edit work preferences\n"; + row("Work if on batteries: ", $batteries); + row("Work if in use: ", $in_use); + row("Confirm before connecting to network: ", $confirm); + row("Minimum amount of work to buffer: ", "$prefs->low_water_days hours"); + row("Maximum amount of work to buffer: ", "$prefs->high_water_days hours"); + echo "Edit work preferences\n"; + echo "\n"; } function prefs_show_disk($prefs) { - echo "

Disk preferences

\n"; - echo "
Maximum disk used: $prefs->disk_max_used_gb GB\n"; - echo "
Minimum disk free: $prefs->disk_min_free_gb GB\n"; - echo "
Maximum % of disk used: $prefs->disk_max_used_pct\n"; - echo "
Edit disk preferences\n"; + + echo "

"; + echo TABLE2."\n"; + echo "".TD2.LG_FONT."Disk preferences:\n"; + row("Maximum disk space allowed to be used: ", "$prefs->disk_max_used_gb GB"); + row("Minimum disk space to leave free: ", "$prefs->disk_min_free_gb GB"); + row("Maximum % of disk allowed to used: ", "$prefs->disk_max_used_pct %"); + echo "Edit disk preferences\n"; + echo "\n"; } function prefs_show_project($project) { - echo "
master_url: $project->master_url"; - echo "
email_addr: $project->email_addr"; - echo "
authenticator: $project->authenticator"; - echo "
resource_share: $project->resource_share"; - echo "
project_specific: ".htmlspecialchars($project->project_specific); + echo "


"; + row("Master URL: ", "$project->master_url"); + row("Email Address: ", $project->email_addr); + row("Authenticator: ", $project->authenticator); + row("Resource Share: ", $project->resource_share); + row("Project Specific: ", htmlspecialchars($project->project_specific)); } function prefs_show_projects($prefs) { - echo "

Project preferences

\n"; + + echo "

"; + echo TABLE2."\n"; + echo "".TD2.LG_FONT."Project preferences:\n"; for ($i=0; $iprojects); $i++) { $project = $prefs->projects[$i]; prefs_show_project($project); - echo "

\n"; } - echo "
Edit project preferences\n"; + echo "


"; + echo "Edit project preferences\n"; + echo ""; } function print_prefs_display($prefs) { - echo "

Preferences

\n"; prefs_show_work($prefs); prefs_show_disk($prefs); prefs_show_projects($prefs); @@ -212,15 +227,15 @@ function prefs_form_work($user, $prefs) { echo "
\n"; echo " \n"; echo " \n"; - echo " \n"; + echo " \n"; printf(" \n", $prefs->dont_run_on_batteries?"checked":""); echo " \n"; echo " \n"; - echo " \n"; + echo " \n"; printf(" \n", $prefs->dont_run_if_user_active?"checked":""); echo " \n"; echo " \n"; - echo " \n"; + echo " \n"; printf(" \n", $prefs->confirm_before_connecting?"checked":""); echo " \n"; echo " \n"; @@ -259,12 +274,13 @@ function prefs_form_disk($user, $prefs) { function prefs_form_projects($prefs) { for ($i=0; $iprojects); $i++) { $project = $prefs->projects[$i]; - echo "
\n"; + echo "
don't run if on batteriesDon't run if on batteries
don't run if user is activeDon't run if user is active
confirm before connectingConfirm before connecting
"; prefs_show_project($project); - echo "
master_url>Delete this project\n"; - echo "
master_url>Edit this project\n"; + echo "\n"; + echo "\n"; + echo "
master_url>Edit project
master_url>Delete project
"; } - echo "
Add a project\n"; + echo "
Add project\n"; echo "
"; } diff --git a/html/user/prefs.php b/html/user/prefs.php index 8afa0885bc..232fff7e0d 100644 --- a/html/user/prefs.php +++ b/html/user/prefs.php @@ -1,21 +1,20 @@ prefs); - print_prefs_display($prefs); -} else { - //show_login($user); - print_login_form(); -} -echo "

\n"; -page_tail(); + $user = get_user_from_cookie(); + if ($user) { + page_head("Preferences"); + $prefs = prefs_parse($user->prefs); + print_prefs_display($prefs); + } else { + print_login_form(); + } + echo "

\n"; + page_tail(); ?> diff --git a/html/user/prefs_delete_project.php b/html/user/prefs_delete_project.php index edd0a62323..7e8882ed28 100644 --- a/html/user/prefs_delete_project.php +++ b/html/user/prefs_delete_project.php @@ -20,7 +20,7 @@ if ($user == NULL) { echo "Project $master_url deleted"; prefs_form_projects($prefs); echo "
"; - echo "Preferences\n"; + echo "Back to preferences\n"; } echo "

\n"; page_tail(); diff --git a/html/user/prefs_edit_disk_form.php b/html/user/prefs_edit_disk_form.php index fb56ede373..25ca0762da 100644 --- a/html/user/prefs_edit_disk_form.php +++ b/html/user/prefs_edit_disk_form.php @@ -14,7 +14,7 @@ if ($user == NULL) { page_head("Edit Disk Preferences"); $prefs = prefs_parse($user->prefs); prefs_form_disk($user, $prefs); - echo "Preferences\n"; + echo "Back to preferences\n"; } echo "

\n"; page_tail(); diff --git a/html/user/prefs_edit_projects.php b/html/user/prefs_edit_projects.php index 50414a96b4..ad7234971f 100644 --- a/html/user/prefs_edit_projects.php +++ b/html/user/prefs_edit_projects.php @@ -15,7 +15,7 @@ if ($user == NULL) { $prefs = prefs_parse($user->prefs); prefs_form_projects($prefs); echo "
"; - echo "Preferences\n"; + echo "Back to preferences\n"; } echo "

\n"; page_tail(); diff --git a/html/user/prefs_edit_work_form.php b/html/user/prefs_edit_work_form.php index 224ebd28ec..f6fdc99597 100644 --- a/html/user/prefs_edit_work_form.php +++ b/html/user/prefs_edit_work_form.php @@ -14,7 +14,7 @@ if ($user == NULL) { page_head("Edit Work Preferences"); $prefs = prefs_parse($user->prefs); prefs_form_work($user, $prefs); - echo "Preferences\n"; + echo "Back to preferences\n"; } echo "

\n"; page_tail(); diff --git a/html/user/team.inc b/html/user/team.inc index dc31032d20..2948fd067d 100644 --- a/html/user/team.inc +++ b/html/user/team.inc @@ -50,12 +50,12 @@ if ($team->name_html != null) { echo "$team->name_html"; } echo "

"; -echo "id>Join | "; -echo "id>Quit | "; -echo "id>Edit* | "; -echo "id>Remove Inactive Members* | "; -echo "id>Disband Team* | "; -echo "id>View Team Emails*"; +echo "[id>Join] "; +echo "[id>Quit] "; +echo "[id>Edit*] "; +echo "[id>Remove Inactive Members*] "; +echo "[id>Disband Team*] "; +echo "[id>View Team Emails*]"; echo "
* Team founder only"; echo "