Split content sorting bar from channel-information

This commit is contained in:
syeopite 2021-06-26 18:54:31 -07:00
parent b7ff385ff4
commit 07d3f6fb12
No known key found for this signature in database
GPG key ID: 6FA616E5A5294A82
9 changed files with 36 additions and 37 deletions

View file

@ -12,8 +12,7 @@
<% end %>
<% content_type = 5 %>
<% sort_options = Tuple.new %>
<%= rendered "components/channel-information" %>
<%= rendered "components/channels/channel-information" %>
<div class="pure-g h-box" id="about-content-container">
<div class="pure-u-1 pure-u-md-3-4">

View file

@ -4,8 +4,7 @@
<% end %>
<% content_type = 3 %>
<% sort_options = Tuple.new %>
<%= rendered "components/channel-information" %>
<%= rendered "components/channels/channel-information" %>
<% if error_message %>
<div class="h-box">

View file

@ -4,8 +4,7 @@
<% end %>
<% content_type = 4 %>
<% sort_options = Tuple.new %>
<%= rendered "components/channel-information" %>
<%= rendered "components/channels/channel-information" %>
<div class="pure-g h-box">
<% if !featured_channel_categories.empty? %>

View file

@ -4,8 +4,7 @@
<% end %>
<% content_type = 0 %>
<% sort_options = Tuple.new %>
<%= rendered "components/channel-information" %>
<%= rendered "components/channels/channel-information" %>
<div class="pure-g">
<% items.each do | section | %>

View file

@ -4,7 +4,8 @@
<% end %>
<% content_type = 2 %>
<%= rendered "components/channel-information" %>
<%= rendered "components/channels/channel-information" %>
<%= rendered "components/channels/content-sorting-bar" %>
<div class="pure-g">
<% items.each do |item| %>

View file

@ -5,7 +5,8 @@
<% end %>
<% content_type = 1 %>
<%= rendered "components/channel-information" %>
<%= rendered "components/channels/channel-information" %>
<%= rendered "components/channels/content-sorting-bar" %>
<div class="pure-g">
<% items.each do |item| %>

View file

@ -173,31 +173,5 @@
</div>
<div class="h-box">
<% if content_type == 1 || content_type == 2 %>
<% # We really only need a single <hr> (handled below) outside of content_type 1 or 2 %>
<hr>
<% route = content_type == 1 ? "/videos" : "/playlists" %>
<% url = "/channel/#{channel.ucid + route}" %>
<div class="pure-menu pure-menu-horizontal" id="sort-options" style="display: flex;">
<ul class="pure-menu-list" style="margin-left: auto;">
<% sort_options.each do |sort| %>
<% if sort_by == sort %>
<li class="pure-menu-item pure-menu-selected">
<a class="pure-menu-link" href="<%= url %>?sort_by=<%= sort %>">
<b><%= translate(locale, sort) %></b>
</a>
</li>
<% else %>
<li class="pure-menu-item">
<a class="pure-menu-link" href="<%= url %>?sort_by=<%= sort %>">
<%= translate(locale, sort) %>
</a>
</li>
<% end %>
<% end %>
</ul>
</div>
<% end %>
<hr>
</div>

View file

@ -0,0 +1,27 @@
<div class="h-box">
<% route = content_type == 1 ? "/videos" : "/playlists" %>
<% url = "/channel/#{channel.ucid + route}" %>
<div class="pure-menu pure-menu-horizontal" id="sort-options" style="display: flex;">
<ul class="pure-menu-list" style="margin-left: auto;">
<% sort_options.each do |sort| %>
<% if sort_by == sort %>
<li class="pure-menu-item pure-menu-selected">
<a class="pure-menu-link" href="<%= url %>?sort_by=<%= sort %>">
<b><%= translate(locale, sort) %></b>
</a>
</li>
<% else %>
<li class="pure-menu-item">
<a class="pure-menu-link" href="<%= url %>?sort_by=<%= sort %>">
<%= translate(locale, sort) %>
</a>
</li>
<% end %>
<% end %>
</ul>
</div>
<hr>
</div>

View file

@ -12,7 +12,7 @@
<% if is_channel_search && channel.is_a? AboutChannel && !subscriptions.nil? %>
<% content_type = 7 %>
<% sort_options = Tuple.new %>
<%= rendered "components/channel-information" %>
<%= rendered "components/channels/channel-information" %>
<% end %>
<% search_query_encoded = env.get?("search").try { |x| URI.encode(x.as(String), space_to_plus: true) } %>