This repository has been archived by the owner on Dec 24, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #30 from connorshea/move-search-to-sidebar
Move search to sidebar
- Loading branch information
Showing
5 changed files
with
168 additions
and
144 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,124 +1,132 @@ | ||
<div class="container"> | ||
<div class="container"> | ||
<div class="row py-4 w-100"> | ||
<%= form_tag("/features", method: "get", class: "w-100") do %> | ||
<%= text_field_tag(:query, | ||
params['query'], | ||
placeholder: "Search", | ||
class: "form-control") %> | ||
<div class="container search-page"> | ||
<div class="row no-wrap-row"> | ||
<div class="col-lg-3 col-12 search-sidebar"> | ||
<div class="row p-2"> | ||
<%= form_tag("/features", method: "get", class: "w-100") do %> | ||
<div class="search-filters-container"> | ||
<div class="form-group"> | ||
<%= text_field_tag(:query, | ||
params['query'], | ||
placeholder: "Search", | ||
class: "form-control") %> | ||
</div> | ||
|
||
<div class="py-2 w-100"> | ||
<div class="px-2 d-block d-md-inline-block"> | ||
Categories: | ||
</div> | ||
<% @categories.each do |key, value| %> | ||
<div class="px-2 d-block d-md-inline-block"> | ||
<%= check_box_tag( | ||
"categories[]", | ||
key, | ||
(true if params["categories"].present? && params["categories"].include?(key.to_s)), | ||
{id: key} | ||
) %> | ||
<%= label_tag(key, value) %> | ||
</div> | ||
<% end %> | ||
</div> | ||
<div class="py-2 w-100"> | ||
<div class="px-2 d-block d-md-inline-block"> | ||
Filters: | ||
</div> | ||
<div class="px-2 d-block d-md-inline-block"> | ||
<%= label_tag("mdn_url", "Includes an MDN URL?") %> | ||
<%= select_tag( | ||
"mdn_url", | ||
options_for_select( | ||
[ | ||
['Has an MDN URL', true], | ||
['Has no MDN URL', false] | ||
], | ||
params["mdn_url"] | ||
), | ||
{ include_blank: true } | ||
) %> | ||
</div> | ||
<div class="form-group-title"> | ||
Categories | ||
</div> | ||
<div class="form-group"> | ||
<% @categories.each do |key, value| %> | ||
<div class="form-check"> | ||
<%= check_box_tag( | ||
"categories[]", | ||
key, | ||
(true if params["categories"].present? && params["categories"].include?(key.to_s)), | ||
{id: key, class: "form-check-input"} | ||
) %> | ||
<%= label_tag(key, value, class: "form-check-label") %> | ||
</div> | ||
<% end %> | ||
</div> | ||
|
||
<div class="px-2 d-block d-md-inline-block"> | ||
<%= label_tag("description", "Includes a description?") %> | ||
<%= select_tag( | ||
"description", | ||
options_for_select( | ||
[ | ||
['Has a description', true], | ||
['Has no description', false] | ||
], | ||
params["description"] | ||
), | ||
{ include_blank: true } | ||
) %> | ||
</div> | ||
<div class="form-group-title"> | ||
Filters | ||
</div> | ||
<div class="form-group"> | ||
<%= label_tag("mdn_url", "Includes an MDN URL?") %> | ||
<%= select_tag( | ||
"mdn_url", | ||
options_for_select( | ||
[ | ||
['Has an MDN URL', true], | ||
['Has no MDN URL', false] | ||
], | ||
params["mdn_url"] | ||
), | ||
{ include_blank: true, class: "form-control form-control-sm" } | ||
) %> | ||
</div> | ||
|
||
<div class="px-2 d-block d-md-inline-block"> | ||
<%= label_tag("deprecated", "Deprecated?") %> | ||
<%= select_tag( | ||
"deprecated", | ||
options_for_select( | ||
[ | ||
['Deprecated', true], | ||
['Not deprecated', false], | ||
['No deprecation info', "no_info"] | ||
], | ||
params["deprecated"] | ||
), | ||
{ include_blank: true } | ||
) %> | ||
</div> | ||
<div class="form-group"> | ||
<%= label_tag("description", "Includes a description?") %> | ||
<%= select_tag( | ||
"description", | ||
options_for_select( | ||
[ | ||
['Has a description', true], | ||
['Has no description', false] | ||
], | ||
params["description"] | ||
), | ||
{ include_blank: true, class: "form-control form-control-sm" } | ||
) %> | ||
</div> | ||
|
||
<div class="px-2 d-block d-md-inline-block"> | ||
<%= label_tag("experimental", "Experimental?") %> | ||
<%= select_tag( | ||
"experimental", | ||
options_for_select( | ||
[ | ||
['Experimental', true], | ||
['Not experimental', false], | ||
['No experimental info', "no_info"] | ||
], | ||
params["experimental"] | ||
), | ||
{ include_blank: true } | ||
) %> | ||
</div> | ||
<div class="form-group"> | ||
<%= label_tag("deprecated", "Deprecated?") %> | ||
<%= select_tag( | ||
"deprecated", | ||
options_for_select( | ||
[ | ||
['Deprecated', true], | ||
['Not deprecated', false], | ||
['No deprecation info', "no_info"] | ||
], | ||
params["deprecated"] | ||
), | ||
{ include_blank: true, class: "form-control form-control-sm" } | ||
) %> | ||
</div> | ||
|
||
<div class="form-group"> | ||
<%= label_tag("experimental", "Experimental?") %> | ||
<%= select_tag( | ||
"experimental", | ||
options_for_select( | ||
[ | ||
['Experimental', true], | ||
['Not experimental', false], | ||
['No experimental info', "no_info"] | ||
], | ||
params["experimental"] | ||
), | ||
{ include_blank: true, class: "form-control form-control-sm" } | ||
) %> | ||
</div> | ||
|
||
<div class="form-group"> | ||
<%= label_tag("standard_track", "Standard track?") %> | ||
<%= select_tag( | ||
"standard_track", | ||
options_for_select( | ||
[ | ||
['On standard track', true], | ||
['Not on standard track', false], | ||
['No standard track info', "no_info"] | ||
], | ||
params["standard_track"] | ||
), | ||
{ include_blank: true, class: "form-control form-control-sm" } | ||
) %> | ||
</div> | ||
</div> | ||
|
||
<div class="px-2 d-block d-md-inline-block"> | ||
<%= label_tag("standard_track", "Standard track?") %> | ||
<%= select_tag( | ||
"standard_track", | ||
options_for_select( | ||
[ | ||
['On standard track', true], | ||
['Not on standard track', false], | ||
['No standard track info', "no_info"] | ||
], | ||
params["standard_track"] | ||
), | ||
{ include_blank: true } | ||
) %> | ||
</div> | ||
<div class="search-button-container"> | ||
<%= submit_tag("Search", class: "btn btn-primary btn-lg btn-block search-button") %> | ||
</div> | ||
<% end %> | ||
</div> | ||
</div> | ||
|
||
<%= submit_tag("Search", class: "btn btn-primary btn-lg btn-block") %> | ||
<% end %> | ||
</div> | ||
<div class="col-lg-9 col-12 py-3"> | ||
<h1>Features</h1> | ||
|
||
<div class="row"> | ||
<% unless @feature_count.zero? %> | ||
<p>Features: <%= @feature_count %></p> | ||
<% end %> | ||
|
||
<%= render 'features_list', | ||
features: @features, | ||
browsers: @browsers %> | ||
<% unless @feature_count.zero? %> | ||
<p>Features: <%= @feature_count %></p> | ||
<% end %> | ||
<%= render 'features_list', | ||
features: @features, | ||
browsers: @browsers %> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters