dont show sort form if there is no javascript

This commit is contained in:
slonkazoid 2024-08-02 13:21:09 +03:00
parent 5dcaf85984
commit 2a4bef84b1
Signed by: slonk
SSH key fingerprint: SHA256:tbZfJX4IOvZ0LGWOWu5Ijo8jfMPi78TU7x1VoEeCIjM
2 changed files with 3 additions and 2 deletions

View file

@ -2,6 +2,7 @@ replaceDates();
let form = document.getElementById("sort"); let form = document.getElementById("sort");
if (form) { if (form) {
form.style.display = "block";
let postsByDate = document.getElementById("posts"); let postsByDate = document.getElementById("posts");
let postsByName = document.createElement("div"); let postsByName = document.createElement("div");
populateByName(postsByDate, postsByName); populateByName(postsByDate, postsByName);

View file

@ -32,8 +32,8 @@
there are no posts right now. check back later!<!-- prettier-br --> there are no posts right now. check back later!<!-- prettier-br -->
{% else %}<!-- prettier-br --> {% else %}<!-- prettier-br -->
{% if js %}<!-- prettier-br --> {% if js %}<!-- prettier-br -->
sort by: <form id="sort" style="display: none">
<form id="sort"> sort by: <br />
<input type="radio" name="sort" id="sort-date" value="date" {% if sort == Sort::Date %} checked {% endif %} /> <input type="radio" name="sort" id="sort-date" value="date" {% if sort == Sort::Date %} checked {% endif %} />
<label for="sort-date">date</label> <label for="sort-date">date</label>
<input type="radio" name="sort" id="sort-name" value="name" {% if sort == Sort::Name %} checked {% endif %} /> <input type="radio" name="sort" id="sort-name" value="name" {% if sort == Sort::Name %} checked {% endif %} />