plugin pubsub schema, tools (common/template xmlui): use a JID for publisher:
- a JidWidget is used instead of text for publisher, nothing is set if publisher attribute doesn't exist - added missing JidWidget implementation in tools.common.template_xmlui
This commit is contained in:
parent
a693f9f53e
commit
9780bd3480
1 changed files with 24 additions and 10 deletions
|
|
@ -310,17 +310,23 @@ class PubsubSchema(object):
|
|||
form = data_form.Form.fromElement(x_elt)
|
||||
if form_ns and form.formNamespace != form_ns:
|
||||
continue
|
||||
prepend = [
|
||||
("label", "id"),
|
||||
("text", item_elt["id"], "id"),
|
||||
("label", "publisher"),
|
||||
]
|
||||
try:
|
||||
publisher = jid.JID(item_elt['publisher'])
|
||||
except (KeyError, jid.InvalidFormat):
|
||||
pass
|
||||
else:
|
||||
prepend.append(("jid", publisher, "publisher"))
|
||||
xmlui = xml_tools.dataFormResult2XMLUI(
|
||||
form,
|
||||
schema_form,
|
||||
# FIXME: conflicts with schema (i.e. if "id" or "publisher" already exists)
|
||||
# are not checked
|
||||
prepend=(
|
||||
("label", "id"),
|
||||
("text", item_elt["id"], "id"),
|
||||
("label", "publisher"),
|
||||
("text", item_elt.getAttribute("publisher", ""), "publisher"),
|
||||
),
|
||||
prepend=prepend,
|
||||
filters=filters,
|
||||
read_only=False,
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in a new issue