<% content_for "header" do %>
<title><%= channel.author %> - Invidious</title>
<link rel="stylesheet" href="/css/channel.css?v=<%= ASSET_COMMIT %>">
<% 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>

    <div class="pure-u-1 pure-u-md-2-3" id="external-links">
        <div class="h-box">
            <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>
                </div>
            <% end %>
        </div>
    </div>
</div>
