Add config_display option to support regular and large renders (#310)
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
</section>
|
||||
<% } else { %>
|
||||
<div class="row">
|
||||
<section>
|
||||
<section class="largeable-column-fields">
|
||||
<div class="field">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"><path d="M2.75 1.5a.25.25 0 00-.25.25v11.5c0 .138.112.25.25.25h3.5a.75.75 0 010 1.5h-3.5A1.75 1.75 0 011 13.25V1.75C1 .784 1.784 0 2.75 0h8a1.75 1.75 0 011.508.862.75.75 0 11-1.289.768.25.25 0 00-.219-.13h-8z"></path><path fill-rule="evenodd" d="M8 7a4 4 0 116.49 3.13l.995 4.973a.75.75 0 01-.991.852l-2.409-.876a.25.25 0 00-.17 0l-2.409.876a.75.75 0 01-.991-.852l.994-4.973A3.993 3.993 0 018 7zm4-2.5a2.5 2.5 0 100 5 2.5 2.5 0 000-5zm0 6.5a4 4 0 001.104-.154l.649 3.243-1.155-.42c-.386-.14-.81-.14-1.196 0l-1.155.42.649-3.243A4 4 0 0012 11z"></path></svg>
|
||||
<%= plugins.licenses.default?.spdxId ?? "No license provided" %>
|
||||
@@ -23,7 +23,7 @@
|
||||
<%= plugins.licenses.dependencies.length %> dependenc<%= s(plugins.licenses.dependencies.length, "y") %>
|
||||
</div>
|
||||
</section>
|
||||
<section>
|
||||
<section class="largeable-column-fields">
|
||||
<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="M9.585.52a2.678 2.678 0 00-3.17 0l-.928.68a1.178 1.178 0 01-.518.215L3.83 1.59a2.678 2.678 0 00-2.24 2.24l-.175 1.14a1.178 1.178 0 01-.215.518l-.68.928a2.678 2.678 0 000 3.17l.68.928c.113.153.186.33.215.518l.175 1.138a2.678 2.678 0 002.24 2.24l1.138.175c.187.029.365.102.518.215l.928.68a2.678 2.678 0 003.17 0l.928-.68a1.17 1.17 0 01.518-.215l1.138-.175a2.678 2.678 0 002.241-2.241l.175-1.138c.029-.187.102-.365.215-.518l.68-.928a2.678 2.678 0 000-3.17l-.68-.928a1.179 1.179 0 01-.215-.518L14.41 3.83a2.678 2.678 0 00-2.24-2.24l-1.138-.175a1.179 1.179 0 01-.518-.215L9.585.52zM7.303 1.728c.415-.305.98-.305 1.394 0l.928.68c.348.256.752.423 1.18.489l1.136.174c.51.078.909.478.987.987l.174 1.137c.066.427.233.831.489 1.18l.68.927c.305.415.305.98 0 1.394l-.68.928a2.678 2.678 0 00-.489 1.18l-.174 1.136a1.178 1.178 0 01-.987.987l-1.137.174a2.678 2.678 0 00-1.18.489l-.927.68c-.415.305-.98.305-1.394 0l-.928-.68a2.678 2.678 0 00-1.18-.489l-1.136-.174a1.178 1.178 0 01-.987-.987l-.174-1.137a2.678 2.678 0 00-.489-1.18l-.68-.927a1.178 1.178 0 010-1.394l.68-.928c.256-.348.423-.752.489-1.18l.174-1.136c.078-.51.478-.909.987-.987l1.137-.174a2.678 2.678 0 001.18-.489l.927-.68zM11.28 6.78a.75.75 0 00-1.06-1.06L7 8.94 5.78 7.72a.75.75 0 00-1.06 1.06l1.75 1.75a.75.75 0 001.06 0l3.75-3.75z"></path></svg>
|
||||
<%= plugins.licenses.known %> known license<%= s(plugins.licenses.known) %> used
|
||||
@@ -34,23 +34,23 @@
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
<% if (plugins.licenses.ratio) { %>
|
||||
<% if (plugins.licenses.ratio) { const width = 460 * (1 + large), rows = large ? [0, 1, 2, 3] : [0, 1] %> %>
|
||||
<div class="licenses-details">
|
||||
<section class="column">
|
||||
<svg class="bar" xmlns="http://www.w3.org/2000/svg" width="460" height="8">
|
||||
<svg class="bar" xmlns="http://www.w3.org/2000/svg" width="<%= width %>" height="8">
|
||||
<mask id="licenses-bar">
|
||||
<rect x="0" y="0" width="460" height="8" fill="white" rx="5"/>
|
||||
<rect x="0" y="0" width="<%= width %>" height="8" fill="white" rx="5"/>
|
||||
</mask>
|
||||
<rect mask="url(#licenses-bar)" x="0" y="0" width="<%= plugins.licenses.list.length ? 0 : 460 %>" height="8" fill="#d1d5da"/>
|
||||
<rect mask="url(#licenses-bar)" x="0" y="0" width="<%= plugins.licenses.list.length ? 0 : width %>" height="8" fill="#d1d5da"/>
|
||||
<% for (const {name, value, color, x} of plugins.licenses.list) { %>
|
||||
<rect mask="url(#licenses-bar)" x="<%= x*460 %>" y="0" width="<%= value*460 %>" height="8" fill="<%= color %>"/>
|
||||
<rect mask="url(#licenses-bar)" x="<%= x*width %>" y="0" width="<%= value*width %>" height="8" fill="<%= color %>"/>
|
||||
<% } %>
|
||||
</svg>
|
||||
</section>
|
||||
<div class="row fill-width">
|
||||
<% for (const row of [0, 1]) { %>
|
||||
<% for (const row of rows) { %>
|
||||
<section>
|
||||
<% for (const {name, value, color, count} of plugins.licenses.list.filter((_, i) => i%2 === row)) { %>
|
||||
<% for (const {name, value, color, count} of plugins.licenses.list.filter((_, i) => i%rows.length === row)) { %>
|
||||
<div class="field license details">
|
||||
<div class="field">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"><path fill="<%= color %>" fill-rule="evenodd" d="M8 4a4 4 0 100 8 4 4 0 000-8z"></path></svg>
|
||||
|
||||
Reference in New Issue
Block a user