Commit 322d3223 authored by Romain Courteaud's avatar Romain Courteaud

[erp5_web_renderjs_ui] Display submit button under the dialog form

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