Add notable contributions plugin (#222)

This commit is contained in:
Simon Lecoq
2021-04-09 20:51:45 +02:00
committed by GitHub
parent e63dee0c6e
commit 19bb1b3766
15 changed files with 218 additions and 4 deletions

View File

@@ -5,6 +5,7 @@
"base.repositories",
"followup",
"languages",
"notable",
"projects",
"gists",
"pagespeed",

View File

@@ -0,0 +1,27 @@
<% if (plugins.notable) { %>
<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="M1 2.5A2.5 2.5 0 013.5 0h8.75a.75.75 0 01.75.75v3.5a.75.75 0 01-1.5 0V1.5h-8a1 1 0 00-1 1v6.708A2.492 2.492 0 013.5 9h3.25a.75.75 0 010 1.5H3.5a1 1 0 100 2h5.75a.75.75 0 010 1.5H3.5A2.5 2.5 0 011 11.5v-9zm13.23 7.79a.75.75 0 001.06-1.06l-2.505-2.505a.75.75 0 00-1.06 0L9.22 9.229a.75.75 0 001.06 1.061l1.225-1.224v6.184a.75.75 0 001.5 0V9.066l1.224 1.224z"></path></svg>
Notable contributions
</h2>
<% if (plugins.notable.error) { %>
<div class="row">
<section>
<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.notable.error.message %>
</div>
</section>
</div>
<% } else { %>
<div class="row organization contributions">
<% for (const {name, avatar} of plugins.notable.contributions) { %>
<div class="organization contribution">
<img class="organization avatar" src="<%= avatar %>" width="16" height="16" />
<span class="organization name">@<%= name %></span>
</div>
<% } %>
</div>
<% } %>
</section>
<% } %>

View File

@@ -92,10 +92,34 @@
margin: 0 6px;
}
.avatar.organization {
.organization.avatar {
border-radius: 15%;
}
.organization.name {
white-space: nowrap;
}
.organization.contributions {
margin: 0 8px;
flex-wrap: wrap;
}
.contribution.organization {
display: flex;
border: 1px solid #959da5;
border-radius: 6px;
padding: 2px 6px;
padding-left: 0;
margin: 2px;
font-size: 12px;
background-color: #959da520;
}
.contribution.organization .avatar {
margin: 0 4px;
}
/* Commit calendar */
.calendar.field {
margin: 4px 0;