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