<%=h @year %>/<%=h @month %>

<% unless @mode == :edit %> <%= link_to "(edit)", edit_logs_path(:year => @year, :month => @month) %> <% end %> <% @accounts.each_with_index do |account, i| %> <%# for each account %>

<%=h account.name %> <%= link_to '△', move_up_account_path(account) %> <%= link_to '▽', move_down_account_path(account) %>

<%# table %> <%# first row %> <% if @mode == :edit %> <% end %> <% [:expense, :income, :move].each do |kind| %> <% end %> <% @cat_all.each do |cat| %> <% end %> <% make_table_data(account).each_with_index do |(day, i, btn, row), k| %> <%# for each row %> <% tr_class = (k%2 == 0) ? "even" : "odd" %> <%# first cell %> <% if @mode == :edit %> <% end %> <% row.each do |item| %> <%# for each cell %> <% case item when Date %> <% when :no_date %> <% when Item %> <% else %> <% end %> <% end %> <% end %>
Date <%=h kind.to_s.capitalize %>
<%=h cat.name %>
<% if btn %> <% end %> <%=h item.to_s %> <%= cell(item.title) %> <%= cell(item.amount) %> <%= cell("") %> <%= cell("") %>
<% end %> <% javascript_tag do %> var MoneyRail = MoneyRail || {}; MoneyRail.editable = <%=h (@mode == :edit) ? "true" : "false" %>; MoneyRail.authenticity_token = '<%=h form_authenticity_token %>'; MoneyRail.category_numbers = [ <%=h [:expense, :income, :move].map{|kind| @categories[kind].length.to_s }.join(", ") %> ]; MoneyRail.category_ids = [ <%=h @cat_all.map{|c| c.id.to_s}.join(", ") %> ]; MoneyRail.item_update_path = function(item_id){ var str = "<%=h update_item_path(9999) %>.json"; return str.replace(/9999/, item_id); }; MoneyRail.item_destroy_path = function(item_id){ var str = "<%=h destroy_item_path(9999) %>.json"; return str.replace(/9999/, item_id); }; MoneyRail.item_create_path = "<%=h create_item_path %>.json"; <% end %> <%= link_to 'back', root_path %>