2014-05-09 14:53:28 +00:00
|
|
|
<h1>Campaigns</h1>
|
|
|
|
<hr>
|
|
|
|
<table class="table table-striped">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th>Listing Code (Form Hash)</th>
|
|
|
|
<th>Advertiser</th>
|
|
|
|
<th>Sent?</th>
|
|
|
|
<th>Percent of Videos Completed</th>
|
|
|
|
<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>
|
|
|
|
<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>
|
|
|
|
<td><%= campaign.address %></td>
|
|
|
|
<td><%= campaign.city %></td>
|
|
|
|
<td><%= campaign.state %></td>
|
|
|
|
<td><%= campaign.zip %></td>
|
|
|
|
<td><%= link_to 'Edit', edit_campaign_path(campaign.listingcode) unless campaign.sent %></td>
|
2014-05-14 18:01:19 +00:00
|
|
|
<td><%= link_to 'Destroy', campaign_path(campaign.listingcode), method: :delete, data: { confirm: 'Are you sure?' } if admin_signed_in? %></td>
|
2014-05-09 14:53:28 +00:00
|
|
|
</tr>
|
|
|
|
<% end %>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
<%= link_to 'New Campaign', new_campaign_path unless Rails.env.production? %>
|