Skip to content

Commit

Permalink
Use pluralize instead of custom code
Browse files Browse the repository at this point in the history
  • Loading branch information
vpereira committed Sep 14, 2018
1 parent f046371 commit 27086b3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/api/app/views/webui/package/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<li>
<%= sprite_tag 'exclamation', title: '' %>
<%= @failures %>
<%= link_to "error#{@failures == 1 ? '' : 's'}", :action => :monitor, :project => @project, :succeeded => 0, :blocked => 0, :finished => 0, :signing => 0, :dispatching => 0, :scheduled => 0, :building => 0, :controller => :project, :pkgname => @package.name %>
<%= link_to pluralize(@failures.count,'error'), :action => :monitor, :project => @project, :succeeded => 0, :blocked => 0, :finished => 0, :signing => 0, :dispatching => 0, :scheduled => 0, :building => 0, :controller => :project, :pkgname => @package.name %>
</li>
<% end %>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
%li
%i.fas.fa-times-circle.text-danger{ title: 'Errors' }
= failures
= link_to "error#{failures == 1 ? '' : 's'}", project_monitor_path(project: project, pkgname: package_name, succeeded: 0,
= link_to pluralize(errors.count, 'error'), project_monitor_path(project: project, pkgname: package_name, succeeded: 0,
blocked: 0, finished: 0, signing: 0, dispatching: 0,
scheduled: 0, building: 0)

0 comments on commit 27086b3

Please sign in to comment.