1 <h1><%= @headline %></h1>
4 <%= form_for @security, :url=>{:action=>:create}, :method=>:POST do |f| %>
5 <fieldset id='security'>
6 <legend><% if @security.id %>Edit<% else %>Add<% end %> Security</legend>
7 <%= f.hidden_field :id %>
8 <div style='display: block; float: left;'>
9 <% if not @security.has_type_model? %>
10 <%= select_tag :security_use_type, options_for_select(Security.types.collect{|t| [Security.describe_type(t), t]}), :prompt=>'-- Select Type --' %>
12 <span><%= @security %></span>
16 Belongs to Organization <%= f.select :id_organization, @organizations.collect{|o| [o.name, o.id]} %><br/>
17 Brief Description <%= f.text_field :brief, :size=>25, :placeholder=>'Brief Description' %><br/>
18 Investor Relations Link <%= f.url_field :url, :size=>25, :placeholder=>'Link to Investor Relations page' %><br/>
21 <%= f.label :fetch_quote %><%= f.check_box :fetch_quote %><br/>
22 <%= f.text_field :symbol, :size=>12, :placeholder=>'Trading Symbol' %>
23 <%= f.select :id_security_symbolextension, @symbolextensions.collect{|se| ['%s - %s' %[se.fullname, se.extension], se.id] }, :prompt=>'-- Select Extension --' %>
24 via <%= f.select :id_security_quotesource, @quotesources.collect{|qs| [qs.source, qs.id] }, :prompt=>'-- Select Source --' %>
27 Collateral Coverage Ratio
28 <%= f.number_field :collateral_coverage_ratio, :step=>0.01, :min=>0.0, :value=>number_with_precision(f.object.collateral_coverage_ratio.to_f, :precision=>2) %><br/>
30 <%= f.text_area :description, :cols=>45, :rows=>15, placeholder: 'What is the story on this security?' %>
32 <%= f.submit 'Save Security' %>
35 <% if @security.fetch_quote and @quote_retrieval_status %>
36 <table id="quote_retrieval_status">
37 <thead><tr><th colspan='2'>Quote Retrieval Status</th></thead>
39 <% @quote_retrieval_status.each do |k,v| %>
40 <tr class="separaterows"><td><%= k %>:</td><td><%= v %></td></tr>
46 <div style='display: block; float: right;'>
47 <%= if @security.has_type_model? then
49 :partial=>'objects/security/%s_form' % @security.type,
50 :locals=>{:security=>@security, :type=>@security.get_type}
59 <% if not @securities %>
60 <p>No securities exist yet.</p>
63 <fieldset id="security_create_from_symbol">
64 <legend>Create new Security from Symbol</legend>
65 <%= form_tag({:action=>'new'}, method: :get) do %>
67 <%= text_field_tag :symbol, nil, :placeholder=>'ISIN' %>
68 <%= submit_tag 'Create' %>
73 <%= search_form_for @query, :url=>{:action=>:index}, :class=>:filter_form, :id=>:controller_filter do |f| %>
75 <%= f.search_field :symbol_or_brief_or_Organization_name_cont_any, :placeholder=>'Pattern' %>
77 # f.select :id_organization_eq, options_from_collection_for_select(@organizations, :id, :name)
79 <%= f.submit :filter %>
82 <tr><th colspan="2">Type of Security</th></tr>
83 <% Security.types.each do |t|
84 type_id_column = ('id_security_%s_gt' % t).to_sym
86 <tr><td><%= check_box_tag 'q[%s]' % type_id_column,
88 (if params[:q] and params[:q][type_id_column] then true else false end)
90 <%= label_tag 'q[%s][]' % type_id_column, Security.describe_type(t) %></td></tr>
98 <table id='securities'>
101 <th><%= smr_paginate @page, @total_pages, objects_security_index_path %></th>
103 <th>Quote Source</th>
105 <th>Collateral Coverage Ratio</th>
110 <% @securities.each do |s| %>
111 <tr class="separaterows">
112 <td <% if not s.description.blank? %>rowspan=2<% end %>>
113 <% unless s.id == Smr::ID_CASH_SECURITY %>
114 <%= link_to '+', edit_objects_security_path(s.id) %>
115 <%= link_to '...', s.link.to_url %>
118 <%= link_to truncate(s.url, :length=>40), s.url if s.url %>
120 <td><%= s.symbol %><span><%= s.SecuritySymbolextension %></span></td>
121 <td><%= s.SecurityQuotesource %></td>
122 <td><%= s.fetch_quote %></td>
123 <td><%= smr_humanize s.collateral_coverage_ratio %></td>
124 <td><%= link_to 'delete', delete_security_path(:id=>s.id) unless s.id == Smr::ID_CASH_SECURITY %></td>
126 <% if not s.description.blank? %>
128 <td colspan="6"><span class="comment_text"><%= s.description %></span></td>