Commit 767bad4b authored by Romain Courteaud's avatar Romain Courteaud

erp5_web_renderjs_ui: easily allow user to see his preference list

parent e012a040
<!DOCTYPE html>
<html>
<!--
data-i18n=Active Preference
data-i18n=Preferences
data-i18n=Language
data-i18n=Profile
......
......@@ -240,7 +240,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>994.61047.58814.54169</string> </value>
<value> <string>994.62318.46378.10649</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -260,7 +260,7 @@
</tuple>
<state>
<tuple>
<float>1632221574.49</float>
<float>1716899361.99</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -29,6 +29,7 @@
return RSVP.hash({
translation: gadget.getTranslationDict([
'Active Preference',
'Preferences',
'Language',
'Profile',
......@@ -50,8 +51,6 @@
// Calculate user name
if (result === undefined) {
user = null;
} else if (result.data.rows.length === 0) {
user = null;
} else {
user = result.data.rows[0].value.title;
}
......@@ -60,8 +59,10 @@
url_dict: gadget.getUrlForDict({
// Back url
back: {command: 'history_previous'},
preference: {command: 'push_history',
my_preference: {command: 'push_history',
options: {page: "preference"}},
portal_preference: {command: 'push_history',
options: {jio_key: "portal_preferences"}},
person: {command: 'push_history',
options: {jio_key: me_relative_url}},
// Change language
......@@ -75,7 +76,11 @@
domsugar(gadget.element.querySelector('.document_list'), [
domsugar('ul', {'class': 'document-listview'}, [
domsugar('li', [
domsugar('a', {href: result_dict.url_dict.preference,
domsugar('a', {href: result_dict.url_dict.my_preference,
text: result_dict.translation['Active Preference']})
]),
domsugar('li', [
domsugar('a', {href: result_dict.url_dict.portal_preference,
text: result_dict.translation.Preferences})
]),
(me_relative_url === undefined) ? '' :
......
......@@ -236,7 +236,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>998.18207.59213.64375</string> </value>
<value> <string>1014.4857.18905.5273</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -256,7 +256,7 @@
</tuple>
<state>
<tuple>
<float>1667992189.61</float>
<float>1716899348.27</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -19,7 +19,7 @@
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/click_on_panel_link" />
</tal:block>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<tal:block tal:define="click_configuration python: {'text': 'Preferences'}">
<tal:block tal:define="click_configuration python: {'text': 'Active Preference'}">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/click_on_page_link" />
</tal:block>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
......
......@@ -21,7 +21,7 @@
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<tr>
<td>assertElementPresent</td>
<td>//ul[@class="ui-list-grid"]/li[2]/h2[text()="Tools"]</td>
<td>//ul[@class="ui-list-grid"]//li/h2[text()="Tools"]</td>
<td></td>
</tr>
<tr>
......@@ -33,7 +33,7 @@
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/click_on_panel_link" />
</tal:block>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<tal:block tal:define="click_configuration python: {'text': 'Preferences'}">
<tal:block tal:define="click_configuration python: {'text': 'Active Preference'}">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/click_on_page_link" />
</tal:block>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
......@@ -53,7 +53,7 @@
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<tr>
<td>assertElementNotPresent</td>
<td>//ul[@class="ui-list-grid"]/li[2]/h2[text()="Tools"]</td>
<td>//ul[@class="ui-list-grid"]//li/h2[text()="Tools"]</td>
<td></td>
</tr>
</tbody></table>
......
......@@ -27,7 +27,13 @@
<tr>
<td>assertElementPresent</td>
<td>//div[@data-gadget-scope='m']//a[text()='Preferences' and contains(@href, '#!push_history') and contains(@href, 'n.page=preference')]</td>
<td>//div[@data-gadget-scope='m']//a[text()='Active Preference' and contains(@href, '#!push_history') and contains(@href, 'n.page=preference')]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[@data-gadget-scope='m']//a[text()='Preferences' and contains(@href, '#!push_history') and contains(@href, 'n.jio_key=portal_preferences')]</td>
<td></td>
</tr>
......
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