]> git.openstreetmap.org Git - rails.git/blob - app/views/issues/show.html.erb
Use a secondary-actions nav for issue actions
[rails.git] / app / views / issues / show.html.erb
1 <% content_for :heading do %>
2 <h1><%= t ".title", :status => @issue.status.humanize, :issue_id => @issue.id %></h1>
3 <p><%= @issue.reportable.model_name.human %> : <%= link_to reportable_title(@issue.reportable), reportable_url(@issue.reportable) %></p>
4 <p class="text-muted">
5   <small>
6     <%= @issue.assigned_role %>
7     | <%= t ".reports", :count => @issue.reports.count %>
8     | <%= t ".report_created_at", :datetime => l(@issue.created_at.to_datetime, :format => :friendly) %>
9     <%= " | #{t('.last_resolved_at', :datetime => l(@issue.resolved_at.to_datetime, :format => :friendly))}" if @issue.resolved_at? %>
10     <%= " | #{t('.last_updated_at', :datetime => l(@issue.updated_at.to_datetime, :format => :friendly), :displayname => @issue.user_updated.display_name)}" if @issue.user_updated %>
11   </small>
12 </p>
13 <nav class="secondary-actions">
14   <ul class="clearfix">
15     <% if @issue.may_resolve? %>
16       <li><%= link_to t(".resolve"), resolve_issue_url(@issue), :method => :post %></li>
17     <% end %>
18     <% if @issue.may_ignore? %>
19       <li><%= link_to t(".ignore"), ignore_issue_url(@issue), :method => :post %></li>
20     <% end %>
21     <% if @issue.may_reopen? %>
22       <li><%= link_to t(".reopen"), reopen_issue_url(@issue), :method => :post %></li>
23     <% end %>
24   </ul>
25 </nav>
26 <% end %>
27
28 <div class="row">
29   <div class="col-md-8">
30     <h3><%= t ".reports_of_this_issue" %></h3>
31
32     <% if @read_reports.present? %>
33     <div class="bg-light text-muted">
34       <h4><%= t ".read_reports" %></h4>
35       <%= render "reports", :reports => @read_reports %>
36     </div>
37     <% end %>
38
39     <% if @unread_reports.any? %>
40     <div>
41       <h4><%= t ".new_reports" %></h4>
42       <%= render "reports", :reports => @unread_reports %>
43     </div>
44     <% end %>
45   </div>
46
47   <% if @issue.reported_user %>
48     <div class="col-md-4">
49       <h3><%= t ".other_issues_against_this_user" %></h3>
50       <% if @related_issues.count > 1 %>
51         <ul>
52           <% @related_issues.each do |issue| %>
53             <% if issue.id != @issue.id %>
54               <li><%= link_to reportable_title(issue.reportable), issue %></li>
55             <% end %>
56           <% end %>
57         </ul>
58       <% else %>
59         <p><%= t ".no_other_issues" %></p>
60       <% end %>
61     </div>
62   <% end %>
63 </div>
64
65 <h3><%= t ".comments_on_this_issue" %></h3>
66 <%= render "comments", :comments => @comments %>