index.html.erb
3.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
<%= stylesheet_link_tag 'tasks' %>
<h1><%= _("%s's pending tasks") % profile.name %></h1>
<p>
<%
type_collection = [[nil, _('All')]] + @task_types
%>
<% if !@failed.blank? %>
<div id="errorExplanation">
<% @failed.each do |error, tasks_descriptions|%>
<h2> <%= error %></h2>
<p><%=_("This error happened with the following tasks: ")%></p>
<ul>
<% tasks_descriptions.each do |description| %>
<li> <%= description %> </li>
<% end %>
</ul>
<% end %>
</div>
<% end %>
<%= form_tag '#', :method => 'get' do %>
<%= field_set_tag _('Filter'), :class => 'filter_fields' do %>
<p>
<%= labelled_select(_('Type of task')+': ', :filter_type, :first, :last, @filter_type, type_collection, {:id => 'filter-type'}) %>
</p>
<p>
<%= labelled_text_field(_("Text filter")+': ', :filter_text, nil, {:id => 'filter-text',:value => @filter_text}) %>
</p>
<% if profile.organization? %>
<p>
<%= labelled_select(_('Assigned to')+': ', :filter_responsible, :id, :name, @filter_responsible, [OpenStruct.new(:name => _('All'), :id => nil), OpenStruct.new(:name => _('Unassigned'), :id => -1)] + @responsible_candidates, :class => 'filter_responsible') %>
</p>
<% end %>
<p>
<%= submit_button(:search, _('Search')) %>
</p>
<% end %>
<% end %>
<% if @tasks.empty? %>
<p>
<em><%= _('No pending tasks for %s') % profile.name %></em>
</p>
<% else %>
<%= form_tag :action => 'close' do%>
<% button_bar(:class => 'task-actions') do %>
<%# FiXME button(:edit, _('View my requests'), :action => 'list_requested') %>
<%# FIXME button('menu-mail', _('Send request'), :action => 'new') %>
<%= submit_button :save, _("Apply!") %>
<%= button(:edit, _('View processed tasks'), :action => 'processed') %>
<%= button(:back, _('Back to control panel'), :controller => 'profile_editor') %>
<% end unless @view_only %>
<ul class='task-list'>
<% unless @view_only %>
<p>
<%= labelled_select(_("Set all to: "), 'set-decisions', 'first', 'last', nil, [['',""],['accept',_("Accept")],['reject',_("Reject")],['skip',_("Skip")]], :id => "up-set-all-tasks-to") %>
</p>
<% end %>
<div class="task_boxes">
<%= render :partial => 'task', :collection => @tasks %>
</div>
<% unless @view_only %>
<p>
<%= labelled_select(_("Set all to: "), 'set-decisions', 'first', 'last', nil, [['',""],['accept',_("Accept")],['reject',_("Reject")],['skip',_("Skip")]], :id => "down-set-all-tasks-to") %>
</p>
<% end %>
</ul>
<%= pagination_links(@tasks)%>
<% button_bar(:class => 'task-actions') do %>
<%# FiXME button(:edit, _('View my requests'), :action => 'list_requested') %>
<%# FIXME button('menu-mail', _('Send request'), :action => 'new') %>
<%= submit_button :save, _("Apply!") %>
<%= button(:edit, _('View processed tasks'), :action => 'processed') %>
<%= button(:back, _('Back to control panel'), :controller => 'profile_editor') %>
<% end unless @view_only %>
<% end %>
<% end %>
</p>
<%= javascript_include_tag 'tasks' %>