Enhance chan about page to show channel description

This commit is contained in:
syeopite 2021-06-25 20:28:25 -07:00
parent 6fce4351f4
commit 741b1992b8
No known key found for this signature in database
GPG key ID: 6FA616E5A5294A82
12 changed files with 54 additions and 27 deletions

View file

@ -1,46 +1,50 @@
<% content_for "header" do %>
<title><%= channel.author %> - Invidious</title>
<link rel="stylesheet" href="/css/channel.css?v=<%= ASSET_COMMIT %>">
<!-- Channel description on the header should always be hidden on the about page -->
<style>
#channel-description-container {
display: none
}
</style>
<% end %>
<% content_type = 5 %>
<% sort_options = Tuple.new %>
<%= rendered "components/channel-information" %>
<div class="pure-g">
<% stats_style_append = ""%>
<% if !channel.country.empty? %>
<div class="pure-u-1 pure-u-md-3-4">
<div class="h-box">
<h3> <%= translate(locale, "Details") %> </h3>
<p><%= translate(locale, "Country: ") %><%=channel.country%></p> <!-- Translate Country Names -->
</div>
</div>
<% else %>
<% stats_style_append = "style=\"order: 1;\"" %>
<% end %>
<div class="pure-u-1 pure-u-md-1-4" <%= stats_style_append %>>
<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 class="pure-g h-box" id="about-content-container">
<div class="pure-u-1 pure-u-md-3-4">
<h3> <%= translate(locale, "Description") %> </h3>
<p id="channel-description" class="pure-u-md-22-24" style="margin: 0"><span style="white-space:pre-wrap"><%= channel.description_html %></span></p>
</div>
<div class="pure-u-1 pure-u-md-2-3" id="external-links">
<div class="h-box">
<div class="pure-u-1 pure-u-md-1-4">
<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 class="pure-u-1 pure-u-md-3-4">
<h3> <%= translate(locale, "Details") %> </h3>
<p><%= translate(locale, "Country: ") %><%=channel.country%></p> <!-- Translate Country Names -->
</div>
<% if !channel.links.empty? %>
<div class="pure-u-1 pure-u-md-2-3" id="external-links">
<h3> <%= translate(locale, "Links") %> </h3>
<% channel.links.each do |link_tuple| %>
<div class="pure-u-11-24" style="margin-bottom: 2em;">
<img src="/fetch_link_favicon?url=<%=link_tuple[2]%>">
<a href="<%=link_tuple[1]%>"><%=link_tuple[0]%></a>
<a href="<%=link_tuple[1]%>"><%=HTML.escape(link_tuple[0])%></a>
</div>
<% end %>
</div>
</div>
<% end %>
</div>