web: various appearance tweaks

policy change: when showing lists of name/value pairs in a table,
don't show the names with a different background color or font.
This is what Edward Tufte would call "noise".
Keep the visuals as simple as possible.
This commit is contained in:
David Anderson 2016-12-19 01:15:48 -08:00
parent 3410015b00
commit cb5668a0d8
8 changed files with 27 additions and 25 deletions

View File

@ -57,7 +57,8 @@ function location_form($host) {
<option value=work $w>".tra("Work")."
<option value=school $s>".tra("School")."
</select>
<input class=\"btn btn-primary\" type=submit value=".tra("Update").">
<p></p>
<input class=\"btn btn-primary btn-sm\" type=submit value=\"".tra("Update location")."\">
</form>
";
return $x;
@ -201,7 +202,7 @@ function show_host($host, $user, $ipprivate) {
} else {
$x = "";
}
row2(tra("Merge duplicate records of this computer"), "<a href=host_edit_form.php?hostid=$host->id>".tra("Merge")."</a> $x");
row2(tra("Merge duplicate records of this computer"), "<a class=\"btn btn-primary btn-sm\" href=host_edit_form.php?hostid=$host->id>".tra("Merge")."</a> $x");
} else {
row2(tra("Number of times client has contacted server"), $host->rpc_seqno);
row2(tra("Last contact"), date_str($host->rpc_time));

View File

@ -565,7 +565,7 @@ function print_prefs_form(
$script = "prefs_edit.php";
$submit_value = tra("Update preferences");
}
echo "<form action=$script><input type=hidden name=subset value=$subset>
echo "<form class=\"form-inline\" action=$script><input type=hidden name=subset value=$subset>
".form_tokens($user->authenticator);
if ($venue) {
echo "<input type=hidden name=venue value=$venue>\n";

View File

@ -69,7 +69,7 @@ abstract class PREF {
function show_cols($prefs) {
global $venues;
$this->tooltip_tr();
echo "<td class=\"text-right active\">$this->desc</td>";
echo "<td class=\"text-right \">$this->desc</td>";
$tag = $this->tag;
if (isset($prefs->$tag)) {
$this->show_value($prefs);
@ -90,7 +90,7 @@ abstract class PREF {
//
function show($prefs) {
$this->tooltip_tr();
echo "<td class=\"text-right active\">$this->desc</td>";
echo "<td class=\"text-right \">$this->desc</td>";
$tag = $this->tag;
if (isset($prefs->$tag)) {
$this->show_value($prefs);
@ -206,8 +206,8 @@ class NUM_SPEC {
}
}
if ($disabled) $v = "";
$i = $id?"id=$id":"";
return "<input type=text size=5 name=$tag value='$v' $disabled $i>$this->suffix ";
$i = $id?"id=\"$id\"":"";
return '<input type="text" size="5" class="form-control input-sm" name="'.$tag.' value="'.$v."\" $disabled $i> &nbsp; $this->suffix ";
}
function form_convert($in, &$out, &$error) {
$error = false;
@ -332,7 +332,7 @@ class PREF_OPT_NUM extends PREF {
$c = $val?"checked":"";
$d = $val?"":"disabled";
echo "<td $attrs>"
."<input type=checkbox id=$checkbox_id onClick=\"checkbox_clicked('$checkbox_id', '$text_id', $default)\" $c> "
."<input type=checkbox id=$checkbox_id onClick=\"checkbox_clicked('$checkbox_id', '$text_id', $default)\" $c> &nbsp;"
.$this->num_spec->form_str($tag, $prefs->$tag, $had_error, $d, $text_id)
."</td>
";
@ -442,12 +442,12 @@ class PREF_NUM2 extends PREF {
function hour_select($x, $name, $id, $d) {
$s = "";
$s = $s. "<select class=\"form-control\" name=$name id=$id $d>\n";
$s .= "<select class=\"selectbox form-control input-sm\" name=$name id=$id $d>\n";
for ($i=0; $i<24; $i++) {
$sel = ($x == $i)?"selected":"";
$s = $s."<option value=$i $sel> $i:00";
$s .= "<option value=$i $sel> $i:00";
}
$s = $s."</select>\n";
$s .= "</select>\n";
return $s;
}
@ -487,12 +487,12 @@ class PREF_HOUR_RANGE extends PREF {
$d = "";
}
echo "<td ".VALUE_ATTRS.">"
."<input type=checkbox id=$checkbox_id onClick=\"checkbox_clicked2('$checkbox_id', '$t1_id', '$t2_id', 0, 23)\" $c> "
."<input type=checkbox id=$checkbox_id onClick=\"checkbox_clicked2('$checkbox_id', '$t1_id', '$t2_id', 0, 23)\" $c> &nbsp; "
.hour_select($prefs->$tag, $tag, $t1_id, $d)
." "
." &nbsp; "
.tra("and")
." "
." &nbsp; "
.hour_select($prefs->$tag2, $tag2, $t2_id, $d)
."
";
@ -614,7 +614,7 @@ function row_links($subset, $prefs) {
$schl = isset($prefs->school) ? $pre_edit."school".$post_edit : $pre_add."school".$post_add;
$wrk = isset($prefs->work) ? $pre_edit."work".$post_edit : $pre_add."work".$post_add;
echo "<tr><td class=\"text-right active\"> </td>";
echo "<tr><td class=\"text-right \"> </td>";
echo "<td>$gen</td>";
echo "<td>$hom</td>";
echo "<td>$schl</td>";
@ -625,7 +625,7 @@ function row_links($subset, $prefs) {
$schl = isset($prefs->school) ? $pre_remove."school".$post_remove : "<br>";
$wrk = isset($prefs->work) ? $pre_remove."work".$post_remove : "<br>";
echo "<tr><td class=\"text-right active\"> </td>";
echo "<tr><td class=\"text-right \"> </td>";
echo "<td> </td>";
echo "<td>$hom</td>";
echo "<td>$schl</td>";

View File

@ -431,7 +431,7 @@ function row1($x, $ncols=2, $class="heading") {
}
}
define('NAME_ATTRS', 'class="text-right active" style="padding-right:12px"');
define('NAME_ATTRS', 'class="text-right " style="padding-right:12px"');
define('VALUE_ATTRS', 'style="padding-left:12px"');
define('VALUE_ATTRS_ERR', 'class="danger" style="padding-left:12px"');
@ -447,7 +447,7 @@ function row2($x, $y, $show_error=false, $lwidth='40%') {
function row2_init($x, $y, $lwidth='40%') {
echo '<tr>
<td class="text-right active" width="'.$lwidth.'" style="padding-right: 20px;">'.$x.'</td>
<td class="text-right " width="'.$lwidth.'" style="padding-right: 20px;">'.$x.'</td>
<td '.VALUE_ATTRS.'>'.$y.'
';
}
@ -672,7 +672,7 @@ function post_int($name, $optional=false) {
return $y;
}
function get_array($name) {
function get_array($name, $optional=false) {
if (isset($_GET[$name])) {
$x = $_GET[$name];
} else {

View File

@ -85,7 +85,7 @@ function project_banner($title, $prefix, $is_main) {
function project_footer($show_return, $show_date, $prefix) {
// If you include any links, prepend URL with $prefix
//
echo '<br>
echo '<p></p>
<a class="brand boinc-logo" href="http://boinc.berkeley.edu/"><img align="middle" border="0" src="'.secure_url_base().'img/pb_boinc.gif" alt="Powered by BOINC"></a>
<br>
<p class="text-center"> &copy;'.gmdate("Y ").COPYRIGHT_HOLDER.'</p>

View File

@ -154,7 +154,7 @@ row2(tra("Filtered users").
"<br><p class=\"text-muted\">".tra("Ignore message board posts and private messages from these users.")."</p>",
"$forum_filtered_userlist
<input type=\"text\" name=\"forum_filter_user\" size=12> ".tra("User ID (For instance: 123456789)")."
<br><input class=\"btn btn-default\" type=\"submit\" name=\"add_user_to_filter\" value=\"".tra("Add user to filter")."\">
<p></p><input class=\"btn btn-default\" type=\"submit\" name=\"add_user_to_filter\" value=\"".tra("Add user to filter")."\">
"
);

View File

@ -113,6 +113,7 @@ echo '
</tr>
</table>
</form>
<p></p>
';
show_forum($forum, $start, $sort_style, $user);

View File

@ -58,13 +58,13 @@ function user_search_form() {
echo "</select></td></tr>";
row2(tra("With profile?"),
"<input type=radio name=profile value=either checked=1> ".tra("Either")."
<input type=radio name=profile value=no> ".tra("No")."
<input type=radio name=profile value=yes> ".tra("Yes")."
&nbsp;<input type=radio name=profile value=no> ".tra("No")."
&nbsp;<input type=radio name=profile value=yes> ".tra("Yes")."
");
row2(tra("On a team?"),
"<input type=radio name=team value=either checked=1> ".tra("Either")."
<input type=radio name=team value=no> ".tra("No")."
<input type=radio name=team value=yes> ".tra("Yes")."
&nbsp;<input type=radio name=team value=no> ".tra("No")."
&nbsp;<input type=radio name=team value=yes> ".tra("Yes")."
");
row1(tra("Ordering"), 2, "heading");
row2(tra("Decreasing sign-up time"), "<input type=radio name=search_type value=\"date\" checked>");