Merge branch 'ipn' of github.com:zyphlar/Open-Source-Access-Control-Web-Interface into ipn
This commit is contained in:
commit
ca7808a525
|
@ -90,17 +90,18 @@ class User < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
def member_status
|
def member_status
|
||||||
member_status_calculation[:rank]
|
results = member_status_calculation
|
||||||
|
return results[:rank]
|
||||||
end
|
end
|
||||||
|
|
||||||
def member_status_symbol
|
def member_status_symbol
|
||||||
results = member_status_calculation
|
results = member_status_calculation
|
||||||
return "<img src='#{results[:icon]}#{results[:flair]}-coin.png' title='#{results[:message]}' />"
|
return "<img src='/#{results[:icon]}#{results[:flair]}-coin.png' title='#{results[:message]}' />"
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def member_status_calcuation
|
def member_status_calculation
|
||||||
# Begin output buffer
|
# Begin output buffer
|
||||||
message = ""
|
message = ""
|
||||||
icon = ""
|
icon = ""
|
||||||
|
@ -122,7 +123,7 @@ class User < ActiveRecord::Base
|
||||||
when 10..24
|
when 10..24
|
||||||
message = "Volunteer"
|
message = "Volunteer"
|
||||||
icon = :heart
|
icon = :heart
|
||||||
rank = 100
|
rank = 101
|
||||||
when 25..49
|
when 25..49
|
||||||
message = member_level_string
|
message = member_level_string
|
||||||
icon = :copper
|
icon = :copper
|
||||||
|
@ -146,7 +147,7 @@ class User < ActiveRecord::Base
|
||||||
if self.payments.last.date > (DateTime.now - 45.days)
|
if self.payments.last.date > (DateTime.now - 45.days)
|
||||||
flair = "-paid"
|
flair = "-paid"
|
||||||
else
|
else
|
||||||
message = "Last Payment (#{(DateTime.now - self.payments.last.date).to_i} days ago)"
|
message = "Last Payment #{(DateTime.now - self.payments.last.date).to_i/30} months ago"
|
||||||
rank = rank/10
|
rank = rank/10
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
@ -155,7 +156,7 @@ class User < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
return [:message => message, :icon => icon, :flair => flair, :rank => rank]
|
return {:message => message, :icon => icon, :flair => flair, :rank => rank}
|
||||||
end
|
end
|
||||||
|
|
||||||
def send_new_user_email
|
def send_new_user_email
|
||||||
|
|
Loading…
Reference in New Issue
Block a user