<% if user found = nil ary = [] count, total = @saifu.retrieve_all(user) do |x| ary.push(x) found = x if x.key == @edit end bg = ERbUtil::BGAttr.new %>

<%=h user %>

total: <%=total%>

<% if found %> > <% else bg.succ %> <% end %> <% ary.each do |rec| bgattr = if rec.key == @edit bg.succ 'bgcolor="#ddddaa"' else bg end %> > <% end %>
  <%=a('detail', {'key'=>-1}, context)%>new
 
[<%=a('delete', {'key'=>rec.key.to_s}, context)%>X] <%=h rec.date %> <%=h rec.memo %> <%=h rec.value %> [<%=a('detail', {'key'=>rec.key.to_s}, context)%>>>]
<% if found %> <%=form('update', context)%>
edit
date
memo
value
<% else date = Time.now.strftime("%Y-%m-%d") %> <%=form('add', context)%>
add
date
memo
value
<% end %>
<% end %>