Skip to content

Commit

Permalink
Update list to include SS4 modules and modules contained in CWP 2.0 r…
Browse files Browse the repository at this point in the history
…ecipes

Also introduce two new boolean attributes, scrutinizer and addons, to aid in displaying the table of modules. Deleted uncommented code. Link to addons page, rather than GitHub. Update links of repos that moved from GitLab to GitHub. Update references to silverstripe-australia, since renaming to symbiote. Retrieve badges directly from Scrutinizer where possible and display custom shield badge, where not possible.
  • Loading branch information
raissanorth committed Jun 11, 2018
1 parent 17a9984 commit 01bfc0b
Show file tree
Hide file tree
Showing 3 changed files with 650 additions and 106 deletions.
6 changes: 2 additions & 4 deletions main.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,8 @@ a {

table {
border-collapse: collapse;
}

th {
font-weight: normal;
width: 100%;
cellpadding: 1;
}

th, td {
Expand Down
81 changes: 29 additions & 52 deletions main.js
Original file line number Diff line number Diff line change
@@ -1,39 +1,3 @@
/*
<?php foreach ($modules as $module): ?>
<tr>
<td>
<?php if ($module["github"]): ?>
<a href="https://github.com/<?php echo $module["github"]; ?>"><?php echo $module["composer"]; ?></a>
<?php elseif ($module["gitlab"]): ?>
<a href="https://gitlab.cwp.govt.nz/<?php echo $module["gitlab"]; ?>"><?php echo $module["composer"]; ?></a>
<?php else: ?>
<?php echo $module["composer"]; ?>
<?php endif; ?>
</td>
<td><?php echo $module["type"]; ?></td>
<?php if ($module["github"]): ?>
<td class="progress first">
<a href="https://travis-ci.org/<?php echo $module["github"]; ?>">
<img src="http://img.shields.io/travis/<?php echo $module["github"]; ?>.svg?style=flat-square" />
</a>
</td>
<td class="progress">
<img src="http://img.shields.io/scrutinizer/coverage/g/<?php echo $module["github"]; ?>.svg?style=flat-square" />
</td>
<td class="progress last">
<a href="https://scrutinizer-ci.com/g/<?php echo $module["github"]; ?>">
<img src="http://img.shields.io/scrutinizer/g/<?php echo $module["github"]; ?>.svg?style=flat-square" />
</a>
</td>
<?php else: ?>
<td colspan="3">
Gitlab
</td>
<?php endif; ?>
</tr>
<?php endforeach; ?>
*/

$.ajax({
"url": "modules.json",
"dataType": "json"
Expand All @@ -43,25 +7,38 @@ $.ajax({
modules.forEach(function(module) {
var row = "<tr>";

if (module.github) {
row += "<td><a href='https://github.com/" + module.github + "'>" + module.composer + "</a></td>";
} else if (module.gitlab) {
row += "<td><a href='https://gitlab.cwp.govt.nz/" + module.gitlab + "'>" + module.composer + "</a></td>";
if (module.addons) {
row += "<td><a href='https://addons.silverstripe.org/add-ons/" + module.composer + "'>" + module.composer + "</a></td>";
}
else {
if (module.github) {
row += "<td><a href='https://github.com/" + module.github + "'>" + module.composer + "</a></td>";
} else if (module.gitlab) {
row += "<td><a href='https://gitlab.cwp.govt.nz/" + module.gitlab + "'>" + module.composer + "</a></td>";
} else {
row += "<td>" + module.composer + "</td>";
}
}

if(module.type === "supported-module") {
row += "<td>" + "Supported module" + "</td>";
} else {
row += "<td>" + module.composer + "</td>";
row += "<td>" + "Supported dependency" + "</td>";
}

row += "<td>" + module.type + "</td>";

if (module.github) {
row += "<td class='progress first'><a href='https://travis-ci.org/" + module.github + "'><img src='http://img.shields.io/travis/" + module.github + ".svg?style=flat-square' /></a></td>";
row += "<td class='progress'><img src='http://img.shields.io/scrutinizer/coverage/g/" + module.github + ".svg?style=flat-square' /></td>";
row += "<td class='progress last'><a href='https://scrutinizer-ci.com/g/" + module.github + "'><img src='http://img.shields.io/scrutinizer/g/" + module.github + ".svg?style=flat-square' /></a></td>";
} else if (module.gitlab) {
row += "<td colspan='3'>Module on Gitlab</td>";
} else {
row += "<td colspan='3'>Module definition incomplete</td>";
}
if (module.github) {
row += "<td class='progress first'><a href='https://travis-ci.org/" + module.github + "'><img src='https://api.travis-ci.org/" + module.github + ".svg' /></a></td>";
row += "<td class='progress'><a href='https://codecov.io/gh/" + module.github + "'><img title='' src='https://codecov.io/gh/" + module.github + "/branch/master/graph/badge.svg' alt=''/></a></td>";
if (module.scrutinizer) {
row += "<td class='progress last'><a href='https://scrutinizer-ci.com/g/" + module.github + "'><img src='https://scrutinizer-ci.com/g/" + module.github + "/badges/quality-score.png'/></a></td>";
} else {
row += "<td class='progress last'><img src='https://img.shields.io/badge/Scrutinizer-n%2Fa-lightgrey.svg'/></td>";
}
} else if (module.gitlab) {
row += "<td colspan='3'>Module on Gitlab</td>";
} else {
row += "<td colspan='3'>Module definition incomplete</td>";
}

row += "</tr>";

Expand Down
Loading

0 comments on commit 01bfc0b

Please sign in to comment.