Skip to content

Commit

Permalink
Add build status icon key to project pages
Browse files Browse the repository at this point in the history
  • Loading branch information
bennuttall committed Jul 17, 2021
1 parent 0cd6e72 commit bcb3524
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 5 deletions.
2 changes: 2 additions & 0 deletions piwheels/master/static/project.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,12 @@ const toggleFiles = (btn, filesTableId) => {
const filesTable = document.getElementById(filesTableId);
filesTable.classList.remove('hidden');
btn.innerHTML = '-';
btn.title = 'Hide files';
} else {
const filesTable = document.getElementById(filesTableId);
filesTable.classList.add('hidden');
btn.innerHTML = '+';
btn.title = 'Show files';
}
};

Expand Down
23 changes: 19 additions & 4 deletions piwheels/master/static/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -224,10 +224,8 @@ th.center, td.center {
text-align: center;
}

.buildpassed, .buildfailed {
text-align: center;
line-height: 20px;
font-size: 40px;
.buildpassed, .buildfailed, .buildskipped {
min-width: 42px;
}

.buildpassed {
Expand Down Expand Up @@ -263,6 +261,23 @@ tr table#versions td.version {
font-weight: bold;
}

table#builds-key {
width: 200px;
float: right;
}

table#builds-key th {
background: #f1f1f1;
}

table#builds-key tr:nth-child(2n) {
background: transparent;
}

table#builds-key {
background: transparent;
}

tr table.files {
margin-bottom: 0;
}
Expand Down
10 changes: 9 additions & 1 deletion piwheels/master/templates/project.pt
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ sudo pip3 install ${project}</pre>
<div class="row">
<div class="small-12 columns">
<h3>Releases</h3>

<table id="versions" tal:condition="releases">
<tr>
<th>Version</th>
Expand All @@ -78,7 +79,7 @@ sudo pip3 install ${project}</pre>
<td class="${row.abis['cp35m'].css_class if 'cp35m' in row.abis else ''}" title="${row.abis['cp35m'].title if 'cp35m' in row.abis else ''}"></td>
<td class="${row.abis['cp37m'].css_class if 'cp37m' in row.abis else ''}" title="${row.abis['cp37m'].title if 'cp37m' in row.abis else ''}"></td>
<td class="${row.abis['cp39'].css_class if 'cp39' in row.abis else ''}" title="${row.abis['cp39'].title if 'cp39' in row.abis else ''}"></td>
<td class="center"><a class="button small" onclick="toggleFiles(this, 'files-${repeat.row.number}')" tal:condition="len(row.files) > 0">+</a></td>
<td class="center"><a class="button small" onclick="toggleFiles(this, 'files-${repeat.row.number}')" tal:condition="len(row.files) > 0" title="Show files">+</a></td>
</tr>
<tr id="files-${repeat.row.number}" class="hidden">
<td colspan="8">
Expand All @@ -101,6 +102,13 @@ sudo pip3 install ${project}</pre>
<table tal:condition="not:releases" class="empty">
<tr><th>No releases</th></tr>
</table>

<table id="builds-key">
<tr><th colspan="2">Key</th></tr>
<tr><td class="buildpassed"></td><td>Build succeeded</td></tr>
<tr><td class="buildfailed"></td><td>Build failed</td></tr>
<tr><td class="buildskipped"></td><td>Build skipped</td></tr>
</table>
</div>
</div>

Expand Down

0 comments on commit bcb3524

Please sign in to comment.