description is now dynamically editable (edit field appears if there's already a description written) (Github request #14)
This commit is contained in:
parent
22b299665a
commit
fa1b7058df
@ -19,6 +19,7 @@ This plugin uses [FontAwesome icons](http://fontawesome.io/)
|
|||||||
|
|
||||||
### Changelog
|
### Changelog
|
||||||
|
|
||||||
|
* **v 0.4.6** : description is now dynamically editable (edit field appears if there's already a description written) (Github request #14)
|
||||||
* **v 0.4.5** : fixed Github issue #13 : CSS display for custom attributes, added Title dynamic edition (Github request #14)
|
* **v 0.4.5** : fixed Github issue #13 : CSS display for custom attributes, added Title dynamic edition (Github request #14)
|
||||||
* **v 0.4.4** : fixed Github issues #6, #12 : User can't update status until all required field are filled for this step of the issue
|
* **v 0.4.4** : fixed Github issues #6, #12 : User can't update status until all required field are filled for this step of the issue
|
||||||
* **v 0.4.3** : partially fixed Github issue #12 : Read only attributes can't be edited anymore. Dynamic refresh for read only attributes when status changes
|
* **v 0.4.3** : partially fixed Github issue #12 : Read only attributes can't be edited anymore. Dynamic refresh for read only attributes when status changes
|
||||||
|
|||||||
@ -84,6 +84,13 @@ function initEditFields()
|
|||||||
$('.subject h3').html('<span class="showValue">' + $('.subject h3').html() + '</span> <i class="fa fa-pencil fa-fw" aria-hidden="true"></i>' +
|
$('.subject h3').html('<span class="showValue">' + $('.subject h3').html() + '</span> <i class="fa fa-pencil fa-fw" aria-hidden="true"></i>' +
|
||||||
htmlCopy).addClass('value');
|
htmlCopy).addClass('value');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($('#DescriptionInput').length > 0) {
|
||||||
|
var htmlCopy = $('#DescriptionInput').get(0).outerHTML;
|
||||||
|
$('#DescriptionInput').remove();
|
||||||
|
$('div.description .wiki').html(' <i class="fa fa-pencil fa-fw" aria-hidden="true" style="float:right;"></i><span class="showValue">' + $('div.description .wiki').html() + '</span>' +
|
||||||
|
htmlCopy).addClass('value');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
initEditFields();
|
initEditFields();
|
||||||
@ -122,6 +129,9 @@ function issueDynamicUpdate(field_name, field_value, type, cssClass){
|
|||||||
} else if (type == "input")
|
} else if (type == "input")
|
||||||
{
|
{
|
||||||
return $('.details .' + cssClass + ' .value input').val()
|
return $('.details .' + cssClass + ' .value input').val()
|
||||||
|
} else if(type == "textarea")
|
||||||
|
{
|
||||||
|
return $('.details .' + cssClass + ' .value textarea').val()
|
||||||
} else if(type == "date")
|
} else if(type == "date")
|
||||||
{
|
{
|
||||||
return "XXXX/XX/XX";
|
return "XXXX/XX/XX";
|
||||||
@ -334,7 +344,20 @@ function initEditFieldListeners()
|
|||||||
if (e.keyCode == 13) {
|
if (e.keyCode == 13) {
|
||||||
$('#TitleInput a.btn.validate').click();
|
$('#TitleInput a.btn.validate').click();
|
||||||
}
|
}
|
||||||
});/* end StartDate */
|
});/* end Title */
|
||||||
|
|
||||||
|
var domInputDescription = $('body').find('#DescriptionInput textarea');
|
||||||
|
$('#DescriptionInput a.btn.validate').on('click', function(e)
|
||||||
|
{
|
||||||
|
e.preventDefault();
|
||||||
|
issueDynamicUpdate('description', domInputDescription.serialize().split('description=')[1], 'textarea', 'description');
|
||||||
|
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
|
||||||
|
var wikiToolbar = new jsToolBar(document.getElementById('description_textarea')); wikiToolbar.setHelpLink('/help/fr/wiki_syntax_textile.html'); wikiToolbar.draw();
|
||||||
|
|
||||||
|
/* end Description */
|
||||||
}
|
}
|
||||||
|
|
||||||
initEditFieldListeners();
|
initEditFieldListeners();
|
||||||
BIN
doc/edit.gif
BIN
doc/edit.gif
Binary file not shown.
|
Before Width: | Height: | Size: 137 KiB After Width: | Height: | Size: 1.5 MiB |
2
init.rb
2
init.rb
@ -6,7 +6,7 @@ Redmine::Plugin.register :redmine_issue_dynamic_edit do
|
|||||||
name 'Redmine Dynamic edit Issue plugin'
|
name 'Redmine Dynamic edit Issue plugin'
|
||||||
author 'Hugo Zilliox'
|
author 'Hugo Zilliox'
|
||||||
description 'Allows users to dynamically update issue attributes in detailed view without refreshing the page (JIRA style)'
|
description 'Allows users to dynamically update issue attributes in detailed view without refreshing the page (JIRA style)'
|
||||||
version '0.4.5'
|
version '0.4.6'
|
||||||
url 'https://github.com/ilogeek/redmine_issue_dynamic_edit'
|
url 'https://github.com/ilogeek/redmine_issue_dynamic_edit'
|
||||||
author_url 'https://hzilliox.fr'
|
author_url 'https://hzilliox.fr'
|
||||||
end
|
end
|
||||||
|
|||||||
@ -147,6 +147,13 @@ class DetailsIssueHooks < Redmine::Hook::ViewListener
|
|||||||
o << " <a href='#' class='btn btn-primary validate' aria-label='" + l(:ide_txt_validation_btn) + "'><i class='fa fa-check fa-fw' aria-hidden='true'></i></a>"
|
o << " <a href='#' class='btn btn-primary validate' aria-label='" + l(:ide_txt_validation_btn) + "'><i class='fa fa-check fa-fw' aria-hidden='true'></i></a>"
|
||||||
o << " <a href='#' class='btn btn-primary close' aria-label='" + l(:ide_txt_cancel_btn) + "'><i class='fa fa-times fa-fw' aria-hidden='true'></i></a>"
|
o << " <a href='#' class='btn btn-primary close' aria-label='" + l(:ide_txt_cancel_btn) + "'><i class='fa fa-times fa-fw' aria-hidden='true'></i></a>"
|
||||||
o << "</span>"
|
o << "</span>"
|
||||||
|
|
||||||
|
# Description
|
||||||
|
o << "<span class='dynamicEdit' id='DescriptionInput'>"
|
||||||
|
o << " <textarea name='description' id='description_textarea' cols='60' rows='10' style='width:calc(100\% - 10px)'>#{issue.description}</textarea>"
|
||||||
|
o << " <div style='display:block; text-align:right; margin-top:10px;'><a href='#' class='btn btn-primary validate' aria-label='" + l(:ide_txt_validation_btn) + "'><i class='fa fa-check fa-fw' aria-hidden='true'></i></a>"
|
||||||
|
o << " <a href='#' class='btn btn-primary close' aria-label='" + l(:ide_txt_cancel_btn) + "'><i class='fa fa-times fa-fw' aria-hidden='true'></i></a></div>"
|
||||||
|
o << "</span>"
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user