Skip to content

Commit

Permalink
fixing badge generation for checklist
Browse files Browse the repository at this point in the history
Signed-off-by: vsoch <vsoch@users.noreply.github.com>
  • Loading branch information
vsoch committed Oct 25, 2021
1 parent 2e034b2 commit cfcde93
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions docs/tools/software-checklist/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@ button {

# Software Checklist

<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>

<div id="app">

The following checklist is to help to support collaborative development and reproducible software, and the points come by way of the <a href="https://github.com/vsoch/contributor-ci" target="_blank">Contributor Friendliness Assessment</a> of the Contributor CI package. Check the points that apply, enter the name of your repository, and then <span style="color:darkred">click the generate button</span>.
Expand Down Expand Up @@ -78,7 +75,10 @@ The following checklist is to help to support collaborative development and repr

<blockquote class="markdown" style="display:none; overflow:hidden">
</blockquote>
</div>

<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script>
new Vue({
el: '#app',
Expand All @@ -96,6 +96,7 @@ new Vue({
methods: {

getCode: function() {

// Get all of the unique ids
var checked = document.querySelectorAll('input.task-list-item-checkbox[type="checkbox"]:checked')

Expand All @@ -115,13 +116,16 @@ new Vue({
return
}

this.countPoints()
var ids = ""
$.each(checked, function(i, e){
ids = ids + $(e).attr('id') + ",";
})
ids = ids.replace(/(^,)|(,$)/g, "")

// Prepare badge images
console.log(this.colors.length)
console.log(ids)
var badgeColor = this.colors[this.points - 1]
var badgeScore = Math.round(this.score) + "%25"
var badgeUrl = "https://img.shields.io/badge/software%20checklist-" + badgeScore + "-" + badgeColor.replace("#", "");
Expand Down

0 comments on commit cfcde93

Please sign in to comment.