Split content sorting bar from channel-information

This commit is contained in:
syeopite 2021-06-26 18:54:31 -07:00
parent efd53285cf
commit 39187cc8c2
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 %> <% end %>
<% content_type = 5 %> <% content_type = 5 %>
<% sort_options = Tuple.new %> <%= rendered "components/channels/channel-information" %>
<%= rendered "components/channel-information" %>
<div class="pure-g h-box" id="about-content-container"> <div class="pure-g h-box" id="about-content-container">
<div class="pure-u-1 pure-u-md-3-4"> <div class="pure-u-1 pure-u-md-3-4">

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -173,31 +173,5 @@
</div> </div>
<div class="h-box"> <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> <hr>
</div> </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? %> <% if is_channel_search && channel.is_a? AboutChannel && !subscriptions.nil? %>
<% content_type = 7 %> <% content_type = 7 %>
<% sort_options = Tuple.new %> <% sort_options = Tuple.new %>
<%= rendered "components/channel-information" %> <%= rendered "components/channels/channel-information" %>
<% end %> <% end %>
<% if count == 0 %> <% if count == 0 %>