-
Notifications
You must be signed in to change notification settings - Fork 0
Added the option to change the assignee of the issue without changing the status #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,86 +1,103 @@ | ||
| <% content_for :header_tags do %> | ||
| <%= stylesheet_link_tag 'flick/jquery-ui-1.8.4.custom.css', :plugin => :redmine_issues_kanban %> | ||
| <%= stylesheet_link_tag 'issues-kanban', :plugin => :redmine_issues_kanban %> | ||
| <%= javascript_include_tag 'jquery-1.4.2.min.js', 'jquery-ui-1.8.4.min.js', :plugin => :redmine_issues_kanban %> | ||
| <script type="text/javascript"> | ||
| jQuery.noConflict(); | ||
| <%= stylesheet_link_tag 'flick/jquery-ui-1.8.4.custom.css', :plugin => :redmine_issues_kanban %> | ||
| <%= stylesheet_link_tag 'issues-kanban', :plugin => :redmine_issues_kanban %> | ||
| <%= javascript_include_tag 'jquery-1.4.2.min.js', 'jquery-ui-1.8.4.min.js', :plugin => :redmine_issues_kanban %> | ||
| <script type="text/javascript"> | ||
| jQuery.noConflict(); | ||
|
|
||
| (function($) { | ||
| var authenticity_token = <%= form_authenticity_token.to_json %>; | ||
| var authenticity_token_name = <%= request_forgery_protection_token.to_json %>; | ||
| (function($) { | ||
| var authenticity_token = <%= form_authenticity_token.to_json.html_safe %>; | ||
| var authenticity_token_name = <%= request_forgery_protection_token.to_json.html_safe %>; | ||
|
|
||
| $(function() { | ||
| $("#issues-kanban").scrollLeft( $('.issue-status:first').width() * 0.9 ); | ||
| $(function() { | ||
| $("#issues-kanban").scrollLeft($('.issue-status:first').width() * 0.9); | ||
|
|
||
| $(".issue-status").sortable({ | ||
| items: "div.issue", | ||
| placeholder: 'ui-state-highlight', | ||
| forcePlaceholderSize: true, | ||
| connectWith: '.issue-status', | ||
| receive: function(event, ui) { | ||
| var issue_id = ui.item.attr('class').match(/issue-(\d+)/)[1]; | ||
| var assigned_to_id = $(ui.item).parent('.user-issues').attr("class").match(/user-id-(\d+)?/)[1] | ||
| var status_id = $(event.target).attr("class").match(/issue-status-(\d+)/)[1]; | ||
| $(".user-issues").sortable({ | ||
| items: "div.issue", | ||
| placeholder: 'ui-state-highlight', | ||
| forcePlaceholderSize: true, | ||
| connectWith: '.user-issues', | ||
| receive: function(event, ui) { | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Changed the connection so it can work with the new sortable divs |
||
| var issue_id = ui.item.attr('class').match(/issue-(\d+)/)[1]; | ||
| var assigned_to_id = $(ui.item).parent('.user-issues').attr("class").match(/user-id-(\d+)?/)[1] | ||
| var status_id = $(event.target).parent('.issue-status').attr("class").match(/issue-status-(\d+)/)[1]; | ||
|
|
||
| var data = { | ||
| var data = { | ||
|
|
||
| 'issue[assigned_to_id]' : assigned_to_id, | ||
| 'issue[status_id]': status_id, | ||
| '_method': "put" | ||
| }; | ||
| data[authenticity_token_name] = authenticity_token; | ||
| 'issue[assigned_to_id]' : assigned_to_id, | ||
| 'issue[status_id]': status_id, | ||
| '_method': "put" | ||
| }; | ||
| data[authenticity_token_name] = authenticity_token; | ||
|
|
||
| ui.item.addClass('updating'); | ||
| $.ajax({ | ||
| 'type': 'post', | ||
| 'data': data, | ||
| 'url': '<%= issues_path %>/' + issue_id, | ||
| 'success': function() { | ||
| ui.item.removeClass('updating'); | ||
| ui.item.addClass('updating'); | ||
| $.ajax({ | ||
| 'type': 'post', | ||
| 'data': data, | ||
| 'url': '<%= issues_path %>/' + issue_id, | ||
| 'success': function() { | ||
| ui.item.removeClass('updating'); | ||
| } | ||
| }); | ||
| } | ||
| }); | ||
| } | ||
| }).disableSelection(); | ||
| }); | ||
| }).disableSelection(); | ||
| }); | ||
|
|
||
| }(jQuery)); | ||
| </script> | ||
| }(jQuery)); | ||
| </script> | ||
| <% end %> | ||
|
|
||
| <div id="issues-kanban-version-query" class="nav"> | ||
| <%= link_to "Issue List", {:controller => "issues", :action => "index", :project_id => @project } %> | ||
| <%= link_to "Issue List", {:controller => "issues", :action => "index", :project_id => @project} %> | ||
|
|
||
| <% if @versions && @versions.size > 0 %> | ||
| <span>Versions:</span> | ||
| <%= link_to "All", {:controller => "issues_kanban", :action => "index", :project_id => @project } %> | ||
| <% @versions.each do |version| %> | ||
| <%= link_to version.name, {:controller => "issues_kanban", :action => "index", :project_id => @project, :version => version } %> | ||
| <% end %> | ||
| <% end %> | ||
| <% if @versions && @versions.size > 0 %> | ||
| <span>Versions:</span> | ||
| <%= link_to "All", {:controller => "issues_kanban", :action => "index", :project_id => @project} %> | ||
| <% @versions.each do |version| %> | ||
| <%= link_to version.name, {:controller => "issues_kanban", :action => "index", :project_id => @project, :version => version} %> | ||
| <% end %> | ||
| <% end %> | ||
| </div> | ||
|
|
||
| <% form_tag({}) do -%> | ||
| <%= hidden_field_tag 'back_url', url_for(params) %> | ||
| <div id="issues-kanban"> | ||
| <% @statuses.each do |status| %> | ||
| <div class="<%= h status_classes(status) %>"> | ||
| <h2 class="title"><%=h status.name %> (<%= @status_estimated_hours[status.id] %> hr)</h2> | ||
| <% @statuses.each do |status| %> | ||
| <div class="<%= h status_classes(status) %>"> | ||
| <h2 class="title"><%= h status.name %> (<%= @status_estimated_hours[status.id] %> hr)</h2> | ||
|
|
||
| <% @assignees.each do |user| %> | ||
| <% if user_estimated_hours(user, status) > 0 %> | ||
| <div class="user-issues user-id-<%= user ? user.id : "" %>"> | ||
| <h3 class="title"><%= user_section_title(user, status) %></h3> | ||
| <% user_issues(user, status).each do |issue| %> | ||
| <div class="issue issue-<%=h issue.id %> issue-priority-<%= issue.priority.position %> issue-tracker-<%= slugalize(issue.tracker.name) %>"> | ||
| <div class="issue-id"><%= link_to issue.id, { :controller => 'issues', :action => 'show', :id => issue.id } %></div> | ||
| <% if issue.estimated_hours %> | ||
| <div class="estimate time"><%= h hour_format(issue.estimated_hours).to_s.sub(/\.0$/, '') %></div> | ||
| <% end %> | ||
| <p><%= h issue.subject %></p> | ||
| </div> | ||
| <% ordered_assignees = [] %> | ||
| <% @assignees.each do |user| %> | ||
| <% ordered_assignees << {:assignee => user, :issues => user_issues(user, status)} %> | ||
| <% end %> | ||
| </div> | ||
| <% end %> | ||
| <% end %> | ||
| <% ordered_assignees.sort! { |a, b| b[:issues].length <=> a[:issues].length } %> | ||
|
|
||
| <% ordered_assignees.each do |hash| %> | ||
| <% user = hash[:assignee] %> | ||
| <% issues = hash[:issues] %> | ||
| <div class="user-issues user-id-<%= user ? user.id : "" %>"> | ||
| <h3 class="title"><%= user_section_title(user, status) %></h3> | ||
| <% issues.each do |issue| %> | ||
| <table class="kanban_issue_table"> | ||
| <tr id="issue-<%= h issue.id %>" class="hascontextmenu"> | ||
| <td> | ||
| <%= check_box_tag("ids[]", issue.id, false, :id => nil, :style => "display:none;") %> | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added a pre-fetch and reordering of each lane, based on the amount of issues assigned for a specific user. |
||
| <div class="issue issue-<%= h issue.id %> issue-priority-<%= issue.priority.position %> issue-tracker-<%= slugalize(issue.tracker.name) %>"> | ||
| <div class="issue-id"><%= link_to issue.id, {:controller => 'issues', :action => 'show', :id => issue.id} %></div> | ||
| <% if issue.estimated_hours %> | ||
| <div class="estimate time"><%= h hour_format(issue.estimated_hours).to_s.sub(/\.0$/, '') %></div> | ||
| <% end %> | ||
| <p><%= h issue.subject %></p> | ||
| </div> | ||
| </td> | ||
| </tr> | ||
| </table> | ||
| <% end %> | ||
| </div> | ||
| <% end %> | ||
| </div> | ||
| <% end %> | ||
| </div> | ||
| <% end %> | ||
| </div> | ||
| <%= context_menu issues_context_menu_path %> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,2 @@ | ||
| ActionController::Routing::Routes.draw do |map| | ||
| map.connect 'projects/:project_id/issues_kanban', :controller => 'issues_kanban', :action => 'index' | ||
| map.connect 'issues_kanban', :controller => 'issues_kanban', :action => 'index' | ||
| end | ||
| get 'projects/:project_id/issues_kanban', :to => 'issues_kanban#index' | ||
| get 'issues_kanban', :to => 'issues_kanban#index' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed the sortable divs.