fix: zobrazování tlačítek na okomentování

This commit is contained in:
Jonas Havelka 2025-02-11 14:57:20 +01:00
parent 82a1efc965
commit befb013e58
2 changed files with 7 additions and 7 deletions

View file

@ -27,25 +27,25 @@ img{background:white;}
--rgb: 255, 0, 0;
[value="k_oprave"] { display: none }
[value="notcomment"] { display: none }
.komentovat_disabled { display: none }
}
[data-opravastatus="opraveno"] {
--rgb: 0, 0, 255;
[value="opraveno"] { display: none }
[value="comment"] { display: none }
.komentovat { display: none }
}
[data-opravastatus="neni_chyba"] {
--rgb: 128, 128, 128;
[value="neni_chyba"] { display: none }
[value="comment"] { display: none }
.komentovat { display: none }
}
[data-opravastatus="k_zaneseni"] {
--rgb: 0, 255, 0;
[value="k_zaneseni"] { display: none }
[value="notcomment"] { display: none }
.komentovat { display: none }
}
/* Skrývání korektur */

View file

@ -37,10 +37,10 @@
<a href='{% url "admin:korektury_oprava_change" -1 %}' class='edit' title='Uprav korekturu jako takovou.' style="text-decoration: none;"> {# FIXME Udělat z toho tlačítko? #}
<img src='{% static "korektury/imgs/edit.png"%}' alt='✏️' style="opacity: 0.5;"/> {# FIXME Odlišit jinak než pomocí opacity? #}
</a>
<button type='button' class='notcomment' title='Korekturu nelze komentovat, protože už je uzavřená' disabled=''>
<button type='button' class='komentovat_disabled' title='Korekturu nelze komentovat, protože už je uzavřená' disabled=''>
<img src='{% static "korektury/imgs/comment-gr.png" %}' alt='💭'/>
</button>
<button type='button' class='comment' title='Komentovat'>
<button type='button' class='komentovat' title='Komentovat'>
<img src='{% static "korektury/imgs/comment.png" %}' alt='💭'/>
</button>
</span>
@ -87,7 +87,7 @@
this.htmlElement.getElementsByClassName('toggle-vis')[0].addEventListener('click', _ => this.#toggle_visibility());
for (const button of this.htmlElement.getElementsByClassName('action'))
button.addEventListener('click', async event => this.#zmenStavKorektury(event));
this.htmlElement.getElementsByClassName('comment')[0].addEventListener('click', _ => this.#comment())
this.htmlElement.getElementsByClassName('komentovat')[0].addEventListener('click', _ => this.#comment())
this.htmlElement.getElementsByClassName('del')[0].addEventListener('click', _ => this.#delete());
const odkaz_editace = this.htmlElement.getElementsByClassName('edit')[0];
odkaz_editace.href = odkaz_editace.href.replace("-1", this.id);