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