time_entries_sort_criterias_list.diff

Jérôme BATAILLE, 2012-01-16 12:27

Download (1.54 KB)

View differences:

app/views/time_entry_reports/report.rhtml (révision 253)
15 15
    end
16 16
-%>
17 17
<%= render :partial => 'timelog/date_range' %>
18

  
18
<%
19
    criterias_options = (@available_criterias.keys - @criterias).collect{|k| [l_or_humanize(@available_criterias[k][:label]), k]}
20
    criterias_options.sort!{ |x, y| x[0] <=> y[0] }
21
    criterias_options = [[]] + criterias_options
22
-%>
19 23
  <p>
20 24
    <%= l(:label_details) %>: <%= select_tag 'periodicity', options_for_select([[l(:label_year), 'year'],
21 25
                                                                            [l(:label_month), 'month'],
......
23 27
                                                                            [l(:label_day_plural).titleize, 'day']], @periodicity),
24 28
                                                        :onchange => "this.form.onsubmit();" %>
25 29

  
26
    <%= l(:button_add) %>: <%= select_tag('criterias[]', options_for_select([[]] + (@available_criterias.keys - @criterias).collect{|k| [l_or_humanize(@available_criterias[k][:label]), k]}),
30
    <%= l(:button_add) %>: <%= select_tag('criterias[]', options_for_select(criterias_options),
27 31
                                                          :onchange => "this.form.submit();",
28 32
                                                          :style => 'width: 200px',
29 33
                                                          :id => nil,