-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy path_search.html.erb
More file actions
50 lines (50 loc) · 2.48 KB
/
_search.html.erb
File metadata and controls
50 lines (50 loc) · 2.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<div class="card">
<div class="card-header d-flex justify-content-between align-items-center">
<h2 class="card-title">Search</h2>
</div>
<div class="card-content">
<div class="card-body">
<p class="card-text"> Use these params settings to search topics</p>
<%= form_for :search, url: topics_path, method: :get do |f| %>
<div class="form-body">
<div class="row">
<div class="col-12">
<div class="form-group">
<%= f.label :provider %>
<%= f.select :provider_id, options_from_collection_for_select(providers, :id, :name, params[:provider_id]), { prompt: "Select provider" }, class: "form-select" %>
</div>
<div class="form-group">
<%= f.label :language %>
<%= f.select :language_id, options_from_collection_for_select(languages, :id, :name, params[:provider_id]), { prompt: "Select language" }, class: "form-select" %>
</div>
<div class="form-group">
<%= f.label :query %>
<%= f.text_field :query, value: params[:query], class: "form-control" %>
</div>
<div class="form-group">
<%= f.label :year %>
<%= f.select :year, options_for_select((Date.today.year-10..Date.today.year).to_a, params[:year]), { prompt: "Select year" }, class: "form-select" %>
</div>
<div class="form-group">
<%= f.label :month %>
<%= f.select :month, options_for_select((1..12).to_a, params[:month]), { prompt: "Select month" }, class: "form-select" %>
</div>
<div class="form-group">
<%= f.label :state %>
<%= f.select :state, options_for_select(Topic::STATES.index_with(&:itself), params[:state]), { prompt: "Select state" }, class: "form-select" %>
</div>
<div class="form-group">
<%= f.label :order %>
<%= f.select :order, options_for_select(Topic::SORTS.reverse.index_with(&:itself), params[:order]), {}, class: "form-select" %>
</div>
<div class="col-12 d-flex justify-content-end">
<%= f.submit "Search", class: "btn btn-primary me-1 mb-1" %>
<%= link_to "Clear", topics_path, class: "btn btn-light-secondary me-1 mb-1" %>
</div>
</div>
</div>
</div>
<% end %>
</div>
</div>
</div>