Skip to content

Commit

Permalink
[webui] Pluralize open requests
Browse files Browse the repository at this point in the history
  • Loading branch information
bgeuken committed Jan 25, 2016
1 parent 33aa5da commit 39f1a57
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/api/app/views/webui/project/_incident_table_entries.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@
</td>
<td rowspan="<%= release_targets_ng.length %>" class="nowrap">
<% rqs_in = BsRequest.list_ids(roles: %w(target), states: %w(new review), project: incident.name) %>
<% if rqs_in && rqs_in.length > 0 %>
<% text = "#{rqs_in.length} open request#{rqs_in.length == 1 ? '' : 's'}" %>
<% if rqs_in.length == 1 %>
<%= link_to(sprite_tag('exclamation', title: text), request_show_path(id: rqs_in[0])) %>
<% if rqs_in.count > 0 %>
<% if rqs_in.count == 1 %>
<% path = request_show_path(id: rqs_in.first) %>
<% else %>
<%= link_to(sprite_tag('exclamation', title: text), project_requests_path(project: incident.name)) %>
<% path = project_requests_path(project: incident.name) %>
<% end %>
<%= link_to(sprite_tag('exclamation', title: pluralize(rqs_in.count, "open request")), path) %>
<% end %>
<% rqs_out = BsRequest.list_ids(roles: %w(source), states: %w(new review declined),
types: %w(maintenance_release), project: incident.name) %>
Expand Down

0 comments on commit 39f1a57

Please sign in to comment.