implemented Cash positions
[smr.git] / gui / app / views / objects / figurevar / index.html.erb
blob11a4526590f9249ab984d22111fa0fae5784548b
1 <h1><%= @headline %></h1>
3 <% if @figurevar %>
4     <%= form_for @figurevar, :url=>{action: :create}, :method=>:POST do |f| %>
5      <fieldset id='figurevar'>
6       <legend><% if @figurevar.id  %>Edit<% else %>Add<% end %> Figure</legend>
7         <%= f.hidden_field :id %>
8       <div style='display: block; float: left;'>
9         <%= f.text_field :name, :placeholder=>'Name' %><br/>
10         <%= f.text_field :unit, :placeholder=>'What is this measured in?' %><br/>
11         <%= f.text_field :expression, :size=>32, :placeholder=>'Math Expression (makes this a auto-figure).' %><br/>
12         <%= f.submit 'Save Figure' %>
13       </div>
14       <div style='display: block; float: left;'>
15         <%= f.text_area :comment, :cols=>40, :rows=>15, placeholder: 'Why did you open this Account?' %>
16       </div>
17      </fieldset>
18     <% end %>
19 <% end %>
21 <h2>Figures</h2>
22 <% if not @figurevars %>
23     <p>No figures exist yet.</p>
24 <% else %>
26 <table id='figurevars'>
27     <thead>
28     <tr>
29         <th><%= smr_paginate @page, @total_pages, objects_figurevar_index_path %></th>
30         <th>Unit</th>
31         <th>Expression</th>
32     </tr>
33     </thead>
34     <tbody>
35     <% @figurevars.each do |f| %>
36         <tr class="separaterows">
37             <td <% if not f.comment.blank? %>rowspan=2<% end %>>
38               <%= link_to '+', controller: 'objects/figurevar', action: 'edit', id: f.id %>
39               <%= f.name %><br/>
40             </td>
41             <td><%= 'in %s' % f.unit if f.unit %></td>
42             <td><code><%= f.expression if f.expression %></code></td>
43         </tr>
44         <% if not f.comment.empty? %><tr><td colspan=3><span class="comment_text"><%= f.comment %></span></td></tr><% end %>
45     <% end %>
46     </tbody>
47 </table>
48 <% end %>