Merge pull request #10293 from ashwinisave35/knowledge_base_button

Changed Text of Knowledge base button to Help Article
This commit is contained in:
Nabin Hait 2017-08-07 13:50:02 +05:30 committed by GitHub
commit 79005e83d7

View File

@ -18,12 +18,12 @@ frappe.ui.form.on("Issue", {
}, },
timeline_refresh: function(frm) { timeline_refresh: function(frm) {
// create button for "Add to Knowledge Base" // create button for "Help Article"
if(frappe.model.can_create('Help Article')) { if(frappe.model.can_create('Help Article')) {
// Removing Knowledge Base button if exists to avoid multiple occurance // Removing Help Article button if exists to avoid multiple occurance
frm.timeline.wrapper.find('.comment-header .asset-details .btn-add-to-kb').remove(); frm.timeline.wrapper.find('.comment-header .asset-details .btn-add-to-kb').remove();
$('<button class="btn btn-xs btn-default btn-add-to-kb hidden-xs pull-right" style="margin-top: -2px">'+ $('<button class="btn btn-xs btn-link btn-add-to-kb text-muted hidden-xs pull-right">'+
__('Add to Knowledge Base') + '</button>') __('Help Article') + '</button>')
.appendTo(frm.timeline.wrapper.find('.comment-header .asset-details')) .appendTo(frm.timeline.wrapper.find('.comment-header .asset-details'))
.on('click', function() { .on('click', function() {
var content = $(this).parents('.timeline-item:first').find('.timeline-item-content').html(); var content = $(this).parents('.timeline-item:first').find('.timeline-item-content').html();