Merge lp:~kfogel/launchpad/old-1.6-ml-archiver-ui into lp:launchpad

Proposed by Karl Fogel
Status: Merged
Approved by: Barry Warsaw
Approved revision: no longer in the source branch.
Merged at revision: not available
Proposed branch: lp:~kfogel/launchpad/old-1.6-ml-archiver-ui
Merge into: lp:launchpad
Diff against target: 224 lines
To merge this branch: bzr merge lp:~kfogel/launchpad/old-1.6-ml-archiver-ui
Reviewer Review Type Date Requested Status
Barry Warsaw (community) code Approve
Martin Albisetti (community) ui Approve
Review via email: mp+6001@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Karl Fogel (kfogel) wrote :
Download full text (11.3 KiB)

Make some basic improvements to our mailing list archives user interface.
(This is the "low-hanging fruit" part of bug #375557.)

Summary:
--------

  When we switched to MHonArc for mailing list archives, the archive
  pages became very Web 1.0, looking unlike the rest of Launchpad and
  having various usability problems: all the messages in chronological
  order on one page (should be reverse-chronological and multi-page),
  no indication of what team the mailing list is for, etc.

  This branch just brings us back to roughly where we were with
  Pipermail on lists.canonical.com / lists.ubuntu.com. It does not
  address everything in bug #375557 (which describes many further
  improvements we could make to our mailing list archives).

  This branch makes the following changes to the mailing list archives:

    - Use multi-page indexes, so large archives don't swamp browsers.
    - Sort messages in reverse chronological order.
    - Show the date next to each message on an index page.
    - Show the mailing list's name, and link back to the team.
    - Give pages a white background, instead of browser-default-gray.
    - Put Launchpad logo in upper left corner.

Proposed fix:
-------------

  Create a Launchpad-wide MHonArc control file, to customize the
  appearance of mailing list archive pages (both the indexes and the
  individual messages). Discussed with Barry and Kiko.

Pre-implementation notes:
-------------------------

  Barry and I talked a lot. I don't think any issues came up that
  need mentioning here. We knew we were aiming for the low-hanging
  fruit, and that's what we got.

Implementation details:
-----------------------

  Code changes:

  * lib/canonical/launchpad/mailman/monkeypatches/lp-mhonarc-common.mrc:
    New rc file, controls MHonArc behavior.

  * lib/canonical/launchpad/mailman/monkeypatches/__init__.py
    (monkey_patch): Add flags to PUBLIC_EXTERNAL_ARCHIVER to define the
    mailing list name and point MHonArc to the common rc file. Copy the
    rc file to the correct location.

  Along the way, I discovered that we were not really set up for testing
  changes to "lists.launchpad.dev", and made two branches to fix that:

    https://code.edge.launchpad.net/~kfogel/launchpad/lists-in-hosts
    https://code.edge.launchpad.net/~kfogel/launchpad/lists-testable

  The first has passed EC2 tests and been submitted to PQM. The
  second is (in theory) done, but not yet tested.

Tests:
------

  Er, see "Demo and Q/A".

Demo and Q/A:
-------------

  * Start launchpad.dev with 'make run_all'.

  * Log in to launchpad.dev as "<email address hidden>" (this test user
    should already exist, and have the appropriate administrative
    privileges).

  * Create a new team 'mltest'.

  * Create a mailing list for that team.

  * Approve the mailing list (at http://launchpad.dev/+mailinglists).

  * Inject the sample data, which you get from here:

    http://launchpadlibrarian.net/26091302/lp-ml-test-data.tar.gz

    Untar it, cd into the resultant lp-ml-test-data/ directory, and
    run "./inject.sh" (while launchpad.dev is running, of course).

    There are 999 messages in the data. They're originally from the
   ...

Revision history for this message
Martin Albisetti (beuno) wrote :

Hi Karl,

Could you possibly just provide a screenshot of this so I can review?
Steps to reproduce seem long and painful :)

Revision history for this message
Karl Fogel (kfogel) wrote :

Martin Albisetti <email address hidden> writes:
> Could you possibly just provide a screenshot of this so I can review?
> Steps to reproduce seem long and painful :)

:-) Sure:

  http://www.red-bean.com/kfogel/ml-archiver-ui-screenshots/

Revision history for this message
Martin Albisetti (beuno) wrote :

Hi Karl,

Thanks for working on this, it's a very big improvement.

The only comment I have, is that the sender and the date should be somehow visually distinct (looking at: http://www.red-bean.com/kfogel/ml-archiver-ui-screenshots/new-ml-archives-by-thread-top.png), maybe the sender could be in bold?
Also, maybe the date should be YYYY-MM-DD instead of YYYY/MM/DD, as using slashes usually means it's formatted.

Neither of these are blockers for the branch to land, but would be nice :)

review: Approve (ui)
Revision history for this message
Karl Fogel (kfogel) wrote :

> The only comment I have, is that the sender and the date should be somehow
> visually distinct (looking at: http://www.red-bean.com/kfogel/ml-archiver-ui-
> screenshots/new-ml-archives-by-thread-top.png), maybe the sender could be in
> bold?

Done, for the thread index only (using bold didn't look so good for
the date index, so I didn't do it there). On the thread index, it
is a big improvement.

> Also, maybe the date should be YYYY-MM-DD instead of YYYY/MM/DD, as using
> slashes usually means it's formatted.

That turns out to be a bit tricky, due to the way MHonArc works. I'm
not even sure it can be done without modifying MHonArc itself, which
so far we've managed to avoid. Leaving as YYYY/MM/DD for now.

Thanks for the review!

Revision history for this message
Barry Warsaw (barry) wrote :

Karl, thanks for working on this, it's a *huge* improvement! I have just a couple of comments.

* Should the link to the team be an https link? It'll probably get redirected there anyway so might as well send people to the right place the first time.

* Should there be a link to the help wiki's mailing lists page?

* Please coordinate with the LOSAs to regenerate all the existing archives. I think we want to switch them all over to the new and improved look. It shouldn't be difficult; probably one command per list, and that could be scripted (and tested on staging).

review: Approve (code)
Revision history for this message
Karl Fogel (kfogel) wrote :

> Karl, thanks for working on this, it's a *huge* improvement! I have just a
> couple of comments.
>
> * Should the link to the team be an https link? It'll probably get redirected
> there anyway so might as well send people to the right place the first time.
>
> * Should there be a link to the help wiki's mailing lists page?

Done in r8117.

> * Please coordinate with the LOSAs to regenerate all the existing archives. I
> think we want to switch them all over to the new and improved look. It
> shouldn't be difficult; probably one command per list, and that could be
> scripted (and tested on staging).

Will do.

Revision history for this message
Karl Fogel (kfogel) wrote :

Note to self: the relevant wiki page is

   https://wiki.canonical.com/ImportingMailingListArchives

The mhonarc command there needs to be tweaked -- it should be told to read
the new config file.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'lib/canonical/launchpad/mailman/monkeypatches/__init__.py'
--- lib/canonical/launchpad/mailman/monkeypatches/__init__.py 2009-04-29 19:10:17 +0000
+++ lib/canonical/launchpad/mailman/monkeypatches/__init__.py 2009-06-09 12:25:02 +0000
@@ -91,6 +91,8 @@
91-add \91-add \
92-dbfile %(var_dir)s/archives/private/%%(listname)s.mbox/mhonarc.db \92-dbfile %(var_dir)s/archives/private/%%(listname)s.mbox/mhonarc.db \
93-outdir %(var_dir)s/mhonarc/%%(listname)s \93-outdir %(var_dir)s/mhonarc/%%(listname)s \
94-definevar ML-NAME=%%(listname)s \
95-rcfile %(var_dir)s/data/lp-mhonarc-common.mrc \
94-stderr %(var_dir)s/logs/mhonarc \96-stderr %(var_dir)s/logs/mhonarc \
95-stdout %(var_dir)s/logs/mhonarc \97-stdout %(var_dir)s/logs/mhonarc \
96-spammode \98-spammode \
@@ -150,8 +152,13 @@
150 print >> handler_file, 'from', module, 'import *'152 print >> handler_file, 'from', module, 'import *'
151 finally:153 finally:
152 handler_file.close()154 handler_file.close()
155
156 here = os.path.dirname(__file__)
157 # Install the MHonArc control file.
158 mhonarc_rc_file = os.path.join(here, 'lp-mhonarc-common.mrc')
159 runtime_data_dir = os.path.join(config.mailman.build_var_dir, 'data')
160 shutil.copy(mhonarc_rc_file, runtime_data_dir)
153 # Install the launchpad site templates.161 # Install the launchpad site templates.
154 here = os.path.dirname(__file__)
155 launchpad_template_path = os.path.join(here, 'sitetemplates')162 launchpad_template_path = os.path.join(here, 'sitetemplates')
156 site_template_path = os.path.join(mailman_path, 'templates', 'site')163 site_template_path = os.path.join(mailman_path, 'templates', 'site')
157 if os.path.isdir(site_template_path):164 if os.path.isdir(site_template_path):
158165
=== added file 'lib/canonical/launchpad/mailman/monkeypatches/lp-mhonarc-common.mrc'
--- lib/canonical/launchpad/mailman/monkeypatches/lp-mhonarc-common.mrc 1970-01-01 00:00:00 +0000
+++ lib/canonical/launchpad/mailman/monkeypatches/lp-mhonarc-common.mrc 2009-06-09 12:25:02 +0000
@@ -0,0 +1,192 @@
1<!-- Launchpad customizations common to all our MHonArc-generated
2 mailing list archives.
3
4 See http://www.mhonarc.org/MHonArc/doc/mhonarc.html and
5 http://www.mhonarc.org/MHonArc/doc/faq/, they are your friends.
6
7 http://www.mhonarc.org/MHonArc/doc/resources.html#index is
8 especially your friend, when all others have abandoned you. -->
9
10<!-- Basic parameters. -->
11<MAIN>
12<THREAD>
13<SORT>
14<REVERSE>
15<TREVERSE>
16<NODOC>
17
18<!-- Use multi-page indexes.
19 See http://www.mhonarc.org/MHonArc/doc/resources/multipg.html -->
20<MULTIPG>
21<IDXSIZE>
22200
23</IDXSIZE>
24
25<!-- Define a custom resource variable to represent this mailing list.
26 This depends on $ML-NAME$ having been set already, presumably on
27 the command line via '-definevar'. See
28 http://www.mhonarc.org/MHonArc/doc/resources/definevar.html. -->
29<DefineVar>
30ML-FULL-TITLE
31<a href="https://launchpad.net/~$ML-NAME$">$ML-NAME$</a> mailing list archive
32</DefineVar>
33
34<IDXLABEL>
35Date Index
36</IDXLABEL>
37
38<TIDXLABEL>
39Thread Index
40</TIDXLABEL>
41
42<!-- What do the next/prev links look like? -->
43<PREVPGLINK>
44<a href="$PG(FIRST)$">&larr;First</a>&nbsp;&nbsp;&nbsp;<a href="$PG(PREV)$">&larr;Prev</a>
45</PREVPGLINK>
46<PREVPGLINKIA>
47&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
48</PREVPGLINKIA>
49<TPREVPGLINK>
50<a href="$PG(TFIRST)$">&larr;First</a>&nbsp;&nbsp;&nbsp;<a href="$PG(TPREV)$">&larr;Prev</a>
51</TPREVPGLINK>
52<TPREVPGLINKIA>
53&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
54</TPREVPGLINKIA>
55<NEXTPGLINK>
56<a href="$PG(NEXT)$">Next&rarr;</a>&nbsp;&nbsp;&nbsp;<a href="$PG(LAST)$">Last&rarr;</a>
57</NEXTPGLINK>
58<NEXTPGLINKIA>
59&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
60</NEXTPGLINKIA>
61<TNEXTPGLINK>
62<a href="$PG(TNEXT)$">Next&rarr;</a>&nbsp;&nbsp;&nbsp;<a href="$PG(TLAST)$">Last&rarr;</a>
63</TNEXTPGLINK>
64<TNEXTPGLINKIA>
65&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
66</TNEXTPGLINKIA>
67
68<!-- Formatting for the start of list page.
69 See http://www.mhonarc.org/MHonArc/doc/resources/listbegin.html. -->
70<LISTBEGIN>
71<p>(<a href="$TIDXFNAME$">go to $TIDXLABEL$</a>)</p>
72<hr/>
73<div style="text-align: left;">$PGLINK(PREV)$&nbsp;&nbsp;&nbsp;$PGLINK(NEXT)$</div>
74<div style="text-align: center;">$PGLINKLIST(5;5)$</div>
75<ul>
76</LISTBEGIN>
77
78<LISTEND>
79</ul>
80<div style="text-align: center;">$PGLINKLIST(5;5)$</div>
81<div style="text-align: left;">$PGLINK(PREV)$&nbsp;&nbsp;&nbsp;$PGLINK(NEXT)$</div>
82</LISTEND>
83
84<!-- Formatting for the start of thread page.
85 See http://www.mhonarc.org/MHonArc/doc/resources/thead.html. -->
86<THEAD>
87<p>(<a href="$IDXFNAME$">go to $IDXLABEL$</a>)</p>
88<hr/>
89<div style="text-align: left;">$PGLINK(TPREV)$&nbsp;&nbsp;&nbsp;$PGLINK(TNEXT)$</div>
90<div style="text-align: center;">$PGLINKLIST(T5;T5)$</div>
91<ul>
92</THEAD>
93
94<TFOOT>
95</ul>
96<div style="text-align: center;">$PGLINKLIST(T5;T5)$</div>
97<div style="text-align: left;">$PGLINK(TPREV)$&nbsp;&nbsp;&nbsp;$PGLINK(TNEXT)$</div>
98</TFOOT>
99
100<!-- Per-message formatting on the indexed-by-date main page. -->
101<LITEMPLATE>
102<li><strong>$SUBJECT$</strong>
103<ul><li><em>From</em>: $FROM$,&nbsp;<em>$YYYYMMDD$</em></li></ul>
104</li>
105</LITEMPLATE>
106
107<!-- Per-message formatting on the thread page. -->
108<TTOPBEGIN>
109<li><strong>$SUBJECT$</strong>,
110<em><b>$FROMNAME$</b>, $YYYYMMDD$</em>
111</TTOPBEGIN>
112<TLITXT>
113<li><strong>$SUBJECT$</strong>,
114<em><b>$FROMNAME$</b>, $YYYYMMDD$</em>
115</TLITXT>
116<TSINGLETXT>
117<li><strong>$SUBJECT$</strong>,
118<em><b>$FROMNAME$</b>, $YYYYMMDD$</em>
119</TSINGLETXT>
120
121<!-- Modify appropriate resources to print our link at the bottom
122 of MHonArc generated pages. Notice how the custom resource
123 variable defined above can be used to include our link. -->
124
125<!-- Main index pages -->
126<IDXPGBEGIN>
127<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
128 "http://www.w3.org/TR/html4/loose.dtd">
129<html>
130<head>
131<title>$ML-NAME$ mailing list (by date)</title>
132</head>
133<body text="#000000" bgcolor="#FFFFFF">
134<p><a href="https://launchpad.net/"><img border="0" src="https://launchpad.net/@@/launchpad-logo-and-name.png" alt="Launchpad logo and name."/></a></p>
135<h1><center>$ML-FULL-TITLE$ (by date)</center></h1>
136</IDXPGBEGIN>
137
138<IDXPGEND>
139<hr/>
140<p><strong>This is the $ML-FULL-TITLE$&mdash;&nbsp;see also the
141general <a href="https://help.launchpad.net/Teams/MailingLists"
142>help for Launchpad.net mailing lists</a>.</strong></p>
143<p><em>(Formatted by <a href="$DOCURL$">MHonArc</a>.)</em></p>
144</body>
145</html>
146</IDXPGEND>
147
148<!-- Thread index pages -->
149<TIDXPGBEGIN>
150<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
151 "http://www.w3.org/TR/html4/loose.dtd">
152<html>
153<head>
154<title>$ML-NAME$ mailing list (by thread)</title>
155</head>
156<body text="#000000" bgcolor="#FFFFFF">
157<p><a href="https://launchpad.net/"><img border="0" src="https://launchpad.net/@@/launchpad-logo-and-name.png" alt="Launchpad logo and name."/></a></p>
158<h1><center>$ML-FULL-TITLE$ (by thread)</center></h1>
159</TIDXPGBEGIN>
160
161<TIDXPGEND>
162<hr/>
163<p><strong>This is the $ML-FULL-TITLE$&mdash;&nbsp;see also the
164general <a href="https://help.launchpad.net/Teams/MailingLists"
165>help for Launchpad.net mailing lists</a>.</strong></p>
166<p><em>(Formatted by <a href="$DOCURL$">MHonArc</a>.)</em></p>
167</body>
168</html>
169</TIDXPGEND>
170
171<!-- Message pages -->
172<MSGPGBEGIN>
173<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
174 "http://www.w3.org/TR/html4/loose.dtd">
175<html>
176<head>
177<title>$SUBJECTNA$</title>
178<link rev="made" href="mailto:$FROMADDR$">
179</head>
180<body text="#000000" bgcolor="#FFFFFF">
181<p><a href="https://launchpad.net/"><img border="0" src="https://launchpad.net/@@/launchpad-logo-and-name.png" alt="Launchpad logo and name."/></a></p>
182</MSGPGBEGIN>
183
184<MSGPGEND>
185<hr/>
186<p><strong>This is the $ML-FULL-TITLE$&mdash;&nbsp;see also the
187general <a href="https://help.launchpad.net/Teams/MailingLists"
188>help for Launchpad.net mailing lists</a>.</strong></p>
189<p><em>(Formatted by <a href="$DOCURL$">MHonArc</a>.)</em></p>
190</body>
191</html>
192</MSGPGEND>