Skip to content

Commit

Permalink
1032 request page status design (#1046)
Browse files Browse the repository at this point in the history
* requests views adapted to use a partial to show status tags

* partial to show status with stylized tags
  • Loading branch information
jeduardo824 authored and armahillo committed Jun 9, 2019
1 parent e54181d commit dda6743
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
4 changes: 3 additions & 1 deletion app/views/requests/_request_row.html.erb
@@ -1,7 +1,9 @@
<tr>
<td><%= request_row.created_at.strftime("%m/%d/%Y") %></td>
<td><%= request_row.partner.name %> </td>
<td><%= request_row.status.try(:humanize) %></td>
<td>
<%= render partial: "status", locals: {status: request_row.status} %>
</td>
<td class="text-right">
<%= view_button_to request_path(request_row) %>
<%= delete_button_to request_path(request_row), { confirm: "Are you sure? This will cancel the request and send a friendly email notification to your partner that their request has been cancelled" } %>
Expand Down
10 changes: 10 additions & 0 deletions app/views/requests/_status.html.erb
@@ -0,0 +1,10 @@
<% case status %>
<% when "pending" %>
<span class="label label-default">Pending</span>
<% when "started" %>
<span class="label label-primary">Started</span>
<% when "fulfilled" %>
<span class="label label-success">Fulfilled</span>
<% else %>
<span class="label label-warning">Errored</span>
<% end %>
2 changes: 1 addition & 1 deletion app/views/requests/show.html.erb
Expand Up @@ -21,7 +21,7 @@
<p>This request was sent on <%= @request.created_at.to_s(:distribution_date) %>:</p>
<ul class="list-group">
<li class="list-group-item">It was sent by: <%= @request.partner.name %></li>
<li class="list-group-item">It has a status of: <%= @request.status %></li>
<li class="list-group-item">It has a status of: <%= render partial: "status", locals: {status: @request.status} %></li>
<li class="list-group-item">Comments: <%= @request.comments || 'None' %></li>
</ul>

Expand Down

0 comments on commit dda6743

Please sign in to comment.