@@ -1,72 +1,74 | |||||
1 | <div class="contextual"> |
|
1 | <div class="contextual"> | |
2 | <%= link_to l(:button_log_time), |
|
2 | <%= link_to l(:button_log_time), | |
3 | _new_time_entry_path(@project, @issue), |
|
3 | _new_time_entry_path(@project, @issue), | |
4 | :class => 'icon icon-time-add' if User.current.allowed_to?(:log_time, @project, :global => true) %> |
|
4 | :class => 'icon icon-time-add' if User.current.allowed_to?(:log_time, @project, :global => true) %> | |
5 | </div> |
|
5 | </div> | |
6 |
|
6 | |||
7 | <h2><%= @query.new_record? ? l(:label_spent_time) : @query.name %></h2> |
|
7 | <h2><%= @query.new_record? ? l(:label_spent_time) : @query.name %></h2> | |
8 |
|
8 | |||
9 | <%= form_tag(_report_time_entries_path(@project, nil), :method => :get, :id => 'query_form') do %> |
|
9 | <%= form_tag(_report_time_entries_path(@project, nil), :method => :get, :id => 'query_form') do %> | |
10 | <% @report.criteria.each do |criterion| %> |
|
10 | <% @report.criteria.each do |criterion| %> | |
11 | <%= hidden_field_tag 'criteria[]', criterion, :id => nil %> |
|
11 | <%= hidden_field_tag 'criteria[]', criterion, :id => nil %> | |
12 | <% end %> |
|
12 | <% end %> | |
13 | <%= render :partial => 'timelog/date_range' %> |
|
13 | <%= render :partial => 'timelog/date_range' %> | |
14 |
|
14 | |||
15 | <p><label for='columns'><%= l(:label_details) %></label>: <%= select_tag 'columns', options_for_select([[l(:label_year), 'year'], |
|
15 | <p><label for='columns'><%= l(:label_details) %></label>: <%= select_tag 'columns', options_for_select([[l(:label_year), 'year'], | |
16 | [l(:label_month), 'month'], |
|
16 | [l(:label_month), 'month'], | |
17 | [l(:label_week), 'week'], |
|
17 | [l(:label_week), 'week'], | |
18 | [l(:label_day_plural).titleize, 'day']], @report.columns), |
|
18 | [l(:label_day_plural).titleize, 'day']], @report.columns), | |
19 | :onchange => "this.form.submit();" %> |
|
19 | :onchange => "this.form.submit();" %> | |
20 |
|
20 | |||
21 | <label for='criterias'><%= l(:button_add) %></label>: <%= select_tag('criteria[]', options_for_select([[]] + (@report.available_criteria.keys - @report.criteria).collect{|k| [l_or_humanize(@report.available_criteria[k][:label]), k]}), |
|
21 | <label for='criterias'><%= l(:button_add) %></label>: <%= select_tag('criteria[]', options_for_select([[]] + (@report.available_criteria.keys - @report.criteria).collect{|k| [l_or_humanize(@report.available_criteria[k][:label]), k]}), | |
22 | :onchange => "this.form.submit();", |
|
22 | :onchange => "this.form.submit();", | |
23 | :style => 'width: 200px', |
|
23 | :style => 'width: 200px', | |
24 | :disabled => (@report.criteria.length >= 3), |
|
24 | :disabled => (@report.criteria.length >= 3), | |
25 | :id => "criterias") %> |
|
25 | :id => "criterias") %> | |
26 | <%= link_to l(:button_clear), {:project_id => @project, :issue_id => @issue, :period_type => params[:period_type], :period => params[:period], :from => @from, :to => @to, :columns => @report.columns}, :class => 'icon icon-reload' %></p> |
|
26 | <%= link_to l(:button_clear), {:project_id => @project, :issue_id => @issue, :period_type => params[:period_type], :period => params[:period], :from => @from, :to => @to, :columns => @report.columns}, :class => 'icon icon-reload' %></p> | |
27 | <% end %> |
|
27 | <% end %> | |
28 |
|
28 | |||
29 | <% unless @report.criteria.empty? %> |
|
29 | <% unless @report.criteria.empty? %> | |
30 |
<% |
|
30 | <% if @report.hours.empty? %> | |
|
31 | <p class="nodata"><%= l(:label_no_data) %></p> | |||
|
32 | <% else %> | |||
31 | <div class="autoscroll"> |
|
33 | <div class="autoscroll"> | |
32 | <table class="list" id="time-report"> |
|
34 | <table class="list" id="time-report"> | |
33 | <thead> |
|
35 | <thead> | |
34 | <tr> |
|
36 | <tr> | |
35 | <% @report.criteria.each do |criteria| %> |
|
37 | <% @report.criteria.each do |criteria| %> | |
36 | <th><%= l_or_humanize(@report.available_criteria[criteria][:label]) %></th> |
|
38 | <th><%= l_or_humanize(@report.available_criteria[criteria][:label]) %></th> | |
37 | <% end %> |
|
39 | <% end %> | |
38 | <% columns_width = (40 / (@report.periods.length+1)).to_i %> |
|
40 | <% columns_width = (40 / (@report.periods.length+1)).to_i %> | |
39 | <% @report.periods.each do |period| %> |
|
41 | <% @report.periods.each do |period| %> | |
40 | <th class="period" style="width:<%= columns_width %>%;"><%= period %></th> |
|
42 | <th class="period" style="width:<%= columns_width %>%;"><%= period %></th> | |
41 | <% end %> |
|
43 | <% end %> | |
42 | <th class="total" style="width:<%= columns_width %>%;"><%= l(:label_total_time) %></th> |
|
44 | <th class="total" style="width:<%= columns_width %>%;"><%= l(:label_total_time) %></th> | |
43 | </tr> |
|
45 | </tr> | |
44 | </thead> |
|
46 | </thead> | |
45 | <tbody> |
|
47 | <tbody> | |
46 | <%= render :partial => 'report_criteria', :locals => {:criterias => @report.criteria, :hours => @report.hours, :level => 0} %> |
|
48 | <%= render :partial => 'report_criteria', :locals => {:criterias => @report.criteria, :hours => @report.hours, :level => 0} %> | |
47 | <tr class="total"> |
|
49 | <tr class="total"> | |
48 | <td><%= l(:label_total_time) %></td> |
|
50 | <td><%= l(:label_total_time) %></td> | |
49 | <%= ('<td></td>' * (@report.criteria.size - 1)).html_safe %> |
|
51 | <%= ('<td></td>' * (@report.criteria.size - 1)).html_safe %> | |
50 | <% total = 0 -%> |
|
52 | <% total = 0 -%> | |
51 | <% @report.periods.each do |period| -%> |
|
53 | <% @report.periods.each do |period| -%> | |
52 | <% sum = sum_hours(select_hours(@report.hours, @report.columns, period.to_s)); total += sum -%> |
|
54 | <% sum = sum_hours(select_hours(@report.hours, @report.columns, period.to_s)); total += sum -%> | |
53 | <td class="hours"><%= html_hours("%.2f" % sum) if sum > 0 %></td> |
|
55 | <td class="hours"><%= html_hours("%.2f" % sum) if sum > 0 %></td> | |
54 | <% end -%> |
|
56 | <% end -%> | |
55 | <td class="hours"><%= html_hours("%.2f" % total) if total > 0 %></td> |
|
57 | <td class="hours"><%= html_hours("%.2f" % total) if total > 0 %></td> | |
56 | </tr> |
|
58 | </tr> | |
57 | </tbody> |
|
59 | </tbody> | |
58 | </table> |
|
60 | </table> | |
59 | </div> |
|
61 | </div> | |
60 |
|
62 | |||
61 | <% other_formats_links do |f| %> |
|
63 | <% other_formats_links do |f| %> | |
62 | <%= f.link_to 'CSV', :url => params %> |
|
64 | <%= f.link_to 'CSV', :url => params %> | |
63 | <% end %> |
|
65 | <% end %> | |
64 | <% end %> |
|
66 | <% end %> | |
65 | <% end %> |
|
67 | <% end %> | |
66 |
|
68 | |||
67 | <% content_for :sidebar do %> |
|
69 | <% content_for :sidebar do %> | |
68 | <%= render_sidebar_queries(TimeEntryQuery, @project) %> |
|
70 | <%= render_sidebar_queries(TimeEntryQuery, @project) %> | |
69 | <% end %> |
|
71 | <% end %> | |
70 |
|
72 | |||
71 | <% html_title(@query.new_record? ? l(:label_spent_time) : @query.name, l(:label_report)) %> |
|
73 | <% html_title(@query.new_record? ? l(:label_spent_time) : @query.name, l(:label_report)) %> | |
72 |
|
74 |
@@ -1,58 +1,58 | |||||
1 | <div class="contextual"> |
|
1 | <div class="contextual"> | |
2 | <%= link_to l(:label_user_new), new_user_path, :class => 'icon icon-add' %> |
|
2 | <%= link_to l(:label_user_new), new_user_path, :class => 'icon icon-add' %> | |
3 | </div> |
|
3 | </div> | |
4 |
|
4 | |||
5 | <h2><%=l(:label_user_plural)%></h2> |
|
5 | <h2><%=l(:label_user_plural)%></h2> | |
6 |
|
6 | |||
7 | <%= form_tag(users_path, :method => :get) do %> |
|
7 | <%= form_tag(users_path, :method => :get) do %> | |
8 | <fieldset><legend><%= l(:label_filter_plural) %></legend> |
|
8 | <fieldset><legend><%= l(:label_filter_plural) %></legend> | |
9 | <label for='status'><%= l(:field_status) %>:</label> |
|
9 | <label for='status'><%= l(:field_status) %>:</label> | |
10 | <%= select_tag 'status', users_status_options_for_select(@status), :class => "small", :onchange => "this.form.submit(); return false;" %> |
|
10 | <%= select_tag 'status', users_status_options_for_select(@status), :class => "small", :onchange => "this.form.submit(); return false;" %> | |
11 |
|
11 | |||
12 | <% if @groups.present? %> |
|
12 | <% if @groups.present? %> | |
13 | <label for='group_id'><%= l(:label_group) %>:</label> |
|
13 | <label for='group_id'><%= l(:label_group) %>:</label> | |
14 | <%= select_tag 'group_id', content_tag('option') + options_from_collection_for_select(@groups, :id, :name, params[:group_id].to_i), :onchange => "this.form.submit(); return false;" %> |
|
14 | <%= select_tag 'group_id', content_tag('option') + options_from_collection_for_select(@groups, :id, :name, params[:group_id].to_i), :onchange => "this.form.submit(); return false;" %> | |
15 | <% end %> |
|
15 | <% end %> | |
16 |
|
16 | |||
17 | <label for='name'><%= l(:label_user) %>:</label> |
|
17 | <label for='name'><%= l(:label_user) %>:</label> | |
18 | <%= text_field_tag 'name', params[:name], :size => 30 %> |
|
18 | <%= text_field_tag 'name', params[:name], :size => 30 %> | |
19 | <%= submit_tag l(:button_apply), :class => "small", :name => nil %> |
|
19 | <%= submit_tag l(:button_apply), :class => "small", :name => nil %> | |
20 | <%= link_to l(:button_clear), users_path, :class => 'icon icon-reload' %> |
|
20 | <%= link_to l(:button_clear), users_path, :class => 'icon icon-reload' %> | |
21 | </fieldset> |
|
21 | </fieldset> | |
22 | <% end %> |
|
22 | <% end %> | |
23 | |
|
23 | | |
24 |
|
24 | |||
25 | <div class="autoscroll"> |
|
25 | <div class="autoscroll"> | |
26 | <table class="list"> |
|
26 | <table class="list users"> | |
27 | <thead><tr> |
|
27 | <thead><tr> | |
28 | <%= sort_header_tag('login', :caption => l(:field_login)) %> |
|
28 | <%= sort_header_tag('login', :caption => l(:field_login)) %> | |
29 | <%= sort_header_tag('firstname', :caption => l(:field_firstname)) %> |
|
29 | <%= sort_header_tag('firstname', :caption => l(:field_firstname)) %> | |
30 | <%= sort_header_tag('lastname', :caption => l(:field_lastname)) %> |
|
30 | <%= sort_header_tag('lastname', :caption => l(:field_lastname)) %> | |
31 | <th><%= l(:field_mail) %></th> |
|
31 | <th><%= l(:field_mail) %></th> | |
32 | <%= sort_header_tag('admin', :caption => l(:field_admin), :default_order => 'desc') %> |
|
32 | <%= sort_header_tag('admin', :caption => l(:field_admin), :default_order => 'desc') %> | |
33 | <%= sort_header_tag('created_on', :caption => l(:field_created_on), :default_order => 'desc') %> |
|
33 | <%= sort_header_tag('created_on', :caption => l(:field_created_on), :default_order => 'desc') %> | |
34 | <%= sort_header_tag('last_login_on', :caption => l(:field_last_login_on), :default_order => 'desc') %> |
|
34 | <%= sort_header_tag('last_login_on', :caption => l(:field_last_login_on), :default_order => 'desc') %> | |
35 | <th></th> |
|
35 | <th></th> | |
36 | </tr></thead> |
|
36 | </tr></thead> | |
37 | <tbody> |
|
37 | <tbody> | |
38 | <% for user in @users -%> |
|
38 | <% for user in @users -%> | |
39 | <tr class="<%= user.css_classes %> <%= cycle("odd", "even") %>"> |
|
39 | <tr class="<%= user.css_classes %> <%= cycle("odd", "even") %>"> | |
40 | <td class="username"><%= avatar(user, :size => "14") %><%= link_to user.login, edit_user_path(user) %></td> |
|
40 | <td class="username"><%= avatar(user, :size => "14") %><%= link_to user.login, edit_user_path(user) %></td> | |
41 | <td class="firstname"><%= user.firstname %></td> |
|
41 | <td class="firstname"><%= user.firstname %></td> | |
42 | <td class="lastname"><%= user.lastname %></td> |
|
42 | <td class="lastname"><%= user.lastname %></td> | |
43 | <td class="email"><%= mail_to(user.mail) %></td> |
|
43 | <td class="email"><%= mail_to(user.mail) %></td> | |
44 | <td class="tick"><%= checked_image user.admin? %></td> |
|
44 | <td class="tick"><%= checked_image user.admin? %></td> | |
45 | <td class="created_on"><%= format_time(user.created_on) %></td> |
|
45 | <td class="created_on"><%= format_time(user.created_on) %></td> | |
46 | <td class="last_login_on"><%= format_time(user.last_login_on) unless user.last_login_on.nil? %></td> |
|
46 | <td class="last_login_on"><%= format_time(user.last_login_on) unless user.last_login_on.nil? %></td> | |
47 | <td class="buttons"> |
|
47 | <td class="buttons"> | |
48 | <%= change_status_link(user) %> |
|
48 | <%= change_status_link(user) %> | |
49 | <%= delete_link user_path(user, :back_url => request.original_fullpath) unless User.current == user %> |
|
49 | <%= delete_link user_path(user, :back_url => request.original_fullpath) unless User.current == user %> | |
50 | </td> |
|
50 | </td> | |
51 | </tr> |
|
51 | </tr> | |
52 | <% end -%> |
|
52 | <% end -%> | |
53 | </tbody> |
|
53 | </tbody> | |
54 | </table> |
|
54 | </table> | |
55 | </div> |
|
55 | </div> | |
56 | <span class="pagination"><%= pagination_links_full @user_pages, @user_count %></span> |
|
56 | <span class="pagination"><%= pagination_links_full @user_pages, @user_count %></span> | |
57 |
|
57 | |||
58 | <% html_title(l(:label_user_plural)) -%> |
|
58 | <% html_title(l(:label_user_plural)) -%> |
General Comments 0
You need to be logged in to leave comments.
Login now