web: add bootstrap checkbox function

This commit is contained in:
David Anderson 2017-01-23 21:37:30 -08:00
parent 805ce04546
commit b3995e20c0
3 changed files with 25 additions and 12 deletions

View File

@ -99,7 +99,7 @@ function platform_icons($f) {
$x .= "<img hspace=$hs height=$ht src=images/mac.jpg title=\"Supports Mac OS X\">";
}
if ($f->linux) {
$x .= "<img hspace=$hs height=$ht src=images/linux.jpg title=\"Supports Linux\">";
$x .= "<img hspace=$hs height=$ht src=images/linux.jpg title=\"Supports Linux on Intel\">";
}
if ($f->android) {
$x .= "<img hspace=$hs height=$ht src=images/android.png title=\"Supports Android\">";
@ -108,7 +108,7 @@ function platform_icons($f) {
$x .= "<img hspace=$hs height=$ht src=images/freebsd.png title=\"Supports FreeBSD\">";
}
if ($f->rasp_pi) {
$x .= "<img hspace=$hs height=$ht src=images/raspberry-pi.jpg title=\"Supports Raspberry Pi\">";
$x .= "<img hspace=$hs height=$ht src=images/linux_arm.png title=\"Supports Linux on ARM (e.g. Raspberry Pi)\">";
}
if ($f->nvidia_gpu) {
$x .= "<img hspace=$hs height=$ht src=images/nvidia.jpg title=\"Supports NVIDIA GPUs\">";
@ -138,6 +138,8 @@ function valid($url, $plat) {
if (strstr($url, "gpugrid.net")) {
if (strstr($plat, "android")) return false;
if (strstr($plat, "vbox")) return false;
} else if (strstr($url, "csgrid")) {
if (strstr($plat, "android")) return false;
}
return true;
}

View File

@ -179,16 +179,16 @@ $biomed = array(
"",
"Study evolution using genetics"
),
array(
"Malariacontrol.net",
"http://www.malariacontrol.net/",
tra("The Swiss Tropical Institute"),
tra("Epidemiology"),
tra("Simulation models of the transmission dynamics and health effects of malaria are an important tool for malaria control. They can be used to determine optimal strategies for delivering mosquito nets, chemotherapy, or new vaccines which are currently under development and testing. Such modeling is extremely computer intensive, requiring simulations of large human populations with a diverse set of parameters related to biological and social factors that influence the distribution of the disease. "),
"africaathome.gif",
"",
"Study the spread of malaria"
),
// array(
// "Malariacontrol.net",
// "http://www.malariacontrol.net/",
// tra("The Swiss Tropical Institute"),
// tra("Epidemiology"),
// tra("Simulation models of the transmission dynamics and health effects of malaria are an important tool for malaria control. They can be used to determine optimal strategies for delivering mosquito nets, chemotherapy, or new vaccines which are currently under development and testing. Such modeling is extremely computer intensive, requiring simulations of large human populations with a diverse set of parameters related to biological and social factors that influence the distribution of the disease. "),
// "africaathome.gif",
// "",
// "Study the spread of malaria"
// ),
// array(
// "Tanpaku",
// "http://issofty17.is.noda.tus.ac.jp/",

View File

@ -272,6 +272,7 @@ function grid($top_func, $left_func, $right_func, $left_width=6) {
function form_start($action) {
echo '
<div class="container">
<form class="form-horizontal" method="get" action="'.$action.'">
';
}
@ -283,6 +284,7 @@ function form_input_hidden($name, $value) {
function form_end() {
echo '</form>
</div>
';
}
@ -351,3 +353,12 @@ function form_submit($text) {
</div>
';
}
function form_checkbox($label, $name, $checked=false) {
echo sprintf('
<div class="form-group">
<input type="checkbox" name="%s" %s> &nbsp; <span class="lead">%s</span>
</div>
', $name, $checked?"checked":"", $label
);
}