[PATCH] mod_mbox: show list name in the h1/

2012-01-02 Thread Daniel Shahaf
Henri Yandell (Created) (JIRA) wrote on Wed, Dec 21, 2011 at 06:03:30 +:
 Note list name on mail detail page
 --
 
  Key: INFRA-4238
  URL: https://issues.apache.org/jira/browse/INFRA-4238
  Project: Infrastructure
   Issue Type: Improvement
   Security Level: public (Regular issues)
 Reporter: Henri Yandell
 Priority: Minor
 
 
 Looking at
 http://mail-archives.apache.org/mod_mbox/www-infrastructure-dev/201112.mbox/%3ca603ffce-623b-43e9-87f8-39baa51c7...@gbiv.com%3E
 - it would be nice to know what mailing list the email is to in the
 UI. Currently you have to infer it from links or the url.
 
 Having it as some kind of title would be good. Possibly it could
 replace the 'list index' text for the link to the emails for that
 mailing list.
 

[[[
Tweak h1/ title in the message display screen, for INFRA-4238.

Patch by: danielsh

* module-2.0/mod_mbox_out.c
  (mbox_ajax_browser, mbox_static_browser):
Include the directory's basename in the title.
]]]

[[[
Index: module-2.0/mod_mbox_out.c
===
--- module-2.0/mod_mbox_out.c   (revision 1188408)
+++ module-2.0/mod_mbox_out.c   (working copy)
@@ -17,6 +17,8 @@
 /* This file contains all output functions.
  */
 
+#include libgen.h /* basename() */
+
 #include mod_mbox.h
 
 #ifdef APLOG_USE_MODULE
@@ -886,9 +888,11 @@ apr_status_t mbox_ajax_browser(request_rec *r)
 {
 mbox_dir_cfg_t *conf;
 char *baseURI;
+const char *base_path;
 
 conf = ap_get_module_config(r-per_dir_config, mbox_module);
 baseURI = get_base_uri(r);
+base_path = get_base_path(r);
 
 ap_set_content_type(r, text/html; charset=utf-8);
 
@@ -920,7 +924,8 @@ apr_status_t mbox_ajax_browser(request_rec *r)
 ap_rprintf(r,
 body id=\archives\ onload=\javascript:loadBrowser 
('%s');\\n,
baseURI);
-ap_rputs(  h1Mailing list archives/h1\n\n, r);
+ap_rprintf(r,   h1%s mailing list archives/h1\n\n,
+  basename(base_path));
 
 ap_rputs(  h5\n, r);
 
@@ -930,7 +935,7 @@ apr_status_t mbox_ajax_browser(request_rec *r)
 }
 
 ap_rprintf(r, a href=\%s\ title=\Back to the list index\
-   List index/a/h5, get_base_path(r));
+   List index/a/h5, base_path);
 
 /* Output a small notice if no MboxScriptPath configuration
directive was specified. */
@@ -1122,6 +1127,7 @@ int mbox_static_message(request_rec *r, apr_file_t
 Message *m;
 
 char *baseURI, *from, **context, *msgID, *escaped_msgID;
+const char *base_path = get_base_path(r);
 
 conf = ap_get_module_config(r-per_dir_config, mbox_module);
 baseURI = get_base_uri(r);
@@ -1166,7 +1172,8 @@ int mbox_static_message(request_rec *r, apr_file_t
 
 ap_rputs( /head\n\n, r);
 ap_rputs( body id=\archives\\n, r);
-ap_rputs(  h1Mailing list archives/h1\n\n, r);
+ap_rprintf(r,   h1%s mailing list archives/h1\n\n,
+  basename(base_path));
 
 ap_rputs(  h5\n, r);
 
@@ -1176,7 +1183,7 @@ int mbox_static_message(request_rec *r, apr_file_t
 }
 
 ap_rprintf(r, a href=\%s\ title=\Back to the list index\
-   List index/a/h5, get_base_path(r));
+   List index/a/h5, base_path);
 
 /* Display context message list */
 from = ESCAPE_OR_BLANK(r-pool, m-from);
]]]

 --
 This message is automatically generated by JIRA.
 If you think it was sent incorrectly, please contact your JIRA 
 administrators: 
 https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
 For more information on JIRA, see: http://www.atlassian.com/software/jira
 
 


Re: [PATCH] mod_mbox: show list name in the h1/

2012-01-02 Thread Stefan Fritsch
On Monday 02 January 2012, Daniel Shahaf wrote:
 Henri Yandell (Created) (JIRA) wrote on Wed, Dec 21, 2011 at 
06:03:30 +:
  Note list name on mail detail page
  --
  
   Key: INFRA-4238
   URL:
   https://issues.apache.org/jira/browse/INFRA-423
   8
   
   Project: Infrastructure

Issue Type: Improvement

Security Level: public (Regular issues)

  Reporter: Henri Yandell
  Priority: Minor
  
  Looking at
  http://mail-archives.apache.org/mod_mbox/www-infrastructure-dev/2
  01112.mbox/%3ca603ffce-623b-43e9-87f8-39baa51c7...@gbiv.com%3E -
  it would be nice to know what mailing list the email is to in
  the UI. Currently you have to infer it from links or the url.
  
  Having it as some kind of title would be good. Possibly it could
  replace the 'list index' text for the link to the emails for that
  mailing list.
 
 [[[
 Tweak h1/ title in the message display screen, for INFRA-4238.
 
 Patch by: danielsh
 
 * module-2.0/mod_mbox_out.c
   (mbox_ajax_browser, mbox_static_browser):
 Include the directory's basename in the title.
 ]]]

Hi Daniel,

I have done some work on mod_mbox last week which I have committed 
now. It includes displaying the list name in h1 and title tags, 
though implemented slightly differently than your patch. This and some 
more code cleanup is now in trunk. This code should still work with 
2.2

In the new convert-charsets branch, I have committed some work to 
actually convert mail bodies, subject and from lines to UTF-8. This 
should take care of a load of displaying problems with various mails.
I have tested it with Firefox 9, Chrome, and KDE Konqueror 4.6.
There are two caveats, though: It adds a field to the cache files. 
This means that all mbox cache files need to be re-created. And it 
depends on HTTPD 2.3.x functionality.

It would of course be very nice if you could test the code from the 
branch, but doing the re-indexing is of course more work. Maybe you 
could pull some tricks with ZFS snapshots to allow for a fall-back 
path.

Cheers,
Stefan


Re: [PATCH] mod_mbox: show list name in the h1/

2012-01-02 Thread Daniel Shahaf
Stefan Fritsch wrote on Mon, Jan 02, 2012 at 20:07:30 +0100:
 On Monday 02 January 2012, Daniel Shahaf wrote:
  Henri Yandell (Created) (JIRA) wrote on Wed, Dec 21, 2011 at 
 06:03:30 +:
   Note list name on mail detail page
   --
   
Key: INFRA-4238
URL:
https://issues.apache.org/jira/browse/INFRA-423
8

Project: Infrastructure
 
 Issue Type: Improvement
 
 Security Level: public (Regular issues)
 
   Reporter: Henri Yandell
   Priority: Minor
   
   Looking at
   http://mail-archives.apache.org/mod_mbox/www-infrastructure-dev/2
   01112.mbox/%3ca603ffce-623b-43e9-87f8-39baa51c7...@gbiv.com%3E -
   it would be nice to know what mailing list the email is to in
   the UI. Currently you have to infer it from links or the url.
   
   Having it as some kind of title would be good. Possibly it could
   replace the 'list index' text for the link to the emails for that
   mailing list.
  
  [[[
  Tweak h1/ title in the message display screen, for INFRA-4238.
  
  Patch by: danielsh
  
  * module-2.0/mod_mbox_out.c
(mbox_ajax_browser, mbox_static_browser):
  Include the directory's basename in the title.
  ]]]
 
 Hi Daniel,
 
 I have done some work on mod_mbox last week which I have committed 
 now. It includes displaying the list name in h1 and title tags, 
 though implemented slightly differently than your patch. This and some 
 more code cleanup is now in trunk. This code should still work with 
 2.2
 

Saw the commits --- thanks.  I'll deploy the code on eos and let this
list know when that's done.

 In the new convert-charsets branch, I have committed some work to 
 actually convert mail bodies, subject and from lines to UTF-8. This 
 should take care of a load of displaying problems with various mails.

Sounds good.

 I have tested it with Firefox 9, Chrome, and KDE Konqueror 4.6.
 There are two caveats, though: It adds a field to the cache files. 
 This means that all mbox cache files need to be re-created. And it 
 depends on HTTPD 2.3.x functionality.
 

Meaning that we can't deploy it for the private mail archives yet.

 It would of course be very nice if you could test the code from the 
 branch, but doing the re-indexing is of course more work. Maybe you 
 could pull some tricks with ZFS snapshots to allow for a fall-back 
 path.
 

Okay.  I'll first see about installing trunk@HEAD, and later separately
about giving the branch a spin too.  Filed this as
https://issues.apache.org/jira/browse/INFRA-4273.

 Cheers,
 Stefan

Thanks,

Daniel