Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
erp5_rtl_support
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Romain Courteaud
erp5_rtl_support
Commits
eedd20e5
Commit
eedd20e5
authored
Jan 02, 2015
by
Sven Franck
Committed by
Xiaowu Zhang
Jan 12, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_web_renderjs_ui: improved translation handling and cleanup
parent
1f5af98b
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
42 additions
and
52 deletions
+42
-52
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_header_js.xml
...emplateItem/web_page_module/rjs_gadget_erp5_header_js.xml
+3
-10
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_listbox_js.xml
...mplateItem/web_page_module/rjs_gadget_erp5_listbox_js.xml
+13
-8
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_actionpage_js.xml
...Item/web_page_module/rjs_gadget_erp5_pt_actionpage_js.xml
+13
-17
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_breadcrumbpage_js.xml
.../web_page_module/rjs_gadget_erp5_pt_breadcrumbpage_js.xml
+5
-11
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_frontpage_js.xml
...eItem/web_page_module/rjs_gadget_erp5_pt_frontpage_js.xml
+4
-3
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_searchfield_js.xml
...teItem/web_page_module/rjs_gadget_erp5_searchfield_js.xml
+4
-3
No files found.
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_header_js.xml
View file @
eedd20e5
...
@@ -286,10 +286,8 @@
...
@@ -286,10 +286,8 @@
if (options.hasOwnProperty("breadcrumb_url")) {\n
if (options.hasOwnProperty("breadcrumb_url")) {\n
title_link.url = options.breadcrumb_url;\n
title_link.url = options.breadcrumb_url;\n
promise_list.push(gadget.translateHtml(header_title_link_template(title_link)));\n
promise_list.push(gadget.translateHtml(header_title_link_template(title_link)));\n
//gadget.props.title_element.innerHTML = header_title_link_template(title_link);\n
} else {\n
} else {\n
promise_list.push(gadget.translateHtml(header_title_template(title_link)));\n
promise_list.push(gadget.translateHtml(header_title_template(title_link)));\n
//gadget.props.title_element.innerHTML = header_title_template(title_link);\n
}\n
}\n
\n
\n
// Handle left link\n
// Handle left link\n
...
@@ -317,13 +315,10 @@
...
@@ -317,13 +315,10 @@
}\n
}\n
}\n
}\n
if
(left_button
!==
undefined)
{\n
if
(left_button
!==
undefined)
{\n
//
gadget.props.left_link.innerHTML =
header_button_template(left_button);\n
promise_list.push(gadget.translateHtml(header_button_template(left_button)));\n
promise_list.push(gadget.translateHtml(header_button_template(left_button)));\n
}
else
if
(
left_link =
==
undefined)
{\n
}
else
if
(
left_link =
==
undefined)
{\n
//
gadget.props.left_link.innerHTML =
""
;\n
promise_list.push(gadget.translateHtml(""));\n
promise_list.push(gadget.translateHtml(""));\n
}
else
{\n
}
else
{\n
//
gadget.props.left_link.innerHTML =
header_link_template(left_link);\n
promise_list.push(gadget.translateHtml(header_link_template(left_link)));\n
promise_list.push(gadget.translateHtml(header_link_template(left_link)));\n
}\n
}\n
\n
\n
...
@@ -373,13 +368,10 @@
...
@@ -373,13 +368,10 @@
}\n
}\n
if
(right_button
!==
undefined)
{\n
if
(right_button
!==
undefined)
{\n
promise_list.push(gadget.translateHtml(header_button_template(right_button)));\n
promise_list.push(gadget.translateHtml(header_button_template(right_button)));\n
//
gadget.props.right_link.innerHTML =
header_button_template(right_button);\n
}
else
if
(right_link
!==
undefined)
{\n
}
else
if
(right_link
!==
undefined)
{\n
promise_list.push(gadget.translateHtml(header_link_template(right_link)));\n
promise_list.push(gadget.translateHtml(header_link_template(right_link)));\n
//
gadget.props.right_link.innerHTML =
header_link_template(right_link);\n
}
else
{\n
}
else
{\n
promise_list.push(gadget.translateHtml(""));\n
promise_list.push(gadget.translateHtml(""));\n
//
gadget.props.right_link.innerHTML =
""
;\n
}\n
}\n
\n
\n
//
Handle
sub
header\n
//
Handle
sub
header\n
...
@@ -408,6 +400,7 @@
...
@@ -408,6 +400,7 @@
//
gadget.props.sub_header_ul.innerHTML =
sub_header_template({\n
//
gadget.props.sub_header_ul.innerHTML =
sub_header_template({\n
//
sub_header_list:
sub_header_list\n
//
sub_header_list:
sub_header_list\n
//});\n
//});\n
\n
promise_list.push(gadget.translateHtml(sub_header_template({\n
promise_list.push(gadget.translateHtml(sub_header_template({\n
sub_header_list:
sub_header_list\n
sub_header_list:
sub_header_list\n
})));\n
})));\n
...
@@ -588,7 +581,7 @@
...
@@ -588,7 +581,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
940.
1374.53791.13363
</string>
</value>
<value>
<string>
940.
2108.16108.5614
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -606,7 +599,7 @@
...
@@ -606,7 +599,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
1420
191334.15
</float>
<float>
1420
237508.03
</float>
<string>
GMT
</string>
<string>
GMT
</string>
</tuple>
</tuple>
</state>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_listbox_js.xml
View file @
eedd20e5
...
@@ -204,7 +204,6 @@
...
@@ -204,7 +204,6 @@
}).push(function (result) {\n
}).push(function (result) {\n
var promise_list = [result];\n
var promise_list = [result];\n
counter = Math.min(result.data.total_rows, lines);\n
counter = Math.min(result.data.total_rows, lines);\n
\n
for (i = 0; i < counter; i += 1) {\n
for (i = 0; i < counter; i += 1) {\n
promise_list.push(\n
promise_list.push(\n
gadget.whoWantToDisplayThis(result.data.rows[i].id)\n
gadget.whoWantToDisplayThis(result.data.rows[i].id)\n
...
@@ -272,6 +271,8 @@
...
@@ -272,6 +271,8 @@
paging_info = document.createElement("span"),\n
paging_info = document.createElement("span"),\n
paging_menu = document.createElement("div"),\n
paging_menu = document.createElement("div"),\n
paging_wrap = document.createElement("div"),\n
paging_wrap = document.createElement("div"),\n
temp = document.createElement("div"),\n
temp_table = document.createElement("table"),\n
len;\n
len;\n
\n
\n
th.setAttribute("colspan", field_json.column_list.length);\n
th.setAttribute("colspan", field_json.column_list.length);\n
...
@@ -322,14 +323,18 @@
...
@@ -322,14 +323,18 @@
for (len = table.children.length; len > 0; len -= 1) {\n
for (len = table.children.length; len > 0; len -= 1) {\n
table.removeChild(table.lastChild);\n
table.removeChild(table.lastChild);\n
}\n
}\n
\n
table.appendChild(fragment);\n
\n
\n
// XXX: DOM touches\n
// NOTE: for passing translations, temp must contain a table\n
return gadget.translateHtml(gadget.props.element.innerHTML);\n
temp_table.appendChild(fragment);\n
temp.appendChild(temp_table);\n
\n
return gadget.translateHtml(temp.innerHTML);\n
})\n
})\n
.push(function (my_translated_html) {\n
.push(function (my_translated_html) {\n
gadget.props.element.innerHTML = my_translated_html;\n
var temp = document.createElement("div");\n
\n
temp.innerHTML = my_translated_html;\n
gadget.props.element.appendChild(temp.firstElementChild);\n
return gadget;\n
return gadget;\n
});\n
});\n
});\n
});\n
...
@@ -471,7 +476,7 @@
...
@@ -471,7 +476,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
9
39.51316.12701.36232
</string>
</value>
<value>
<string>
9
40.2150.5227.15428
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -489,7 +494,7 @@
...
@@ -489,7 +494,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
14
19419239.32
</float>
<float>
14
20237871.41
</float>
<string>
GMT
</string>
<string>
GMT
</string>
</tuple>
</tuple>
</state>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_actionpage_js.xml
View file @
eedd20e5
...
@@ -147,6 +147,7 @@
...
@@ -147,6 +147,7 @@
.declareMethod("render", function (options) {\n
.declareMethod("render", function (options) {\n
var gadget = this,\n
var gadget = this,\n
erp5_document,\n
erp5_document,\n
result_list,\n
view_list;\n
view_list;\n
\n
\n
return gadget.jio_get({"_id": options.jio_key})\n
return gadget.jio_get({"_id": options.jio_key})\n
...
@@ -173,6 +174,8 @@
...
@@ -173,6 +174,8 @@
.push(function (all_result) {\n
.push(function (all_result) {\n
var i,\n
var i,\n
tab_list = [];\n
tab_list = [];\n
\n
result_list = all_result;\n
\n
\n
for (i = 2; i < all_result.length; i += 1) {\n
for (i = 2; i < all_result.length; i += 1) {\n
tab_list.push({\n
tab_list.push({\n
...
@@ -181,29 +184,22 @@
...
@@ -181,29 +184,22 @@
i18n: view_list[i - 2].title\n
i18n: view_list[i - 2].title\n
});\n
});\n
}\n
}\n
\n
\n
\n
return gadget.translateHtml(table_template({\n
gadget.props.element.innerHTML = table_template({\n
definition_title: "Workflow Transitions",\n
definition_title: "Workflow Transitions",\n
documentlist: tab_list,\n
documentlist: tab_list,\n
definition_i18n: "Workflow-Transitions"\n
definition_i18n: "Workflow-Transitions"\n
});\n
})); \n
})\n
.push(function (my_translated_html) {\n
gadget.props.element.innerHTML = my_translated_html;\n
\n
\n
return gadget.renderPageHeader({\n
return gadget.renderPageHeader({\n
back_url:
all_resul
t[0],\n
back_url:
result_lis
t[0],\n
page_title: erp5_document.title,\n
page_title: erp5_document.title,\n
breadcrumb_url:
all_resul
t[1]\n
breadcrumb_url:
result_lis
t[1]\n
});\n
});\n
})\n
// XXX: DOM touches\n
.push(function () {\n
return gadget.translateHtml(gadget.props.element.innerHTML);\n
})\n
.push(function (my_translated_html) {\n
gadget.props.element.innerHTML = my_translated_html;\n
});\n
});\n
\n
\n
});\n
});\n
\n
\n
}(window, rJS, RSVP, Handlebars));
}(window, rJS, RSVP, Handlebars));
...
@@ -343,7 +339,7 @@
...
@@ -343,7 +339,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
9
39.52883.40109.10154
</string>
</value>
<value>
<string>
9
40.2136.15566.12765
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -361,7 +357,7 @@
...
@@ -361,7 +357,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
14
19417919.9
4
</float>
<float>
14
20237984.6
4
</float>
<string>
GMT
</string>
<string>
GMT
</string>
</tuple>
</tuple>
</state>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_breadcrumbpage_js.xml
View file @
eedd20e5
...
@@ -198,21 +198,15 @@
...
@@ -198,21 +198,15 @@
return parent_queue;\n
return parent_queue;\n
})\n
})\n
.push(function () {\n
.push(function () {\n
gadget.props.element.innerHTML =
table_template({\n
return gadget.translateHtml(
table_template({\n
definition_title: "Breadcrumb",\n
definition_title: "Breadcrumb",\n
documentlist: parent_list\n
documentlist: parent_list\n
});\n
}));\n
\n
return gadget.renderPageHeader(header_options);\n
})\n
// XXX: DOM touches\n
.push(function () {\n
return gadget.translateHtml(gadget.props.element.innerHTML);\n
})\n
})\n
.push(function (my_translated_html) {\n
.push(function (my_translated_html) {\n
gadget.props.element.innerHTML = my_translated_html;\n
gadget.props.element.innerHTML = my_translated_html;\n
return gadget.renderPageHeader(header_options);\n
});\n
});\n
\n
});\n
});\n
\n
\n
}(window, rJS, RSVP, Handlebars, URI));
</string>
</value>
}(window, rJS, RSVP, Handlebars, URI));
</string>
</value>
...
@@ -350,7 +344,7 @@
...
@@ -350,7 +344,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
9
39.52887.29595.20992
</string>
</value>
<value>
<string>
9
40.1898.34631.55091
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -368,7 +362,7 @@
...
@@ -368,7 +362,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
14
19417866.54
</float>
<float>
14
20236895.39
</float>
<string>
GMT
</string>
<string>
GMT
</string>
</tuple>
</tuple>
</state>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_frontpage_js.xml
View file @
eedd20e5
...
@@ -228,7 +228,8 @@
...
@@ -228,7 +228,8 @@
return gadget.translateHtml(result_html);\n
return gadget.translateHtml(result_html);\n
})\n
})\n
.push(function (my_translated_html) {\n
.push(function (my_translated_html) {\n
gadget.props.element.querySelector(\'.document_list\').innerHTML = my_translated_html;\n
gadget.props.element.querySelector(\'.document_list\').innerHTML =\n
my_translated_html;\n
});\n
});\n
});\n
});\n
}(window, rJS, RSVP, Handlebars));
}(window, rJS, RSVP, Handlebars));
...
@@ -368,7 +369,7 @@
...
@@ -368,7 +369,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
9
39.43978.9403.31744
</string>
</value>
<value>
<string>
9
40.1897.57739.49578
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -386,7 +387,7 @@
...
@@ -386,7 +387,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
14
19417516.48
</float>
<float>
14
20236486.36
</float>
<string>
GMT
</string>
<string>
GMT
</string>
</tuple>
</tuple>
</state>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_searchfield_js.xml
View file @
eedd20e5
...
@@ -163,7 +163,8 @@
...
@@ -163,7 +163,8 @@
}));\n
}));\n
})\n
})\n
.push(function (my_translated_html) {\n
.push(function (my_translated_html) {\n
search_gadget.props.element.querySelector("form").innerHTML = my_translated_html;\n
search_gadget.props.element.querySelector("form").innerHTML = \n
my_translated_html;\n
return search_gadget;\n
return search_gadget;\n
});\n
});\n
})\n
})\n
...
@@ -337,7 +338,7 @@
...
@@ -337,7 +338,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
9
39.62632.40457.51063
</string>
</value>
<value>
<string>
9
40.1897.14544.10120
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -355,7 +356,7 @@
...
@@ -355,7 +356,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
14
19934628.57
</float>
<float>
14
20236368.31
</float>
<string>
GMT
</string>
<string>
GMT
</string>
</tuple>
</tuple>
</state>
</state>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment