Skip to content

Commit

Permalink
The filter option (behind a feature flag) is incomplete. This change …
Browse files Browse the repository at this point in the history
…just brings it up to its behaviour in the current theme
  • Loading branch information
mlandauer committed Feb 13, 2024
1 parent 12fb6fb commit a290d13
Showing 1 changed file with 3 additions and 64 deletions.
67 changes: 3 additions & 64 deletions app/views/_tailwind/applications/_address_with_results.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@

<%# TODO: Do we want to keep this template for when there are no errors? %>
<%# TODO: Remove duplication of heading %>
<% if error.nil? && applications.empty? %>
<%# TODO: Figure out how to handle no results when extra_options_on_address_search is enabled %>
<%# TODO: Add filter option for no filtering (e.g. any distance or any time) because the filtering in its current is very confusing in its behaviour %>
<% if error.nil? && applications.empty? && !Flipper.enabled?(:extra_options_on_address_search, current_user)%>
<section class="pt-16">
<%= render "no_applications", full_address:, q: %>
</section>
Expand Down Expand Up @@ -74,66 +76,3 @@
</div>
</section>
<% end %>

<%
=begin
%>
<% if q.nil? || error %>
<h3>
Search for applications near an address
</h3>
<%= render "address_search_form", q:, error: %>
<% else %>
<h3>
Applications within
<% if Flipper.enabled?(:extra_options_on_address_search, current_user) %>
the last
<%= days_in_words(time) %>
and
<% end %>
<%= meters_in_words(radius) %>
of
<%= full_address %>
</h3>
<% unless other_addresses.empty? %>
<h4>Or did you want?</h4>
<ul>
<% other_addresses.each do |a| %>
<li>
<%= link_to a, q: a %>
</li>
<% end %>
</ul>
<% end %>
<%# TODO: Figure out how to handle no results when extra_options_on_address_search is enabled %>
<% if applications.empty? && !Flipper.enabled?(:extra_options_on_address_search, current_user) %>
<%= render "no_applications", full_address:, q: %>
<% else %>
<div class="attention">
<%= render "alerts/signup_introduction" %>
<%= render "alerts/frequency" %>
<%= render "privacy_policy" %>
<%= render "alerts/signup_form", alert:, address_hidden: true %>
</div>
<div class="filter-and-sort-options">
<div class="sort-options">
<%= render "sort_options", sort:, extra_params: { q: } %>
</div>
<% if Flipper.enabled?(:extra_options_on_address_search, current_user) %>
<div class="filter-options">
<%= render "filter_options", sort:, q:, radius:, time: %>
</div>
<% end %>
</div>
<%= render "pagination", applications: %>
<ol class="applications">
<%= render partial: "application", collection: applications %>
</ol>
<%= render "pagination", applications: %>
<% end %>
<% end %>
<%
=end
%>

0 comments on commit a290d13

Please sign in to comment.