Commit 5e6e9282 authored by Romain Courteaud's avatar Romain Courteaud

[erp5_web_renderjs_ui] Display submit button under the dialog form

parent 298ee10d
...@@ -901,7 +901,9 @@ div[data-gadget-scope='header'] .ui-header ul { ...@@ -901,7 +901,9 @@ div[data-gadget-scope='header'] .ui-header ul {
} }
.gadget-content input[type='submit'] { .gadget-content input[type='submit'] {
padding: 6pt; padding: 6pt;
background-color: #444444; margin-top: 30pt;
margin-right: 12pt;
background-color: #FF6600;
color: #FFFFFF; color: #FFFFFF;
border-radius: 0.325em; border-radius: 0.325em;
border-width: 1px; border-width: 1px;
...@@ -910,10 +912,10 @@ div[data-gadget-scope='header'] .ui-header ul { ...@@ -910,10 +912,10 @@ div[data-gadget-scope='header'] .ui-header ul {
} }
.gadget-content input[type='submit']:hover, .gadget-content input[type='submit']:hover,
.gadget-content input[type='submit']:focus { .gadget-content input[type='submit']:focus {
background-color: #5e5e5e; background-color: #ff8533;
} }
.gadget-content input[type='submit']:active { .gadget-content input[type='submit']:active {
background-color: #777777; background-color: #ffa366;
} }
@media only screen and (min-width: 90em) { @media only screen and (min-width: 90em) {
.gadget-content { .gadget-content {
......
...@@ -242,7 +242,7 @@ ...@@ -242,7 +242,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>957.39714.21193.35498</string> </value> <value> <string>957.40793.17925.62225</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -260,7 +260,7 @@ ...@@ -260,7 +260,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1488215480.92</float> <float>1488280785.24</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -26,12 +26,12 @@ ...@@ -26,12 +26,12 @@
<!-- XXX action, method, fieldset --> <!-- XXX action, method, fieldset -->
<form class="dialog_form"> <form class="dialog_form">
<button type="submit" class="ui-btn ui-btn-b ui-btn-inline
ui-icon-action ui-btn-icon-right ui-screen-hidden">Submit</button>
<div data-gadget-url="gadget_erp5_form.html" <div data-gadget-url="gadget_erp5_form.html"
data-gadget-scope="erp5_form" data-gadget-scope="erp5_form"
data-gadget-sandbox="public"> data-gadget-sandbox="public">
</div> </div>
<input class="dialogconfirm" data-theme="b" data-inline="true" type="submit" data-i18n="[value]Proceed" value="Proceed" data-icon="check" />
<a class="dialogcancel" data-i18n="Cancel">Cancel</a>
</form> </form>
</body> </body>
</html> </html>
\ No newline at end of file
...@@ -234,7 +234,7 @@ ...@@ -234,7 +234,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>956.14163.7437.54408</string> </value> <value> <string>957.40660.8707.11059</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>1482749950.28</float> <float>1488277468.66</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
// declared methods // declared methods
///////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////
.declareMethod('triggerSubmit', function () { .declareMethod('triggerSubmit', function () {
this.element.querySelector('button').click(); this.element.querySelector('input[type="submit"]').click();
}) })
.declareMethod('render', function (options) { .declareMethod('render', function (options) {
...@@ -51,21 +51,16 @@ ...@@ -51,21 +51,16 @@
view_list = this.state.erp5_document._links.action_workflow || []; view_list = this.state.erp5_document._links.action_workflow || [];
title = this.state.form_definition.title; title = this.state.form_definition.title;
for (i = 0; i < view_list.length; i += 1) {
if (view_list[i].name === this.state.view) {
title = view_list[i].title;
}
}
// XXX hardcoded... // XXX hardcoded...
switch (form_gadget.state.title) { switch (title) {
case "Create User": case "Create User":
icon = " ui-icon-user"; icon = " ui-icon-user";
break; break;
case "Create Document": case "Create Document":
icon = " ui-icon-file-o"; icon = " ui-icon-file-o";
break; break;
case "Change State": case "Validate Workflow Action":
icon = " ui-icon-share-alt"; icon = " ui-icon-share-alt";
break; break;
case "Submit": case "Submit":
...@@ -76,10 +71,25 @@ ...@@ -76,10 +71,25 @@
break; break;
} }
for (i = 0; i < view_list.length; i += 1) {
if (view_list[i].href === this.state.view) {
title = view_list[i].title;
}
}
// Calculate the h3 properties // Calculate the h3 properties
return form_gadget.translate(title) return new RSVP.Queue()
.push(function (translated_title) { .push(function () {
selector.textContent = "\u00A0" + translated_title; return RSVP.all([
form_gadget.translate(form_gadget.state.form_definition.title),
form_gadget.translate(title),
]);
})
.push(function (translated_title_list) {
form_gadget.element.querySelector('input.dialogconfirm').value = translated_title_list[1];
selector.textContent = "\u00A0" + translated_title_list[0];
selector.className = "ui-content-title ui-body-c ui-icon ui-icon-custom" + icon; selector.className = "ui-content-title ui-body-c ui-icon ui-icon-custom" + icon;
// Render the erp5_from // Render the erp5_from
...@@ -102,10 +112,10 @@ ...@@ -102,10 +112,10 @@
]); ]);
}) })
.push(function (all_result) { .push(function (all_result) {
form_gadget.element.querySelector('a.dialogcancel').href = all_result[0];
return form_gadget.updateHeader({ return form_gadget.updateHeader({
cancel_url: all_result[0], cancel_url: all_result[0],
page_title: all_result[1], page_title: all_result[1]
submit_action: true
}); });
}); });
}) })
......
...@@ -230,7 +230,7 @@ ...@@ -230,7 +230,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>956.14161.10627.9233</string> </value> <value> <string>957.40691.44097.35481</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -248,7 +248,7 @@ ...@@ -248,7 +248,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1482749961.0</float> <float>1488273849.34</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -1021,8 +1021,10 @@ div[data-gadget-scope='header'] .ui-header { ...@@ -1021,8 +1021,10 @@ div[data-gadget-scope='header'] .ui-header {
input[type='submit'] { input[type='submit'] {
padding: @margin-size; padding: @margin-size;
margin-top: @headerheight;
margin-right: @double-margin-size;
background-color: @panelbackgroundcolor; background-color: @coloraccent;
color: @white; color: @white;
border-radius: @radius; border-radius: @radius;
...@@ -1032,10 +1034,10 @@ div[data-gadget-scope='header'] .ui-header { ...@@ -1032,10 +1034,10 @@ div[data-gadget-scope='header'] .ui-header {
min-width: 8em; min-width: 8em;
&:hover, &:focus { &:hover, &:focus {
background-color: lighten(@panelbackgroundcolor, 10%); background-color: lighten(@coloraccent, 10%);
} }
&:active { &:active {
background-color: lighten(@panelbackgroundcolor, 20%); background-color: lighten(@coloraccent, 20%);
} }
} }
......
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