Added sortable headers + search + reportable Notes
[rails.git] / app / views / issues / index.html.erb
1 <p id= "notice"><%= notice %></p>
2
3 <% content_for :heading do %>
4         <h1>List of <%= @user_role %> issues:</h1>
5 <% end %>
6
7 <%= form_tag(issues_path, :method => :get) do %>
8         Search for a particular issue(s):  
9         <%= select :status, nil, [['open', 0],['resolved',2],['ignored',1]],{:include_blank => "Select status"},data: { behavior: 'category_dropdown' } %>
10         <%= select :issue_type, nil, @issue_types,{:include_blank => "Select type"},data: { behavior: 'category_dropdown' } %>
11         <%= text_field_tag :search_by_user, params[:search_by_user], placeholder: "Reported User" %>
12         <%= submit_tag "Search" %>
13 <% end %>
14 <br/>
15 <br/>
16
17 <table>
18         <thead>
19                 <tr>
20                         <tr>
21                                 <td><b> <%= sortable("status") %></b></td>
22                                 <td><b> <%= sortable("report_count", "Number of Reports") %></b></td>
23                                 <td><b> <%= sortable("updated_at","Last updated at") %></b></td>
24                                 <td><b> <%= sortable("updated_by","Last updated by") %></b></td>
25                                 <td><b> Link to reports </b></td>
26                                 <td><b> <%= sortable("reported_user_id","Reported User") %> </b></td>
27                                 <td><b> Link to reported instance</b></td>
28                         </tr>
29                 </tr>
30         </thead>
31         <tbody>
32                 <% @issues.each do |issue| %>
33                         <tr>
34                                 <td><span class="count-number"> <strong><%= issue.status %></strong></span> </td>
35                                 <td><%= issue.report_count %></td>
36                                 <td><%= issue.updated_at.strftime('%H:%M %m/%d/%y') %></td>
37                                 <td><% if issue.user_updated %> <%= issue.user_updated.display_name %> <% else %> - <% end %></td>
38                                 <td> <%= reports_url(issue) %></td>
39                                 <td><%= link_to issue.user.display_name , :controller => :user, :action => :view,:display_name => issue.user.display_name %></td>
40                                 <td><%= instance_url(issue.reportable) %></td>
41                         </tr>
42                 <% end %>
43         </tbody>
44 </table>
45
46