diff --git a/locales/en-US.json b/locales/en-US.json index a1e39777..613a459d 100644 --- a/locales/en-US.json +++ b/locales/en-US.json @@ -384,6 +384,7 @@ "Download": "Download", "Download as: ": "Download as: ", "%A %B %-d, %Y": "%A %B %-d, %Y", + "%B %-d, %Y": "%B %-d, %Y", "(edited)": "(edited)", "YouTube comment permalink": "YouTube comment permalink", "permalink": "permalink", @@ -423,5 +424,9 @@ "Current version: ": "Current version: ", "next_steps_error_message": "After which you should try to: ", "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", } diff --git a/src/invidious/routes/channels.cr b/src/invidious/routes/channels.cr index c11833d2..3930c1fb 100644 --- a/src/invidious/routes/channels.cr +++ b/src/invidious/routes/channels.cr @@ -98,8 +98,18 @@ module Invidious::Routes::Channels end locale, user, subscriptions, continuation, ucid, channel = data - env.redirect "/channel/#{ucid}" - end + 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 # Redirects brand url channels to a normal /channel/:ucid route def self.brand_redirect(env) diff --git a/src/invidious/views/channel_about.ecr b/src/invidious/views/channel_about.ecr new file mode 100644 index 00000000..8272c1ea --- /dev/null +++ b/src/invidious/views/channel_about.ecr @@ -0,0 +1,35 @@ +<% content_type = 4 %> +<% sort_options = Tuple.new %> +<%= rendered "components/channel-information" %> + +
+
+
+

<%= translate(locale, "Details") %>

+

Country: <%=channel.country%>

+
+
+ +
+
+

<%= translate(locale, "Stats") %>

+

<%= translate(locale, "Joined") %> + +

+

<%= channel.total_views ? translate(locale, "`x` views", number_with_separator(channel.total_views || 0)) : "" %>

+
+
+ + +
diff --git a/src/invidious/views/community.ecr b/src/invidious/views/community.ecr index 3288f6b7..7d8fefbe 100644 --- a/src/invidious/views/community.ecr +++ b/src/invidious/views/community.ecr @@ -1,7 +1,4 @@ <% content_type = 2 %> -<% -# Make compiler happy -%> <% sort_options = Tuple.new %> <%= rendered "components/channel-information" %> diff --git a/src/invidious/views/components/channel-information.ecr b/src/invidious/views/components/channel-information.ecr index 8cf49c55..a756a446 100644 --- a/src/invidious/views/components/channel-information.ecr +++ b/src/invidious/views/components/channel-information.ecr @@ -77,19 +77,33 @@ <% end %> <% if channel.tabs.includes? "community" %> - <% if content_type == 2 %> -
  • - - <%= translate(locale, "Community") %> - -
  • - <% else %> -
  • - - <%= translate(locale, "Community") %> - -
  • - <% end %> + <% if content_type == 2 %> +
  • + + <%= translate(locale, "Community") %> + +
  • + <% else %> +
  • + + <%= translate(locale, "Community") %> + +
  • + <% end %> + <% end %> + + <% if content_type == 4 %> +
  • + + <%= translate(locale, "About") %> + +
  • + <% else %> +
  • + + <%= translate(locale, "About") %> + +
  • <% end %> <% if !channel.auto_generated %>