From 166ea4ff90ee31e7cb702dc12b9d108dac773d9e Mon Sep 17 00:00:00 2001 From: Mark Sapiro Date: Sat, 10 Jan 2015 21:22:36 -0800 Subject: Implement a new WEB_HEAD_ADD setting to specify text to be added to the section of Mailman's internally generated web pages. --- Mailman/Defaults.py.in | 16 +++++++++++++++- Mailman/htmlformat.py | 4 +++- NEWS | 5 +++++ 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/Mailman/Defaults.py.in b/Mailman/Defaults.py.in index 2834d98d..bec3e441 100755 --- a/Mailman/Defaults.py.in +++ b/Mailman/Defaults.py.in @@ -1,6 +1,6 @@ # -*- python -*- -# Copyright (C) 1998-2014 by the Free Software Foundation, Inc. +# Copyright (C) 1998-2015 by the Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License @@ -224,6 +224,20 @@ WEB_VLINK_COLOR = '' # If true, forces VLINK= WEB_HIGHLIGHT_COLOR = '#dddddd' # If true, alternating rows # in listinfo & admin display +# If you wish to include extra elements in the section of Mailman's +# web pages, e.g. style information or a link to a style sheet, you can set +# the following. For example, to include a css style sheet reference, you +# can put in mm_cfg.py +# WEB_HEAD_ADD = """""" +# You can specify anything that is allowed in the section. The default +# is to not add anything. This only applies to internally generated pages. +# For pages built from templates you can create custom templates containing +# this information. +WEB_HEAD_ADD = None + # User entered data is escaped for redisplay in web responses to avoid Cross # Site Scripting (XSS) attacks. The normal escaping replaces the characters # <, >, & and " with the respective HTML entities <, >, & and diff --git a/Mailman/htmlformat.py b/Mailman/htmlformat.py index d02780d1..419fa296 100755 --- a/Mailman/htmlformat.py +++ b/Mailman/htmlformat.py @@ -1,4 +1,4 @@ -# Copyright (C) 1998-2014 by the Free Software Foundation, Inc. +# Copyright (C) 1998-2015 by the Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License @@ -318,6 +318,8 @@ class Document(Container): 'content="text/html; charset=%s">' % charset) if self.title: output.append('%s%s' % (tab, self.title)) + if mm_cfg.WEB_HEAD_ADD: + output.append(mm_cfg.WEB_HEAD_ADD) output.append('%s' % tab) quals = [] # Default link colors diff --git a/NEWS b/NEWS index aea5380f..2c05020c 100755 --- a/NEWS +++ b/NEWS @@ -9,6 +9,11 @@ Here is a history of user visible changes to Mailman. New Features + - There is a new WEB_HEAD_ADD setting to specify text to be added to the + section of Mailman's internally generated web pages. This doesn't + apply to pages built from templates, but in those cases, custom templates + can be created. (LP: #1409396) + - There is a new DEFAULT_SUBSCRIBE_OR_INVITE setting. Set this to Yes to make the default selection on the admin Mass Subscriptions page Invite rather than Subscribe. (LP: #1404511) -- cgit v1.2.3