~xav0989/ubuntu/vivid/mailman/ubuntu-logo

« back to all changes in this revision

Viewing changes to Mailman/HTMLFormatter.py

  • Committer: Bazaar Package Importer
  • Author(s): Thijs Kinkhorst
  • Date: 2008-04-24 19:30:49 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20080424193049-jy5fa9tus40tjbmn
Tags: 1:2.1.10-2
Apply upstream patch to fix regression in cmd_subscribe
so that email subscribe to the -subscribe or -join address or the
-request address with a bare 'subscribe' command results in the message
being shunted.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 1998-2006 by the Free Software Foundation, Inc.
 
1
# Copyright (C) 1998-2008 by the Free Software Foundation, Inc.
2
2
#
3
3
# This program is free software; you can redistribute it and/or
4
4
# modify it under the terms of the GNU General Public License
60
60
                         _('Overview of all %(hostname)s mailing lists')),
61
61
                    '<p>', MailmanLogo()))).Format()
62
62
 
63
 
    def FormatUsers(self, digest, lang=None):
 
63
    def FormatUsers(self, digest, lang=None, list_hidden=False):
64
64
        if lang is None:
65
65
            lang = self.preferred_language
66
66
        conceal_sub = mm_cfg.ConcealSubscription
67
67
        people = []
68
68
        if digest:
69
 
            digestmembers = self.getDigestMemberKeys()
70
 
            for dm in digestmembers:
71
 
                if not self.getMemberOption(dm, conceal_sub):
72
 
                    people.append(dm)
73
 
            num_concealed = len(digestmembers) - len(people)
 
69
            members = self.getDigestMemberKeys()
74
70
        else:
75
71
            members = self.getRegularMemberKeys()
76
 
            for m in members:
77
 
                if not self.getMemberOption(m, conceal_sub):
78
 
                    people.append(m)
79
 
            num_concealed = len(members) - len(people)
 
72
        for m in members:
 
73
            if list_hidden or not self.getMemberOption(m, conceal_sub):
 
74
                people.append(m)
 
75
        num_concealed = len(members) - len(people)
80
76
        if num_concealed == 1:
81
77
            concealed = _('<em>(1 private member not shown)</em>')
82
78
        elif num_concealed > 1:
410
406
            d['<mm-favicon>'] = mm_cfg.IMAGE_LOGOS + mm_cfg.SHORTCUT_ICON
411
407
        return d
412
408
 
413
 
    def GetAllReplacements(self, lang=None):
 
409
    def GetAllReplacements(self, lang=None, list_hidden=False):
414
410
        """
415
411
        returns standard replaces plus formatted user lists in
416
412
        a dict just like GetStandardReplacements.
418
414
        if lang is None:
419
415
            lang = self.preferred_language
420
416
        d = self.GetStandardReplacements(lang)
421
 
        d.update({"<mm-regular-users>": self.FormatUsers(0, lang),
422
 
                  "<mm-digest-users>": self.FormatUsers(1, lang)})
 
417
        d.update({"<mm-regular-users>": self.FormatUsers(0, lang, list_hidden),
 
418
                  "<mm-digest-users>": self.FormatUsers(1, lang, list_hidden)})
423
419
        return d
424
420
 
425
421
    def GetLangSelectBox(self, lang=None, varname='language'):