Thread view improvements
authorMichael M Slusarz <slusarz@curecanti.org>
Thu, 18 Feb 2010 21:07:22 +0000 (14:07 -0700)
committerMichael M Slusarz <slusarz@curecanti.org>
Thu, 18 Feb 2010 22:56:04 +0000 (15:56 -0700)
imp/templates/thread/thread.html
imp/themes/screen.css
imp/thread.php

index 0944c3d..61d940b 100644 (file)
@@ -1,55 +1,26 @@
 <h1 class="header">
  <if:thread><gettext>Thread Display:</gettext><else:thread><gettext>Multiple Message View:</gettext></else:thread></if:thread> <tag:subject /> <tag:delete />
 </h1>
-<br class="spacer" />
 
 <a id="display"></a>
-<div class="solidbox">
+<div class="solidbox striped threadSummary">
 <loop:tree>
-<div class="<tag:tree.class />">&nbsp;<tag:tree.subject /></div>
+ <div><tag:tree.subject /></div>
 </loop:tree>
 </div>
 
-<br class="spacer" />
-
-<table width="100%" cellspacing="0" cellpadding="3">
-
 <loop:messages>
- <tr>
-  <td class="item">
-  <a id="i<tag:messages.idx />"></a>
-   <table width="100%">
-    <tr>
-     <td class="item">
-      <table class="multipleMsgs" width="100%" cellpadding="2" cellspacing="0">
-       <tr>
-        <td class="item0 rightAlign nowrap"><strong><gettext>Date:</gettext></strong>&nbsp;</td>
-        <td class="item0 msgheader leftAlign"><tag:messages.date /></td>
-        <td class="item0 rightAlign"><tag:messages.link /></td>
-       </tr>
-       <tr>
-        <td class="item1 rightAlign nowrap"><strong><if:messages.addr_to><gettext>To:</gettext><else:messages.addr_to><gettext>From:</gettext></else:messages.addr_to></if:messages.addr_to></strong>&nbsp;</td>
-        <td class="item1 msgheader leftAlign" width="100%" colspan="2"><tag:messages.addr /></td>
-       </tr>
-<if:messages.subject>
-       <tr>
-        <td class="item0 rightAlign nowrap"><strong><gettext>Subject:</gettext></strong>&nbsp;</td>
-        <td class="item0 msgheader leftAlign" width="100%" colspan="2"><tag:messages.subject /></td>
-       </tr>
-</if:messages.subject>
-      </table>
-
-      <div class="messageBody">
-        <tag:messages.body />
-      </div>
-     </td>
-    </tr>
-
-   </table>
-  </td>
- </tr>
-
- <tr><td>&nbsp;</td></tr>
+<a id="i<tag:messages.idx />"></a>
+<div class="solidbox threadBox">
+ <div class="item0">
+  <span class="threadlink"><tag:messages.link /></span>
+  <strong><if:messages.addr_to><gettext>To:</gettext><else:messages.addr_to><gettext>From:</gettext></else:messages.addr_to></if:messages.addr_to></strong>
+  <tag:messages.addr />
+  (<small><tag:messages.date /></small>)
+ </div>
+
+ <div class="messageBody">
+  <tag:messages.body />
+ </div>
+</div>
 </loop:messages>
-
-</table>
index a09f45b..a071c54 100644 (file)
@@ -376,14 +376,10 @@ table.accountsmanagement td.noneconfigured {
     background: #f00;
 }
 
+/* Pad the addressbook icon in header compose links. */
 td.msgheader {
     width: 100%;
 }
-table.multipleMsgs td.msgheader {
-    width: auto;
-}
-
-/* Pad the addressbook icon in header compose links. */
 .msgheader img {
     vertical-align: middle;
     padding: 1px 1px 1px 2px;
@@ -432,6 +428,26 @@ span.spellcheckPopdownImg:hover {
     text-decoration: underline;
 }
 
+/* Thread page */
+.threadSummary {
+    margin: 5px 3px;
+}
+.threadSummary div {
+    height: 16px;
+}
+.threadBox {
+    margin: 3px;
+}
+.threadBox div.item0 {
+    padding: 1px 2px;
+}
+.threadBox span.threadlink {
+    float: right;
+}
+.threadBox .messageBody {
+    border-bottom: 0;
+}
+
 /* Thread/folder images */
 span.treeImg {
     height: 20px;
index acb7876..b863e1a 100644 (file)
@@ -113,12 +113,9 @@ foreach ($loop_array as $mbox => $idxlist) {
         }
 
         $subject_header = htmlspecialchars($envelope['subject'], ENT_COMPAT, $charset);
-        if ($mode == 'thread') {
-            if (empty($subject)) {
-                $subject = preg_replace('/^re:\s*/i', '', $subject_header);
-            }
+        if (($mode == 'thread') && empty($subject)) {
+            $subject = preg_replace('/^re:\s*/i', '', $subject_header);
         }
-        $curr_msg['subject'] = $subject_header;
 
         /* Create links to current message and mailbox. */
         if ($mode == 'thread') {
@@ -129,7 +126,6 @@ foreach ($loop_array as $mbox => $idxlist) {
         $curr_msg['link'] .= ' | ' . Horde::widget(IMP::generateIMPUrl('message.php', $imp_mbox['mailbox'], $idx, $mbox), _("Go to Message"), 'widget', '', '', _("Go to Message"), true);
         $curr_msg['link'] .= ' | ' . Horde::widget(IMP::generateIMPUrl('mailbox.php', $mbox)->add(array('start' => $imp_mailbox->getArrayIndex($idx))), sprintf(_("Back to %s"), $page_label), 'widget', '', '', sprintf(_("Bac_k to %s"), $page_label));
 
-        $curr_tree['class'] = (++$rowct % 2) ? 'text' : 'item0';
         $curr_tree['subject'] = (($mode == 'thread') ? $threadtree[$idx] : null) . ' ' . Horde::link('#i' . $idx) . Horde_String::truncate($subject_header, 60) . '</a> (' . $addr . ')';
 
         $msgs[] = $curr_msg;
@@ -161,6 +157,7 @@ $template->set('tree', $tree);
 
 /* Output page. */
 $title = ($mode == 'thread') ? _("Thread View") : _("Multiple Message View");
+Horde::addScriptFile('stripe.js', 'horde');
 IMP::prepareMenu();
 require IMP_TEMPLATES . '/common-header.inc';
 IMP::menu();