Add about tab to channels
This commit is contained in:
parent
90bd19dc45
commit
e8015fc144
5 changed files with 80 additions and 19 deletions
|
@ -384,6 +384,7 @@
|
||||||
"Download": "Download",
|
"Download": "Download",
|
||||||
"Download as: ": "Download as: ",
|
"Download as: ": "Download as: ",
|
||||||
"%A %B %-d, %Y": "%A %B %-d, %Y",
|
"%A %B %-d, %Y": "%A %B %-d, %Y",
|
||||||
|
"%B %-d, %Y": "%B %-d, %Y",
|
||||||
"(edited)": "(edited)",
|
"(edited)": "(edited)",
|
||||||
"YouTube comment permalink": "YouTube comment permalink",
|
"YouTube comment permalink": "YouTube comment permalink",
|
||||||
"permalink": "permalink",
|
"permalink": "permalink",
|
||||||
|
@ -423,5 +424,9 @@
|
||||||
"Current version: ": "Current version: ",
|
"Current version: ": "Current version: ",
|
||||||
"next_steps_error_message": "After which you should try to: ",
|
"next_steps_error_message": "After which you should try to: ",
|
||||||
"next_steps_error_message_refresh": "Refresh",
|
"next_steps_error_message_refresh": "Refresh",
|
||||||
"next_steps_error_message_go_to_youtube": "Go to YouTube"
|
"next_steps_error_message_go_to_youtube": "Go to YouTube",
|
||||||
|
"Details": "Details",
|
||||||
|
"Stats": "Stats",
|
||||||
|
"Joined": "Joined",
|
||||||
|
"Links": "Links",
|
||||||
}
|
}
|
||||||
|
|
|
@ -98,8 +98,18 @@ module Invidious::Routes::Channels
|
||||||
end
|
end
|
||||||
locale, user, subscriptions, continuation, ucid, channel = data
|
locale, user, subscriptions, continuation, ucid, channel = data
|
||||||
|
|
||||||
env.redirect "/channel/#{ucid}"
|
ucid = env.params.url["ucid"]
|
||||||
end
|
continuation = env.params.query["continuation"]?
|
||||||
|
|
||||||
|
begin
|
||||||
|
channel = get_about_info(ucid, locale)
|
||||||
|
rescue ex : ChannelRedirect
|
||||||
|
next env.redirect env.request.resource.gsub(ucid, ex.channel_id)
|
||||||
|
rescue ex
|
||||||
|
next error_template(500, ex)
|
||||||
|
end
|
||||||
|
|
||||||
|
templated "channel_about" end
|
||||||
|
|
||||||
# Redirects brand url channels to a normal /channel/:ucid route
|
# Redirects brand url channels to a normal /channel/:ucid route
|
||||||
def self.brand_redirect(env)
|
def self.brand_redirect(env)
|
||||||
|
|
35
src/invidious/views/channel_about.ecr
Normal file
35
src/invidious/views/channel_about.ecr
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
<% content_type = 4 %>
|
||||||
|
<% sort_options = Tuple.new %>
|
||||||
|
<%= rendered "components/channel-information" %>
|
||||||
|
|
||||||
|
<div class="pure-g">
|
||||||
|
<div class="pure-u-3-4">
|
||||||
|
<div class="h-box">
|
||||||
|
<h3> <%= translate(locale, "Details") %> </h3>
|
||||||
|
<p>Country: <%=channel.country%></p> <!-- Translate Country Names -->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="pure-u-1-4">
|
||||||
|
<div class="h-box">
|
||||||
|
<h3> <%= translate(locale, "Stats") %> </h3>
|
||||||
|
<p> <%= translate(locale, "Joined") %>
|
||||||
|
<time datetime="<%=channel.joined.to_s("%Y-%m-%d")%>">
|
||||||
|
<%= channel.joined.to_s(translate(locale, "%B %-d, %Y")) %>
|
||||||
|
</time>
|
||||||
|
</p>
|
||||||
|
<p><%= channel.total_views ? translate(locale, "`x` views", number_with_separator(channel.total_views || 0)) : "" %></p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="pure-u-2-3" id="external-links">
|
||||||
|
<div class="h-box">
|
||||||
|
<h3> <%= translate(locale, "Links") %> </h3>
|
||||||
|
<% channel.links.each do |link_tuple| %>
|
||||||
|
<p class="pure-u-11-24">
|
||||||
|
<a href="<%=link_tuple[1]%>"><%=link_tuple[0]%></a>
|
||||||
|
</p>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
|
@ -1,7 +1,4 @@
|
||||||
<% content_type = 2 %>
|
<% content_type = 2 %>
|
||||||
<%
|
|
||||||
# Make compiler happy
|
|
||||||
%>
|
|
||||||
<% sort_options = Tuple.new %>
|
<% sort_options = Tuple.new %>
|
||||||
<%= rendered "components/channel-information" %>
|
<%= rendered "components/channel-information" %>
|
||||||
|
|
||||||
|
|
|
@ -77,19 +77,33 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<% if channel.tabs.includes? "community" %>
|
<% if channel.tabs.includes? "community" %>
|
||||||
<% if content_type == 2 %>
|
<% if content_type == 2 %>
|
||||||
<li class="pure-menu-item pure-menu-selected">
|
<li class="pure-menu-item pure-menu-selected">
|
||||||
<a class="pure-menu-link" href="/channel/<%= channel.ucid %>/community">
|
<a class="pure-menu-link" href="/channel/<%= channel.ucid %>/community">
|
||||||
<b> <%= translate(locale, "Community") %> </b>
|
<b> <%= translate(locale, "Community") %> </b>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<% else %>
|
<% else %>
|
||||||
<li class="pure-menu-item">
|
<li class="pure-menu-item">
|
||||||
<a class="pure-menu-link" href="/channel/<%= channel.ucid %>/community">
|
<a class="pure-menu-link" href="/channel/<%= channel.ucid %>/community">
|
||||||
<%= translate(locale, "Community") %>
|
<%= translate(locale, "Community") %>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
<% if content_type == 4 %>
|
||||||
|
<li class="pure-menu-item pure-menu-selected">
|
||||||
|
<a class="pure-menu-link" href="/channel/<%= channel.ucid %>/about">
|
||||||
|
<b> <%= translate(locale, "About") %> </b>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<% else %>
|
||||||
|
<li class="pure-menu-item">
|
||||||
|
<a class="pure-menu-link" href="/channel/<%= channel.ucid %>/about">
|
||||||
|
<%= translate(locale, "About") %>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<% if !channel.auto_generated %>
|
<% if !channel.auto_generated %>
|
||||||
|
|
Loading…
Add table
Reference in a new issue