Newer
Older
dmpopidor / app / views / shared / _org_dropdown.html.erb
<% others = allow_other_orgs ||= false %>
<% left_size = (others ? 5 : 8) %>

<div class="form-group col-md-<%= left_size %>">
  <%= f.label :org_name, _('Organisation'), class: 'control-label' %>
  <%= render partial: "shared/accessible_combobox",
             locals: {name: "user[org_name]",
                      id: "user_org_name",
                      default_selection: default_org,
                      models: orgs,
                      attribute: 'name'} %>

  <% if others %>
    <%= f.text_field :other_organisation, autocomplete: "off", class: "form-control hide", 
                     placeholder: _('Please enter the name of your organisation') %>
  <% end %>
</div>

<% if others %>
  <div class="checkbox col-md-3">
    <label for="other_orgs_toggle">
      <input type="checkbox" id="other_orgs_toggle" /><%= _('My organisation isn\'t listed') %>
    </label>
  </div>
<% end %>