portrait Security and Organization records
[smr.git] / gui / app / views / portrait / _overview_security.html.erb
blob24ec3fe3feb88cafdc87397858ecd3841824d489
3 <% if security.description || (security.has_type_model? and security.get_type.comment) %>
4 <p class="comment_text">
5     <%= security.description %>
6     <%= security.get_type.comment if security.has_type_model? %>
7 </p>
8 <% end %>
10 <div id="overview">
11  <div><div>
13     <% if @last_trade %>
14     <div class="overview_container">
15     <table id="overview_security_quote">
16       <thead>
17         <tr><th colspan="2">Last Trade</th></tr>
18       </thead>
19       <tbody>
20         <tr><td>Price</td><td><%= @last_trade.quote %></td></tr>
21         <% if @last_trade.volume.to_i.abs != 0 %><tr><td>Volume</td><td><%= smr_humanize @last_trade.volume, :shortword=>true %></td></tr><% end %>
22         <tr><td>Time</td><td><%= smr_humanize @last_trade.time, :date_with_time=>true %></td></tr>
23         <% if @last_trade.low.to_i.abs != 0 %><tr><td>Day Low</td><td><%= @last_trade.low %></td></tr><% end %>
24         <% if @last_trade.high.to_i.abs != 0 %><tr><td>Day High</td><td><%= @last_trade.high %></td></tr><% end %>
25         <tr><td>Exchange</td><td><%= @last_trade.exchange %></td></tr>
26       </tbody>
27     </table>
28     </div>
29     <% end %>
31     <% unless @intraday_quotes.empty? %>
32     <div class="overview_container">
33     <table id="overview_security_intraday">
34       <thead>
35         <tr><th colspan="3">Intraday Quotes</th></tr>
36         <tr>
37             <th>Price</th>
38             <th>Volume</th>
39             <th>Exchange</th>
40         </tr>
41       </thead>
42       <tbody>
43         <% @intraday_quotes.each do |q| %>
44         <tr>
45             <td><%= q.quote %></td>
46             <td><%= smr_humanize q.volume, :shortword=>true %></td>
47             <td><%= q.exchange %></td>
48         </tr>
49         <% end %>
50       </tbody>
51     </table>
52     </div>
53     <% end %>
55     <% unless @quoterecords.empty? %>
56     <div class="overview_container">
57     <table id="overview_security_quoterecords">
58       <thead>
59         <tr><th colspan="2">Quoterecords</th></tr>
60       </thead>
61       <tbody>
62         <tr>
63             <td>Last Record in</td>
64             <td>
65                 <%= link_to Smr::Quoterecords.translate_column(@quoterecords.get_last_recorded_column),
66                             quoterecords_path(:id_security=>@security.id) %>
67             </td>
68         </tr>
69         <tr>
70             <td>Pivotal Points</td>
71             <td>
72              <% Smr::Quoterecords.get_columns.each do |c|
73                 val = @quoterecords.get_pivot_point c
74                 next unless val
75              %>
76                 <div><%= Smr::Quoterecords.translate_column c %> at <span><%= val %></span></div>
77              <% end %>
78             </td>
79         </tr>
80       </tbody>
81     </table>
82     </div>
83     <% end %>
85     <% if @figures_have_data %>
86     <div class="overview_container" id="portrait_figures_container">
87     <table class="overview_security_figures" id="figures">
88       <thead>
89         <tr><th colspan="8">Latest Figures</th></tr>
90       </thead>
91       <tbody>
92         <% for row in 0...@figures_datatable.rows %>
93         <tr <% if @figures_datatable.rowspan(row) %>
94                 <% if row>0 and @figures_datatable.rowspan(row+1) %>class="separaterows"
95                 <% elsif row>0 %>class="separaterows_rowspan"<% end %>
96             <% end %>
97         >
98           <% for col in 0...@figures_datatable.columns %>
99             <% next if col==0  and not @figures_datatable.rowspan(row) #skip blanked cells %>
101             <td <% if col==0 %>rowspan="<%=@figures_datatable.rowspan(row)%>"<% end %>>
102              <%= if @figures_datatable.link(row, col) then
103                     link_to(smr_humanize(@figures_datatable.cell(row, col), :scientific=>true), @figures_datatable.link(row, col))
104                  else smr_humanize(@figures_datatable.cell(row, col), :scientific=>true) end %><%= @figures_datatable.cell_unit(row, col) %>
105             </td>
106           <% end %>
107         </tr>
108         <% end %>
109       </tbody>
110     </table>
111     </div>
112     <% end %>
114  </div></div>
115 </div>