]> git.openstreetmap.org Git - rails.git/blob - app/views/issues/index.html.erb
44f4e0cac9026bd175b75ad6dca40f12b5d30f52
[rails.git] / app / views / issues / index.html.erb
1 <% content_for :heading do %>
2   <h1><%= t ".title" %></h1>
3 <% end %>
4
5 <p><%= t ".search_guidance" %></p>
6
7 <%= form_tag(issues_path, :method => :get) do %>
8   <div class="form-row">
9     <div class="form-group col-md-auto">
10       <%= select_tag :status,
11                      options_for_select(Issue.aasm.states.map(&:name).map { |state| [t(".states.#{state}"), state] }, params[:status]),
12                      :include_blank => t(".select_status"),
13                      :data => { :behavior => "category_dropdown" },
14                      :class => "form-control custom-select" %>
15     </div>
16     <div class="form-group col-md-auto">
17       <%= select_tag :issue_type,
18                      options_for_select(@issue_types, params[:issue_type]),
19                      :include_blank => t(".select_type"),
20                      :data => { :behavior => "category_dropdown" },
21                      :class => "form-control custom-select" %>
22     </div>
23     <div class="form-group col-md">
24       <%= text_field_tag :search_by_user,
25                          params[:search_by_user],
26                          :placeholder => t(".reported_user"),
27                          :class => "form-control" %>
28     </div>
29     <div class="form-group col-md-auto">
30       <%= select_tag :last_updated_by,
31                      options_for_select(@users.all.collect { |f| [f.display_name, f.id] } << [t(".not_updated"), "nil"], params[:last_updated_by]),
32                      :include_blank => t(".select_last_updated_by"),
33                      :data => { :behavior => "category_dropdown" },
34                      :class => "form-control custom-select" %>
35     </div>
36     <div class="form-group col-md-auto">
37       <%= submit_tag t(".search"), :name => nil, :class => "btn btn-primary" %>
38     </div>
39   </div>
40 <% end %>
41 <br />
42
43 <% if @issues.length == 0 %>
44   <p><%= t ".issues_not_found" %></p>
45 <% end %>
46
47 <br />
48
49 <table class="table table-sm">
50   <thead>
51     <tr>
52       <th><%= t ".status" %></th>
53       <th><%= t ".reports" %></th>
54       <th><%= t ".reported_item" %></th>
55       <th><%= t ".reported_user" %></th>
56       <th><%= t ".last_updated" %></th>
57     </tr>
58   </thead>
59   <tbody>
60     <% @issues.each do |issue| %>
61       <tr>
62         <td><%= t ".states.#{issue.status}" %></td>
63         <td class="text-nowrap"><%= link_to t(".reports_count", :count => issue.reports_count), issue %></td>
64         <td><%= link_to reportable_title(issue.reportable), reportable_url(issue.reportable) %></td>
65         <td><%= link_to issue.reported_user.display_name, user_path(issue.reported_user) if issue.reported_user %></td>
66         <td>
67           <% if issue.user_updated %>
68             <%= t ".last_updated_time_user_html", :user => link_to(issue.user_updated.display_name, user_path(issue.user_updated)),
69                                                   :time => time_ago_in_words(issue.updated_at, :scope => :'datetime.distance_in_words_ago'),
70                                                   :title => l(issue.updated_at) %>
71           <% else %>
72             <%= t ".last_updated_time_html", :time => time_ago_in_words(issue.updated_at, :scope => :'datetime.distance_in_words_ago'),
73                                              :title => l(issue.updated_at) %>
74           <% end %>
75         </td>
76       </tr>
77     <% end %>
78   </tbody>
79 </table>