Hi,

Am Freitag, den 24.05.2013, 15:11 +0800 schrieb Paul Wise:
> One setting per row sounds like it would waste vertical space so if you
> can figure out the fluid column system I linked to, that would be good.

fluid layout implemented, see the attached patch (and
http://qa.debian.org/~nomeata/developer.php?packages=ghc for a preview).

Greetings,
Joachim

-- 
Joachim "nomeata" Breitner
Debian Developer
  nome...@debian.org | ICQ# 74513189 | GPG-Keyid: 4743206C
  JID: nome...@joachim-breitner.de | http://people.debian.org/~nomeata

From 84c8cfec5fd5cd87a088e95327b94f6b3ded9a58 Mon Sep 17 00:00:00 2001
From: Joachim Breitner <m...@joachim-breitner.de>
Date: Sat, 25 May 2013 19:38:03 +0200
Subject: [PATCH 4/4] Implement a fluid layout for the settings

which should wrap if the screen is not wide enough.

Also move function checkbox() closer to where it belongs and turn the
documentation for the Ordering field into tooltips.
---
 wml/common-html.php |  71 +++-----------------------
 wml/developer.css   |  20 +++++++-
 wml/developer.wml   | 140 ++++++++++++++++++++++++++++++++++++++--------------
 3 files changed, 131 insertions(+), 100 deletions(-)

diff --git a/wml/common-html.php b/wml/common-html.php
index 6d16135..614eaaa 100644
--- a/wml/common-html.php
+++ b/wml/common-html.php
@@ -338,12 +338,9 @@ function html_color($text, $color)
 
 function html_div($text,$id,$class,$extra="")
 {
-    if($class != "")
-    {
-        return "<div id=\"$id\" class=\"$class\" $extra>$text</div>\n";
-    }else{
-        return "<div id=\"$id\" $extra>$text</div>\n";
-    } 
+    if ($id) $id = " id=\"".$id."\"";
+    if ($class) $class = " class=\"".$class."\"";
+    return "<div".$id.$class." ".$extra.">".$text."</div>\n";
 }
 
 function html_span($text,$id,$class,$extra="")
@@ -353,6 +350,11 @@ function html_span($text,$id,$class,$extra="")
     return "<span".$id.$class." ".$extra.">".$text."</span>";
 }
 
+function html_tooltip($text,$title)
+{
+    return "<span class=\"tooltip\" title=\"".$title."\">".$text."</span>";
+}
+
 function html_ul($text, $class = "")
 {
     if ($class) $class = " class=\"$class\"";
@@ -386,63 +388,6 @@ function isdisplayed($value)
   return $arg_cookie[$value];
 }
 
-/*
-    This function is used for the display settings table
-    Note that there is a exception with bugs
-*/
-function checkbox($value)
-{
-    global $arg_cookie;
-    if($arg_cookie[$value] == 1)
-    {
-        $data = html_input_radio($value,1,true,"Show\n") . html_br();
-        $data .= html_input_radio($value,0,false,"Hide") . html_br();
-    }else{
-        $data = html_input_radio($value,1,false,"Show\n") . html_br();
-        $data .= html_input_radio($value,0,true,"Hide") . html_br();
-    }
-/*    if($value == 'version')
-    {
-        if($arg_cookie[$value] == 2)
-        {
-            $data = html_input_radio($value,1,false,"Show\n") . html_br();
-            $data .= html_input_radio($value,0,false,"Hide\n") . html_br();
-            $data .= html_input_radio($value,2,true,"Without Exp. &amp; Prop. Upt.\n") . html_br();
-        }elseif($arg_cookie[$value] == 1)
-        {
-            $data = html_input_radio($value,1,true,"Show\n") . html_br();
-            $data .= html_input_radio($value,0,false,"Hide\n") . html_br();
-            $data .= html_input_radio($value,2,false,"Without Exp. &amp; Prop. Upt.\n") . html_br();
-        }else{
-            $data = html_input_radio($value,1,false,"Show\n") . html_br();
-            $data .= html_input_radio($value,0,true,"Hide\n") . html_br();
-            $data .= html_input_radio($value,2,false,"Without Exp. &amp; Prop. Upt.\n") . html_br();
-        }
-    } */
-    if($value == 'bugs')
-    {
-        $data = html_input_radio($value,1,$arg_cookie[$value] == 1,"Show (1)\n") . html_br();
-        $data .= html_input_radio($value,0,$arg_cookie[$value] == 0,"Hide (0)\n") . html_br();
-        $data .= html_input_radio($value,2,$arg_cookie[$value] == 2,"Sum. (2)\n") . html_br();
-        $data .= html_input_radio($value,3,$arg_cookie[$value] == 3,"Sum.&amp;RC (3)\n") . html_br();
-    } elseif ($value == 'ordering') {
-        $data = html_input_radio($value,0,$arg_cookie[$value] == 0,"Name (0)\n") . html_br();
-        $data .= html_input_radio($value,1,$arg_cookie[$value] == 1,"Date (1)\n") . html_br();
-        $data .= html_input_radio($value,2,$arg_cookie[$value] == 2,"N./D. (2)\n") . html_br();
-        $data .= html_input_radio($value,3,$arg_cookie[$value] == 3,"Section (3)\n") . html_br();
-    } elseif ($value == 'comaint') {
-        $data = html_input_radio($value,"yes",!strcmp($arg_cookie[$value],"yes"),"yes\n") . html_br();
-        $data .= html_input_radio($value,"no",!strcmp($arg_cookie[$value],"no"),"no\n") . html_br();
-        $data .= html_input_radio($value,"only",!strcmp($arg_cookie[$value],"only"),"only\n") . html_br();
-    } elseif ($value == 'buildd') {
-        $data = html_input_radio($value,1,$arg_cookie[$value] == 1,"Show (1)\n") . html_br();
-        $data .= html_input_radio($value,0,$arg_cookie[$value] == 0,"Hide (0)\n") . html_br();
-        $data .= html_input_radio($value,2,$arg_cookie[$value] == 2,"Detail (2)\n") . html_br();
-    }
-    $data = html_color($data,"green");
-    return $data;
-}
-
 
 /*
     return hidden fields with action parameters to be provided for the form validation
diff --git a/wml/developer.css b/wml/developer.css
index 2abbbb3..3fc39a8 100644
--- a/wml/developer.css
+++ b/wml/developer.css
@@ -1,5 +1,6 @@
 a.dash:link,a.dash:visited,a.dash:active {text-decoration: none;}
 .general {color:black}
+.tooltip {border-bottom: 1px dashed #999;}
 .span_general { text-align:left;
 	cursor:pointer;
 	border-bottom-style:dashed;
@@ -48,9 +49,26 @@ h3 { margin-bottom: 0.5em; }
 	vertical-align: middle;
 }
 
-table.settings td {
+
+#settings {
+	margin-top: 1em;
+	margin-bottom: 1em;
+}
+
+#settings .head{
+	color: green;
+	font-weight: bold;
+}
+
+#settings input {
 	white-space: nowrap;
 }
+#settings div {
+    display: inline-block;
+    vertical-align: top;
+    margin-right:1em;
+    margin-bottom:1em;
+}
 
 a.buildd-state span {
     border-radius: .5ex;
diff --git a/wml/developer.wml b/wml/developer.wml
index e57310c..5f223b3 100644
--- a/wml/developer.wml
+++ b/wml/developer.wml
@@ -230,46 +230,114 @@ function print_header_entries_top($login, $name)
     print html_h($title, 2, "center");
 }
 
+function settings_entry($title, $extra, $value)
+{
+    $line = "";
+    if ($extra != "")
+    {
+        $line .= html_span("$title", "", "head") . html_br() . html_color("($extra)", "black");
+    }else{
+        $line .= html_color($title, "green");
+    }
+    $line .= html_br() . checkbox($value);
+    return html_div($line);
+}
+
+/*
+    This function is used for the display settings table
+    Note that there is a exception with bugs
+*/
+function checkbox($value)
+{
+    global $arg_cookie;
+    if($arg_cookie[$value] == 1)
+    {
+        $data = html_input_radio($value,1,true,"Show\n") . html_br();
+        $data .= html_input_radio($value,0,false,"Hide") . html_br();
+    }else{
+        $data = html_input_radio($value,1,false,"Show\n") . html_br();
+        $data .= html_input_radio($value,0,true,"Hide") . html_br();
+    }
+/*    if($value == 'version')
+    {
+        if($arg_cookie[$value] == 2)
+        {
+            $data = html_input_radio($value,1,false,"Show\n") . html_br();
+            $data .= html_input_radio($value,0,false,"Hide\n") . html_br();
+            $data .= html_input_radio($value,2,true,"Without Exp. &amp; Prop. Upt.\n") . html_br();
+        }elseif($arg_cookie[$value] == 1)
+        {
+            $data = html_input_radio($value,1,true,"Show\n") . html_br();
+            $data .= html_input_radio($value,0,false,"Hide\n") . html_br();
+            $data .= html_input_radio($value,2,false,"Without Exp. &amp; Prop. Upt.\n") . html_br();
+        }else{
+            $data = html_input_radio($value,1,false,"Show\n") . html_br();
+            $data .= html_input_radio($value,0,true,"Hide\n") . html_br();
+            $data .= html_input_radio($value,2,false,"Without Exp. &amp; Prop. Upt.\n") . html_br();
+        }
+    } */
+    if($value == 'bugs')
+    {
+        $data = html_input_radio($value,1,$arg_cookie[$value] == 1,"Show (1)\n") . html_br();
+        $data .= html_input_radio($value,0,$arg_cookie[$value] == 0,"Hide (0)\n") . html_br();
+        $data .= html_input_radio($value,2,$arg_cookie[$value] == 2,"Sum. (2)\n") . html_br();
+        $data .= html_input_radio($value,3,$arg_cookie[$value] == 3,"Sum.&amp;RC (3)\n") . html_br();
+    } elseif ($value == 'ordering') {
+        $data =
+          html_input_radio($value,0,$arg_cookie[$value] == 0,
+                html_tooltip("Name (0)","'Name' sorts by package name")
+                ) . html_br() .
+          html_input_radio($value,1,$arg_cookie[$value] == 1,
+                html_tooltip("Date (1)","'Date' sorts by upload date (descending).")
+                ) . html_br() .
+          html_input_radio($value,2,$arg_cookie[$value] == 2,
+                html_tooltip("N./D. (2)", "'N./D.' sorts by name for main/contrib/non-free packages and by date for other sections.")
+                ) . html_br() .
+          html_input_radio($value,3,$arg_cookie[$value] == 3,
+                html_tooltip("Section (3)", "'Section' sorts by sections first and by name secondly.")
+                );
+    } elseif ($value == 'comaint') {
+        $data = html_input_radio($value,"yes",!strcmp($arg_cookie[$value],"yes"),"yes\n") . html_br();
+        $data .= html_input_radio($value,"no",!strcmp($arg_cookie[$value],"no"),"no\n") . html_br();
+        $data .= html_input_radio($value,"only",!strcmp($arg_cookie[$value],"only"),"only\n") . html_br();
+    } elseif ($value == 'buildd') {
+        $data = html_input_radio($value,1,$arg_cookie[$value] == 1,"Show (1)\n") . html_br();
+        $data .= html_input_radio($value,0,$arg_cookie[$value] == 0,"Hide (0)\n") . html_br();
+        $data .= html_input_radio($value,2,$arg_cookie[$value] == 2,"Detail (2)\n") . html_br();
+    }
+    $data = html_color($data,"green");
+    return $data;
+}
+
+
+
 function print_help() {
     $counter_span = 0;
 
-    $display_data = html_b(html_em("You need to allow cookies if you want the configuration to be stored. If not, remember/bookmark the right URL that will be provided after submitting changes. "));
-    $display_data .= "You can override the settings by providing an extra arg to the URL (e.g. &amp;buildd=1 if you want to display the buildd column). These args will not change the custom settings you defined before (the cookie is not modified)." . html_br();
-    $display_data .= "The 'Name' ordering sorts by package name, 'Date' sorts by upload date (descending), 'N./D.' sorts by name for main/contrib/non-free packages and by date for other sections, 'Section' sorts by sections first and by name secondly." . html_br();
+    $display_data = html_div(
+        html_b(html_em("You need to allow cookies if you want the configuration to be stored. If not, remember/bookmark the right URL that will be provided after submitting changes. ")).
+        "You can override the settings by providing an extra arg to the URL (e.g. &amp;buildd=1 if you want to display the buildd column). These args will not change the custom settings you defined before (the cookie is not modified).","","small");
+
     $display_data = html_small($display_data);
-    $display_table_th = html_th("Co-maintained","&amp;comaint=");
-    $display_table_th .= html_th("Bugs","&amp;bugs=");
-    $display_table_th .= html_th("Version","&amp;version=");
-    $display_table_th .= html_th("Ubuntu","&amp;ubuntu=");
-    $display_table_th .= html_th("Excuses","&amp;excuses=");
-    $display_table_th .= html_th("Binary" . html_br() . "Package","&amp;bin=");
-    $display_table_th .= html_th("Buildd","&amp;buildd=");
-    $display_table_th .= html_th("Debcheck","&amp;problems=");
-    $display_table_th .= html_th("Lintian","&amp;lintian=");
-    $display_table_th .= html_th("Popcon","&amp;popc=");
-    $display_table_th .= html_th("Watch","&amp;watch=");
-    $display_table_th .= html_th("Section","&amp;section=");
-    $display_table_th .= html_th("Ordering","&amp;ordering=");
-    $display_table_th .= html_th("Uploads","&amp;uploads=");
-
-    $display_table_tds = html_td(checkbox('comaint'));
-    $display_table_tds .= html_td(checkbox('bugs'));
-    $display_table_tds .= html_td(checkbox('version'));
-    $display_table_tds .= html_td(checkbox('ubuntu'));
-    $display_table_tds .= html_td(checkbox('excuses'));
-    $display_table_tds .= html_td(checkbox('bin'));
-    $display_table_tds .= html_td(checkbox('buildd'));
-    $display_table_tds .= html_td(checkbox('problems'));
-    $display_table_tds .= html_td(checkbox('lintian'));
-    $display_table_tds .= html_td(checkbox('popc'));
-    $display_table_tds .= html_td(checkbox('watch'));
-    $display_table_tds .= html_td(checkbox('section'));
-    $display_table_tds .= html_td(checkbox('ordering'));
-    $display_table_tds .= html_td(checkbox('uploads'));
-
-    $display_table_tr = html_tr($display_table_tds, "left");
-
-    $display_data .= html_table(html_tr($display_table_th), array($display_table_tr), "", "small settings") . html_br();
+    $display_data .= html_div(
+        settings_entry("Co-maintained","&amp;comaint=", "comaint") .
+        settings_entry("Bugs","&amp;bugs=", "bugs") .
+        settings_entry("Version","&amp;version=", "version") .
+        settings_entry("Ubuntu","&amp;ubuntu=", "ubuntu") .
+        settings_entry("Excuses","&amp;excuses=", "excuses") .
+        settings_entry("Binary Package","&amp;bin=", "bin") .
+        settings_entry("Buildd","&amp;buildd=", "buildd") .
+        settings_entry("Debcheck","&amp;problems=", "problems") .
+        settings_entry("Lintian","&amp;lintian=", "lintian") .
+        settings_entry("Popcon","&amp;popc=", "popc") .
+        settings_entry("Watch","&amp;watch=", "watch") .
+        settings_entry("Section","&amp;section=", "section") .
+        settings_entry("Ordering","&amp;ordering=", "ordering") .
+        settings_entry("Uploads","&amp;uploads=", "uploads"),
+        "settings",
+        "small"
+    );
+
     $display_data .= "Additionally show packages: ". html_input_text("packages", isdisplayed('packages'));
     $display_data .= " uploaders: ". html_input_text("uploader", isdisplayed('uploader')) . html_br();
     $display_data .= "Mirror: ". html_input_text("mirror", isdisplayed('mirror')) . html_br();
-- 
1.8.3.rc3

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to