manage bookmarks, bugfixes
[smr.git] / gui / app / views / portrait / _overview_security.html.erb
blob82ae752c6ba988a4a98f9f81478c99cab0b78e32
3 <%
4 desc1 = security.description || false
5 desc2 = security.has_type_model? ? security.get_type.comment : false
6 if desc1 || desc2 || security.has_trading_ceased? %>
7  <p class="comment_text">
8    <%=
9     [
10       desc1,
11       desc2,
12       (security.has_trading_ceased? ? "\n\n" : ''),
13       (security.has_trading_ceased? ? 'Trading has been ceased on %s.' % smr_humanize(security.time_trading_ceased) : ''),
14       (security.trading_ceased_reason.blank? ? '' : 'Reason: %s.' % security.trading_ceased_reason),
15     ].compact.join(' ').strip
16    %>
17  </p>
18 <% end %>
20 <div id="overview">
21  <div><div>
23     <%= render :partial=>'security_quote', :locals=>{:security=>@security} %>
25     <% unless @intraday_quotes.empty? %>
26     <div class="overview_container">
27     <table id="overview_security_intraday">
28       <thead>
29         <tr><th colspan="3">Intraday Quotes</th></tr>
30         <tr>
31             <th>Price</th>
32             <th>Volume</th>
33             <th>Exchange</th>
34         </tr>
35       </thead>
36       <tbody>
37         <% @intraday_quotes.each do |q| %>
38         <tr>
39             <td><%= q.last %></td>
40             <td><%= smr_humanize q.volume, :shortword=>true %></td>
41             <td><span><%= smr_humanize q.time_last, :date_time_only=>true %></span><%= q.exchange %></td>
42         </tr>
43         <% end %>
44       </tbody>
45     </table>
46     </div>
47     <% end %>
49     <%= render :partial=>'security_info_%s' % @security.type, :locals=>{:security=>@security} %>
51     <% unless @quoterecords.empty? %>
52     <div class="overview_container">
53     <table id="overview_security_quoterecords">
54       <thead>
55         <tr><th colspan="2">Quoterecords</th></tr>
56       </thead>
57       <tbody>
58         <tr>
59             <td>Last Record in</td>
60             <td>
61                 <%= link_to Smr::Quoterecords.translate_column(@quoterecords.get_last_recorded_column),
62                             quoterecords_path(:id_security=>@security.id) %>
63             </td>
64         </tr>
65         <tr>
66             <td>Pivotal Points</td>
67             <td>
68              <% Smr::Quoterecords.get_columns.each do |c|
69                 val = @quoterecords.get_pivot_point c
70                 next unless val
71              %>
72                 <div><%= Smr::Quoterecords.translate_column c %> at <span><%= val %></span></div>
73              <% end %>
74             </td>
75         </tr>
76       </tbody>
77     </table>
78     </div>
79     <% end %>
81     <% if @figures_have_data %>
82     <div class="overview_container" id="portrait_figures_container">
83     <table class="overview_security_figures" id="figures">
84       <thead>
85         <tr><th colspan="8">Latest Figures</th></tr>
86       </thead>
87       <tbody>
88         <% for row in 0...@figures_datatable.rows %>
89         <tr <% if @figures_datatable.rowspan(row) %>
90                 <% if row>0 and @figures_datatable.rowspan(row+1) %>class="separaterows"
91                 <% elsif row>0 %>class="separaterows_rowspan"<% end %>
92             <% end %>
93         >
94           <% for col in 0...@figures_datatable.columns %>
95             <% next if col==0  and not @figures_datatable.rowspan(row) #skip blanked cells %>
97             <td <% if col==0 %>rowspan="<%=@figures_datatable.rowspan(row)%>"<% end %>>
98              <%= if @figures_datatable.link(row, col) then
99                     link_to(smr_humanize(@figures_datatable.cell(row, col), :scientific=>true), @figures_datatable.link(row, col))
100                  else smr_humanize(@figures_datatable.cell(row, col), :scientific=>true) end %><%= @figures_datatable.cell_unit(row, col) %>
101             </td>
102           <% end %>
103         </tr>
104         <% end %>
105       </tbody>
106     </table>
107     </div>
108     <% end %>
110  </div></div>
111 </div>