Commit bcf21696 authored by Romain Courteaud's avatar Romain Courteaud

erp5_forge: push directly from the vcs gadget

parent 07fa136d
...@@ -135,7 +135,7 @@ ...@@ -135,7 +135,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <string>python: [(\'default_changelog\', "{}: ".format(context.getTitle())), (\'diff_url\', \'%s/BusinessTemplate_doVcsDiffAsJson\' % here.absolute_url()), (\'get_tree_url\', \'%s/tree.xml\' % here.absolute_url()), (\'remote_url\', here.getVcsTool().getRemoteUrl()), (\'remote_comment\', here.getVcsTool().getRemoteComment())]</string> </value> <value> <string>python: [(\'default_push\', preferences.getPreferredVcsPushMode() and not here.getVcsTool().getAheadCount()), (\'default_changelog\', "{}: ".format(context.getTitle())), (\'diff_url\', \'%s/BusinessTemplate_doVcsDiffAsJson\' % here.absolute_url()), (\'get_tree_url\', \'%s/tree.xml\' % here.absolute_url()), (\'remote_url\', here.getVcsTool().getRemoteUrl()), (\'remote_comment\', here.getVcsTool().getRemoteComment())]</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
data-i18n=Diff data-i18n=Diff
data-i18n=Changelog data-i18n=Changelog
data-i18n=Expand data-i18n=Expand
data-i18n=Push
--> -->
<meta http-equiv="Content-type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, user-scalable=no" /> <meta name="viewport" content="width=device-width, user-scalable=no" />
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
function getTranslationDict(gadget) { function getTranslationDict(gadget) {
var word_list = ['Added Files', 'Modified Files', 'Removed Files', var word_list = ['Added Files', 'Modified Files', 'Removed Files',
'Tree', 'Diff', 'Changelog', 'Expand']; 'Tree', 'Diff', 'Changelog', 'Expand', 'Push'];
return gadget.getTranslationList(word_list) return gadget.getTranslationList(word_list)
.push(function (result_list) { .push(function (result_list) {
var result = {}, var result = {},
...@@ -492,6 +492,13 @@ ...@@ -492,6 +492,13 @@
.push(function (translation_dict) { .push(function (translation_dict) {
renderGadgetHeader(gadget, false, translation_dict); renderGadgetHeader(gadget, false, translation_dict);
domsugar(gadget.element.querySelector('div.vcsbody'), [ domsugar(gadget.element.querySelector('div.vcsbody'), [
domsugar('label', {text: translation_dict.Push}, [
' ',
domsugar('input', {
type: 'checkbox',
checked: result.push || gadget.state.default_push || false
})
]),
domsugar('h3', {text: translation_dict.Changelog}), domsugar('h3', {text: translation_dict.Changelog}),
domsugar('textarea', { domsugar('textarea', {
value: result.changelog || gadget.state.default_changelog || '' value: result.changelog || gadget.state.default_changelog || ''
...@@ -509,6 +516,7 @@ ...@@ -509,6 +516,7 @@
function getContentFromChangelogView(gadget) { function getContentFromChangelogView(gadget) {
var result = JSON.parse(gadget.state.value); var result = JSON.parse(gadget.state.value);
result.changelog = gadget.element.querySelector('textarea').value; result.changelog = gadget.element.querySelector('textarea').value;
result.push = gadget.element.querySelector('input').checked;
gadget.state.value = JSON.stringify(result); gadget.state.value = JSON.stringify(result);
} }
......
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