Style modifications and README update
This commit is contained in:
parent
94bb6e67f6
commit
9a7a860ea5
17
README.md
17
README.md
@ -1,4 +1,19 @@
|
|||||||
# redmine_issue_dynamic_edit
|
# redmine_issue_dynamic_edit
|
||||||
|
|
||||||
Add new dropdowns elements on detailed issue page to dynamically update issue's status, assignee and priority directly in the details block of the issue
|
Add new dropdowns elements on detailed issue page to dynamically update issue's status, assignee and priority directly in the details block of the issue
|
||||||
You have to enable Redmine REST API
|
**You have to enable Redmine REST API** (`Administration` > `Settings` > `API` > check **Enable REST web service**)
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
### Installation
|
||||||
|
|
||||||
|
* Enable REST API
|
||||||
|
* Clone repo into plugins directory : `git clone https://github.com/Ilogeek/redmine_issue_dynamic_edit.git`
|
||||||
|
* Restart your Redmine instance
|
||||||
|
|
||||||
|
### Customization
|
||||||
|
|
||||||
|
Feel free to edit `assets/stylesheets/issue_dynamic_edit.css` to update the look of your fields depending on your current Redmine Theme
|
||||||
|
This plugin uses [FontAwesome icons](http://fontawesome.io/)
|
||||||
@ -48,6 +48,9 @@ function updateDataIssue(field_name, field_value, cssClass) {
|
|||||||
},
|
},
|
||||||
success: function(msg) {
|
success: function(msg) {
|
||||||
setTimeout(function(){
|
setTimeout(function(){
|
||||||
|
$('.details .attributes .' + cssClass + '.attribute .value .selectedValue span').html(
|
||||||
|
$('.details .attributes .' + cssClass + '.attribute .value select option:selected').html()
|
||||||
|
);
|
||||||
$('.details .attributes .' + cssClass + '.attribute .value i.fa-spin').remove();
|
$('.details .attributes .' + cssClass + '.attribute .value i.fa-spin').remove();
|
||||||
$('.details .attributes .' + cssClass + '.attribute .value').append(' <i class="fa fa-check"></i>');
|
$('.details .attributes .' + cssClass + '.attribute .value').append(' <i class="fa fa-check"></i>');
|
||||||
setTimeout(function(){
|
setTimeout(function(){
|
||||||
@ -72,13 +75,4 @@ function updateDataIssue(field_name, field_value, cssClass) {
|
|||||||
var domSelectUsers = $('body').find('#usersListDropdown select');
|
var domSelectUsers = $('body').find('#usersListDropdown select');
|
||||||
domSelectUsers.on('change', function(e){
|
domSelectUsers.on('change', function(e){
|
||||||
updateDataIssue('assigned_to_id', domSelectUsers.val(), 'assigned-to');
|
updateDataIssue('assigned_to_id', domSelectUsers.val(), 'assigned-to');
|
||||||
}); /* end on change domSelectUsers */
|
}); /* end on change domSelectUsers */
|
||||||
|
|
||||||
$('.details .attributes .attribute .value').on({
|
|
||||||
mouseenter: function () {
|
|
||||||
$(this).find('.fa-pencil').removeClass('fa-pencil').addClass('fa-angle-down');
|
|
||||||
},
|
|
||||||
mouseleave: function () {
|
|
||||||
$(this).find('.fa-angle-down').removeClass('fa-angle-down').addClass('fa-pencil');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
@ -1,3 +1,7 @@
|
|||||||
|
div.issue .attribute .value {
|
||||||
|
overflow: visible;
|
||||||
|
}
|
||||||
|
|
||||||
.value .dynamicEditSelect select {
|
.value .dynamicEditSelect select {
|
||||||
border-color: transparent;
|
border-color: transparent;
|
||||||
border: 0;
|
border: 0;
|
||||||
@ -10,17 +14,39 @@
|
|||||||
font-size: inherit;
|
font-size: inherit;
|
||||||
color: inherit;
|
color: inherit;
|
||||||
font-family: inherit;
|
font-family: inherit;
|
||||||
padding-left: 0;
|
background: transparent;
|
||||||
padding-right: 0;
|
padding-left:0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.value .dynamicEditSelect {
|
||||||
|
padding-left: 5px;
|
||||||
|
margin-left: -6px; /* padding + border */
|
||||||
|
display: inline-block;
|
||||||
|
border: 1px solid transparent;
|
||||||
|
border-radius: 3px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.value:hover .dynamicEditSelect select {
|
.value:hover .dynamicEditSelect {
|
||||||
border-color: inherit;
|
border-color: #e0e2e3;
|
||||||
}
|
}
|
||||||
|
|
||||||
.value .dynamicEditSelect {
|
.value .dynamicEditSelect {
|
||||||
position:relative;
|
position:relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.value .dynamicEditSelect .selectedValue {
|
||||||
|
position: absolute;
|
||||||
|
top: 2px;
|
||||||
|
right: 0;
|
||||||
|
left: 5px;
|
||||||
|
background: white;
|
||||||
|
pointer-events: none;
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.value:hover .dynamicEditSelect .selectedValue {
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
|
||||||
.value .dynamicEditSelect i.dropdown {
|
.value .dynamicEditSelect i.dropdown {
|
||||||
position:absolute;
|
position:absolute;
|
||||||
@ -28,4 +54,14 @@
|
|||||||
top: 50%;
|
top: 50%;
|
||||||
transform: translateY(-50%);
|
transform: translateY(-50%);
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.value:hover .dynamicEditSelect i.dropdown {
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.value:hover .dynamicEditSelect select option[disabled="disabled"]
|
||||||
|
{
|
||||||
|
display:none;
|
||||||
}
|
}
|
||||||
BIN
doc/edit.gif
Normal file
BIN
doc/edit.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 137 KiB |
@ -25,7 +25,9 @@ class DetailsIssueHooks < Redmine::Hook::ViewListener
|
|||||||
o = ''
|
o = ''
|
||||||
statuses = issue.new_statuses_allowed_to(User.current)
|
statuses = issue.new_statuses_allowed_to(User.current)
|
||||||
if (!statuses.empty?)
|
if (!statuses.empty?)
|
||||||
o << "<span class='dynamicEditSelect' id='statusListDropdown'><select data-issue='#{issue_id}'>"
|
o << "<span class='dynamicEditSelect' id='statusListDropdown'>"
|
||||||
|
o << "<div class='selectedValue'><span>#{issue.status}</span> <i class=\"fa fa-pencil fa-fw\" aria-hidden=\"true\"></i></div> "
|
||||||
|
o << "<select data-issue='#{issue_id}'><option disabled='disabled' selected> </option>"
|
||||||
statuses.each do |s|
|
statuses.each do |s|
|
||||||
if (s != issue.status)
|
if (s != issue.status)
|
||||||
o << "<option value='#{s.id}'>#{s.name}</option>"
|
o << "<option value='#{s.id}'>#{s.name}</option>"
|
||||||
@ -33,11 +35,13 @@ class DetailsIssueHooks < Redmine::Hook::ViewListener
|
|||||||
o << "<option value='#{s.id}' selected>#{s.name}</option>"
|
o << "<option value='#{s.id}' selected>#{s.name}</option>"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
o << "</select><i class=\"fa fa-pencil fa-fw dropdown\" aria-hidden=\"true\"></i></span>"
|
o << "</select><i class=\"fa fa-angle-down fa-fw dropdown\" aria-hidden=\"true\"></i></span>"
|
||||||
end
|
end
|
||||||
assignables = project.assignable_users
|
assignables = project.assignable_users
|
||||||
if (!assignables.empty?)
|
if (!assignables.empty?)
|
||||||
o << "<span class='dynamicEditSelect' id='usersListDropdown'><select data-issue='#{issue_id}'>"
|
o << "<span class='dynamicEditSelect' id='usersListDropdown'>"
|
||||||
|
o << "<div class='selectedValue'><span>#{issue.assigned_to}</span> <i class=\"fa fa-pencil fa-fw\" aria-hidden=\"true\"></i></div> "
|
||||||
|
o << "<select data-issue='#{issue_id}'><option disabled='disabled' selected> </option>"
|
||||||
assignables.each do |u|
|
assignables.each do |u|
|
||||||
if (u != issue.assigned_to)
|
if (u != issue.assigned_to)
|
||||||
o << "<option value='#{u.id}'>#{u.name}</option>"
|
o << "<option value='#{u.id}'>#{u.name}</option>"
|
||||||
@ -45,12 +49,14 @@ class DetailsIssueHooks < Redmine::Hook::ViewListener
|
|||||||
o << "<option value='#{u.id}' selected>#{u.name}</option>"
|
o << "<option value='#{u.id}' selected>#{u.name}</option>"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
o << "</select><i class=\"fa fa-pencil fa-fw dropdown\" aria-hidden=\"true\"></i></span>"
|
o << "</select><i class=\"fa fa-angle-down fa-fw dropdown\" aria-hidden=\"true\"></i></span>"
|
||||||
end
|
end
|
||||||
|
|
||||||
priorities = IssuePriority.all
|
priorities = IssuePriority.all
|
||||||
if(!priorities.empty?)
|
if(!priorities.empty?)
|
||||||
o << "<span class='dynamicEditSelect' id='prioritiesListDropdown'><select data-issue='#{issue_id}'>"
|
o << "<span class='dynamicEditSelect' id='prioritiesListDropdown'>"
|
||||||
|
o << "<div class='selectedValue'><span>#{issue.priority}</span> <i class=\"fa fa-pencil fa-fw\" aria-hidden=\"true\"></i></div> "
|
||||||
|
o << "<select data-issue='#{issue_id}'><option disabled='disabled' selected> </option>"
|
||||||
priorities.each do |p|
|
priorities.each do |p|
|
||||||
if (p != issue.priority)
|
if (p != issue.priority)
|
||||||
o << "<option value='#{p.id}'>#{p.name}</option>"
|
o << "<option value='#{p.id}'>#{p.name}</option>"
|
||||||
@ -58,7 +64,7 @@ class DetailsIssueHooks < Redmine::Hook::ViewListener
|
|||||||
o << "<option value='#{p.id}' selected>#{p.name}</option>"
|
o << "<option value='#{p.id}' selected>#{p.name}</option>"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
o << "</select><i class=\"fa fa-pencil fa-fw dropdown\" aria-hidden=\"true\"></i></span>"
|
o << "</select><i class=\"fa fa-angle-down fa-fw dropdown\" aria-hidden=\"true\"></i></span>"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user