mirror of
https://github.com/TrentSPalmer/hugo_themes_report.git
synced 2024-12-04 16:41:31 -08:00
add description text
This commit is contained in:
parent
eec9cd95af
commit
afbe353ca9
@ -25,10 +25,13 @@
|
||||
</div>
|
||||
<div id="selection-menu" style="margin-bottom: 1rem;">
|
||||
</div>
|
||||
<div id="description">
|
||||
</div>
|
||||
<div id="results">
|
||||
</div>
|
||||
<script>
|
||||
var themes = {{ themes }};
|
||||
{% include 'js/buildDescription.js' %}
|
||||
{% include 'js/buildButton.js' %}
|
||||
{% include 'js/buildSelectionInputs.js' %}
|
||||
{% include 'js/getAvailableTagsAndFeaturesAndLicenses.js' %}
|
||||
|
48
templates/js/buildDescription.js
Normal file
48
templates/js/buildDescription.js
Normal file
@ -0,0 +1,48 @@
|
||||
function buildDescription(
|
||||
selectedColumns,
|
||||
sortBy,
|
||||
selectedMinVer,
|
||||
selectedLicenses,
|
||||
selectedTags,
|
||||
selectedFeatures
|
||||
) {
|
||||
let d = document.getElementById("description");
|
||||
d.style.fontSize = ".9rem";
|
||||
d.style.color = "gray";
|
||||
d.style.fontStyle = "italic";
|
||||
d.style.textAlign = "left";
|
||||
let sCols = selectedColumns.map((x) => {
|
||||
if (x === "cname") {
|
||||
return "theme";
|
||||
} else if (x === "num_stars") {
|
||||
return "stars";
|
||||
} else if (x === "min_ver") {
|
||||
return "minVer";
|
||||
} else {
|
||||
return x;
|
||||
}
|
||||
});
|
||||
let showingColumns = `<span style="color: blue;font-weight: bold">ShowingColumns:</span> ${sCols}; `;
|
||||
let sortedBy = `<span style="color: blue;font-weight: bold">SortedBy:</span> ${sortBy}; `;
|
||||
let sMinVer = `<span style="color: green;font-weight: bold">MinHugoVersion</span>=${
|
||||
selectedMinVer.length === 0 ? "none" : selectedMinVer
|
||||
}; `;
|
||||
let sLicences = `<span style="color: green;font-weight: bold">Licenses</span>=${
|
||||
selectedLicenses.length === 0 ? "none" : selectedLicenses
|
||||
}; `;
|
||||
let sTags = `<span style="color: green;font-weight: bold">Tags</span>=${
|
||||
selectedTags.length === 0 ? "none" : selectedTags
|
||||
}; `;
|
||||
let sFeatures = `<span style="color: green;font-weight: bold">Features</span>=${
|
||||
selectedFeatures.length === 0 ? "none" : selectedFeatures
|
||||
}`;
|
||||
let innerHTML =
|
||||
showingColumns +
|
||||
sortedBy +
|
||||
" <span style='color: blue;font-weight: bold'>FilteredBy:</span> " +
|
||||
sMinVer +
|
||||
sLicences +
|
||||
sTags +
|
||||
sFeatures;
|
||||
d.innerHTML = innerHTML.replace(/[,]/g, ", ");
|
||||
}
|
@ -163,6 +163,15 @@ function buildResults() {
|
||||
selectedMinVer,
|
||||
getDiplayState()
|
||||
);
|
||||
|
||||
buildDescription(
|
||||
selectedColumns,
|
||||
sortedBy,
|
||||
selectedMinVer,
|
||||
selectedLicenses,
|
||||
selectedTags,
|
||||
selectedFeatures
|
||||
);
|
||||
}
|
||||
|
||||
buildResults();
|
||||
|
Loading…
Reference in New Issue
Block a user