<% @content_title = 'Grindable Home' -%> <%= render :partial => 'shared/menu' %>

Fund details

<% if @fund.nil? -%>

You have no associated fund!

Visit the <%= link_to 'Fund Controller', :controller => 'fund' -%> to configure funds and change your associated fund.

<% else -%> <% unless @fund.contribution == 0.0 -%> <% if session[:barista].paid_this_month? -%>

You have paid this month's contribution.

<% else -%>

You have not paid this month

<% end -%> <% end -%> <% end -%>
<% unless @fund.nil? or @fund.contribution == 0.0 -%>

Milk Purchases

<%= form_tag({ :action => 'milk_purchased' }, { :id => 'milk_form' }) -%> <%= end_form_tag -%> <% unless session[:barista].milk_last_bought_at.nil? -%>

You last bought milk <%= time_ago_in_words session[:barista].milk_last_bought_at -%> ago.

<% else -%>

You have never bought milk!

<% end -%> <% unless @next_milk_purchaser.id == session[:barista].id -%>

The next person to buy milk will be: <%= h(@next_milk_purchaser.name) -%>

<% else -%>

You will have to buy milk next.

<% end -%>
<% end -%> <% unless @fund.nil? -%> <% @dojo_map ||= {} @dojo_map['contributionDialog'] = ['dialog', '{bgColor: "black", bgOpacity: "0.5"}'] @dojo_map['purchaseDialog'] = ['dialog', '{bgColor: "black", bgOpacity: "0.5"}'] %> <% end -%>