Look improvements. Can identify unread message and switch from a message to
authorx2003bruneau <x2003bruneau@9869982d-c50d-0410-be91-f2a2ec7c7c7b>
Tue, 23 Oct 2007 22:04:15 +0000 (22:04 +0000)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Fri, 4 Jan 2008 23:35:50 +0000 (00:35 +0100)
another via the tree.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
git-svn-id: svn+ssh://murphy/home/svn/banana/trunk@280 9869982d-c50d-0410-be91-f2a2ec7c7c7b

13 files changed:
banana/spool.inc.php
banana/templates/banana-message.inc.tpl
css/style.css
img/T2.gif [new file with mode: 0644]
img/T2r.gif [new file with mode: 0644]
img/f2.gif [new file with mode: 0644]
img/f2r.gif [new file with mode: 0644]
img/h2.gif [new file with mode: 0644]
img/h2r.gif [new file with mode: 0644]
img/l2.gif [new file with mode: 0644]
img/l2r.gif [new file with mode: 0644]
img/t2.gif [new file with mode: 0644]
img/t2r.gif [new file with mode: 0644]

index 2ce0755..6ce1751 100644 (file)
@@ -9,7 +9,7 @@
 
 require_once dirname(__FILE__) . '/banana.inc.php';
 
-define('BANANA_SPOOL_VERSION', '0.6');
+define('BANANA_SPOOL_VERSION', '0.5.1');
 
 /** Class spoolhead
  *  class used in thread overviews
@@ -542,30 +542,46 @@ class BananaSpool
 
 
     public function _buildTree($id, BananaSpoolHead &$head, $current) {
-        $style = 'color:' . $head->color . '; text-decoration: none';
+        static $t_e, $u_h, $u_ht, $u_vt, $u_l, $u_f, $r_h, $r_ht, $r_vt, $r_l, $r_f;
+        if (!isset($spfx_f)) {
+            $t_e   = Banana::$page->makeImg(Array('img' => 'e',  'alt' => '&nbsp;', 'height' => 18,  'width' => 14));
+            $u_h   = Banana::$page->makeImg(Array('img' => 'h2', 'alt' => '-', 'height' => 18,  'width' => 14));
+            $u_ht  = Banana::$page->makeImg(Array('img' => 'T2', 'alt' => '+', 'height' => 18, 'width' => 14));
+            $u_vt  = Banana::$page->makeImg(Array('img' => 't2', 'alt' => '`', 'height' => 18, 'width' => 14));
+            $u_l   = Banana::$page->makeImg(Array('img' => 'l2', 'alt' => '|', 'height' => 18, 'width' => 14));
+            $u_f   = Banana::$page->makeImg(Array('img' => 'f2', 'alt' => 't', 'height' => 18, 'width' => 14));
+            $r_h   = Banana::$page->makeImg(Array('img' => 'h2r', 'alt' => '-', 'height' => 18,  'width' => 14));
+            $r_ht  = Banana::$page->makeImg(Array('img' => 'T2r', 'alt' => '+', 'height' => 18, 'width' => 14));
+            $r_vt  = Banana::$page->makeImg(Array('img' => 't2r', 'alt' => '`', 'height' => 18, 'width' => 14));
+            $r_l   = Banana::$page->makeImg(Array('img' => 'l2r', 'alt' => '|', 'height' => 18, 'width' => 14));
+            $r_f   = Banana::$page->makeImg(Array('img' => 'f2r', 'alt' => 't', 'height' => 18, 'width' => 14));
+        }
+        $style = 'background-color:' . $head->color . '; text-decoration: none';
         $prof  = 1;
-        if ($id == $current) {
-            $text = "<strong style=\"$style\">0</strong>";
-        } else {
-            $text = Banana::$page->makeLink(Array('group' => $this->group, 'artid' => $id,
-                                                  'text'  => 'o', 'popup' => $head->from,
-                                                  'style' => $style));
-        }
+        $text = '<span style="' . $style . '" title="' . banana_entities($head->from) . '">' .
+                '<input type="radio" name="banana_tree" '. ($id == $current ? 'checked="checked" ' : ' ' ) .
+                (Banana::$msgshow_javascript ? 'onchange="window.location=\'' .
+                    Banana::$page->makeURL(array('group' => $this->group, 'artid' => $id)) . '\'"' : ' disabled="disabled"')
+                .' />' .
+                '</span>';
         $array = array($text);
         foreach ($head->children as $key=>&$child) {
-            list($tpr, $tree) = $this->_buildTree($child, $this->overview[$child], $current);
+            $msg =& $this->overview[$child];
+            list($tpr, $tree) = $this->_buildTree($child, $msg, $current);
             $last = $key == count($head->children) - 1;
             foreach ($tree as $kt=>&$line) {
-                if ($kt == 0 && $key == 0) {
-                    $array[0] .= '--' . $line;
+                if ($kt == 0 && $key == 0 && !$last) {
+                    $array[0] .= ($msg->isread ? $r_ht : $u_ht) . $line;
+                } else if($kt == 0 && $key == 0) {
+                    $array[0] .= ($msg->isread ? $r_h : $u_h)  . $line;
                 } else if ($kt == 0 && $last) {
-                    $array[] = ' !-' . $line;
+                    $array[] = $t_e . ($msg->isread ? $r_vt : $u_vt) . $line;
                 } else if ($kt == 0) {
-                    $array[] = ' |-' . $line;
+                    $array[] = $t_e . ($msg->isread ? $r_f : $u_f) . $line;
                 } else if ($last) {
-                    $array[] = '   ' . $line;
+                    $array[] = $t_e . $t_e . $line;
                 } else {
-                    $array[] = ' | ' . $line;
+                    $array[] = $t_e . ($msg->isread ? $r_l : $u_l) . $line;
                 }
             }
             if ($tpr > $prof) {
index 161ccda..94d7fa7 100644 (file)
@@ -1,4 +1,4 @@
-<pre>
+<pre class="thread_tree">
 {$spool->buildTree($artid)|smarty:nodefaults}
 </pre>
 
index 7654978..98f6b67 100644 (file)
     background-color: #fff;
 }
 
+.banana pre.thread_tree {
+  overflow: scroll;
+}
+
+.banana .thread_tree input {
+    width: 14px;
+    height: 14px;
+    padding: 2px 0;
+    margin: 0;
+}
+
+.banana .thread_tree img {
+    margin: 0;
+    padding: 0;
+    width: 14px;
+    height: 18px;
+}
+
+
 /** MISC **/
 
 .banana .center { text-align: center; padding: 1em; }
diff --git a/img/T2.gif b/img/T2.gif
new file mode 100644 (file)
index 0000000..3465566
Binary files /dev/null and b/img/T2.gif differ
diff --git a/img/T2r.gif b/img/T2r.gif
new file mode 100644 (file)
index 0000000..df32793
Binary files /dev/null and b/img/T2r.gif differ
diff --git a/img/f2.gif b/img/f2.gif
new file mode 100644 (file)
index 0000000..a056c87
Binary files /dev/null and b/img/f2.gif differ
diff --git a/img/f2r.gif b/img/f2r.gif
new file mode 100644 (file)
index 0000000..dc6048b
Binary files /dev/null and b/img/f2r.gif differ
diff --git a/img/h2.gif b/img/h2.gif
new file mode 100644 (file)
index 0000000..16fbff8
Binary files /dev/null and b/img/h2.gif differ
diff --git a/img/h2r.gif b/img/h2r.gif
new file mode 100644 (file)
index 0000000..761c5e8
Binary files /dev/null and b/img/h2r.gif differ
diff --git a/img/l2.gif b/img/l2.gif
new file mode 100644 (file)
index 0000000..9b414fd
Binary files /dev/null and b/img/l2.gif differ
diff --git a/img/l2r.gif b/img/l2r.gif
new file mode 100644 (file)
index 0000000..b4f2345
Binary files /dev/null and b/img/l2r.gif differ
diff --git a/img/t2.gif b/img/t2.gif
new file mode 100644 (file)
index 0000000..f66bc3c
Binary files /dev/null and b/img/t2.gif differ
diff --git a/img/t2r.gif b/img/t2r.gif
new file mode 100644 (file)
index 0000000..d767dae
Binary files /dev/null and b/img/t2r.gif differ