mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2022-04-11.git
synced 2024-08-15 00:43:26 +00:00
parent
2ed4a24dbc
commit
0a2d910668
5 changed files with 80 additions and 18 deletions
|
@ -385,6 +385,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",
|
||||||
|
@ -433,5 +434,9 @@
|
||||||
"footer_source_code": "Source code",
|
"footer_source_code": "Source code",
|
||||||
"footer_original_source_code": "Original source code",
|
"footer_original_source_code": "Original source code",
|
||||||
"footer_modfied_source_code": "Modified Source code",
|
"footer_modfied_source_code": "Modified Source code",
|
||||||
"adminprefs_modified_source_code_url_label": "URL to modified source code repository"
|
"adminprefs_modified_source_code_url_label": "URL to modified source code repository",
|
||||||
|
"channel_about_page_details_section_header": "Details",
|
||||||
|
"channel_about_page_stats_section_header": "Stats",
|
||||||
|
"channel_about_page_stats_joined_label": "Joined",
|
||||||
|
"channel_about_page_links_section_header": "Links"
|
||||||
}
|
}
|
||||||
|
|
|
@ -98,7 +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"]
|
||||||
|
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
|
end
|
||||||
|
|
||||||
# Redirects brand url channels to a normal /channel/:ucid route
|
# Redirects brand url channels to a normal /channel/:ucid route
|
||||||
|
|
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, "channel_about_page_details_section_header") %> </h3>
|
||||||
|
<p>Country: <%=channel.country%></p> <!-- Translate Country Names -->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="pure-u-1-4">
|
||||||
|
<div class="h-box">
|
||||||
|
<h3> <%= translate(locale, "channel_about_page_stats_section_header") %> </h3>
|
||||||
|
<p> <%= translate(locale, "channel_about_page_stats_joined_label") %>
|
||||||
|
<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, "channel_about_page_links_section_header") %> </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" %>
|
||||||
|
|
||||||
|
|
|
@ -92,6 +92,20 @@
|
||||||
<% end %>
|
<% 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 %>
|
||||||
|
|
||||||
<% if !channel.auto_generated %>
|
<% if !channel.auto_generated %>
|
||||||
<li class="pure-menu-item navbar" style="margin: 0 0 0 0.5em">
|
<li class="pure-menu-item navbar" style="margin: 0 0 0 0.5em">
|
||||||
<div class="searchbar">
|
<div class="searchbar">
|
||||||
|
|
Loading…
Reference in a new issue