Skip to content

Commit

Permalink
Cleanup erb
Browse files Browse the repository at this point in the history
  • Loading branch information
lukashlavacka committed Nov 29, 2023
1 parent 4bcb157 commit 589f65d
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions app/views/eventsimple/shared/_header.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,27 @@
</div>

<% if @model_name %>
<div class="col col-sm-7">
<%= form_with url: model_entity_path(@model_name, ''), id: 'model-search' do |f| %>
<%= form_with url: model_entity_path(@model_name, ''), id: 'model-search' do |f| %>
<div clas s="col col-sm-7">
<%= f.search_field :event_id, class: 'form-control', placeholder: 'Go to event by identifier', value: @aggregate_id, aria: { label: 'Go to event by identifier' } %>
</div>
<div class="col col-sm-2">
<%= f.submit 'Search', class: 'btn btn-primary' %>
<% end %>
</div>
<% unless @aggregate_id %>
<div class="col col-sm-7">
<%= form_with url: model_path(@model_name), method: :get, id: 'metadata-search' do |f| %>
<% @metadata_attributes.each do |metadata_attribute| %>
<%= f.search_field "metadata[#{metadata_attribute}]", class: 'form-control', placeholder: "Search by #{metadata_attribute}", value: @metadata[metadata_attribute], aria: { label: "Search by #{metadata_attribute}" } %>
<% end %>
</div>
<div class="col col-sm-2">
<%= f.submit 'Search', class: 'btn btn-primary' %>
<div class="row">
<% @metadata_attributes.each do |metadata_attribute| %>
<div class="form-group col-md-3">
<%= f.search_field "metadata[#{metadata_attribute}]", class: 'form-control', placeholder: "Search by #{metadata_attribute}", value: @metadata[metadata_attribute], aria: { label: "Search by #{metadata_attribute}" } %>
</div>
<% end %>
<div class="col-md-2">
<%= f.submit 'Search', class: 'btn btn-primary' %>
</div>
</div>
<% end %>
</div>
<% end %>
<% end %>
</div>
Expand Down

0 comments on commit 589f65d

Please sign in to comment.