Commit 75f9b67b authored by Romain Courteaud's avatar Romain Courteaud

[erp5_web_renderjs_ui] Display the document portal type on the header title

On a module, only display the portal_type.
parent 057686d0
......@@ -108,7 +108,7 @@
<value> <string encoding="cdata"><![CDATA[
CACHE MANIFEST\n
# generated on Mon, 07 Apr 2016 10:30:00 GMT\n
# generated on Mon, 11 Apr 2016 14:30:00 GMT\n
# XXX + fonts\n
# images/ajax-loader.gif\n
CACHE:\n
......@@ -211,6 +211,7 @@ gadget_erp5_searchfield.js\n
gadget_erp5_sort_editor.html\n
gadget_erp5_sort_editor.js\n
gadget_global.js\n
gadget_erp5_global.js\n
gadget_jio.html\n
gadget_jio.js\n
gadget_translation.html\n
......@@ -356,7 +357,7 @@ NETWORK:\n
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>950.22851.261.49698</string> </value>
<value> <string>950.28770.51995.64546</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -374,7 +375,7 @@ NETWORK:\n
</tuple>
<state>
<tuple>
<float>1460023873.3</float>
<float>1460381405.36</float>
<string>UTC</string>
</tuple>
</state>
......
/*global window, RSVP */
/*jslint indent: 2, maxerr: 3, nomen: true, unparam: true */
(function (window, RSVP) {
"use strict";
window.calculatePageTitle = function (gadget, erp5_document) {
return new RSVP.Queue()
.push(function () {
var title = erp5_document.title,
portal_type = erp5_document._links.type.name;
if (/ Module$/.test(portal_type)) {
return portal_type;
}
return portal_type + ': ' + title;
});
};
}(window, RSVP));
\ No newline at end of file
......@@ -236,7 +236,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>949.25536.57875.14165</string> </value>
<value> <string>950.24504.62713.15360</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -254,7 +254,7 @@
</tuple>
<state>
<tuple>
<float>1456426686.64</float>
<float>1460362264.77</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -234,7 +234,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>949.53828.65434.1638</string> </value>
<value> <string>950.28765.38539.13653</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -252,7 +252,7 @@
</tuple>
<state>
<tuple>
<float>1457950556.56</float>
<float>1460378755.69</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -101,8 +101,12 @@
"editable": 1
}
}},
"_links": {}
},
"_links": {
"type": {
// form_list display portal_type in header
name: ""
}
}},
form_definition: {
group_list: [[
"bottom",
......
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>949.63941.3687.12936</string> </value>
<value> <string>950.28737.36313.33262</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1458557180.6</float>
<float>1460377090.92</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -13,6 +13,7 @@
<!-- custom script -->
<script src="gadget_global.js" type="text/javascript"></script>
<script src="gadget_erp5_global.js" type="text/javascript"></script>
<script src="gadget_erp5_page_action.js" type="text/javascript"></script>
<!-- XXX need theme here currently -->
......
......@@ -234,7 +234,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>949.6674.56490.63948</string> </value>
<value> <string>949.53789.19765.27784</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -252,7 +252,7 @@
</tuple>
<state>
<tuple>
<float>1455548880.29</float>
<float>1460378795.97</float>
<string>UTC</string>
</tuple>
</state>
......
/*global window, rJS, RSVP, Handlebars */
/*global window, rJS, RSVP, Handlebars, calculatePageTitle */
/*jslint nomen: true, indent: 2, maxerr: 3 */
(function (window, rJS, RSVP, Handlebars) {
(function (window, rJS, RSVP, Handlebars, calculatePageTitle) {
"use strict";
/////////////////////////////////////////////////////////////////
......@@ -93,23 +93,26 @@
if (erp5_document._links.action_object_clone_action) {
action = tab_list.pop();
}
return gadget.translateHtml(table_template({
definition_title: "Workflow Transitions",
documentlist: tab_list,
definition_i18n: "Workflow-Transitions",
section_i18n: "Actions",
section_title: "Actions",
action: action
}));
return RSVP.all([
gadget.translateHtml(table_template({
definition_title: "Workflow Transitions",
documentlist: tab_list,
definition_i18n: "Workflow-Transitions",
section_i18n: "Actions",
section_title: "Actions",
action: action
})),
calculatePageTitle(gadget, erp5_document)
]);
})
.push(function (my_translated_html) {
gadget.props.element.innerHTML = my_translated_html;
.push(function (last_result_list) {
gadget.props.element.innerHTML = last_result_list[0];
return gadget.updateHeader({
back_url: result_list[0],
page_title: erp5_document.title
page_title: last_result_list[1]
});
});
});
}(window, rJS, RSVP, Handlebars));
\ No newline at end of file
}(window, rJS, RSVP, Handlebars, calculatePageTitle));
\ No newline at end of file
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>950.21620.6361.8277</string> </value>
<value> <string>950.28791.23999.5956</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1459950557.16</float>
<float>1460380327.89</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -12,6 +12,7 @@
<!-- custom script -->
<script src="gadget_global.js" type="text/javascript"></script>
<script src="gadget_erp5_global.js" type="text/javascript"></script>
<script src="gadget_erp5_pt_form_dialog.js" type="text/javascript"></script>
</head>
......
......@@ -220,7 +220,7 @@
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>super_sven</string> </value>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
......@@ -234,7 +234,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>939.43978.9403.31744</string> </value>
<value> <string>946.44927.40202.16725</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -252,8 +252,8 @@
</tuple>
<state>
<tuple>
<float>1419347929.19</float>
<string>GMT</string>
<float>1460379182.94</float>
<string>UTC</string>
</tuple>
</state>
</object>
......
/*jslint nomen: true, indent: 2, maxerr: 3 */
/*global window, rJS, RSVP, URI, loopEventListener, document */
(function (window, rJS, RSVP, URI, loopEventListener) {
/*global window, rJS, RSVP, URI, loopEventListener, document, calculatePageTitle */
(function (window, rJS, RSVP, URI, loopEventListener, calculatePageTitle) {
"use strict";
/////////////////////////////////////////////////////////////////
......@@ -112,13 +112,14 @@
section.innerHTML = my_translation_html;
return RSVP.all([
erp5_form.render(form_options),
form_gadget.getUrlFor({command: 'change', options: {page: undefined, view: undefined}})
form_gadget.getUrlFor({command: 'change', options: {page: undefined, view: undefined}}),
calculatePageTitle(form_gadget, options.erp5_document)
]);
})
.push(function (all_result) {
return form_gadget.updateHeader({
cancel_url: all_result[1],
page_title: options.erp5_document.title,
page_title: all_result[2],
submit_action: true
});
});
......@@ -201,4 +202,4 @@
);
});
}(window, rJS, RSVP, URI, loopEventListener));
\ No newline at end of file
}(window, rJS, RSVP, URI, loopEventListener, calculatePageTitle));
\ No newline at end of file
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>949.54154.3158.28962</string> </value>
<value> <string>950.28774.6948.60706</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1459949953.41</float>
<float>1460380958.69</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -11,6 +11,7 @@
<!-- custom script -->
<script src="gadget_global.js" type="text/javascript"></script>
<script src="gadget_erp5_global.js" type="text/javascript"></script>
<script src="gadget_erp5_pt_form_list.js" type="text/javascript"></script>
</head>
......
......@@ -220,7 +220,7 @@
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>romain</string> </value>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
......@@ -234,7 +234,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>945.61017.50891.24046</string> </value>
<value> <string>946.44927.40202.16725</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -252,8 +252,8 @@
</tuple>
<state>
<tuple>
<float>1442998685.54</float>
<string>GMT</string>
<float>1460379295.13</float>
<string>UTC</string>
</tuple>
</state>
</object>
......
/*global window, rJS, RSVP, loopEventListener */
/*global window, rJS, RSVP, loopEventListener, calculatePageTitle */
/*jslint nomen: true, indent: 2, maxerr: 3 */
(function (window, rJS, RSVP, loopEventListener) {
(function (window, rJS, RSVP, loopEventListener, calculatePageTitle) {
"use strict";
rJS(window)
......@@ -29,7 +29,7 @@
.declareAcquiredMethod("getUrlParameter", "getUrlParameter")
.allowPublicAcquisition("getListboxInfo", function () {
return this.getDeclaredGadget("erp5_form")
.push(function(form_gadget) {
.push(function (form_gadget) {
return form_gadget.getListboxInfo();
});
})
......@@ -70,7 +70,8 @@
gadget.getDeclaredGadget("erp5_form"),
new_content_action,
gadget.getUrlFor({command: 'change', options: {page: "action"}}),
gadget.getUrlFor({command: 'display', options: {}})
gadget.getUrlFor({command: 'display', options: {}}),
calculatePageTitle(gadget, options.erp5_document)
]);
})
.push(function (all_gadget) {
......@@ -84,7 +85,7 @@
add_url: all_gadget[2],
actions_url: all_gadget[3],
export_url: "",
page_title: options.erp5_document.title,
page_title: all_gadget[5],
front_url: all_gadget[4]
})
......@@ -124,4 +125,4 @@
);
});
}(window, rJS, RSVP, loopEventListener));
\ No newline at end of file
}(window, rJS, RSVP, loopEventListener, calculatePageTitle));
\ No newline at end of file
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>950.21719.42799.7953</string> </value>
<value> <string>950.28775.58471.1331</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1459956126.43</float>
<float>1460380526.47</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -12,6 +12,7 @@
<!-- custom script -->
<script src="gadget_global.js" type="text/javascript"></script>
<script src="gadget_erp5_global.js" type="text/javascript"></script>
<script src="gadget_erp5_pt_form_view_editable.js" type="text/javascript"></script>
</head>
......
......@@ -234,7 +234,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>940.10457.48901.33450</string> </value>
<value> <string>946.44927.40202.16725</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -252,7 +252,7 @@
</tuple>
<state>
<tuple>
<float>1420736835.67</float>
<float>1460379409.72</float>
<string>UTC</string>
</tuple>
</state>
......
/*global window, rJS, RSVP, loopEventListener, document */
/*global window, rJS, RSVP, loopEventListener, document, calculatePageTitle */
/*jslint nomen: true, indent: 2, maxerr: 3 */
(function (window, rJS, RSVP, loopEventListener) {
(function (window, rJS, RSVP, loopEventListener, calculatePageTitle) {
"use strict";
rJS(window)
......@@ -80,7 +80,8 @@
form_gadget.getUrlFor({command: 'change', options: {page: "action", editable: true}}),
new_content_action,
form_gadget.getUrlFor({command: 'history_previous'}),
delete_action
delete_action,
calculatePageTitle(form_gadget, options.erp5_document)
]);
})
.push(function (all_result) {
......@@ -91,7 +92,7 @@
selection_url: all_result[4],
delete_url: all_result[5],
cut_url: "",
page_title: options.erp5_document.title
page_title: all_result[6]
};
if (form_gadget.props.action !== undefined) {
header_dict.save_action = true;
......@@ -165,4 +166,4 @@
);
});
}(window, rJS, RSVP, loopEventListener));
\ No newline at end of file
}(window, rJS, RSVP, loopEventListener, calculatePageTitle));
\ No newline at end of file
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>950.21392.9218.22186</string> </value>
<value> <string>950.28778.40365.28040</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1459949626.4</float>
<float>1460380770.14</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -12,6 +12,7 @@
<!-- custom script -->
<script src="gadget_global.js" type="text/javascript"></script>
<script src="gadget_erp5_global.js" type="text/javascript"></script>
<script src="gadget_erp5_pt_form_view.js" type="text/javascript"></script>
</head>
......
......@@ -220,7 +220,7 @@
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>romain</string> </value>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
......@@ -234,7 +234,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>937.64343.1806.54016</string> </value>
<value> <string>946.44927.40202.16725</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -252,8 +252,8 @@
</tuple>
<state>
<tuple>
<float>1412342134.54</float>
<string>GMT</string>
<float>1460379399.92</float>
<string>UTC</string>
</tuple>
</state>
</object>
......
/*global window, rJS, RSVP */
/*global window, rJS, RSVP, calculatePageTitle */
/*jslint nomen: true, indent: 2, maxerr: 3 */
(function (window, rJS, RSVP) {
(function (window, rJS, RSVP, calculatePageTitle) {
"use strict";
// Precompile the templates while loading the first gadget instance
......@@ -56,7 +56,8 @@
gadget.getUrlFor({command: 'history_previous'}),
gadget.getUrlFor({command: 'selection_previous'}),
gadget.getUrlFor({command: 'selection_next'}),
gadget.getUrlFor({command: 'change', options: {page: "tab"}})
gadget.getUrlFor({command: 'change', options: {page: "tab"}}),
calculatePageTitle(gadget, options.erp5_document)
]);
})
.push(function (all_result) {
......@@ -69,9 +70,9 @@
next_url: all_result[5],
tab_url: all_result[6],
export_url: "",
page_title: options.erp5_document.title,
page_title: all_result[7]
});
});
});
}(window, rJS, RSVP));
\ No newline at end of file
}(window, rJS, RSVP, calculatePageTitle));
\ No newline at end of file
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>950.21248.30063.21504</string> </value>
<value> <string>950.28778.3703.7458</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1459949849.57</float>
<float>1460380730.43</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -13,6 +13,7 @@
<!-- custom script -->
<script src="gadget_global.js" type="text/javascript"></script>
<script src="gadget_erp5_global.js" type="text/javascript"></script>
<script src="gadget_erp5_page_jump.js" type="text/javascript"></script>
<!-- XXX need theme here currently -->
......
......@@ -234,7 +234,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>949.63827.42318.23261</string> </value>
<value> <string>950.21248.30063.21504</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -252,7 +252,7 @@
</tuple>
<state>
<tuple>
<float>1458556447.37</float>
<float>1460379569.95</float>
<string>UTC</string>
</tuple>
</state>
......
/*global window, rJS, RSVP, Handlebars, URI */
/*global window, rJS, RSVP, Handlebars, URI, calculatePageTitle */
/*jslint nomen: true, indent: 2, maxerr: 3 */
(function (window, rJS, RSVP, Handlebars, URI) {
(function (window, rJS, RSVP, Handlebars, URI, calculatePageTitle) {
"use strict";
/////////////////////////////////////////////////////////////////
......@@ -81,20 +81,23 @@
i18n: view_list[i - 1].title
});
}
return gadget.translateHtml(table_template({
definition_title: "Jumps",
documentlist: tab_list,
definition_i18n: "Jumps"
}));
return RSVP.all([
gadget.translateHtml(table_template({
definition_title: "Jumps",
documentlist: tab_list,
definition_i18n: "Jumps"
})),
calculatePageTitle(gadget, erp5_document)
]);
})
.push(function (my_translated_html) {
gadget.props.element.innerHTML = my_translated_html;
.push(function (last_result_list) {
gadget.props.element.innerHTML = last_result_list[0];
return gadget.updateHeader({
back_url: result_list[0],
page_title: erp5_document.title
page_title: last_result_list[1]
});
});
});
}(window, rJS, RSVP, Handlebars, URI));
\ No newline at end of file
}(window, rJS, RSVP, Handlebars, URI, calculatePageTitle));
\ No newline at end of file
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>950.21615.60122.32938</string> </value>
<value> <string>950.28780.17945.40857</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1459950664.05</float>