Commit f46c50ec authored by Gabriel Monnerat's avatar Gabriel Monnerat

erp5_web_renderjs_ui: Add button to display graphic selection

parent 3cc347f7
...@@ -14,6 +14,9 @@ ...@@ -14,6 +14,9 @@
"translated_validation_state_title" "translated_validation_state_title"
]; ];
if (!option_list.length) {
return;
}
for (i = 0; i < option_list.length; i += 1) { for (i = 0; i < option_list.length; i += 1) {
if (default_option_list.indexOf(option_list[i][0]) !== -1) { if (default_option_list.indexOf(option_list[i][0]) !== -1) {
return option_list[i][0]; return option_list[i][0];
......
...@@ -240,7 +240,7 @@ ...@@ -240,7 +240,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>997.32361.48448.8823</string> </value> <value> <string>997.32364.32479.38109</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -258,7 +258,7 @@ ...@@ -258,7 +258,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1642122989.73</float> <float>1642458074.31</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -30,8 +30,22 @@ ...@@ -30,8 +30,22 @@
<!-- XXX action, method, fieldset --> <!-- XXX action, method, fieldset -->
<form> <form>
<button type="submit" class="ui-icon-action ui-btn-icon-right ui-screen-hidden">Submit</button> <button type="submit" class="ui-icon-action ui-btn-icon-right ui-screen-hidden">Submit</button>
<!-- XXX Just a draft -->
<div class="graphic-button" style="float: left;padding-top: 6pt;">
<div>
<button class="ui-btn-icon-notext ui-icon-bar-chart-o display-graphic"
style="border: 1px solid rgba(0, 0, 0, 0.14);
border-radius: 0.325em;
background-color: #FFFFFF;
margin-right: 6pt;
max-width: 6em;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
padding: 3pt;" type="button"> Graphic</button>
</div>
</div>
<div data-gadget-url="gadget_erp5_searchfield.html" <div data-gadget-url="gadget_erp5_searchfield.html"
data-gadget-scope="erp5_searchfield" data-gadget-scope="erp5_searchfield"
data-gadget-sandbox="public"></div> data-gadget-sandbox="public"></div>
...@@ -41,6 +55,5 @@ ...@@ -41,6 +55,5 @@
data-gadget-sandbox="public"></div> data-gadget-sandbox="public"></div>
</form> </form>
</body> </body>
</html> </html>
\ No newline at end of file
...@@ -238,7 +238,7 @@ ...@@ -238,7 +238,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>974.48720.1486.39116</string> </value> <value> <string>997.37810.8320.54442</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -256,7 +256,7 @@ ...@@ -256,7 +256,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1554191230.42</float> <float>1642474757.61</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -136,6 +136,13 @@ ...@@ -136,6 +136,13 @@
form_options.form_definition.extended_search = form_gadget.state.extended_search; form_options.form_definition.extended_search = form_gadget.state.extended_search;
} }
form_options.enable_graphic = true; form_options.enable_graphic = true;
if (!form_gadget.state.extended_search) {
form_gadget.element.querySelector(
".graphic-button").classList.add("ui-screen-hidden");
} else {
form_gadget.element.querySelector(
".graphic-button").classList.remove("ui-screen-hidden");
}
return erp5_form.render(form_options); return erp5_form.render(form_options);
}) })
...@@ -201,6 +208,17 @@ ...@@ -201,6 +208,17 @@
}); });
}, {mutex: 'changestate'}) }, {mutex: 'changestate'})
.onEvent('click', function click(evt) {
var gadget = this;
if (evt.target.classList.contains("display-graphic")) {
return gadget.redirect({
command: "display_with_history",
options: {
jio_key: gadget.state.jio_key
}
});
}
})
.onEvent('submit', function submit() { .onEvent('submit', function submit() {
var gadget = this; var gadget = this;
......
...@@ -234,7 +234,7 @@ ...@@ -234,7 +234,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>997.28531.29725.31266</string> </value> <value> <string>997.37922.23380.46216</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -252,7 +252,7 @@ ...@@ -252,7 +252,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1641893404.13</float> <float>1642458450.04</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
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