From a202469d99cc2c5524fe59e7f98a83b0348029b7 Mon Sep 17 00:00:00 2001 From: lowlighter <22963968+lowlighter@users.noreply.github.com> Date: Tue, 9 Feb 2021 18:50:57 +0100 Subject: [PATCH] Add support for languages details for repository template --- .../repository/partials/languages.ejs | 42 +++++++++++++++---- 1 file changed, 33 insertions(+), 9 deletions(-) diff --git a/source/templates/repository/partials/languages.ejs b/source/templates/repository/partials/languages.ejs index 244d41f1..742d21d2 100644 --- a/source/templates/repository/partials/languages.ejs +++ b/source/templates/repository/partials/languages.ejs @@ -1,6 +1,9 @@ <% if (plugins.languages) { %>
-

Most used languages

+

+ + Most used languages +

<% if (plugins.languages.error) { %>
@@ -18,14 +21,35 @@ <% } %> -
- <% for (const {name, value, color} of plugins.languages.favorites) { %> -
- - <%= name %> -
- <% } %> -
+ <% if (plugins.languages.details?.length) { %> +
+ <% for (const row of [0, 1]) { %> +
+ <% for (const {name, value, color, size} of plugins.languages.favorites.filter((_, i) => i%2 === row)) { %> +
+
+ + <%= name %> +
+ + <% if (plugins.languages.details.includes("bytes-size")) { %>
<%= f.bytes(size) %>
<% } %> + <% if (plugins.languages.details.includes("percentage")) { %>
<%= f.percentage(value) %>
<% } %> +
+
+ <% } %> +
+ <% } %> +
+ <% } else { %> +
+ <% for (const {name, value, color} of plugins.languages.favorites) { %> +
+ + <%= name %> +
+ <% } %> +
+ <% } %> <% } %>
<% } %> \ No newline at end of file