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 @@
translateString = context.Base_translateString\n
result = []\n
portal_type = context.getPortalType()\n
translated_portal_type = context.getTranslatedPortalType()\n
request = context.REQUEST\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
exchange_action_list = action_dict.get(\'object_exchange\', [])\n
button_action_list = action_dict.get(\'object_button\', [])\n
......@@ -97,34 +98,20 @@ editable_mode = int(request.form.get(\'editable_mode\', \n
request.get(\'editable_mode\', 0)))\n
# Append a button to edit the current document\n
if not editable_mode:\n
# The title is called Edit only if the document can be edited\n
if portal_type == \'Web Section\' and context.getDefaultDocumentValue() is not None:\n
# try to show link to default page\n
default_document = context.getDefaultDocumentValue()\n
# change portal_type, this will be taken into account when determining parent action (below)\n
portal_type = default_document.getPortalType() \n
edit_title = getActionTitleForContext(context, 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
edit_title = getActionTitleForContext(context, translated_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
label = "%s Icon" % translated_portal_type,))\n
else: \n
result.append(dict(\n
url = "%s/view?editable_mode:int=0&%s" % (absolute_url, http_parameters),\n
icon = context.getIcon() or \'file_icon.gif\',\n
title = translateString("View ${portal_type}", \n
mapping=dict(portal_type=portal_type)),\n
label = "%s Icon" % portal_type,))\n
mapping=dict(portal_type=translated_portal_type)),\n
label = "%s Icon" % translated_portal_type,))\n
\n
# Append a button to edit the parent section\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
url = "%s/view?editable_mode=1" % current_web_section.absolute_url(),\n
icon = current_web_section.getIcon(),\n
title = translateString("Edit Parent ${portal_type}",\n
mapping=dict(portal_type=current_web_section_pt)),\n
label = "%s Icon" % current_web_section_pt,))\n
mapping=dict(portal_type=current_web_section_translated_portal_type)),\n
label = "%s Icon" % current_web_section_translated_portal_type,))\n
\n
# Append all icon buttons\n
for action in button_action_list:\n
......@@ -199,9 +186,10 @@ return result\n
<string>translateString</string>
<string>result</string>
<string>portal_type</string>
<string>translated_portal_type</string>
<string>request</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>exchange_action_list</string>
<string>button_action_list</string>
......@@ -213,8 +201,6 @@ return result\n
<string>getActionTitleForContext</string>
<string>int</string>
<string>editable_mode</string>
<string>None</string>
<string>default_document</string>
<string>edit_title</string>
<string>dict</string>
<string>_getiter_</string>
......
......@@ -41,11 +41,12 @@
<!-- Floating Panel -->\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 context needed by action drop-down list.\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
<tal:block\n
......@@ -82,10 +83,13 @@
the current object and which have no button equivalent\n
\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
<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
\n
<!-- Document creation panel.\n
......@@ -115,7 +119,7 @@
<fieldset style="display:block;">\n
\n
<div class="field">\n
<label>Title</label>\n
<label i18n:translate="" i18n:domain="ui">Title</label>\n
<div class="input">\n
<input class="input" size="12" \n
type="text" name="clone_title"\n
......@@ -124,7 +128,7 @@
</div>\n
\n
<div class="field">\n
<label>Reference</label>\n
<label i18n:translate="" i18n:domain="ui">Reference</label>\n
<div class="input">\n
<input class="input" size="12" \n
type="text" name="clone_reference"\n
......@@ -133,7 +137,7 @@
</div>\n
\n
<div class="field">\n
<label>Version</label>\n
<label i18n:translate="" i18n:domain="ui">Version</label>\n
<div class="input">\n
<input class="input" size="5" \n
type="text" name="clone_version"\n
......@@ -142,7 +146,7 @@
</div>\n
\n
<div class="field">\n
<label>Language</label>\n
<label i18n:translate="" i18n:domain="ui">Language</label>\n
<div class="input">\n
<input class="input" size="5" \n
type="text" name="clone_language"\n
......@@ -150,16 +154,16 @@
</div>\n
</div>\n
\n
<div class="field hiddenLabel">\n
<label>Type</label>\n
<div class="field">\n
<label i18n:translate="" i18n:domain="ui">Portal type</label>\n
<div class="input">\n
<select class="input" name="clone_portal_type" \n
size="1" onchange="setCreationMode(this)">\n
<option value="None" selected>&mdash; Same as Current &mdash;</option>\n
<tal:block tal:repeat="portal_type python: here.getPortalWebDocumentTypeList()">\n
<option tal:content="portal_type"\n
tal:attributes="value portal_type"/>\n
</tal:block>\n
<option tal:repeat="portal_type python: here.getPortalWebDocumentTypeList()"\n
tal:content="portal_type"\n
tal:attributes="value portal_type"\n
i18n:translate="" i18n:domain="ui">portal_type</option>\n
</select>\n
</div>\n
</div>\n
......@@ -194,7 +198,7 @@
var action_name = \'Clone &amp; Edit\';\n
var icon = \'admin_toolbox_clone_document.png\';\n
var name = \'Base_cloneContent:method\';\n
var clone_class = \'\';\n
var clone_display = \'inline\';\n
var new_title = \'\';\n
\n
// a portal type is given, so create a new document\n
......@@ -204,13 +208,13 @@
action_name = \'Create New &amp; Edit\';\n
icon = \'admin_toolbox_new_document.png\';\n
name = \'Base_newContent:method\';\n
clone_class = \'doNotDisplay\';\n
clone_display = \'none\';\n
new_title = \'Create New Document\';\n
}\n
\n
// update action dependent values\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
\n
// replace the action icon\n
......
813
\ No newline at end of file
814
\ 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