Add contributors plugin (#126)
This commit is contained in:
@@ -7,5 +7,6 @@
|
||||
"stargazers",
|
||||
"people",
|
||||
"activity",
|
||||
"contributors",
|
||||
"licenses"
|
||||
]
|
||||
30
source/templates/repository/partials/contributors.ejs
Normal file
30
source/templates/repository/partials/contributors.ejs
Normal file
@@ -0,0 +1,30 @@
|
||||
<% if (plugins.contributors) { %>
|
||||
<section>
|
||||
<h2 class="field">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M4.25 2.5c-1.336 0-2.75 1.164-2.75 3 0 2.15 1.58 4.144 3.365 5.682A20.565 20.565 0 008 13.393a20.561 20.561 0 003.135-2.211C12.92 9.644 14.5 7.65 14.5 5.5c0-1.836-1.414-3-2.75-3-1.373 0-2.609.986-3.029 2.456a.75.75 0 01-1.442 0C6.859 3.486 5.623 2.5 4.25 2.5zM8 14.25l-.345.666-.002-.001-.006-.003-.018-.01a7.643 7.643 0 01-.31-.17 22.075 22.075 0 01-3.434-2.414C2.045 10.731 0 8.35 0 5.5 0 2.836 2.086 1 4.25 1 5.797 1 7.153 1.802 8 3.02 8.847 1.802 10.203 1 11.75 1 13.914 1 16 2.836 16 5.5c0 2.85-2.045 5.231-3.885 6.818a22.08 22.08 0 01-3.744 2.584l-.018.01-.006.003h-.002L8 14.25zm0 0l.345.666a.752.752 0 01-.69 0L8 14.25z"></path></svg>
|
||||
Contributors
|
||||
<% if (plugins.contributors.base || plugins.contributors.ref?.base?.abbreviatedOid) { %>
|
||||
from <%= plugins.contributors.base || plugins.contributors.ref?.base?.abbreviatedOid %> to <%= plugins.contributors.head || plugins.contributors.ref?.head?.abbreviatedOid %>
|
||||
<% } else if (plugins.contributors.head || plugins.contributors.ref?.head?.abbreviatedOid) { %>
|
||||
of <%= plugins.contributors.head || plugins.contributors.ref?.head?.abbreviatedOid %>
|
||||
<% } %>
|
||||
</h2>
|
||||
<section>
|
||||
<div class="contributors fill-width">
|
||||
<% if (plugins.contributors.error) { %>
|
||||
<div class="field error">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M2.343 13.657A8 8 0 1113.657 2.343 8 8 0 012.343 13.657zM6.03 4.97a.75.75 0 00-1.06 1.06L6.94 8 4.97 9.97a.75.75 0 101.06 1.06L8 9.06l1.97 1.97a.75.75 0 101.06-1.06L9.06 8l1.97-1.97a.75.75 0 10-1.06-1.06L8 6.94 6.03 4.97z"></path></svg>
|
||||
<%= plugins.contributors.error.message %>
|
||||
</div>
|
||||
<% } else { %>
|
||||
<% for (const [login, {avatar}] of Object.entries(plugins.contributors.list)) { %>
|
||||
<div class="label">
|
||||
<img class="avatar" src="data:image/png;base64,<%= avatar %>" width="22" height="22" alt="" />
|
||||
<%= login %>
|
||||
</div>
|
||||
<% } %>
|
||||
<% } %>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
<% } %>
|
||||
Reference in New Issue
Block a user