﻿id	summary	reporter	owner	description	type	status	priority	component	severity	resolution	keywords	cc	release
7686	Support `ListOption`s with have a list as default value	martin_s	rjollos	"The `ListOption` can work with a comma or otherwise separated string or a list (or similar) as default argument. The underlying `getlist` is checking the type and handles both cases.
Unfortunately the IniAdminPlugin does not handles lists as default value and passes them to Genshi template where they are displayed without the separator.

For example the `ctxtnav_names` option of the AnnouncerPlugin has a default value of `[_('Watch This'),_('Unwatch This')]` which is shown as `Watch ThisUnwatch This` in the panel.

I like to suggest the following changes which resemble the way `getlist` handles this case:
{{{
#!diff
Index: iniadminplugin/0.11/iniadmin/iniadmin.py
===================================================================
--- iniadminplugin/0.11/iniadmin/iniadmin.py	(revision 8874)
+++ iniadminplugin/0.11/iniadmin/iniadmin.py	(working copy)
@@ -75,6 +75,9 @@
             value = self.env.config.get(page, option.name)
             # We assume the classes all end in ""Option""
             type = option.__class__.__name__.lower()[:-6] or 'text'
+            # Handle list option which have a list as default value
+            if type == 'list' and not isinstance(value,basestring):
+                value = unicode(option.sep).join(list(value))
             option_data  = {'name': option.name, 'default': option.default,
                            'doc': Markup(doc), 'value': value, 'type': type}
             if type == 'extension':
}}}"	enhancement	closed	normal	IniAdminPlugin	normal	fixed	ListOption	doki_pen	0.11
