Updating payment and front page status alerts to work properly

This commit is contained in:
Will Bradley 2013-10-10 20:58:19 -07:00
parent 008ceaed9e
commit 0d1894d6e8
3 changed files with 5 additions and 2 deletions

View File

@ -13,6 +13,7 @@ class Ability
can :read_details, Mac can :read_details, Mac
can [:update], Mac, :user_id => nil can [:update], Mac, :user_id => nil
can [:create,:update], Mac, :user_id => user.id can [:create,:update], Mac, :user_id => user.id
can :read, Payment, :user_id => user.id
can [:read,:new_member_report], User, :id => user.id #TODO: why can users update themselves? Maybe because Devise doesn't check users/edit? can [:read,:new_member_report], User, :id => user.id #TODO: why can users update themselves? Maybe because Devise doesn't check users/edit?
can :read, UserCertification, :user_id => user.id can :read, UserCertification, :user_id => user.id

View File

@ -5,7 +5,7 @@
<div class="payment_links <%= "payment-highlighted" if params[:flash] == "welcome_msg" %>"> <div class="payment_links <%= "payment-highlighted" if params[:flash] == "welcome_msg" %>">
<%= render '/statistics/index' %> <%= render '/statistics/index' %>
<% if can? :read, resource.payments then %> <% if can? :read, resource.payments.first then %>
<h3>Recorded Payments:</h3> <h3>Recorded Payments:</h3>
<ul> <ul>
<% resource.payments.sort_by(&:date).reverse!.each do |payment| %> <% resource.payments.sort_by(&:date).reverse!.each do |payment| %>

View File

@ -7,7 +7,9 @@
<% if user_signed_in? && current_user.orientation.blank? then %> <% if user_signed_in? && current_user.orientation.blank? then %>
<p class="alert">There's a lot more to see here, but our records show you haven't completed the new member orientation yet. If that's incorrect, please contact a volunteer.</p> <p class="alert">There's a lot more to see here, but our records show you haven't completed the new member orientation yet. If that's incorrect, please contact a volunteer.</p>
<% end %> <% end %>
<% if user_signed_in? && current_user.member.to_i < current_user.member_level.to_i then %> <% if user_signed_in? && current_user.member_status.between?(2,100) then %>
<%= current_user.member.inspect %>
<%= current_user.member_level.inspect %>
<p class="alert">Looks like we haven't acknowledged a recent payment for you yet. This could be because we're slow, or this app just got started, but if in doubt please see your profile for payment instructions, or consider updating your membership level to something accurate.<br/>Thanks for supporting HeatSync!</p> <p class="alert">Looks like we haven't acknowledged a recent payment for you yet. This could be because we're slow, or this app just got started, but if in doubt please see your profile for payment instructions, or consider updating your membership level to something accurate.<br/>Thanks for supporting HeatSync!</p>
<% end %> <% end %>
<table> <table>