Skip to content

Commit

Permalink
Added no payments found
Browse files Browse the repository at this point in the history
  • Loading branch information
chrismatthieu committed Aug 6, 2012
1 parent d928e9f commit a0ea51a
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 25 deletions.
2 changes: 1 addition & 1 deletion app/views/payments/_form.html.erb
Expand Up @@ -33,7 +33,7 @@
<%= f.text_area :paypalcode, :class=>"input-xxlarge", :placeholder=>"PayPal-supplied code" %>
</div>
<div class="field">
<%= f.label :promoactive %>
<%= f.label :promoactive %>
<%= f.check_box :promoactive %>
</div>
<div><br />
Expand Down
54 changes: 30 additions & 24 deletions app/views/payments/index.html.erb
Expand Up @@ -15,34 +15,40 @@
</p>

<p>

<% if @payments %>
<% @payments.each do |payment| %>
<% if payment.promoactive or (@current_user && @current_user.admin) %>
<div class="row-fluid">
<div class="span8">
<h2>
<%= payment.title %>
<% if !payment.promoactive %>
<span style="color:red;">NOT ACTIVE</span>
<% end %>
</h2>
<p><%= payment.description %></p>
<p>
<% if @current_user && @current_user.admin %>
<%= link_to 'Show', payment %>
<%= link_to 'Edit', edit_payment_path(payment) %>
<%= link_to 'Destroy', payment, method: :delete, data: { confirm: 'Are you sure?' } %>
<% end %>
</p>
<% @payments.each do |payment| %>
<% if payment.promoactive or (@current_user && @current_user.admin) %>
<div class="row-fluid">
<div class="span8">
<h2>
<%= payment.title %>
<% if !payment.promoactive %>
<span style="color:red;">NOT ACTIVE</span>
<% end %>
</h2>
<p><%= payment.description %></p>
<p>
<% if @current_user && @current_user.admin %>
<%= link_to 'Show', payment %>
<%= link_to 'Edit', edit_payment_path(payment) %>
<%= link_to 'Destroy', payment, method: :delete, data: { confirm: 'Are you sure?' } %>
<% end %>
</p>
</div>

<div class="span4">
<p><%= raw(payment.paypalcode) %></p>
</div>
</div>
<% end %>
<div class="span4">
<p><%= raw(payment.paypalcode) %></p>
</div>
</div>
<% end %>
<% end %>
<% else %>
No active promotions available...<br /><br />
<% end %>

<br />
Expand Down

0 comments on commit a0ea51a

Please sign in to comment.