2 if has_role?(:user, @project)
3 action_plans = Internal.issues.findActionPlanStats(@resource.key)
4 open_action_plans = action_plans.select {|plan| plan.isOpen()}
6 div_id = "issues-action-plan-widget-#{widget.id.to_s}"
9 <div class="line-block">
10 <% if has_role?(:admin, @project) %>
11 <div style="float:right">
12 <a href="<%= url_for :controller => 'issues_action_plans', :action => 'index', :id => @project.id -%>">
13 <%= message('widgets.more') -%>
18 <h3><%= message('widget.issues_action_plans.title') -%></h3>
22 <div id="<%= div_id -%>">
24 <% if open_action_plans.size ==0 %>
26 <span class="empty_widget"><%= message('widget.issues_action_plans.no_action_plan') -%></span>
30 show_resolved_issues = widget_properties["showResolvedIssues"]
31 if show_resolved_issues
35 max_unresolved_issues = open_action_plans.map {|plan| plan.unresolvedIssues()}.max
39 <table class="width100 <%= show_resolved_issues ? 'actionPlans' : 'data' -%>">
42 <th colspan="<%= show_resolved_issues ? '3' : '4' %>"></th>
47 open_action_plans.each do |plan|
49 <tr class="<%= show_resolved_issues ? '' : cycle("even", "odd", :name => "action_plan_" + widget.id.to_s) -%>">
50 <td class="nowrap <%= line_class -%>"><%= h(plan.name) -%></td>
51 <td class="nowrap small <%= line_class -%> <%= 'over-due' if plan.overDue() -%>" style="text-align: right; padding-left:10px"><%= format_date(plan.deadLine()) -%></td>
53 <% if show_resolved_issues %>
54 <% if plan.totalIssues()==0 %>
55 <td class="noprogress nowrap <%= line_class -%>"><%= message('action_plans.no_issues_linked_to_action_plan') -%></td>
57 <td class="progress <%= line_class -%>">
58 <%= render :partial => 'issues_action_plans/progress', :locals => {:action_plan => plan} -%>
63 unresolved_issues_size = plan.unresolvedIssues()
65 <td class="right <%= line_class -%>" style="padding-left:20px">
66 <% if unresolved_issues_size == 0 %>
67 <%= unresolved_issues_size -%>
69 <a href="<%= url_for({:controller => 'issues', :action => 'search',
70 :actionPlans => plan.key, :resolved => 'false'}) -%>"
71 title="<%= message('widget.issues_action_plans.x_unresolved_issues', :params => unresolved_issues_size.to_s) -%>"><%= unresolved_issues_size -%></a>
74 <td class="<%= line_class -%>" style="padding: 0 40px 0 10px; width: 300px;">
75 <div class="barchart" style="width: 100%">
76 <div style="width: <%= max_unresolved_issues > 0 ? 100 * unresolved_issues_size / max_unresolved_issues : 0 -%>%;background-color:#777;"></div>