3 options['resolved'] = 'false'
4 options['componentRoots'] = @project.key
5 if @dashboard_configuration.selected_period?
6 options['createdAfter'] = Api::Utils.format_datetime(@dashboard_configuration.from_datetime)
7 options['createdBefore'] = Api::Utils.format_datetime(DateTime.now)
9 results = Internal.issues.findIssueAssignees(options)
10 assignees = results.results
12 unless assignees.empty?
13 issues_by_assignee = {}
14 counter_no_assignee = 0
15 assignees.each do |assignee|
17 counter = issues_by_assignee[assignee]
19 issues_by_assignee[assignee] = counter+1
21 issues_by_assignee[assignee] = 1
24 counter_no_assignee += 1
28 counter_max = issues_by_assignee.values.max unless issues_by_assignee.empty?
29 counter_max = counter_no_assignee if counter_no_assignee > counter_max
31 div_id = "unresolved-issues-per-assignee-widget-#{widget.id.to_s}"
35 <h3><%= message('widget.reviews_per_developer.name') -%></h3>
37 <% if assignees.size ==0 %>
38 <span class="empty_widget"><%= message('widget.reviews_per_developer.name') -%></span>
41 <div id="<%= div_id -%>">
43 <table class="data width100">
52 issues_by_assignee.sort{|h1,h2| h2[1] <=> h1[1]}.each do |assignee, count|
54 <tr class="<%= cycle 'even', 'odd', :name => (div_id) -%>">
55 <td class="max-width">
56 <%= link_to results.user(assignee).name,
57 {:controller => 'issues', :action => 'search', :assignees => assignee}.merge(options) -%>
60 <%= '+' if @dashboard_configuration.selected_period? -%><%= count.to_s -%>
62 <% if counter_max > 0 %>
64 <%= barchart(:width => 100, :percent => (100 * count / counter_max).to_i) %>
70 # And now show the unassigned issues counter
71 unless counter_no_assignee==0
73 <tr class="<%= cycle 'even', 'odd', :name => (div_id) -%>">
74 <td class="max-width">
75 <%= link_to message('widget.reviews_per_developer.not_assigned'),
76 {:controller => 'issues', :action => 'search', :assigned => 'false'}.merge(options) -%>
79 <%= '+' if @dashboard_configuration.selected_period? -%><%= counter_no_assignee.to_s -%>
81 <% if counter_max > 0 %>
83 <%= barchart(:width => 100, :percent => (100 * counter_no_assignee / counter_max).to_i) %>