Commit 91e081b5 authored by Romain Courteaud's avatar Romain Courteaud

[erp5_administration] Support editing components

parent 13c52bb3
...@@ -7,21 +7,34 @@ class Message: ...@@ -7,21 +7,34 @@ class Message:
Supports both being displayed in a listbox and being printed. Supports both being displayed in a listbox and being printed.
""" """
def __init__(self, location, message, edit_url): def __init__(self, location, message, edit_url, jio_key=None):
self.location = location self.location = location
self.message = message self.message = message
self.edit_url = edit_url self.edit_url = edit_url
self.jio_key = jio_key
def getListItemUrl(self, *args, **kw): def getListItemUrl(self, *args, **kw):
return self.edit_url return self.edit_url
def getListItemUrlDict(self, *args, **kw): def getListItemUrlDict(self, *args, **kw):
return { if self.jio_key is None:
'command': 'raw', # Use raw portal skins edition
'options': { return {
'url': self.edit_url 'command': 'raw',
'options': {
'url': self.edit_url
}
}
else:
# Stay in ERP5JS
# XXX How to focus on the line to change directly?
return {
'command': 'push_history',
'options': {
'jio_key': self.jio_key,
'editable': True,
}
} }
}
def __repr__(self): def __repr__(self):
return "{}:{}".format(self.location, self.message) return "{}:{}".format(self.location, self.message)
...@@ -60,7 +73,8 @@ def checkComponent(component_instance): ...@@ -60,7 +73,8 @@ def checkComponent(component_instance):
Message( Message(
location="{component_path}:{row}:{column}".format(**annotation), location="{component_path}:{row}:{column}".format(**annotation),
message=annotation["text"], message=annotation["text"],
edit_url="{component_path}?line={row}".format(**annotation),)) edit_url="{component_path}?line={row}".format(**annotation),
jio_key=annotation['component_path'],),)
# Check scripts # Check scripts
script_container_list = [] script_container_list = []
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment