vidpush/app/views/campaigns/index.html.erb

39 lines
1.4 KiB
Plaintext
Raw Normal View History

2014-04-25 01:32:32 +00:00
<div class="container">
<section>
2014-04-25 02:02:21 +00:00
<h1>Campaigns</h1>
<hr>
2014-04-25 01:32:32 +00:00
<table class="table table-striped">
<thead>
<tr>
<th>Listing Code (Form Hash)</th>
<th>Advertiser</th>
2014-04-29 17:03:46 +00:00
<th>Sent?</th>
<th>Percent of Videos Completed</th>
2014-04-25 01:32:32 +00:00
<th>Address</th>
<th>City</th>
<th>State</th>
<th>ZIP</th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
<% @campaigns.each do |campaign| %>
<tr>
<td><%= link_to campaign.listingcode, campaign_path(campaign.listingcode) %></td>
<td><%= campaign.advertisername %></td>
2014-04-29 17:03:46 +00:00
<td><i class="glyphicon glyphicon-<% if campaign.sent? %>ok<% else %>remove<% end %>"></i> </td>
<td><%= number_to_percentage(campaign.video_completion_percent, precision: 0) %></td>
2014-04-25 01:32:32 +00:00
<td><%= campaign.address %></td>
<td><%= campaign.city %></td>
<td><%= campaign.state %></td>
<td><%= campaign.zip %></td>
2014-04-29 17:03:46 +00:00
<td><%= link_to 'Edit', edit_campaign_path(campaign.listingcode) unless campaign.sent %></td>
2014-04-25 01:32:32 +00:00
<td><%= link_to 'Destroy', campaign_path(campaign.listingcode), method: :delete, data: { confirm: 'Are you sure?' } %></td>
</tr>
<% end %>
</tbody>
</table>
2014-05-06 19:50:56 +00:00
<%= link_to 'New Campaign', new_campaign_path unless Rails.env.production? %>
2014-04-25 01:32:32 +00:00
</section>
</div>