|
|
|
@ -15,7 +15,6 @@
|
|
|
|
|
<div id="filters" class="pure-g h-box">
|
|
|
|
|
<!-- Grabs all search filters. This is to make sure we don't accidently overwrite something within the
|
|
|
|
|
search query later on-->
|
|
|
|
|
|
|
|
|
|
<% filter_params = env.request.query_params.to_s.gsub(/q=.+?(?=&|$)/, "") %>
|
|
|
|
|
<% base_url = "/search?q=#{HTML.escape(query.not_nil!)}" %>
|
|
|
|
|
|
|
|
|
@ -25,7 +24,7 @@
|
|
|
|
|
<ul class="pure-menu-list">
|
|
|
|
|
<% ["hour", "today", "week", "month", "year"].each do |date| %>
|
|
|
|
|
<li class="pure-menu-item">
|
|
|
|
|
<% if operator_hash.fetch("date", "all") == date %>
|
|
|
|
|
<% if operators.fetch("date", "all") == date %>
|
|
|
|
|
<a style="color: inherit;" href="<%= base_url + "#{filter_params.gsub(/&date=[a-z]+/, "")}"%>">
|
|
|
|
|
<b><%= translate(locale, date) %></b>
|
|
|
|
|
<i class="remove-filter icon ion-md-close"></i>
|
|
|
|
@ -46,7 +45,7 @@
|
|
|
|
|
<ul class="pure-menu-list">
|
|
|
|
|
<% ["video", "channel", "playlist", "movie", "show"].each do |content_type| %>
|
|
|
|
|
<li class="pure-menu-item">
|
|
|
|
|
<% if operator_hash.fetch("content_type", "all") == content_type %>
|
|
|
|
|
<% if operators.fetch("content_type", "all") == content_type %>
|
|
|
|
|
<a style="color: inherit;" href="<%= base_url + "#{filter_params.gsub(/&content_type=[a-z]+/, "")}"%>">
|
|
|
|
|
<b><%= translate(locale, content_type) %></b>
|
|
|
|
|
<i class="remove-filter icon ion-md-close"></i>
|
|
|
|
@ -67,7 +66,7 @@
|
|
|
|
|
<ul class="pure-menu-list">
|
|
|
|
|
<% ["short", "long"].each do |duration| %>
|
|
|
|
|
<li class="pure-menu-item">
|
|
|
|
|
<% if operator_hash.fetch("duration", "all") == duration %>
|
|
|
|
|
<% if operators.fetch("duration", "all") == duration %>
|
|
|
|
|
<a style="color: inherit;" href="<%= base_url + "#{filter_params.gsub(/&duration=[a-z]+/, "")}"%>">
|
|
|
|
|
<b><%= translate(locale, duration) %></b>
|
|
|
|
|
<i class="remove-filter icon ion-md-close"></i>
|
|
|
|
@ -88,8 +87,8 @@
|
|
|
|
|
<ul class="pure-menu-list">
|
|
|
|
|
<% ["hd", "subtitles", "creative_commons", "3d", "live", "purchased", "4k", "360", "location", "hdr"].each do |feature| %>
|
|
|
|
|
<li class="pure-menu-item">
|
|
|
|
|
<% if operator_hash.fetch("features", "all").includes?(feature) %>
|
|
|
|
|
<% if operator_hash["features"].split(",").size == 1 %>
|
|
|
|
|
<% if operators.fetch("features", "all").includes?(feature) %>
|
|
|
|
|
<% if operators["features"].split(",").size == 1 %>
|
|
|
|
|
<a style="color: inherit;" href="<%= base_url + "#{filter_params.gsub(/&features=[a-z]+/, "")}"%>">
|
|
|
|
|
<b><%= translate(locale, feature) %></b>
|
|
|
|
|
<i class="remove-filter icon ion-md-close"></i>
|
|
|
|
@ -104,7 +103,7 @@
|
|
|
|
|
<i class="remove-filter icon ion-md-close"></i>
|
|
|
|
|
</a>
|
|
|
|
|
<% end %>
|
|
|
|
|
<% elsif operator_hash.has_key?("features") %>
|
|
|
|
|
<% elsif operators.has_key?("features") %>
|
|
|
|
|
<a href="<%= base_url + filter_params.gsub(/features=/, "features=#{feature},")%>">
|
|
|
|
|
<%= translate(locale, feature) %>
|
|
|
|
|
</a>
|
|
|
|
@ -121,17 +120,20 @@
|
|
|
|
|
<div class="pure-u-1-3 pure-u-md-1-5 filter-catagory" id="filter-sort">
|
|
|
|
|
<b><%= translate(locale, "sort") %></b>
|
|
|
|
|
<hr/>
|
|
|
|
|
<ul class="pure-menu-list">
|
|
|
|
|
<% ["relevance", "rating", "date", "views"].each do |sort| %>
|
|
|
|
|
<div class="pure-u-1 pure-md-1-5">
|
|
|
|
|
<% if operator_hash.fetch("sort", "relevance") == sort %>
|
|
|
|
|
<li class="pure-menu-item">
|
|
|
|
|
<% if operators.fetch("sort", "relevance") == sort %>
|
|
|
|
|
<b><%= translate(locale, sort) %></b>
|
|
|
|
|
<% else %>
|
|
|
|
|
<a href="<%= base_url + "#{filter_params.gsub(/&sort=[a-z]+/, "")}&sort=#{sort}"%>">
|
|
|
|
|
<%= translate(locale, sort) %>
|
|
|
|
|
</a>
|
|
|
|
|
<% end %>
|
|
|
|
|
</div>
|
|
|
|
|
</li>
|
|
|
|
|
<% end %>
|
|
|
|
|
</ul>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</details>
|
|
|
|
|
<% end %>
|
|
|
|
@ -161,7 +163,7 @@
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="pure-g">
|
|
|
|
|
<% videos.each_slice(4) do |slice| %>
|
|
|
|
|
<% items.each_slice(4) do |slice| %>
|
|
|
|
|
<% slice.each do |item| %>
|
|
|
|
|
<%= rendered "components/item" %>
|
|
|
|
|
<% end %>
|
|
|
|
|