Skip to content

Commit

Permalink
create resources.js
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnRDOrazio committed Jul 2, 2024
1 parent 0546699 commit 414aa8a
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 5 deletions.
33 changes: 33 additions & 0 deletions assets/js/resources.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
const resourcePaths = [
'/calendars',
'/missals',
'/decrees',
'/events',
'/easter',
'/tests',
'/data'
];

const resourceTemplate = (resource, rowIdx) => `<div class="col-1 ${rowIdx === 0 || rowIdx % 11 === 0 ? 'offset-1' : ''}">
<p class="text-center mb-0 bg-secondary text-white"><span title="LitCalMetadata.json">LitCalMetadata.json</span></p>
<div class="card text-white bg-info rounded-0 LitCalMetadata file-exists">
<div class="card-body">
<p class="card-text d-flex justify-content-between"><span><svg class="svg-inline--fa fa-circle-question fa-fw" aria-hidden="true" focusable="false" data-prefix="fas" data-icon="circle-question" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" data-fa-i2svg=""><path fill="currentColor" d="M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM169.8 165.3c7.9-22.3 29.1-37.3 52.8-37.3h58.3c34.9 0 63.1 28.3 63.1 63.1c0 22.6-12.1 43.5-31.7 54.8L280 264.4c-.2 13-10.9 23.6-24 23.6c-13.3 0-24-10.7-24-24V250.5c0-8.6 4.6-16.5 12.1-20.8l44.3-25.4c4.7-2.7 7.6-7.7 7.6-13.1c0-8.4-6.8-15.1-15.1-15.1H222.6c-3.4 0-6.4 2.1-7.5 5.3l-.4 1.2c-4.4 12.5-18.2 19-30.6 14.6s-19-18.2-14.6-30.6l.4-1.2zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"></path></svg><!-- <i class="fas fa-circle-question fa-fw"></i> Font Awesome fontawesome.com --> data exists</span></p>
</div>
</div>
<div class="card text-white bg-info rounded-0 LitCalMetadata json-valid">
<div class="card-body">
<p class="card-text d-flex justify-content-between"><span><svg class="svg-inline--fa fa-circle-question fa-fw" aria-hidden="true" focusable="false" data-prefix="fas" data-icon="circle-question" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" data-fa-i2svg=""><path fill="currentColor" d="M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM169.8 165.3c7.9-22.3 29.1-37.3 52.8-37.3h58.3c34.9 0 63.1 28.3 63.1 63.1c0 22.6-12.1 43.5-31.7 54.8L280 264.4c-.2 13-10.9 23.6-24 23.6c-13.3 0-24-10.7-24-24V250.5c0-8.6 4.6-16.5 12.1-20.8l44.3-25.4c4.7-2.7 7.6-7.7 7.6-13.1c0-8.4-6.8-15.1-15.1-15.1H222.6c-3.4 0-6.4 2.1-7.5 5.3l-.4 1.2c-4.4 12.5-18.2 19-30.6 14.6s-19-18.2-14.6-30.6l.4-1.2zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"></path></svg><!-- <i class="fas fa-circle-question fa-fw"></i> Font Awesome fontawesome.com --> JSON valid</span></p>
</div>
</div>
<div class="card text-white bg-info rounded-0 LitCalMetadata schema-valid">
<div class="card-body">
<p class="card-text d-flex justify-content-between"><span><svg class="svg-inline--fa fa-circle-question fa-fw" aria-hidden="true" focusable="false" data-prefix="fas" data-icon="circle-question" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" data-fa-i2svg=""><path fill="currentColor" d="M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM169.8 165.3c7.9-22.3 29.1-37.3 52.8-37.3h58.3c34.9 0 63.1 28.3 63.1 63.1c0 22.6-12.1 43.5-31.7 54.8L280 264.4c-.2 13-10.9 23.6-24 23.6c-13.3 0-24-10.7-24-24V250.5c0-8.6 4.6-16.5 12.1-20.8l44.3-25.4c4.7-2.7 7.6-7.7 7.6-13.1c0-8.4-6.8-15.1-15.1-15.1H222.6c-3.4 0-6.4 2.1-7.5 5.3l-.4 1.2c-4.4 12.5-18.2 19-30.6 14.6s-19-18.2-14.6-30.6l.4-1.2zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"></path></svg><!-- <i class="fas fa-circle-question fa-fw"></i> Font Awesome fontawesome.com --> schema valid</span></p>
</div>
</div>
</div>`;

$(document).ready(() => {
let resourcePathHtml = resourcePaths.map((resource,idx) => resourceTemplate).join('');
document.querySelector('#resourcedata-tests').innerHTML(resourcePathHtml);
});
10 changes: 5 additions & 5 deletions resources.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,10 @@ class="btn btn-primary" disabled
</div>
</div>
<div class="accordion-item">
<h2 class="row g-0 accordion-header" id="calendarDataHeader">
<h2 class="row g-0 accordion-header" id="resourceDataHeader">
<button class="accordion-button collapsed" type="button"
data-bs-toggle="collapse" data-bs-target="#calendarDataTests"
aria-expanded="false" aria-controls="calendarDataTests"
data-bs-toggle="collapse" data-bs-target="#resourceDataTests"
aria-expanded="false" aria-controls="resourceDataTests"
>
<div class="col-4">
<i class="fas fa-file-export fa-fw"></i>&nbsp;<?php
Expand All @@ -131,8 +131,8 @@ class="btn btn-primary" disabled
</div>
</button>
</h2>
<div id="calendarDataTests" class="accordion-collapse collapse" aria-labelledby="calendarDataHeader" data-bs-parent="#testSuiteAccordion">
<div class="row g-0 calendardata-tests"></div>
<div id="resourceDataTests" class="accordion-collapse collapse" aria-labelledby="resourceDataHeader" data-bs-parent="#testSuiteAccordion">
<div class="row g-0 resourcedata-tests"></div>
</div>
</div>
</div><!-- end accordion -->
Expand Down

0 comments on commit 414aa8a

Please sign in to comment.