Commit cca56f79 authored by Gabriel Monnerat's avatar Gabriel Monnerat

2010-12-14 gabriel

* Refactor code to use ERP5 System Templates to create each allowed document in UNG Web Site.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@41429 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 3425abf0
......@@ -51,15 +51,28 @@
<item>
<key> <string>_body</string> </key>
<value> <string>request = context.REQUEST\n
portal_type = request.get("select_action", selection_action)\n
template_name = template or request.get("template")\n
if template_name is None:\n
return None\n
\n
template_relative_url = "portal_preferences/ung_preference/%s" % template_name\n
# Create the new content in appropriate module\n
portal_object = context.getPortalObject()\n
module = portal_object.getDefaultModule(portal_type)\n
portal = context.getPortalObject()\n
template = portal.restrictedTraverse(template_relative_url)\n
preference = template.getParentValue()\n
\n
preference.manage_copyObjects(ids=[template.getId()], REQUEST=request, RESPONSE=None)\n
new_content_list = portal.web_page_module.manage_pasteObjects(request[\'__cp\'])\n
new_content_id = new_content_list[0][\'new_id\']\n
new_content = portal.web_page_module[new_content_id]\n
new_content.makeTemplateInstance()\n
\n
portal_type = new_content.getPortalType()\n
module = portal.getDefaultModule(portal_type)\n
new_object = module.newContent(portal_type=portal_type)\n
\n
kw["webpage_path"] = new_object.getPath()\n
return new_object.Base_redirect(context.Base_getEditorViewName(portal_type), \n
return new_content.Base_redirect(context.Base_getEditorViewName(portal_type), \n
keep_items = dict(editable_mode=1, **kw))\n
</string> </value>
</item>
......@@ -71,7 +84,7 @@ return new_object.Base_redirect(context.Base_getEditorViewName(portal_type), \n
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>selection_action=None, **kw</string> </value>
<value> <string>template=None, **kw</string> </value>
</item>
<item>
<key> <string>errors</string> </key>
......@@ -97,13 +110,21 @@ return new_object.Base_redirect(context.Base_getEditorViewName(portal_type), \n
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>selection_action</string>
<string>template</string>
<string>kw</string>
<string>_getattr_</string>
<string>context</string>
<string>request</string>
<string>template_name</string>
<string>None</string>
<string>template_relative_url</string>
<string>portal</string>
<string>preference</string>
<string>_getitem_</string>
<string>new_content_list</string>
<string>new_content_id</string>
<string>new_content</string>
<string>portal_type</string>
<string>portal_object</string>
<string>module</string>
<string>new_object</string>
<string>_write_</string>
......
......@@ -40,23 +40,23 @@
<div class="gadget-action">\n
<div class="menu_create_object">\n
<tal:block tal:define="portal_path here/absolute_url;\n
url_suffix python: \'/ERP5Site_createNewWebDocument?select_action=\'">\n
url_suffix python: \'/ERP5Site_createNewWebDocument?template=\'">\n
<li><a id="current">Create New<img tal:attributes="src python: portal_path + \'/ung_images/arrow.png\'"></a>\n
<ul>\n
<li>\n
<a tal:attributes="href python: portal_path + url_suffix + \'Web Illustration\'">\n
<a tal:attributes="href python: portal_path + url_suffix + \'web_illustration_template\'">\n
<img tal:attributes="src python: portal_path + \'/ung_images/svg.png\'">\n
Web Illustration\n
</a>\n
</li>\n
<li>\n
<a tal:attributes="href python: portal_path + url_suffix +\'Web Table\'">\n
<a tal:attributes="href python: portal_path + url_suffix + \'web_table_template\'">\n
<img tal:attributes="src python: portal_path + \'/ung_images/table.jpg\'">\n
Web Table\n
</a>\n
</li>\n
<li>\n
<a tal:attributes="href python: portal_path + url_suffix + \'Web Page\'">\n
<a tal:attributes="href python: portal_path + url_suffix + \'web_page_template\'">\n
<img tal:attributes="src python: portal_path + \'/ung_images/document.gif\'">\n
Web Page\n
</a>\n
......
2010-12-14 gabriel
* Refactor code to use ERP5 System Templates to create each allowed document in UNG Web Site.
* Added one preference and one template for each allowed object in UNG Web Site
2010-12-13 gabriel
......
......@@ -3,5 +3,4 @@ Experimental theme to provide an UNG experience as part of an ERP5 web site.
TODO:
- Define naming conventions for jquery
- Clean up the javascript code
- SpreadSheet Formula is ignored when the document is uploaded
- Change UNG Web Site to use ERP5 System Templates
\ No newline at end of file
- SpreadSheet Formula is ignored when the document is uploaded
\ No newline at end of file
124
\ No newline at end of file
125
\ No newline at end of file
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