Commit 76b3cb72 authored by Romain Courteaud's avatar Romain Courteaud

erp5_forge: activate changelog in the vcs gadget

parent 725f9a7d
...@@ -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: [(\'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_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>
......
...@@ -193,18 +193,16 @@ ...@@ -193,18 +193,16 @@
]) ])
], ],
tree_icon = 'ui-icon-check-square', tree_icon = 'ui-icon-check-square',
diff_icon = 'ui-icon-search-plus'; diff_icon = 'ui-icon-search-plus',
// changelog_icon = 'ui-icon-git'; changelog_icon = 'ui-icon-git';
if (loading) { if (loading) {
if (gadget.state.display_step === DISPLAY_TREE) { if (gadget.state.display_step === DISPLAY_TREE) {
tree_icon = 'ui-icon-spinner'; tree_icon = 'ui-icon-spinner';
} else if (gadget.state.display_step === DISPLAY_DIFF) { } else if (gadget.state.display_step === DISPLAY_DIFF) {
diff_icon = 'ui-icon-spinner'; diff_icon = 'ui-icon-spinner';
/*
} else if (gadget.state.display_step === DISPLAY_CHANGELOG) { } else if (gadget.state.display_step === DISPLAY_CHANGELOG) {
changelog_icon = 'ui-icon-spinner'; changelog_icon = 'ui-icon-spinner';
*/
} else { } else {
throw new Error("Can't render header state " + throw new Error("Can't render header state " +
gadget.state.display_step); gadget.state.display_step);
...@@ -223,14 +221,12 @@ ...@@ -223,14 +221,12 @@
text: translation_dict.Diff, text: translation_dict.Diff,
disabled: (gadget.state.display_step === DISPLAY_DIFF), disabled: (gadget.state.display_step === DISPLAY_DIFF),
class: 'diff-tree-btn ui-btn-icon-left ' + diff_icon class: 'diff-tree-btn ui-btn-icon-left ' + diff_icon
/*
}), }),
domsugar('button', { domsugar('button', {
type: 'button', type: 'button',
text: translation_dict.Changelog, text: translation_dict.Changelog,
disabled: (gadget.state.display_step === DISPLAY_CHANGELOG), disabled: (gadget.state.display_step === DISPLAY_CHANGELOG),
class: 'changelog-btn ui-btn-icon-left ' + changelog_icon class: 'changelog-btn ui-btn-icon-left ' + changelog_icon
*/
}) })
); );
...@@ -496,7 +492,10 @@ ...@@ -496,7 +492,10 @@
.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('textarea', {value: result.changelog}), domsugar('h3', {text: translation_dict.Changelog}),
domsugar('textarea', {
value: result.changelog || gadget.state.default_changelog || ''
}),
domsugar('h3', {text: translation_dict['Added Files']}), domsugar('h3', {text: translation_dict['Added Files']}),
domsugar('pre', {text: result.added.join('\n')}), domsugar('pre', {text: result.added.join('\n')}),
domsugar('h3', {text: translation_dict['Modified Files']}), domsugar('h3', {text: translation_dict['Modified Files']}),
...@@ -526,11 +525,14 @@ ...@@ -526,11 +525,14 @@
remote_comment: options.remote_comment, remote_comment: options.remote_comment,
remote_url: options.remote_url, remote_url: options.remote_url,
key: options.key, key: options.key,
default_changelog: options.default_changelog,
default_push: options.default_push,
value: options.value || JSON.stringify({ value: options.value || JSON.stringify({
added: [], added: [],
modified: [], modified: [],
removed: [], removed: [],
changelog: '' changelog: '',
push: false
}), }),
editable: (options.editable === undefined) ? true : options.editable editable: (options.editable === undefined) ? true : options.editable
}); });
......
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