Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5-Boxiang
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Hamza
erp5-Boxiang
Commits
300e2f1a
Commit
300e2f1a
authored
Dec 21, 2015
by
Xiaowu Zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_web_renderjs_ui: available to hide item in listbox
parent
427fa528
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
963 additions
and
213 deletions
+963
-213
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_form_js.xml
...hTemplateItem/web_page_module/rjs_gadget_erp5_form_js.xml
+3
-2
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_listbox_html.xml
...lateItem/web_page_module/rjs_gadget_erp5_listbox_html.xml
+128
-15
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
+295
-177
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_list_js.xml
...eItem/web_page_module/rjs_gadget_erp5_pt_form_list_js.xml
+3
-2
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_listbox_zuite/testHideItem.xml
...m/portal_tests/renderjs_ui_listbox_zuite/testHideItem.xml
+468
-0
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_listbox_zuite/testSort.xml
...eItem/portal_tests/renderjs_ui_listbox_zuite/testSort.xml
+8
-2
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_listbox_zuite/testSortItemAutoBuild.xml
...tests/renderjs_ui_listbox_zuite/testSortItemAutoBuild.xml
+16
-4
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_listbox_zuite/testSortItemDelete.xml
...al_tests/renderjs_ui_listbox_zuite/testSortItemDelete.xml
+8
-2
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_listbox_zuite/testSortWithPager.xml
...tal_tests/renderjs_ui_listbox_zuite/testSortWithPager.xml
+8
-3
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_listbox_zuite/testSortWithPreviousNext.xml
...ts/renderjs_ui_listbox_zuite/testSortWithPreviousNext.xml
+8
-2
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_router_zuite/testCommandSelectionNextJumpToNextDocument.xml
...uter_zuite/testCommandSelectionNextJumpToNextDocument.xml
+9
-2
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_router_zuite/testCommandSelectionPreviousJumpToPreviousDocument.xml
...te/testCommandSelectionPreviousJumpToPreviousDocument.xml
+9
-2
No files found.
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_form_js.xml
View file @
300e2f1a
...
@@ -221,6 +221,7 @@
...
@@ -221,6 +221,7 @@
if (form_definition.extended_search) {\n
if (form_definition.extended_search) {\n
suboption_dict.extended_search = form_definition.extended_search;\n
suboption_dict.extended_search = form_definition.extended_search;\n
}\n
}\n
suboption_dict.hide_enabled = form_definition.hide_enabled;\n
\n
\n
form_gadget.props.gadget_list = [];\n
form_gadget.props.gadget_list = [];\n
form_gadget.props.id = erp5_document._id;\n
form_gadget.props.id = erp5_document._id;\n
...
@@ -527,7 +528,7 @@
...
@@ -527,7 +528,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
947.
29788.20746.53162
</string>
</value>
<value>
<string>
947.
61242.55162.62464
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -545,7 +546,7 @@
...
@@ -545,7 +546,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
14
48902825.06
</float>
<float>
14
50703702.65
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_listbox_html.xml
View file @
300e2f1a
...
@@ -116,37 +116,150 @@
...
@@ -116,37 +116,150 @@
<script
src=
"rsvp.js"
type=
"text/javascript"
></script>
\n
<script
src=
"rsvp.js"
type=
"text/javascript"
></script>
\n
<script
src=
"renderjs.js"
type=
"text/javascript"
></script>
\n
<script
src=
"renderjs.js"
type=
"text/javascript"
></script>
\n
<script
src=
"URI.js"
type=
"text/javascript"
></script>
\n
<script
src=
"URI.js"
type=
"text/javascript"
></script>
\n
<script
src=
"handlebars.js"
type=
"text/javascript"
></script>
\n
\n
\n
\n
\n
\n
<!-- custom script -->
\n
<!-- custom script -->
\n
<script
src=
"gadget_erp5_field_listbox.js"
type=
"text/javascript"
></script>
\n
<script
src=
"gadget_erp5_field_listbox.js"
type=
"text/javascript"
></script>
\n
\n
\n
</head>
\n
<script
id=
"listbox-hidden-thead-template"
type=
"text/x-handlebars-template"
>
\n
<body>
\n
<table>
\n
\n
<thead
class=
"ui-bar-inherit head"
>
\n
<!-- XXX must set a theme here -->
\n
<tr>
\n
<section
class=
"document_table"
>
\n
{{#if show_anchor}}\n
<th
data-i18n=
"Jump"
>
Jump
</th>
\n
{{/if}}\n
{{#each head_value}}\n
<th
data-i18n=
"{{data-i18n}}"
class=
"{{class_value}}"
>
{{text}}
</th>
\n
{{/each}}\n
</tr>
\n
</thead>
\n
</table>
\n
</script>
\n
\n
<script
id=
"listbox-show-thead-template"
type=
"text/x-handlebars-template"
>
\n
<table>
\n
<thead
class=
"ui-bar-inherit head"
>
\n
<tr>
\n
{{#if show_anchor}}\n
<th
data-i18n=
"Jump"
>
Jump
</th>
\n
{{/if}}\n
<th>
\n
<button
type=
"submit"
name=
"show_all"
data-i18n=
"Show All"
></button>
\n
</th>
\n
{{#each head_value}}\n
<th
data-i18n=
"{{data-i18n}}"
class=
"{{class_value}}"
>
{{text}}
</th>
\n
{{/each}}\n
</tr>
\n
</thead>
\n
</table>
\n
</script>
\n
\n
<script
id=
"listbox-hidden-tbody-template"
type=
"text/x-handlebars-template"
>
\n
<table>
\n
<tbody
class=
"tbody"
>
\n
{{#each body_value}}\n
<tr
value=
"{{value}}"
>
\n
{{#if ../../show_anchor}}\n
<th
class=
"ui-link ui-btn ui-corner-all ui-icon-carat-r ui-btn-icon-notext"
></th>
\n
{{/if}}\n
{{#each tr_value}}\n
<th>
\n
{{#if type}}\n
{{#if editable}}\n
<div
class=
"editable_div"
height=
"{{height}}"
width=
"{{width}}"
></div>
\n
{{else}}\n
<a
href=
"{{href}}"
class=
"ui-link"
>
\n
<div
class=
"editable_div"
height=
"{{height}}"
width=
"{{width}}"
></div>
\n
</a>
\n
{{/if}}\n
{{else}}\n
<a
href=
"{{href}}"
class=
"ui-link"
>
{{text}}
</a>
\n
{{/if}}\n
</th>
\n
{{/each}}\n
</tr>
\n
{{/each}}\n
</tbody>
\n
</table>
\n
</script>
\n
\n
<script
id=
"listbox-show-tbody-template"
type=
"text/x-handlebars-template"
>
\n
<table>
\n
<tbody
class=
"tbody"
>
\n
{{#each body_value}}\n
<tr>
\n
{{#if ../../show_anchor}}\n
<th
class=
"ui-link ui-btn ui-corner-all ui-icon-carat-r ui-btn-icon-notext"
></th>
\n
{{/if}}\n
<th>
\n
<input
value=
"{{value}}"
type=
"checkbox"
checked=
"true"
class=
"hide_form_element"
>
\n
</th>
\n
{{#each tr_value}}\n
<th>
\n
{{#if type}}\n
{{#if editable}}\n
<div
class=
"editable_div"
height=
"{{height}}"
width=
"{{width}}"
></div>
\n
{{else}}\n
<a
href=
"{{href}}"
class=
"ui-link"
>
\n
<div
class=
"editable_div"
height=
"{{height}}"
width=
"{{width}}"
></div>
\n
</a>
\n
{{/if}}\n
{{else}}\n
<a
href=
"{{href}}"
class=
"ui-link"
>
{{text}}
</a>
\n
{{/if}}\n
</th>
\n
{{/each}}\n
</tr>
\n
{{/each}}\n
</tbody>
\n
</table>
\n
</script>
\n
\n
<script
id=
"listbox-tfoot-template"
type=
"text/x-handlebars-template"
>
\n
<table>
\n
<tfoot
class=
"ui-bar-inherit tfoot"
>
\n
<th
colspan=
"{{colspan}}"
>
\n
<div
class=
"ui-controlgroup ui-controlgroup-horizontal ui-corner-all ui-paging-menu"
>
\n
<div
class=
"ui-controlgroup-controls"
>
\n
<a
class=
"{{previous_classname}}"
data-i18n=
"Previous"
href=
"{{previous_url}}"
>
Previous
</a>
\n
<span
class=
"ui-btn ui-disabled"
data-i18n=
"{{record}}"
>
{{record}}
</span>
\n
<a
class=
"{{next_classname}}"
data-i18n=
"Next"
href=
"{{next_url}}"
>
Next
</a>
\n
</div>
\n
</div>
\n
</th>
\n
</tfoot>
\n
</table>
\n
</script>
\n
\n
\n
<script
id=
"listbox-template"
type=
"text/x-handlebars-template"
>
\n
<div
class=
"ui-table-header ui-header ui-bar-c ui-corner-all"
>
\n
<div
class=
"ui-table-header ui-header ui-bar-c ui-corner-all"
>
\n
<div
class=
"ui-controlgroup ui-controlgroup-horizontal ui-btn-left"
>
\n
<div
class=
"ui-controlgroup ui-controlgroup-horizontal ui-btn-left"
>
\n
<div
class=
"ui-controlgroup-controls"
>
\n
<div
class=
"ui-controlgroup-controls"
>
\n
<
a
data-i18n=
"hide"
class=
"ui-responsive ui-btn ui-btn-icon-left ui-icon-eye ui-first-child ui-override-theme ui-disabled"
href=
"#"
>
Hide Rows
</a
>
\n
<
button
data-rel=
"hide"
data-i18n=
"{{i18n}}"
name=
"Hide"
type=
"submit"
class=
"submit responsive ui-last-child ui-btn ui-icon-eye ui-btn-icon-left {{hide_class}}"
>
Hide Rows
</button
>
\n
</div>
\n
</div>
\n
</div>
\n
</div>
\n
<h1
data-i18n=
"0 items selected"
class=
"ui-title ui-override-theme"
>
0 items selected
</h1>
\n
<h1
data-i18n=
"0 items selected"
class=
"ui-title ui-override-theme"
>
0 items selected
</h1>
\n
<div
class=
"ui-controlgroup ui-controlgroup-horizontal ui-btn-right"
>
\n
<div
class=
"ui-controlgroup ui-controlgroup-horizontal ui-btn-right"
>
\n
<div
class=
"ui-controlgroup-controls"
>
\n
<div
class=
"ui-controlgroup-controls"
>
\n
<form
class=
"sort_form"
>
\n
<button
data-rel=
"Sort"
data-i18n=
"Sort"
name=
"Sort"
type=
"submit"
class=
"submit responsive ui-last-child ui-btn ui-icon-sort-amount-desc ui-btn-icon-left"
>
Sort
</button>
\n
<button
data-rel=
"Sort"
type=
"submit"
class=
"submit responsive ui-last-child ui-btn ui-icon-sort-amount-desc ui-btn-icon-left"
>
Sort
</button>
\n
</form>
\n
</div>
\n
</div>
\n
</div>
\n
</div>
\n
</div>
\n
</div>
\n
<table
class=
"ui-responsive ui-body-c ui-table-inset"
>
\n
<table
class=
"ui-responsive ui-body-c ui-table-inset"
>
\n
<thead
class=
"ui-bar-inherit"
></thead>
\n
<thead
class=
"ui-bar-inherit
thead
"
></thead>
\n
<tfoot
class=
"ui-bar-inherit"
></tfoot>
\n
<tfoot
class=
"ui-bar-inherit
tfoot
"
></tfoot>
\n
</table>
\n
</table>
\n
</section>
\n
</div>
\n
\n
</script>
\n
\n
\n
</head>
\n
<body>
\n
<form
class=
"document_table"
>
\n
</form>
\n
</body>
\n
</body>
\n
</html>
</html>
...
@@ -285,7 +398,7 @@
...
@@ -285,7 +398,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
94
6.65186.57926.52411
</string>
</value>
<value>
<string>
94
7.61407.56245.56729
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -303,7 +416,7 @@
...
@@ -303,7 +416,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
14
47174021.56
</float>
<float>
14
50714238.02
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_listbox_js.xml
View file @
300e2f1a
...
@@ -108,9 +108,145 @@
...
@@ -108,9 +108,145 @@
<value>
<string
encoding=
"cdata"
>
<![CDATA[
<value>
<string
encoding=
"cdata"
>
<![CDATA[
/*jslint indent: 2, maxerr: 3, nomen: true */\n
/*jslint indent: 2, maxerr: 3, nomen: true */\n
/*global window, document, rJS, URI, RSVP, loopEventListener*/\n
/*global window, document, rJS, URI, RSVP, loopEventListener,\n
(function (window, document, rJS, URI, RSVP, loopEventListener) {\n
SimpleQuery, ComplexQuery, Query, Handlebars*/\n
(function (window, document, rJS, URI, RSVP, loopEventListener,\n
SimpleQuery, ComplexQuery, Query, Handlebars) {\n
"use strict";\n
"use strict";\n
var gadget_klass = rJS(window),\n
listbox_hidden_thead_source = gadget_klass.__template_element\n
.getElementById("listbox-hidden-thead-template")\n
.innerHTML,\n
listbox_hidden_thead_template = Handlebars.compile(listbox_hidden_thead_source),\n
listbox_show_thead_source = gadget_klass.__template_element\n
.getElementById("listbox-show-thead-template")\n
.innerHTML,\n
listbox_show_thead_template = Handlebars.compile(listbox_show_thead_source),\n
\n
listbox_hidden_tbody_source = gadget_klass.__template_element\n
.getElementById("listbox-hidden-tbody-template")\n
.innerHTML,\n
listbox_hidden_tbody_template = Handlebars.compile(listbox_hidden_tbody_source),\n
listbox_show_tbody_source = gadget_klass.__template_element\n
.getElementById("listbox-show-tbody-template")\n
.innerHTML,\n
listbox_show_tbody_template = Handlebars.compile(listbox_show_tbody_source),\n
\n
listbox_tfoot_source = gadget_klass.__template_element\n
.getElementById("listbox-tfoot-template")\n
.innerHTML,\n
listbox_tfoot_template = Handlebars.compile(listbox_tfoot_source),\n
\n
listbox_source = gadget_klass.__template_element\n
.getElementById("listbox-template")\n
.innerHTML,\n
listbox_template = Handlebars.compile(listbox_source);\n
\n
\n
function renderListBoxThead(gadget, template) {\n
if (template === undefined) {\n
template = listbox_hidden_thead_template;\n
}\n
return gadget.translateHtml(template(\n
{\n
"head_value": gadget.props.head_value,\n
"show_anchor": gadget.props.field_json.show_anchor\n
}\n
));\n
}\n
\n
\n
\n
function renderEditableField(gadget, element) {\n
var i,\n
promise_list = [],\n
uid_value_dict = {},\n
uid_value,\n
height,\n
width,\n
element_list = element.querySelectorAll(".editable_div");\n
gadget.props.listbox_uid_dict = {};\n
gadget.props.cell_gadget_list = [];\n
function renderSubCell(element, sub_field_json) {\n
return gadget.getFieldTypeGadgetUrl(sub_field_json.type)\n
.push(function (gadget_url) {\n
return gadget.declareGadget(gadget_url, {\n
element: element\n
});\n
})\n
.push(function (cell_gadget) {\n
gadget.props.cell_gadget_list.push(cell_gadget);\n
sub_field_json.editable = sub_field_json.editable && gadget.props.field_json.editable; // XXX \n
return cell_gadget.render({field_json: sub_field_json});\n
});\n
}\n
for (i = 0; i < element_list.length; i += 1) {\n
height = element_list[i].getAttribute("height");\n
width = element_list[i].getAttribute("width");\n
if (gadget.props.listbox_uid_dict.key === undefined) {\n
gadget.props.listbox_uid_dict.key = gadget.props.result.data.rows[height].value["listbox_uid:list"].key;\n
gadget.props.listbox_uid_dict.value = [gadget.props.result.data.rows[height].value["listbox_uid:list"].value];\n
uid_value_dict[gadget.props.result.data.rows[height].value["listbox_uid:list"].value] = null;\n
} else {\n
uid_value = gadget.props.result.data.rows[height].value["listbox_uid:list"].value;\n
if (!uid_value_dict.hasOwnProperty(uid_value)) {\n
uid_value_dict[uid_value] = null;\n
gadget.props.listbox_uid_dict.value.push(uid_value);\n
}\n
}\n
promise_list.push(renderSubCell(element_list[i],\n
gadget.props.result.data.rows[height].value[gadget.props.field_json.column_list[width][0]] || ""));\n
}\n
return RSVP.all(promise_list);\n
}\n
\n
function renderListBoxTbody(gadget, template) {\n
var tmp;\n
if (template === undefined) {\n
template = listbox_hidden_tbody_template;\n
}\n
return new RSVP.Queue()\n
.push(function () {\n
return gadget.translateHtml(template(\n
{\n
"body_value": gadget.props.body_value,\n
"show_ancher": gadget.props.field_json.show_anchor,\n
"column_list": gadget.props.field_json.column_list\n
}\n
));\n
})\n
.push(function (my_html) {\n
tmp = document.createElement("tbody");\n
tmp.innerHTML = my_html;\n
return renderEditableField(gadget, tmp);\n
})\n
.push(function () {\n
gadget.props.element.querySelector("table").appendChild(tmp);\n
});\n
}\n
\n
function renderListBoxTfoot(gadget) {\n
return gadget.translateHtml(listbox_tfoot_template(\n
{\n
"colspan": gadget.props.foot.colspan,\n
"previous_classname": gadget.props.foot.previous_classname,\n
"previous_url": gadget.props.foot.previous_url,\n
"record": gadget.props.foot.record,\n
"next_classname": gadget.props.foot.next_classname,\n
"next_url": gadget.props.foot.next_url\n
}\n
));\n
}\n
\n
\n
function renderListBox(gadget, i18n) {\n
return gadget.translateHtml(listbox_template(\n
{\n
"i18n": i18n || "Hide Rows",\n
"hide_class": gadget.props.hide_class\n
}\n
));\n
}\n
\n
\n
\n
\n
rJS(window)\n
rJS(window)\n
...
@@ -142,30 +278,24 @@
...
@@ -142,30 +278,24 @@
.declareAcquiredMethod("getUrlParameter", "getUrlParameter")\n
.declareAcquiredMethod("getUrlParameter", "getUrlParameter")\n
.declareAcquiredMethod("getFieldTypeGadgetUrl", "getFieldTypeGadgetUrl")\n
.declareAcquiredMethod("getFieldTypeGadgetUrl", "getFieldTypeGadgetUrl")\n
.declareAcquiredMethod("renderEditorPanel", "renderEditorPanel")\n
.declareAcquiredMethod("renderEditorPanel", "renderEditorPanel")\n
.declareAcquiredMethod("redirect", "redirect")\n
.declareAcquiredMethod("triggerSubmit", "triggerSubmit")\n
//////////////////////////////////////////////\n
//////////////////////////////////////////////\n
// initialize the gadget content\n
// initialize the gadget content\n
//////////////////////////////////////////////\n
//////////////////////////////////////////////\n
.declareMethod(\'render\', function (options) {\n
.declareMethod(\'render\', function (options) {\n
var gadget = this,\n
var gadget = this,\n
thead = gadget.props.element.querySelector(\'thead\'),\n
field_json = options.field_json,\n
field_json = options.field_json,\n
tr = document.createElement("tr"),\n
head_value = [],\n
document_table = gadget.props.element.querySelector(\'.document_table\'),\n
class_value,\n
th,\n
length_table = field_json.column_list.length,\n
tmp,\n
tmp,\n
i,\n
i,\n
j;\n
j;\n
\n
\n
gadget.props.field_json = field_json;\n
gadget.props.field_json = field_json;\n
gadget.props.extended_search = options.extended_search;\n
gadget.props.extended_search = options.extended_search;\n
gadget.props.hide_class = options.hide_enabled ? "" : "ui-disabled";\n
gadget.props.sort_list = [];\n
gadget.props.sort_list = [];\n
if (field_json.show_anchor) {\n
th = document.createElement("th");\n
th.textContent = "Jump";\n
th.setAttribute("data-i18n", "Jump");\n
tr.appendChild(th);\n
}\n
\n
\n
//only display which is in listbox\'s column list\n
//only display which is in listbox\'s column list\n
if (field_json.sort_column_list.length) {\n
if (field_json.sort_column_list.length) {\n
...
@@ -190,9 +320,13 @@
...
@@ -190,9 +320,13 @@
});\n
});\n
}\n
}\n
field_json.search_column_list.push(["searchable_text", "Searchable Text"]);\n
field_json.search_column_list.push(["searchable_text", "Searchable Text"]);\n
thead.appendChild(tr);
\n
\n
return new RSVP.Queue()\n
return new RSVP.Queue()\n
.push(function () {\n
.push(function () {\n
return renderListBox(gadget);\n
})\n
.push(function (my_html) {\n
gadget.props.element.querySelector(".document_table").innerHTML = my_html;\n
// XXX Fix in case of multiple listboxes\n
// XXX Fix in case of multiple listboxes\n
return RSVP.all([\n
return RSVP.all([\n
gadget.getUrlParameter(field_json.key + \'_begin_from\'),\n
gadget.getUrlParameter(field_json.key + \'_begin_from\'),\n
...
@@ -205,28 +339,31 @@
...
@@ -205,28 +339,31 @@
if (result === undefined) {\n
if (result === undefined) {\n
result = \'0\';\n
result = \'0\';\n
}\n
}\n
for (i = 0; i < length_table; i += 1) {\n
for (i = 0; i < gadget.props.field_json.column_list.length; i += 1) {\n
th = document.createElement("th");\n
class_value = "";\n
th.textContent = field_json.column_list[i][1];\n
for (j = 0; j < gadget.props.sort_list.length; j += 1) {\n
for (j = 0; j < gadget.props.sort_list.length; j += 1) {\n
tmp = gadget.props.sort_list[j].split(",");\n
tmp = gadget.props.sort_list[j].split(",");\n
if (tmp[0] === gadget.props.field_json.column_list[i][0]) {\n
if (tmp[0] === gadget.props.field_json.column_list[i][0]) {\n
if (tmp[1] === "ascending") {\n
if (tmp[1] === "ascending") {\n
th.setAttribute("class", "ui-icon-arrow-up")
;\n
class_value = "ui-icon-arrow-up"
;\n
} else {\n
} else {\n
th.setAttribute("class", "ui-icon-arrow-down")
;\n
class_value = "ui-icon-arrow-down"
;\n
}\n
}\n
break;\n
break;\n
}\n
}\n
}\n
}\n
th.setAttribute("data-i18n", field_json.column_list[i][1]);\n
head_value.push({\n
tr.appendChild(th);\n
"data-i18n": field_json.column_list[i][1],\n
"class_value": class_value,\n
"text": field_json.column_list[i][1]\n
});\n
}\n
}\n
gadget.props.head_value = head_value;\n
gadget.props.begin_from = parseInt(result, 10) || 0;\n
gadget.props.begin_from = parseInt(result, 10) || 0;\n
return
gadget.translateHtml(document_table.innerHTML
);\n
return
renderListBoxThead(gadget
);\n
})\n
})\n
.push(function (my_
translate_
html) {\n
.push(function (my_html) {\n
document_table.innerHTML = my_translate
_html;\n
gadget.props.element.querySelector(".thead").innerHTML = my
_html;\n
});\n
});\n
})\n
})\n
.declareMethod(\'getListboxInfo\', function () {\n
.declareMethod(\'getListboxInfo\', function () {\n
...
@@ -245,9 +382,6 @@
...
@@ -245,9 +382,6 @@
props = gadget.props,\n
props = gadget.props,\n
field_json = props.field_json,\n
field_json = props.field_json,\n
begin_from = props.begin_from,\n
begin_from = props.begin_from,\n
table = props.element.querySelector(\'table\'),\n
original_tfoot = props.element.querySelector(\'tfoot\'),\n
tbody = document.createElement("tbody"),\n
url_query = props.extended_search,\n
url_query = props.extended_search,\n
query_string = new URI(field_json.query).query(true).query,\n
query_string = new URI(field_json.query).query(true).query,\n
lines = field_json.lines,\n
lines = field_json.lines,\n
...
@@ -257,7 +391,7 @@
...
@@ -257,7 +391,7 @@
i;\n
i;\n
\n
\n
if (field_json.query === undefined) {\n
if (field_json.query === undefined) {\n
original_tfoot
.textContent = "Unsupported list method: \'" + field_json.list_method + "\'";\n
gadget.props.element.querySelector(\'tfoot\')
.textContent = "Unsupported list method: \'" + field_json.list_method + "\'";\n
return;\n
return;\n
}\n
}\n
// function buildQueryString(previous, next) {\n
// function buildQueryString(previous, next) {\n
...
@@ -276,7 +410,7 @@
...
@@ -276,7 +410,7 @@
for (i = 0; i < field_json.column_list.length; i += 1) {\n
for (i = 0; i < field_json.column_list.length; i += 1) {\n
select_list.push(field_json.column_list[i][0]);\n
select_list.push(field_json.column_list[i][0]);\n
}\n
}\n
\n
select_list.push("uid");
\n
return gadget.jio_allDocs({\n
return gadget.jio_allDocs({\n
// XXX Not jIO compatible, but until a better api is found...\n
// XXX Not jIO compatible, but until a better api is found...\n
"list_method_template": field_json.list_method_template,\n
"list_method_template": field_json.list_method_template,\n
...
@@ -305,91 +439,37 @@
...
@@ -305,91 +439,37 @@
\n
\n
}).push(function (result_list) {\n
}).push(function (result_list) {\n
var j,\n
var j,\n
tr,\n
th,\n
a,\n
result = result_list[0],\n
result = result_list[0],\n
tmp_url,\n
tmp_div,\n
value,\n
value,\n
promise_list = [],\n
body_value = [],\n
uid_value,\n
tr_value = [],\n
uid_value_dict = {};\n
tmp_url;\n
\n
function renderSubCell(element, sub_field_json) {\n
return gadget.getFieldTypeGadgetUrl(sub_field_json.type)\n
.push(function (gadget_url) {\n
return gadget.declareGadget(gadget_url, {\n
element: element\n
});\n
})\n
.push(function (cell_gadget) {\n
gadget.props.cell_gadget_list.push(cell_gadget);\n
sub_field_json.editable = sub_field_json.editable && field_json.editable; // XXX \n
return cell_gadget.render({field_json: sub_field_json});\n
});\n
}\n
\n
dataset = result;\n
dataset = result;\n
for (i = 0; i < counter; i += 1) {\n
for (i = 0; i < counter; i += 1) {\n
tr = document.createElement("tr");\n
tmp_url = result_list[i + 1];\n
tmp_url = result_list[i + 1];\n
\n
tr_value = [];\n
if (field_json.show_anchor) {\n
th = document.createElement("th");\n
a = document.createElement("a");\n
a.href = tmp_url;\n
a.className = "ui-link ui-btn ui-corner-all ui-icon-carat-r ui-btn-icon-notext";\n
th.appendChild(a);\n
tr.appendChild(th);\n
}\n
for (j = 0; j < field_json.column_list.length; j += 1) {\n
for (j = 0; j < field_json.column_list.length; j += 1) {\n
th = document.createElement("th");\n
value = result.data.rows[i].value[field_json.column_list[j][0]] || "";\n
value = result.data.rows[i].value[field_json.column_list[j][0]] || "";\n
if (value.type === undefined) {\n
tr_value.push({\n
a = document.createElement("a");\n
"type": value.type,\n
a.href = tmp_url;\n
"editable": value.editable,\n
a.className = "ui-link";\n
"href": tmp_url,\n
a.textContent = value;\n
"text": value,\n
th.appendChild(a);\n
"width": j,\n
} else {\n
"height": i\n
tmp_div = document.createElement("div");\n
});\n
if (gadget.props.listbox_uid_dict.key === undefined) {\n
gadget.props.listbox_uid_dict.key = result.data.rows[i].value["listbox_uid:list"].key;\n
gadget.props.listbox_uid_dict.value = [result.data.rows[i].value["listbox_uid:list"].value];\n
uid_value_dict[result.data.rows[i].value["listbox_uid:list"].value] = null;\n
} else {\n
uid_value = result.data.rows[i].value["listbox_uid:list"].value;\n
if (!uid_value_dict.hasOwnProperty(uid_value)) {\n
uid_value_dict[uid_value] = null;\n
gadget.props.listbox_uid_dict.value.push(uid_value);\n
}\n
}\n
\n
promise_list.push(renderSubCell(tmp_div, value));\n
\n
//when a sub field is not editable but it\'s in listbox\'s editable colummn \n
//then create link, see ListBox.py line 2518\n
if (value.editable === 0) {\n
a = document.createElement("a");\n
a.href = tmp_url;\n
a.className = "ui-link";\n
a.appendChild(tmp_div);\n
th.appendChild(a);\n
} else {\n
th.appendChild(tmp_div);\n
}\n
}\n
tr.appendChild(th);\n
}\n
}\n
\n
body_value.push({\n
tbody.appendChild(tr);\n
"value": result.data.rows[i].value.uid,\n
"tr_value": tr_value\n
});\n
}\n
}\n
return RSVP.all(promise_list);\n
gadget.props.body_value = body_value;\n
gadget.props.result = result;\n
return renderListBoxTbody(gadget);\n
}).push(function () {\n
}).push(function () {\n
var prev_param = {},\n
var prev_param = {},\n
next_param = {};\n
next_param = {};\n
\n
function setNext() {\n
function setNext() {\n
if (dataset.data.rows.length >
lines) {\n
if (dataset.data.rows.length >
lines) {\n
next_param[gadget.props.field_json.key + \'_begin_from\'] = begin_from + lines;\n
next_param[gadget.props.field_json.key + \'_begin_from\'] = begin_from + lines;\n
...
@@ -408,79 +488,32 @@
...
@@ -408,79 +488,32 @@
]);\n
]);\n
\n
\n
}).push(function (url_list) {\n
}).push(function (url_list) {\n
var fragment = document.createDocumentFragment(),\n
var foot = {};\n
tfoot = gadget.__element.querySelector("tfoot"),\n
foot.colspan = field_json.column_list.length;\n
//tfoot = document.createElement("tfoot"),\n
foot.default_colspan = foot.colspan;\n
tr = document.createElement("tr"),\n
foot.previous_classname = "ui-btn ui-icon-carat-l ui-btn-icon-left responsive ui-first-child";\n
th = document.createElement("th"),\n
foot.previous_url = url_list[0];\n
paging_prev = document.createElement("a"),\n
foot.next_classname = "ui-btn ui-icon-carat-r ui-btn-icon-right responsive ui-last-child";\n
paging_next = document.createElement("a"),\n
foot.next_url = url_list[1];\n
paging_info = document.createElement("span"),\n
paging_menu = document.createElement("div"),\n
paging_wrap = document.createElement("div"),\n
temp = document.createElement("div"),\n
temp_table = document.createElement("table"),\n
len;\n
\n
th.setAttribute("colspan", field_json.column_list.length);\n
// NOTE: Romain: paging menu with 3+ buttons should have another class name (like ui-paging-grid)\n
paging_menu.className = "ui-controlgroup ui-controlgroup-horizontal ui-corner-all ui-paging-menu";\n
paging_wrap.className = "ui-controlgroup-controls";\n
\n
paging_prev.className = "ui-btn ui-icon-carat-l ui-btn-icon-left responsive ui-first-child";\n
paging_prev.textContent = "Previous";\n
paging_prev.setAttribute("data-i18n", "Previous");\n
paging_prev.href = url_list[0];\n
paging_info.className = "ui-btn ui-disabled";\n
if ((begin_from === 0)
&&
(counter === 0)) {\n
if ((begin_from === 0)
&&
(counter === 0)) {\n
paging_info.textContent = "No records";\n
foot.record = "No records";\n
paging_info.setAttribute("data-i18n", "No Records");\n
} else if ((dataset.data.rows.length
<
= lines)
&&
(begin_from === 0)) {\n
} else if ((dataset.data.rows.length
<
= lines)
&&
(begin_from === 0)) {\n
paging_info.setAttribute("data-i18n", "[last]Record(s)");\n
foot.record = counter + " Records";\n
paging_info.appendChild(document.createTextNode(counter));\n
paging_info.appendChild(document.createTextNode("Record(s)"));\n
} else {\n
} else {\n
paging_info.setAttribute("data-i18n", "[node]Record(s)");\n
foot.record = "Records " + (((begin_from + lines) / lines - 1) * lines + 1) + " - " + (((begin_from + lines) / lines - 1) * lines + counter);\n
paging_info.appendChild(document.createTextNode("Records "));\n
paging_info.appendChild(document.createTextNode((((begin_from + lines) / lines - 1) * lines + 1) + " - " + (((begin_from + lines) / lines - 1) * lines + counter)));\n
}\n
}\n
// paging_info.textContent = "Page " + ((begin_from + lines) / lines);\n
paging_next.className = "ui-btn ui-icon-carat-r ui-btn-icon-right responsive ui-last-child";\n
paging_next.textContent = "Next";\n
paging_next.setAttribute("data-i18n", "Next");\n
paging_next.href = url_list[1];\n
\n
\n
if (begin_from === 0) {\n
if (begin_from === 0) {\n
paging_prev.classN
ame += " ui-disabled";\n
foot.previous_classn
ame += " ui-disabled";\n
}\n
}\n
if (dataset.data.rows.length
<
= lines) {\n
if (dataset.data.rows.length
<
= lines) {\n
paging_next.classN
ame += " ui-disabled";\n
foot.next_classn
ame += " ui-disabled";\n
}\n
}\n
\n
gadget.props.foot = foot;\n
paging_wrap.appendChild(paging_prev);\n
return renderListBoxTfoot(gadget);\n
paging_wrap.appendChild(paging_info);\n
}).push(function (my_html) {\n
paging_wrap.appendChild(paging_next);\n
gadget.props.element.querySelector(".tfoot").innerHTML = my_html;\n
paging_menu.appendChild(paging_wrap);\n
});\n
th.appendChild(paging_menu);\n
tr.appendChild(th);\n
tfoot.appendChild(tr);\n
fragment.appendChild(tbody);\n
fragment.appendChild(tfoot);\n
\n
for (len = table.children.length; len > 0; len -= 1) {\n
table.removeChild(table.lastChild);\n
}\n
// NOTE: for passing translations, temp must contain a table\n
temp_table.appendChild(fragment);\n
temp.appendChild(temp_table);\n
table.appendChild(temp.querySelector("tbody"));\n
return gadget.translateHtml(temp.querySelector("tfoot").innerHTML);\n
})\n
.push(function (my_translated_html) {\n
var temp = document.createElement("tfoot");\n
temp.innerHTML = my_translated_html;\n
table.appendChild(temp);\n
});\n
})\n
})\n
\n
\n
\n
\n
...
@@ -520,21 +553,105 @@
...
@@ -520,21 +553,105 @@
var
gadget =
this,\n
var
gadget =
this,\n
url,\n
url,\n
options =
{},\n
options =
{},\n
sort_form =
gadget.props.element.querySelector(".sort_form");\n
thead_template,\n
tbody_template,\n
form =
gadget.props.element.querySelector(".document_table");\n
return
loopEventListener(\n
return
loopEventListener(\n
sort_
form,\n
form,\n
"submit",\n
"submit",\n
false,\n
false,\n
function
()
{\n
function
()
{\n
url =
"gadget_erp5_sort_editor.html"
;\n
var
focus =
document.activeElement,\n
options.sort_column_list =
gadget.props.field_json.sort_column_list;\n
name =
focus.getAttribute("name");\n
options.sort_list =
gadget.props.sort_list;\n
if
(
name =
==
"Sort")
{\n
options.key =
gadget.props.field_json.key
+
"_sort_list:json";\n
url =
"gadget_erp5_sort_editor.html"
;\n
return
gadget.renderEditorPanel(url,
options);\n
options.sort_column_list =
gadget.props.field_json.sort_column_list;\n
options.sort_list =
gadget.props.sort_list;\n
options.key =
gadget.props.field_json.key
+
"_sort_list:json";\n
return
gadget.renderEditorPanel(url,
options);\n
}\n
if
(
name =
==
"Hide")
{\n
return
new
RSVP.Queue()\n
.push(function
()
{\n
var
i,\n
i18n,\n
all_hide_form_elements,\n
query_list =
[],\n
search_query,\n
hide_form_elements;\n
if
(
gadget.props.foot.colspan =
==
gadget.props.foot.default_colspan)
{\n
thead_template =
listbox_show_thead_template;\n
tbody_template =
listbox_show_tbody_template;\n
gadget.props.foot.colspan
+=
1;\n
i18n =
"Submit"
;\n
}
else
{\n
//hide
closed\n
//maybe
submit\n
all_hide_form_elements =
gadget.props.element.querySelectorAll(".hide_form_element");\n
hide_form_elements =
gadget.props.element.querySelectorAll(".hide_form_element:checked");\n
//nothing
selected,
show
all\n
if
(
hide_form_elements.length =
==
0)
{\n
return
gadget.redirect({\n
command:
\'store_and_change\',\n
options:
{\n
"extended_search":
""\n
}\n
});\n
}\n
//a
part
is
selected\n
if
(hide_form_elements.length
<
all_hide_form_elements.length)
{\n
for
(
i =
0;
i
<
hide_form_elements.length;
i
+=
1)
{\n
query_list.push(new
SimpleQuery({\n
key:
"catalog.uid",\n
type:
"simple",\n
value:
hide_form_elements[i].getAttribute("value")\n
}));\n
}\n
search_query =
new
ComplexQuery({\n
operator:
"OR",\n
query_list:
query_list,\n
type:
"complex"\n
});\n
return
gadget.redirect({\n
command:
\'store_and_change\',\n
options:
{\n
"extended_search":
Query.objectToSearchText(search_query)\n
}\n
});\n
}\n
\n
gadget.props.foot.colspan
-=
1;\n
thead_template =
listbox_hidden_thead_template;\n
tbody_template =
listbox_hidden_tbody_template;\n
i18n =
"Hide Form"
;\n
}\n
return
renderListBox(gadget,
i18n);\n
})\n
.push(function
(innerHTML)
{\n
gadget.props.element.querySelector(".document_table")
.innerHTML =
innerHTML;\n
return
RSVP.all([\n
renderListBoxThead(gadget,
thead_template),\n
renderListBoxTbody(gadget,
tbody_template),\n
renderListBoxTfoot(gadget,
listbox_tfoot_template)\n
]);\n
})\n
.push(function
(all_innerHTML)
{\n
gadget.props.element.querySelector(".thead")
.innerHTML =
all_innerHTML[0];\n
gadget.props.element.querySelector(".tfoot")
.innerHTML =
all_innerHTML[2];\n
});\n
}\n
if
(
name =
==
"show_all")
{\n
return
gadget.redirect({\n
command:
\'store_and_change\',\n
options:
{\n
"extended_search":
""\n
}\n
});\n
}\n
return
gadget.triggerSubmit();\n
}\n
}\n
);\n
);\n
})\n
})\n
\n
.allowPublicAcquisition("notifyInvalid",
function
()
{\n
.allowPublicAcquisition("notifyInvalid",
function
()
{\n
return;\n
return;\n
})\n
})\n
...
@@ -543,7 +660,8 @@
...
@@ -543,7 +660,8 @@
return;\n
return;\n
});\n
});\n
\n
\n
}(window,
document,
rJS,
URI,
RSVP,
loopEventListener));
}(window,
document,
rJS,
URI,
RSVP,
loopEventListener,\n
SimpleQuery,
ComplexQuery,
Query,
Handlebars));
]]
></string>
</value>
]]
></string>
</value>
</item>
</item>
...
@@ -680,7 +798,7 @@
...
@@ -680,7 +798,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
947.
29639.47524.59016
</string>
</value>
<value>
<string>
947.
61432.37148.23500
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -698,7 +816,7 @@
...
@@ -698,7 +816,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
14
48903288.34
</float>
<float>
14
50722777.81
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_list_js.xml
View file @
300e2f1a
...
@@ -157,6 +157,7 @@
...
@@ -157,6 +157,7 @@
form_options.form_definition.extended_search = extended_search;\n
form_options.form_definition.extended_search = extended_search;\n
search_options.extended_search = extended_search;\n
search_options.extended_search = extended_search;\n
}\n
}\n
form_options.form_definition.hide_enabled = true;\n
var new_content_action = options.erp5_document._links.action_object_new_content_action;\n
var new_content_action = options.erp5_document._links.action_object_new_content_action;\n
if (new_content_action !== undefined) {\n
if (new_content_action !== undefined) {\n
new_content_action = gadget.getUrlFor({command: \'change\', options: {view: new_content_action.href, editable: true}});\n
new_content_action = gadget.getUrlFor({command: \'change\', options: {view: new_content_action.href, editable: true}});\n
...
@@ -356,7 +357,7 @@
...
@@ -356,7 +357,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
947.
25536.23903.53674
</string>
</value>
<value>
<string>
947.
61250.52429.21469
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -374,7 +375,7 @@
...
@@ -374,7 +375,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
14
48889486.07
</float>
<float>
14
50704179.93
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
...
...
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_listbox_zuite/testHideItem.xml
0 → 100644
View file @
300e2f1a
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"ZopePageTemplate"
module=
"Products.PageTemplates.ZopePageTemplate"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key>
<string>
_asgns
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
name_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
_text
</string>
</key>
<value>
<unicode
encoding=
"cdata"
>
<![CDATA[
<html xmlns:tal="http://xml.zope.org/namespaces/tal"\n
xmlns:metal="http://xml.zope.org/namespaces/metal">
\n
<head>
\n
<meta
http-equiv=
"Content-Type"
content=
"text/html; charset=UTF-8"
>
\n
<title>
Test RenderJS UI
</title>
\n
</head>
\n
<body>
\n
<table
cellpadding=
"1"
cellspacing=
"1"
border=
"1"
>
\n
<thead>
\n
<tr><td
rowspan=
"1"
colspan=
"3"
>
Test RenderJS UI
</td></tr>
\n
</thead><tbody>
\n
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplate/macros/init"
/>
\n
\n
<!-- Clean Up -->
\n
<tr>
\n
<td>
open
</td>
\n
<td>
${base_url}/bar_module/ListBoxZuite_reset
</td>
\n
<td></td>
\n
</tr>
\n
\n
<tr>
\n
<td>
assertTextPresent
</td>
\n
<td>
Reset Successfully.
</td>
\n
<td></td>
\n
</tr>
\n
<!-- should create in new ui instead of using script -->
\n
<tr>
\n
<td>
open
</td>
\n
<td>
${base_url}/foo_module/FooModule_createObjects
</td>
\n
<td></td>
\n
</tr>
\n
<tr>
\n
<td>
assertTextPresent
</td>
\n
<td>
Created Successfully.
</td>
\n
<td></td>
\n
</tr>
\n
\n
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplate/macros/wait_for_activities"
/>
\n
\n
<!-- Initialize -->
\n
<tr>
\n
<td>
open
</td>
\n
<td>
${base_url}/web_site_module/renderjs_runner/
</td>
\n
<td></td>
\n
</tr>
\n
\n
<tr>
\n
<td>
waitForElementPresent
</td>
\n
<td>
//h3[@data-i18n=\'Other\']
</td>
\n
<td></td>
\n
</tr>
\n
\n
<tr>
\n
<td>
click
</td>
\n
<td>
//h3[@data-i18n=\'Other\']
</td>
\n
<td></td>
\n
</tr>
\n
\n
<tr>
\n
<td>
waitForElementPresent
</td>
\n
<td>
//a[@data-i18n=\'Foos\']
</td>
\n
<td></td>
\n
</tr>
\n
\n
<tr>
\n
<td>
click
</td>
\n
<td>
link=Foos
</td>
\n
<td></td>
\n
</tr>
\n
\n
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplateForRenderjsUi/macros/clear_query"
/>
\n
\n
\n
<tr>
\n
<td>
waitForElementPresent
</td>
\n
<td>
//form[@class="document_table"]//button[@data-i18n=\'Hide Rows\']
</td>
\n
<td></td>
\n
</tr>
\n
\n
<tr>
\n
<td>
focus
</td>
\n
<td>
//form[@class="document_table"]//button[@data-i18n=\'Hide Rows\']
</td>
\n
<td></td>
\n
</tr>
\n
\n
<tr>
\n
<td>
click
</td>
\n
<td>
//form[@class="document_table"]//button[@data-i18n=\'Hide Rows\']
</td>
\n
<td></td>
\n
</tr>
\n
\n
<tr>
\n
<td>
waitForElementPresent
</td>
\n
<td>
//tbody/tr/th/input[@type="checkbox"]
</td>
\n
<td></td>
\n
</tr>
\n
\n
<tr>
\n
<td>
verifyValue
</td>
\n
<td>
//tbody/tr/th/input[@type="checkbox"]
</td>
\n
<td>
on
</td>
\n
</tr>
\n
\n
<tr>
\n
<td>
click
</td>
\n
<td>
//tbody/tr[2]/th/input[@type="checkbox"]
</td>
\n
<td></td>
\n
</tr>
\n
\n
\n
<tr>
\n
<td>
click
</td>
\n
<td>
//tbody/tr[3]/th/input[@type="checkbox"]
</td>
\n
<td></td>
\n
</tr>
\n
\n
<tr>
\n
<td>
focus
</td>
\n
<td>
//form[@class="document_table"]//button[@data-i18n=\'Submit\']
</td>
\n
<td></td>
\n
</tr>
\n
\n
<tr>
\n
<td>
click
</td>
\n
<td>
//form[@class="document_table"]//button[@data-i18n=\'Submit\']
</td>
\n
<td></td>
\n
</tr>
\n
\n
\n
<tr>
\n
<td>
waitForElementNotPresent
</td>
\n
<td>
//a[@data-i18n="Previous"]
</td>
\n
<td></td>
\n
</tr>
\n
\n
<tr>
\n
<td>
waitForElementPresent
</td>
\n
<td>
//a[@data-i18n="Previous"]
</td>
\n
<td></td>
\n
</tr>
\n
\n
<tr>
\n
<td>
waitForElementPresent
</td>
\n
<td>
//tbody/tr/th
</td>
\n
<td></td>
\n
</tr>
\n
\n
<!-- only one element present -->
\n
<tr>
\n
<td>
verifyElementPresent
</td>
\n
<td>
//tbody/tr/th
</td>
\n
<td></td>
\n
</tr>
\n
\n
\n
<tr>
\n
<td>
verifyElementNotPresent
</td>
\n
<td>
//tbody/tr[2]
</td>
\n
<td></td>
\n
</tr>
\n
\n
<tr>
\n
<td>
focus
</td>
\n
<td>
//form[@class="document_table"]//button[@data-i18n=\'Hide Rows\']
</td>
\n
<td></td>
\n
</tr>
\n
\n
<tr>
\n
<td>
click
</td>
\n
<td>
//form[@class="document_table"]//button[@data-i18n=\'Hide Rows\']
</td>
\n
<td></td>
\n
</tr>
\n
\n
<tr>
\n
<td>
waitForElementPresent
</td>
\n
<td>
//tbody/tr/th/input[@type="checkbox"]
</td>
\n
<td></td>
\n
</tr>
\n
\n
<tr>
\n
<td>
verifyValue
</td>
\n
<td>
//tbody/tr/th/input[@type="checkbox"]
</td>
\n
<td>
on
</td>
\n
</tr>
\n
\n
<tr>
\n
<td>
click
</td>
\n
<td>
//tbody/tr/th/input[@type="checkbox"]
</td>
\n
<td></td>
\n
</tr>
\n
\n
<tr>
\n
<td>
focus
</td>
\n
<td>
//form[@class="document_table"]//button[@data-i18n=\'Submit\']
</td>
\n
<td></td>
\n
</tr>
\n
\n
<tr>
\n
<td>
click
</td>
\n
<td>
//form[@class="document_table"]//button[@data-i18n=\'Submit\']
</td>
\n
<td></td>
\n
</tr>
\n
\n
\n
<tr>
\n
<td>
waitForElementNotPresent
</td>
\n
<td>
//a[@data-i18n="Previous"]
</td>
\n
<td></td>
\n
</tr>
\n
\n
<tr>
\n
<td>
waitForElementPresent
</td>
\n
<td>
//a[@data-i18n="Previous"]
</td>
\n
<td></td>
\n
</tr>
\n
\n
<tr>
\n
<td>
waitForElementPresent
</td>
\n
<td>
//tbody/tr/th
</td>
\n
<td></td>
\n
</tr>
\n
\n
\n
<tr>
\n
<td>
verifyElementPresent
</td>
\n
<td>
//tbody/tr/th
</td>
\n
<td></td>
\n
</tr>
\n
\n
\n
<tr>
\n
<td>
verifyElementPresent
</td>
\n
<td>
//tbody/tr[2]
</td>
\n
<td></td>
\n
</tr>
\n
\n
<tr>
\n
<td>
verifyElementPresent
</td>
\n
<td>
//tbody/tr[3]
</td>
\n
<td></td>
\n
</tr>
\n
\n
<tr>
\n
<td>
focus
</td>
\n
<td>
//form[@class="document_table"]//button[@data-i18n=\'Hide Rows\']
</td>
\n
<td></td>
\n
</tr>
\n
\n
<tr>
\n
<td>
click
</td>
\n
<td>
//form[@class="document_table"]//button[@data-i18n=\'Hide Rows\']
</td>
\n
<td></td>
\n
</tr>
\n
\n
<tr>
\n
<td>
waitForElementPresent
</td>
\n
<td>
//tbody/tr/th/input[@type="checkbox"]
</td>
\n
<td></td>
\n
</tr>
\n
\n
\n
<tr>
\n
<td>
verifyValue
</td>
\n
<td>
//tbody/tr/th/input[@type="checkbox"]
</td>
\n
<td>
on
</td>
\n
</tr>
\n
\n
<tr>
\n
<td>
click
</td>
\n
<td>
//tbody/tr[2]/th/input[@type="checkbox"]
</td>
\n
<td></td>
\n
</tr>
\n
\n
\n
<tr>
\n
<td>
click
</td>
\n
<td>
//tbody/tr[3]/th/input[@type="checkbox"]
</td>
\n
<td></td>
\n
</tr>
\n
\n
<tr>
\n
<td>
focus
</td>
\n
<td>
//form[@class="document_table"]//button[@data-i18n=\'Submit\']
</td>
\n
<td></td>
\n
</tr>
\n
\n
<tr>
\n
<td>
click
</td>
\n
<td>
//form[@class="document_table"]//button[@data-i18n=\'Submit\']
</td>
\n
<td></td>
\n
</tr>
\n
\n
\n
<tr>
\n
<td>
waitForElementNotPresent
</td>
\n
<td>
//a[@data-i18n="Previous"]
</td>
\n
<td></td>
\n
</tr>
\n
\n
<tr>
\n
<td>
waitForElementPresent
</td>
\n
<td>
//a[@data-i18n="Previous"]
</td>
\n
<td></td>
\n
</tr>
\n
\n
<tr>
\n
<td>
waitForElementPresent
</td>
\n
<td>
//tbody/tr/th
</td>
\n
<td></td>
\n
</tr>
\n
\n
<!-- only one element present -->
\n
<tr>
\n
<td>
verifyElementPresent
</td>
\n
<td>
//tbody/tr/th
</td>
\n
<td></td>
\n
</tr>
\n
\n
\n
<tr>
\n
<td>
verifyElementNotPresent
</td>
\n
<td>
//tbody/tr[2]
</td>
\n
<td></td>
\n
</tr>
\n
\n
\n
<tr>
\n
<td>
focus
</td>
\n
<td>
//button[@data-i18n=\'Hide Rows\']
</td>
\n
<td></td>
\n
</tr>
\n
\n
<tr>
\n
<td>
click
</td>
\n
<td>
//button[@data-i18n=\'Hide Rows\']
</td>
\n
<td></td>
\n
</tr>
\n
\n
<tr>
\n
<td>
waitForElementPresent
</td>
\n
<td>
//form[@class="document_table"]//button[@data-i18n="Show All"]
</td>
\n
<td></td>
\n
</tr>
\n
\n
<tr>
\n
<td>
focus
</td>
\n
<td>
//form[@class="document_table"]//button[@data-i18n="Show All"]
</td>
\n
<td></td>
\n
</tr>
\n
\n
\n
<tr>
\n
<td>
click
</td>
\n
<td>
//form[@class="document_table"]//button[@data-i18n="Show All"]
</td>
\n
<td></td>
\n
</tr>
\n
\n
\n
<tr>
\n
<td>
waitForElementNotPresent
</td>
\n
<td>
//a[@data-i18n="Previous"]
</td>
\n
<td></td>
\n
</tr>
\n
\n
<tr>
\n
<td>
waitForElementPresent
</td>
\n
<td>
//a[@data-i18n="Previous"]
</td>
\n
<td></td>
\n
</tr>
\n
\n
<tr>
\n
<td>
waitForElementPresent
</td>
\n
<td>
//tbody/tr/th
</td>
\n
<td></td>
\n
</tr>
\n
\n
\n
<tr>
\n
<td>
verifyElementPresent
</td>
\n
<td>
//tbody/tr/th
</td>
\n
<td></td>
\n
</tr>
\n
\n
\n
<tr>
\n
<td>
verifyElementPresent
</td>
\n
<td>
//tbody/tr[2]
</td>
\n
<td></td>
\n
</tr>
\n
\n
<tr>
\n
<td>
verifyElementPresent
</td>
\n
<td>
//tbody/tr[3]
</td>
\n
<td></td>
\n
</tr>
\n
\n
\n
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplateForRenderjsUi/macros/clear_query"
/>
\n
\n
\n
</tbody></table>
\n
</body>
\n
</html>
]]>
</unicode>
</value>
</item>
<item>
<key>
<string>
content_type
</string>
</key>
<value>
<string>
text/html
</string>
</value>
</item>
<item>
<key>
<string>
expand
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
testHideItem
</string>
</value>
</item>
<item>
<key>
<string>
output_encoding
</string>
</key>
<value>
<string>
utf-8
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<unicode></unicode>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_listbox_zuite/testSort.xml
View file @
300e2f1a
...
@@ -113,13 +113,19 @@
...
@@ -113,13 +113,19 @@
\n
\n
<tr>
\n
<tr>
\n
<td>
waitForElementPresent
</td>
\n
<td>
waitForElementPresent
</td>
\n
<td>
//form[@class=\'sort_form\']
</td>
\n
<td>
//form[@class="document_table"]//button[@data-i18n=\'Sort\']
</td>
\n
<td></td>
\n
</tr>
\n
\n
<tr>
\n
<td>
focus
</td>
\n
<td>
//form[@class="document_table"]//button[@data-i18n=\'Sort\']
</td>
\n
<td></td>
\n
<td></td>
\n
</tr>
\n
</tr>
\n
\n
\n
<tr>
\n
<tr>
\n
<td>
click
</td>
\n
<td>
click
</td>
\n
<td>
//form[@class=
\'sort_form\']/button
</td>
\n
<td>
//form[@class=
"document_table"]//button[@data-i18n=\'Sort\']
</td>
\n
<td></td>
\n
<td></td>
\n
</tr>
\n
</tr>
\n
\n
\n
...
...
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_listbox_zuite/testSortItemAutoBuild.xml
View file @
300e2f1a
...
@@ -111,13 +111,19 @@
...
@@ -111,13 +111,19 @@
\n
\n
<tr>
\n
<tr>
\n
<td>
waitForElementPresent
</td>
\n
<td>
waitForElementPresent
</td>
\n
<td>
//form[@class=\'sort_form\']
</td>
\n
<td>
//form[@class="document_table"]//button[@data-i18n=\'Sort\']
</td>
\n
<td></td>
\n
</tr>
\n
\n
<tr>
\n
<td>
focus
</td>
\n
<td>
//form[@class="document_table"]//button[@data-i18n=\'Sort\']
</td>
\n
<td></td>
\n
<td></td>
\n
</tr>
\n
</tr>
\n
\n
\n
<tr>
\n
<tr>
\n
<td>
click
</td>
\n
<td>
click
</td>
\n
<td>
//form[@class=
\'sort_form\']/button
</td>
\n
<td>
//form[@class=
"document_table"]//button[@data-i18n=\'Sort\']
</td>
\n
<td></td>
\n
<td></td>
\n
</tr>
\n
</tr>
\n
\n
\n
...
@@ -189,13 +195,19 @@
...
@@ -189,13 +195,19 @@
\n
\n
<tr>
\n
<tr>
\n
<td>
waitForElementPresent
</td>
\n
<td>
waitForElementPresent
</td>
\n
<td>
//form[@class=\'sort_form\']
</td>
\n
<td>
//form[@class="document_table"]//button[@data-i18n=\'Sort\']
</td>
\n
<td></td>
\n
</tr>
\n
\n
<tr>
\n
<td>
focus
</td>
\n
<td>
//form[@class="document_table"]//button[@data-i18n=\'Sort\']
</td>
\n
<td></td>
\n
<td></td>
\n
</tr>
\n
</tr>
\n
\n
\n
<tr>
\n
<tr>
\n
<td>
click
</td>
\n
<td>
click
</td>
\n
<td>
//form[@class=
\'sort_form\']/button
</td>
\n
<td>
//form[@class=
"document_table"]//button[@data-i18n=\'Sort\']
</td>
\n
<td></td>
\n
<td></td>
\n
</tr>
\n
</tr>
\n
\n
\n
...
...
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_listbox_zuite/testSortItemDelete.xml
View file @
300e2f1a
...
@@ -112,13 +112,19 @@
...
@@ -112,13 +112,19 @@
\n
\n
<tr>
\n
<tr>
\n
<td>
waitForElementPresent
</td>
\n
<td>
waitForElementPresent
</td>
\n
<td>
//form[@class=\'sort_form\']
</td>
\n
<td>
//form[@class="document_table"]//button[@data-i18n=\'Sort\']
</td>
\n
<td></td>
\n
</tr>
\n
\n
<tr>
\n
<td>
focus
</td>
\n
<td>
//form[@class="document_table"]//button[@data-i18n=\'Sort\']
</td>
\n
<td></td>
\n
<td></td>
\n
</tr>
\n
</tr>
\n
\n
\n
<tr>
\n
<tr>
\n
<td>
click
</td>
\n
<td>
click
</td>
\n
<td>
//form[@class=
\'sort_form\']/button
</td>
\n
<td>
//form[@class=
"document_table"]//button[@data-i18n=\'Sort\']
</td>
\n
<td></td>
\n
<td></td>
\n
</tr>
\n
</tr>
\n
\n
\n
...
...
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_listbox_zuite/testSortWithPager.xml
View file @
300e2f1a
...
@@ -108,16 +108,21 @@
...
@@ -108,16 +108,21 @@
\n
\n
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplateForRenderjsUi/macros/clear_query"
/>
\n
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplateForRenderjsUi/macros/clear_query"
/>
\n
\n
\n
\n
<tr>
\n
<tr>
\n
<td>
waitForElementPresent
</td>
\n
<td>
waitForElementPresent
</td>
\n
<td>
//form[@class=\'sort_form\']
</td>
\n
<td>
//form[@class="document_table"]//button[@data-i18n=\'Sort\']
</td>
\n
<td></td>
\n
</tr>
\n
\n
<tr>
\n
<td>
focus
</td>
\n
<td>
//form[@class="document_table"]//button[@data-i18n=\'Sort\']
</td>
\n
<td></td>
\n
<td></td>
\n
</tr>
\n
</tr>
\n
\n
\n
<tr>
\n
<tr>
\n
<td>
click
</td>
\n
<td>
click
</td>
\n
<td>
//form[@class=
\'sort_form\']/button
</td>
\n
<td>
//form[@class=
"document_table"]//button[@data-i18n=\'Sort\']
</td>
\n
<td></td>
\n
<td></td>
\n
</tr>
\n
</tr>
\n
\n
\n
...
...
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_listbox_zuite/testSortWithPreviousNext.xml
View file @
300e2f1a
...
@@ -111,13 +111,19 @@
...
@@ -111,13 +111,19 @@
\n
\n
<tr>
\n
<tr>
\n
<td>
waitForElementPresent
</td>
\n
<td>
waitForElementPresent
</td>
\n
<td>
//form[@class=\'sort_form\']
</td>
\n
<td>
//form[@class="document_table"]//button[@data-i18n=\'Sort\']
</td>
\n
<td></td>
\n
</tr>
\n
\n
<tr>
\n
<td>
focus
</td>
\n
<td>
//form[@class="document_table"]//button[@data-i18n=\'Sort\']
</td>
\n
<td></td>
\n
<td></td>
\n
</tr>
\n
</tr>
\n
\n
\n
<tr>
\n
<tr>
\n
<td>
click
</td>
\n
<td>
click
</td>
\n
<td>
//form[@class=
\'sort_form\']/button
</td>
\n
<td>
//form[@class=
"document_table"]//button[@data-i18n=\'Sort\']
</td>
\n
<td></td>
\n
<td></td>
\n
</tr>
\n
</tr>
\n
\n
\n
...
...
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_router_zuite/testCommandSelectionNextJumpToNextDocument.xml
View file @
300e2f1a
...
@@ -125,16 +125,23 @@
...
@@ -125,16 +125,23 @@
<!-- Sort -->
\n
<!-- Sort -->
\n
<tr>
\n
<tr>
\n
<td>
waitForElementPresent
</td>
\n
<td>
waitForElementPresent
</td>
\n
<td>
//form[@class=\'sort_form\']
</td>
\n
<td>
//form[@class="document_table"]//button[@data-i18n=\'Sort\']
</td>
\n
<td></td>
\n
</tr>
\n
\n
<tr>
\n
<td>
focus
</td>
\n
<td>
//form[@class="document_table"]//button[@data-i18n=\'Sort\']
</td>
\n
<td></td>
\n
<td></td>
\n
</tr>
\n
</tr>
\n
\n
\n
<tr>
\n
<tr>
\n
<td>
click
</td>
\n
<td>
click
</td>
\n
<td>
//form[@class=
\'sort_form\']/button
</td>
\n
<td>
//form[@class=
"document_table"]//button[@data-i18n=\'Sort\']
</td>
\n
<td></td>
\n
<td></td>
\n
</tr>
\n
</tr>
\n
\n
\n
\n
<tr>
\n
<tr>
\n
<td>
waitForElementPresent
</td>
\n
<td>
waitForElementPresent
</td>
\n
<td>
//form[@class=\'plus\']
</td>
\n
<td>
//form[@class=\'plus\']
</td>
\n
...
...
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_router_zuite/testCommandSelectionPreviousJumpToPreviousDocument.xml
View file @
300e2f1a
...
@@ -126,16 +126,23 @@
...
@@ -126,16 +126,23 @@
<!-- Sort -->
\n
<!-- Sort -->
\n
<tr>
\n
<tr>
\n
<td>
waitForElementPresent
</td>
\n
<td>
waitForElementPresent
</td>
\n
<td>
//form[@class=\'sort_form\']
</td>
\n
<td>
//form[@class="document_table"]//button[@data-i18n=\'Sort\']
</td>
\n
<td></td>
\n
</tr>
\n
\n
<tr>
\n
<td>
focus
</td>
\n
<td>
//form[@class="document_table"]//button[@data-i18n=\'Sort\']
</td>
\n
<td></td>
\n
<td></td>
\n
</tr>
\n
</tr>
\n
\n
\n
<tr>
\n
<tr>
\n
<td>
click
</td>
\n
<td>
click
</td>
\n
<td>
//form[@class=
\'sort_form\']/button
</td>
\n
<td>
//form[@class=
"document_table"]//button[@data-i18n=\'Sort\']
</td>
\n
<td></td>
\n
<td></td>
\n
</tr>
\n
</tr>
\n
\n
\n
\n
<tr>
\n
<tr>
\n
<td>
waitForElementPresent
</td>
\n
<td>
waitForElementPresent
</td>
\n
<td>
//form[@class=\'plus\']
</td>
\n
<td>
//form[@class=\'plus\']
</td>
\n
...
...
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