Add config_display option to support regular and large renders (#310)

This commit is contained in:
Simon Lecoq
2021-05-18 22:31:53 +02:00
committed by GitHub
parent 04bf1f0316
commit ed0da41973
36 changed files with 586 additions and 402 deletions

View File

@@ -14,7 +14,7 @@
</div>
<% } else { %>
<div class="row">
<section>
<section class="largeable-column-fields">
<% if (plugins.wakatime.sections.includes("time")) { %>
<div class="field">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M1.643 3.143L.427 1.927A.25.25 0 000 2.104V5.75c0 .138.112.25.25.25h3.646a.25.25 0 00.177-.427L2.715 4.215a6.5 6.5 0 11-1.18 4.458.75.75 0 10-1.493.154 8.001 8.001 0 101.6-5.684zM7.75 4a.75.75 0 01.75.75v2.992l2.028.812a.75.75 0 01-.557 1.392l-2.5-1A.75.75 0 017 8.25v-3.5A.75.75 0 017.75 4z"></path></svg>
@@ -34,7 +34,7 @@
</div>
<% } %>
</section>
<section>
<section class="largeable-column-fields">
<% if (plugins.wakatime.sections.includes("time")) { %>
<div class="field">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M6 2a.75.75 0 01.696.471L10 10.731l1.304-3.26A.75.75 0 0112 7h3.25a.75.75 0 010 1.5h-2.742l-1.812 4.528a.75.75 0 01-1.392 0L6 4.77 4.696 8.03A.75.75 0 014 8.5H.75a.75.75 0 010-1.5h2.742l1.812-4.529A.75.75 0 016 2z"></path></svg>
@@ -56,10 +56,10 @@
</section>
</div>
<% { const sections = plugins.wakatime.sections.filter(x => /-graphs$/.test(x)).map(x => x.replace(/-graphs$/, "")) %>
<% for (let i = 0; i < sections.length; i+=2) { %>
<% { const sections = plugins.wakatime.sections.filter(x => /-graphs$/.test(x)).map(x => x.replace(/-graphs$/, "")), slots = 2 + large %>
<% for (let i = 0; i < sections.length; i+=slots) { %>
<div class="row">
<% for (let j = 0; j < 2; j++) { const key = sections[i+j] ; const section = plugins.wakatime[key] ; if (!key) continue %>
<% for (let j = 0; j < slots; j++) { const key = sections[i+j] ; const section = plugins.wakatime[key] ; if (!key) continue %>
<section class="column chart">
<h3><%= {languages:"Language activity", projects:"Projects activity", editors:"Code editors", os:"Operating systems"}[key] %></h3>
<div class="chart-bars horizontal">