Commit 8eaf92b2 authored by Mateus Ravedutti's avatar Mateus Ravedutti

Put city hall field in search forms

parent 3191b86f
......@@ -4,7 +4,19 @@
<div id="search-form">
<%= search_form_for(@search) do |f| %>
<div class="field-h col s12 m6 l3">
<div class="field-h col s12 m6 l3">
<%= f.label :city_hall_id, t(:city_hall) %><br />
<% if @currentProfessionalServicePlace.role == "adm_c3sl" %>
<%= f.collection_select :city_hall_id_eq, CityHall.active.order(:name),
:id, :name, { :include_blank => "Todos" }, { :class => "search-field" } %>
<% else %>
<%= f.collection_select :city_hall_id_eq, CityHall.where(id: @currentCityHall.id),
:id, :name, { disabled: true }, { :class => "search-field" } %>
<% end %>
</div>
<div class="field-h col s12 m6 l3">
<%= f.label :name, t(:Name)+": " %><br />
<%= f.text_field :name_cont, :class => "search-field"%>
</div>
......
......@@ -25,10 +25,16 @@
</div>
<div class="field-h col s12 m6 l3">
<%= f.label :city, t(:city)+": " %><br />
<%= f.text_field :city_name_cont, :class => "search-field" %>
<%= f.label :city_hall_id, t(:city_hall) %><br />
<% if @currentProfessionalServicePlace.role == "adm_c3sl" %>
<%= f.collection_select :city_hall_id_eq, CityHall.active.order(:name),
:id, :name, { :include_blank => "Todos" }, { :class => "search-field" } %>
<% else %>
<%= f.collection_select :city_hall_id_eq, CityHall.where(id: @currentCityHall.id),
:id, :name, { disabled: true }, { :class => "search-field" } %>
<% end %>
</div>
<% end %>
<% end %>
<div class="field-h col s12 m6 l3">
<%= f.label :active, t(:Situation)+": " %><br />
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment