Commit f17e1a44 authored by Romain Courteaud's avatar Romain Courteaud

[erp5_web_renderjs_ui] Logout: stop using translateHTML

parent d727a4ad
<!DOCTYPE html>
<html>
<!--
data-i18n=Confirm
-->
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width" />
......@@ -9,21 +12,24 @@
<script src="rsvp.js" type="text/javascript"></script>
<script src="renderjs.js" type="text/javascript"></script>
<script src="jiodev.js" type="text/javascript"></script>
<script src="handlebars.js" type="text/javascript"></script>
<!-- custom script -->
<script src="gadget_erp5_page_logout.js" type="text/javascript"></script>
</head>
<body>
<script id="form-template" type="text/x-handlebars-template">
<article class="ui-content ui-body-c">
<section class="ui-body-c ui-content-section">
<form class="logout">
<input data-theme="b" data-inline="true" type="submit" data-i18n="[value]Confirm" value="Confirm" data-icon="check" />
<input data-theme="b" data-inline="true" type="submit" value="{{button_text}}" data-icon="check" />
</form>
</section>
</article>
</script>
<!-- custom script -->
<script src="gadget_erp5_page_logout.js" type="text/javascript"></script>
</head>
<body>
</body>
</html>
\ No newline at end of file
......@@ -234,7 +234,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>954.45675.44850.53452</string> </value>
<value> <string>968.42589.6882.6638</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -252,7 +252,7 @@
</tuple>
<state>
<tuple>
<float>1476953691.35</float>
<float>1530607558.33</float>
<string>UTC</string>
</tuple>
</state>
......
/*global window, rJS, UriTemplate */
/*global window, rJS, UriTemplate, Handlebars */
/*jslint indent: 2, maxerr: 3, nomen: true */
(function (window, rJS, UriTemplate) {
(function (window, rJS, UriTemplate, Handlebars) {
"use strict";
rJS(window)
var gadget_klass = rJS(window),
form_template = Handlebars.compile(
gadget_klass.__template_element
.getElementById("form-template")
.innerHTML
);
gadget_klass
/////////////////////////////////////////////////////////////////
// handle acquisition
/////////////////////////////////////////////////////////////////
.declareAcquiredMethod("redirect", "redirect")
.declareAcquiredMethod("getUrlFor", "getUrlFor")
.declareAcquiredMethod("jio_getAttachment", "jio_getAttachment")
.declareAcquiredMethod("translateHtml", "translateHtml")
.declareAcquiredMethod("translate", "translate")
.declareAcquiredMethod("updateHeader", "updateHeader")
/////////////////////////////////////////////////////////////////
// declared methods
/////////////////////////////////////////////////////////////////
.declareMethod("render", function () {
var gadget = this,
header_dict = {
page_title: 'Logout',
page_icon: 'power-off'
};
.declareMethod("render", function () {
var gadget = this;
return gadget.getUrlFor({command: 'display'})
.push(function (front_url) {
header_dict.front_url = front_url;
return gadget.updateHeader(header_dict);
return gadget.updateHeader({
page_title: 'Logout',
page_icon: 'power-off',
front_url: front_url
});
})
.push(function () {
return gadget.translateHtml(gadget.element.innerHTML);
return gadget.translate('Confirm');
})
.push(function (my_translated_html) {
gadget.element.innerHTML = my_translated_html;
.push(function (translated_text) {
gadget.element.innerHTML = form_template({
button_text: translated_text
});
});
})
......@@ -58,4 +66,4 @@
});
});
});
}(window, rJS, UriTemplate));
\ No newline at end of file
}(window, rJS, UriTemplate, Handlebars));
\ No newline at end of file
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>963.11788.48702.26146</string> </value>
<value> <string>968.42610.16476.33962</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1518598022.73</float>
<float>1530607593.22</float>
<string>UTC</string>
</tuple>
</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