From 107b170ae1b0b97f85bce9a32375b6c84acfe746 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Fri, 2 Dec 2016 23:25:01 -0800 Subject: [PATCH] web: finish job of making headings blue in striped tables i.e. use row_heading() or row_heading_array() to generate the heading --- html/inc/host.inc | 60 +++++++++---------- html/inc/prefs.inc | 3 +- html/inc/prefs_project.inc | 12 ++-- html/inc/result.inc | 41 ++++++------- html/inc/team.inc | 29 ++++----- html/inc/util.inc | 3 +- html/ops/update_profile_pages.php | 8 +-- .../project.sample/project_specific_prefs.inc | 2 +- html/user/custom_dark.css | 8 ++- html/user/top_users.php | 28 ++++----- 10 files changed, 89 insertions(+), 105 deletions(-) diff --git a/html/inc/host.inc b/html/inc/host.inc index 4f33c401f1..c9dd02155f 100644 --- a/html/inc/host.inc +++ b/html/inc/host.inc @@ -216,28 +216,23 @@ function top_host_table_start($sort_by) { global $host_sites; shuffle($host_sites); start_table('table-striped'); - echo ""; - echo "".tra("Computer info")."\n"; - echo "".tra("Rank").""; - echo "".tra("Owner")."\n"; + $x = array( + tra("Computer info"), + tra("Rank"), + tra("Owner"), + ); if ($sort_by == 'total_credit') { - echo " - ".tra("Avg. credit")." - ".tra("Total credit")." - "; + $x[] = "".tra("Avg. credit").""; + $x[] = tra("Total credit"); } else { - echo " - ".tra("Recent average credit")." - ".tra("Total credit")." - "; + $x[] = tra("Recent average credit"); + $x[] = "".tra("Total credit").""; } - echo " - ".tra("BOINC version")." - ".tra("CPU")." - ".tra("GPU")." - ".tra("Operating system")." - - "; + $x[] = tra("BOINC version"); + $x[] = tra("CPU"); + $x[] = tra("GPU"); + $x[] = tra("Operating system"); + row_heading_array($x); } function host_nresults($host) { @@ -668,32 +663,33 @@ function user_host_table_start( $private, $sort, $rev, $show_all, $any_product_name ) { start_table('table-striped'); - echo ""; + $x = array(); $url = link_url_rev($sort, "id", $rev, $show_all); - echo "".tra("Computer ID")."\n"; + $x[] = "".tra("Computer ID").""; if ($private) { $url = link_url_rev($sort, "name", $rev, $show_all); - echo "".tra("Name")."\n"; + $x[] = "".tra("Name").""; $url = link_url_rev($sort, "venue", $rev, $show_all); if ($any_product_name) { - echo "Model\n"; + $x[] = tra("Model"); } - echo "".tra("Location")."\n"; + $x[] = "".tra("Location").""; } else { - echo "".tra("Rank").""; + $x[] = tra("Rank"); } $url = link_url_rev($sort, "expavg_credit", $rev, $show_all); - echo "".tra("Avg. credit")."\n"; + $x[] = "".tra("Avg. credit").""; $url = link_url_rev($sort, "total_credit", $rev, $show_all); - echo "".tra("Total credit")."\n"; - echo "".tra("BOINC
version")."\n"; + $x[] = "".tra("Total credit").""; + $x[] = tra("BOINC
version"); $url = link_url_rev($sort, "cpu", $rev, $show_all); - echo "".tra("CPU")."\n"; - echo "".tra("GPU")."\n"; + $x[] = "".tra("CPU").""; + $x[] = tra("GPU"); $url = link_url_rev($sort, "os", $rev, $show_all); - echo "".tra("Operating System")."\n"; + $x[] = "".tra("Operating System").""; $url = link_url_rev($sort, "rpc_time", $rev, $show_all); - echo "".tra("Last contact")."\n"; + $x[] = "".tra("Last contact").""; + row_heading_array($x); } function show_user_hosts($userid, $private, $show_all, $sort, $rev) { diff --git a/html/inc/prefs.inc b/html/inc/prefs.inc index c5e9bd90f0..1ceb33beb2 100644 --- a/html/inc/prefs.inc +++ b/html/inc/prefs.inc @@ -490,9 +490,8 @@ function prefs_display_venue($prefs, $venue, $subset) { if (isset($prefs->$venue)) $x = $prefs->$venue; if ($x) { - echo "

".tra("Separate preferences for %1", $venue)."

"; - echo ""; start_table(); + row_heading(tra("Separate preferences for %1", $venue)); if ($subset == "global") { prefs_show_global($x); } else { diff --git a/html/inc/prefs_project.inc b/html/inc/prefs_project.inc index a033d27d43..be599fdd51 100644 --- a/html/inc/prefs_project.inc +++ b/html/inc/prefs_project.inc @@ -113,9 +113,9 @@ if (project_has_beta()) { ); } if (defined("EMAIL_FROM")) { - $x = "

" + $x = "
" .tra("Emails will be sent from %1; make sure your spam filter accepts this address.", EMAIL_FROM) - ."

"; + .""; } else { $x = ""; } @@ -271,8 +271,8 @@ function print_prefs_display_project($user, $columns=false) { $switch_link = " ".tra("(Switch View)").""; if ($columns) { - echo "

".tra("Combined preferences").$switch_link."

"; start_table(); + row_heading(tra("Combined preferences").$switch_link); prefs_show_privacy($user, true); venue_show($user); row_top(tra("Project specific settings")); @@ -281,10 +281,10 @@ function print_prefs_display_project($user, $columns=false) { row_links("project", $project_prefs); end_table(); } else { - if (isset($project_prefs->home) || isset($project_prefs->work) || isset($project_prefs->school)) { - echo "

".tra("Primary (default) preferences").$switch_link."

"; - } start_table(); + if (isset($project_prefs->home) || isset($project_prefs->work) || isset($project_prefs->school)) { + row_heading(tra("Primary (default) preferences").$switch_link); + } prefs_show_project($project_prefs, false); prefs_show_privacy($user, false); venue_show($user); diff --git a/html/inc/result.inc b/html/inc/result.inc index ea3a977fa3..ea5c989f7f 100644 --- a/html/inc/result.inc +++ b/html/inc/result.inc @@ -358,46 +358,43 @@ function result_page_url($info) { function result_table_start($show_wu_link, $show_host_link, $info) { start_table('table-striped'); - echo ""; + $x = array(); if ($info) { if ($info->show_names) { $i2 = clone $info; $i2->show_names = 0; $url = result_page_url($i2); - echo "".tra("Task name")."
".tra("click for details")."
".tra("Show IDs")."
\n"; + $x[] = tra("Task name")."
".tra("click for details")."
".tra("Show IDs")."
"; } else { $i2 = clone $info; $i2->show_names = 1; $url = result_page_url($i2); - echo "Task
".tra("click for details")."
".tra("Show names")."
\n"; + $x[] = "Task
".tra("click for details")."
".tra("Show names")."
"; } } else { - echo "".tra("Task")."
".tra("click for details")."\n"; + $x[] = tra("Task")."
".tra("click for details").""; } if ($show_wu_link) { - echo "".tra("Work unit")."
".tra("click for details")."\n"; + $x[] = tra("Work unit")."
".tra("click for details").""; if (function_exists('project_result_info_heading')) { - $x = project_result_info_heading(); - if ($x) { - echo "$x\n"; + $y = project_result_info_heading(); + if ($y) { + $x[] = $y; } } } if ($show_host_link) { - echo "".tra("Computer")."\n"; + $x[] = tra("Computer"); } - echo " - ".tra("Sent")." - ".tra("Time reported
or deadline")." -
".tra("explain")." - - ".tra("Status")." - ".tra("Run time
(sec)")." - ".tra("CPU time
(sec)")." - ".tra("Credit")." - ".tra("Application")." - - "; + $x[] = tra("Sent"); + $x[] = tra("Time reported
or deadline")." +
".tra("explain").""; + $x[] = tra("Status"); + $x[] = tra("Run time
(sec)"); + $x[] = tra("CPU time
(sec)"); + $x[] = tra("Credit"); + $x[] = tra("Application"); + row_heading_array($x); } // was result invalid or timed out? @@ -827,7 +824,7 @@ function result_navigation($info, $where_clause) { } } - $x .= "
".tra("Task name:")."
"; + $x .= '
'.tra("Task name:").'
'; $x .= "
"; return $x; } diff --git a/html/inc/team.inc b/html/inc/team.inc index f86bde15bc..bf631c68a7 100644 --- a/html/inc/team.inc +++ b/html/inc/team.inc @@ -367,27 +367,20 @@ function admin_list($teamid) { } function team_table_start($sort_by, $type_url) { - echo " - ".tra('Rank')." - ".tra('Name')." - ".tra('Members')." - "; + $x = array(); + $x[] = tra('Rank'); + $x[] = tra('Name'); + $x[] = tra('Members'); if ($sort_by == "total_credit") { - echo " - ".tra('Recent average credit')." - ".tra('Total credit')." - "; + $x[] = "".tra('Recent average credit').""; + $x[] = tra('Total credit'); } else { - echo " - ".tra('Recent average credit')." - ".tra('Total credit')." - "; + $x[] = tra('Recent average credit'); + $x[] = "".tra('Total credit').""; } - echo " - ".tra('Country')." - ".tra("Type")." - - "; + $x[] = tra('Country'); + $x[] = tra("Type"); + row_heading_array($x); } function team_links($team) { diff --git a/html/inc/util.inc b/html/inc/util.inc index fea5f946d4..33e716e7c6 100644 --- a/html/inc/util.inc +++ b/html/inc/util.inc @@ -480,7 +480,8 @@ function row_heading_array($x) { } function row_heading($x) { - row_heading_array(array($x)); + echo ''.$x.' + '; } function random_string() { diff --git a/html/ops/update_profile_pages.php b/html/ops/update_profile_pages.php index 0011a74f95..f0f5ccfe2f 100755 --- a/html/ops/update_profile_pages.php +++ b/html/ops/update_profile_pages.php @@ -370,18 +370,18 @@ function build_country_summary_page($countryMembers) { page_head("User Profiles by Country", null, null, "../"); echo "Last updated " . pretty_time_str(time()) . "

"; - echo "\n"; - echo "\n"; + start_table(); + row_heading_array(array("Country", "Profiles")); foreach ($countries as $country) { $numMembers = count($countryMembers[$country]); $name = get_legal_filename($country); echo "\n\n"; + "{$name}_1.html\">$country\n"; } - echo "
CountryProfiles
$country$numMembers$numMembers
"; + end_table(); page_tail(false, "../"); close_output_buffer($filename); diff --git a/html/project.sample/project_specific_prefs.inc b/html/project.sample/project_specific_prefs.inc index 27e9b28ee0..6f2c81e24e 100644 --- a/html/project.sample/project_specific_prefs.inc +++ b/html/project.sample/project_specific_prefs.inc @@ -56,7 +56,7 @@ function option($name, $val) { define('COLOR_DESC', tra('Color scheme for graphics')); // xgettext:no-php-format -define("MAX_GFX_CPU_PCT_DESC", tra("Maximum CPU % for graphics%10 ... 100%2", "

", "

")); +define("MAX_GFX_CPU_PCT_DESC", tra("Maximum CPU % for graphics%10 ... 100%2", "
", "")); define('APP_SELECT_DESC', tra('Run only the selected applications')); define('APP_SELECT_TOOLTIP', tra('Only get tasks for certain applications. Useful to focus on particular applications, or to exclude them.')); define('ACCEPT_ANY_DESC', tra('If no work for selected applications is available, accept work from other applications?')); diff --git a/html/user/custom_dark.css b/html/user/custom_dark.css index 14ba355d3e..234a40c83e 100644 --- a/html/user/custom_dark.css +++ b/html/user/custom_dark.css @@ -14,6 +14,11 @@ table a:hover, .table a:hover, a:hover { text-decoration: underline; } +table a:visited, .table a:visited, a:visited { + color: sandybrown; + text-decoration: underline; +} + .nav.navbar-nav li a { color: white; } @@ -34,7 +39,8 @@ hr { } img.icon { - background-color: gray; + padding: 3px; + background-color: lightgray; } blockquote { diff --git a/html/user/top_users.php b/html/user/top_users.php index 39a29fe435..197b6a5388 100644 --- a/html/user/top_users.php +++ b/html/user/top_users.php @@ -43,27 +43,19 @@ function get_top_participants($offset, $sort_by) { function user_table_start($sort_by) { start_table('table-striped'); - echo " - - ".tra("Rank")." - ".tra("Name")." - "; + $x = array(); + $x[] = tra("Rank"); + $x[] = tra("Name"); if ($sort_by == "total_credit") { - echo " - ".tra("Recent average credit")." - ".tra("Total credit")." - "; + $x[] = "".tra("Recent average credit").""; + $x[] = tra("Total credit"); } else { - echo " - ".tra("Recent average credit")." - ".tra("Total credit")." - "; + $x[] = tra("Recent average credit"); + $x[] = "".tra("Total credit").""; } - echo " - ".tra("Country")." - ".tra("Participant since")." - - "; + $x[] = tra("Country"); + $x[] = tra("Participant since"); + row_heading_array($x); } function show_user_row($user, $i) {