Commit 79bde2b6 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

improve admin_toolbox:

* more translation
* remove unused condition for default_page because context should be a default page not a web section here.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@27171 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent f3d9dfb4
...@@ -69,9 +69,10 @@ ...@@ -69,9 +69,10 @@
translateString = context.Base_translateString\n translateString = context.Base_translateString\n
result = []\n result = []\n
portal_type = context.getPortalType()\n portal_type = context.getPortalType()\n
translated_portal_type = context.getTranslatedPortalType()\n
request = context.REQUEST\n request = context.REQUEST\n
current_web_section = request.current_web_section\n current_web_section = request.current_web_section\n
current_web_section_pt = current_web_section.getPortalType()\n current_web_section_translated_portal_type = current_web_section.getTranslatedPortalType()\n
action_dict = request.get(\'actions\', {}) # XXX actions needs to be renamed to action_dict\n action_dict = request.get(\'actions\', {}) # XXX actions needs to be renamed to action_dict\n
exchange_action_list = action_dict.get(\'object_exchange\', [])\n exchange_action_list = action_dict.get(\'object_exchange\', [])\n
button_action_list = action_dict.get(\'object_button\', [])\n button_action_list = action_dict.get(\'object_button\', [])\n
...@@ -97,34 +98,20 @@ editable_mode = int(request.form.get(\'editable_mode\', \n ...@@ -97,34 +98,20 @@ editable_mode = int(request.form.get(\'editable_mode\', \n
request.get(\'editable_mode\', 0)))\n request.get(\'editable_mode\', 0)))\n
# Append a button to edit the current document\n # Append a button to edit the current document\n
if not editable_mode:\n if not editable_mode:\n
# The title is called Edit only if the document can be edited\n edit_title = getActionTitleForContext(context, translated_portal_type)\n
if portal_type == \'Web Section\' and context.getDefaultDocumentValue() is not None:\n result.append(dict(\n
# try to show link to default page\n url = "%s/view?editable_mode:int=1&%s" \n
default_document = context.getDefaultDocumentValue()\n %(editable_absolute_url, http_parameters),\n
# change portal_type, this will be taken into account when determining parent action (below)\n icon = context.getIcon() or \'file_icon.gif\',\n
portal_type = default_document.getPortalType() \n title = edit_title,\n
edit_title = getActionTitleForContext(context, portal_type)\n label = "%s Icon" % translated_portal_type,))\n
result.append(dict(\n
url = "%s/view?editable_mode:int=1&%s" \n
%(default_document.absolute_url(), http_parameters),\n
icon = default_document.getIcon() or \'file_icon.gif\',\n
title = edit_title,\n
label = "%s Icon" % portal_type,))\n
else:\n
edit_title = getActionTitleForContext(context, portal_type)\n
result.append(dict(\n
url = "%s/view?editable_mode:int=1&%s" \n
%(editable_absolute_url, http_parameters),\n
icon = context.getIcon() or \'file_icon.gif\',\n
title = edit_title,\n
label = "%s Icon" % portal_type,))\n
else: \n else: \n
result.append(dict(\n result.append(dict(\n
url = "%s/view?editable_mode:int=0&%s" % (absolute_url, http_parameters),\n url = "%s/view?editable_mode:int=0&%s" % (absolute_url, http_parameters),\n
icon = context.getIcon() or \'file_icon.gif\',\n icon = context.getIcon() or \'file_icon.gif\',\n
title = translateString("View ${portal_type}", \n title = translateString("View ${portal_type}", \n
mapping=dict(portal_type=portal_type)),\n mapping=dict(portal_type=translated_portal_type)),\n
label = "%s Icon" % portal_type,))\n label = "%s Icon" % translated_portal_type,))\n
\n \n
# Append a button to edit the parent section\n # Append a button to edit the parent section\n
if portal_type not in (\'Web Section\', \'Web Site\'): \n if portal_type not in (\'Web Section\', \'Web Site\'): \n
...@@ -132,8 +119,8 @@ if portal_type not in (\'Web Section\', \'Web Site\'): \n ...@@ -132,8 +119,8 @@ if portal_type not in (\'Web Section\', \'Web Site\'): \n
url = "%s/view?editable_mode=1" % current_web_section.absolute_url(),\n url = "%s/view?editable_mode=1" % current_web_section.absolute_url(),\n
icon = current_web_section.getIcon(),\n icon = current_web_section.getIcon(),\n
title = translateString("Edit Parent ${portal_type}",\n title = translateString("Edit Parent ${portal_type}",\n
mapping=dict(portal_type=current_web_section_pt)),\n mapping=dict(portal_type=current_web_section_translated_portal_type)),\n
label = "%s Icon" % current_web_section_pt,))\n label = "%s Icon" % current_web_section_translated_portal_type,))\n
\n \n
# Append all icon buttons\n # Append all icon buttons\n
for action in button_action_list:\n for action in button_action_list:\n
...@@ -199,9 +186,10 @@ return result\n ...@@ -199,9 +186,10 @@ return result\n
<string>translateString</string> <string>translateString</string>
<string>result</string> <string>result</string>
<string>portal_type</string> <string>portal_type</string>
<string>translated_portal_type</string>
<string>request</string> <string>request</string>
<string>current_web_section</string> <string>current_web_section</string>
<string>current_web_section_pt</string> <string>current_web_section_translated_portal_type</string>
<string>action_dict</string> <string>action_dict</string>
<string>exchange_action_list</string> <string>exchange_action_list</string>
<string>button_action_list</string> <string>button_action_list</string>
...@@ -213,8 +201,6 @@ return result\n ...@@ -213,8 +201,6 @@ return result\n
<string>getActionTitleForContext</string> <string>getActionTitleForContext</string>
<string>int</string> <string>int</string>
<string>editable_mode</string> <string>editable_mode</string>
<string>None</string>
<string>default_document</string>
<string>edit_title</string> <string>edit_title</string>
<string>dict</string> <string>dict</string>
<string>_getiter_</string> <string>_getiter_</string>
......
...@@ -41,11 +41,12 @@ ...@@ -41,11 +41,12 @@
<!-- Floating Panel -->\n <!-- Floating Panel -->\n
\n \n
<!-- header_definitions must be re-called and is_web_mode rededined because calling\n <!-- header_definitions must be re-called and is_web_mode redefined because calling\n
the current page template through editor_field in the form layout seems to reset\n the current page template through editor_field in the form layout seems to reset\n
the context needed by action drop-down list.\n the context needed by action drop-down list.\n
\n \n
TODO: Is this case should be handle by automaticcaly by erp5_xhtml_style ?\n TODO: Is this case should be handle by automatically by erp5_xhtml_style ?\n
More translation is required.\n
-->\n -->\n
\n \n
<tal:block\n <tal:block\n
...@@ -82,10 +83,13 @@ ...@@ -82,10 +83,13 @@
the current object and which have no button equivalent\n the current object and which have no button equivalent\n
\n \n
We need to setup the actions variable from the request because\n We need to setup the actions variable from the request because\n
this template is called from outside the main rendering process-->\n this template is called from outside the main rendering process\n
\n
XXX - the location of context_box_render is hardcoded.\n
-->\n
<div class="adminSection">\n <div class="adminSection">\n
<h3><tal:block tal:content="portal_type"/> Actions</h3>\n <h3><tal:block tal:content="portal_type"/> Actions</h3>\n
<tal:block metal:use-macro="here/context_box_render/macros/action"/>\n <tal:block metal:use-macro="here/portal_skins/erp5_xhtml_style/context_box_render/macros/action"/>\n
</div>\n </div>\n
\n \n
<!-- Document creation panel.\n <!-- Document creation panel.\n
...@@ -115,7 +119,7 @@ ...@@ -115,7 +119,7 @@
<fieldset style="display:block;">\n <fieldset style="display:block;">\n
\n \n
<div class="field">\n <div class="field">\n
<label>Title</label>\n <label i18n:translate="" i18n:domain="ui">Title</label>\n
<div class="input">\n <div class="input">\n
<input class="input" size="12" \n <input class="input" size="12" \n
type="text" name="clone_title"\n type="text" name="clone_title"\n
...@@ -124,7 +128,7 @@ ...@@ -124,7 +128,7 @@
</div>\n </div>\n
\n \n
<div class="field">\n <div class="field">\n
<label>Reference</label>\n <label i18n:translate="" i18n:domain="ui">Reference</label>\n
<div class="input">\n <div class="input">\n
<input class="input" size="12" \n <input class="input" size="12" \n
type="text" name="clone_reference"\n type="text" name="clone_reference"\n
...@@ -133,7 +137,7 @@ ...@@ -133,7 +137,7 @@
</div>\n </div>\n
\n \n
<div class="field">\n <div class="field">\n
<label>Version</label>\n <label i18n:translate="" i18n:domain="ui">Version</label>\n
<div class="input">\n <div class="input">\n
<input class="input" size="5" \n <input class="input" size="5" \n
type="text" name="clone_version"\n type="text" name="clone_version"\n
...@@ -142,7 +146,7 @@ ...@@ -142,7 +146,7 @@
</div>\n </div>\n
\n \n
<div class="field">\n <div class="field">\n
<label>Language</label>\n <label i18n:translate="" i18n:domain="ui">Language</label>\n
<div class="input">\n <div class="input">\n
<input class="input" size="5" \n <input class="input" size="5" \n
type="text" name="clone_language"\n type="text" name="clone_language"\n
...@@ -150,16 +154,16 @@ ...@@ -150,16 +154,16 @@
</div>\n </div>\n
</div>\n </div>\n
\n \n
<div class="field hiddenLabel">\n <div class="field">\n
<label>Type</label>\n <label i18n:translate="" i18n:domain="ui">Portal type</label>\n
<div class="input">\n <div class="input">\n
<select class="input" name="clone_portal_type" \n <select class="input" name="clone_portal_type" \n
size="1" onchange="setCreationMode(this)">\n size="1" onchange="setCreationMode(this)">\n
<option value="None" selected>&mdash; Same as Current &mdash;</option>\n <option value="None" selected>&mdash; Same as Current &mdash;</option>\n
<tal:block tal:repeat="portal_type python: here.getPortalWebDocumentTypeList()">\n <option tal:repeat="portal_type python: here.getPortalWebDocumentTypeList()"\n
<option tal:content="portal_type"\n tal:content="portal_type"\n
tal:attributes="value portal_type"/>\n tal:attributes="value portal_type"\n
</tal:block>\n i18n:translate="" i18n:domain="ui">portal_type</option>\n
</select>\n </select>\n
</div>\n </div>\n
</div>\n </div>\n
...@@ -194,7 +198,7 @@ ...@@ -194,7 +198,7 @@
var action_name = \'Clone &amp; Edit\';\n var action_name = \'Clone &amp; Edit\';\n
var icon = \'admin_toolbox_clone_document.png\';\n var icon = \'admin_toolbox_clone_document.png\';\n
var name = \'Base_cloneContent:method\';\n var name = \'Base_cloneContent:method\';\n
var clone_class = \'\';\n var clone_display = \'inline\';\n
var new_title = \'\';\n var new_title = \'\';\n
\n \n
// a portal type is given, so create a new document\n // a portal type is given, so create a new document\n
...@@ -204,13 +208,13 @@ ...@@ -204,13 +208,13 @@
action_name = \'Create New &amp; Edit\';\n action_name = \'Create New &amp; Edit\';\n
icon = \'admin_toolbox_new_document.png\';\n icon = \'admin_toolbox_new_document.png\';\n
name = \'Base_newContent:method\';\n name = \'Base_newContent:method\';\n
clone_class = \'doNotDisplay\';\n clone_display = \'none\';\n
new_title = \'Create New Document\';\n new_title = \'Create New Document\';\n
}\n }\n
\n \n
// update action dependent values\n // update action dependent values\n
document.getElementById(\'create_new_document_title\').innerHTML = new_title;\n document.getElementById(\'create_new_document_title\').innerHTML = new_title;\n
document.getElementById(\'clone_document_title\' ).className = clone_class;\n document.getElementById(\'clone_document_title\' ).style.display = clone_display;\n
document.getElementById(\'duplicate_document_action\').innerHTML = action_name;\n document.getElementById(\'duplicate_document_action\').innerHTML = action_name;\n
\n \n
// replace the action icon\n // replace the action icon\n
......
813 814
\ No newline at end of file \ 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