Compare commits

..

3 commits

5 changed files with 18 additions and 10 deletions

View file

@ -1,6 +1,6 @@
from django.contrib import admin
from reversion.admin import VersionAdmin
from korektury.models import KorekturovanePDF
from korektury.models import KorekturovanePDF, Oprava
from django.core.mail import EmailMessage
from django.urls import reverse
@ -62,3 +62,4 @@ Korekturovátko
).send()
admin.site.register(KorekturovanePDF, KorekturovanePDFAdmin)
admin.site.register(Oprava)

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

@ -1,7 +1,7 @@
<div id="commform-div" style="display: none">
<input size="24" name="au" value="{{user.first_name}} {{user.last_name}}" readonly/>
<button id="commform-submit">Oprav!</button>
<button id="commform-close">Zavřít</button>
<button type="button" id="commform-submit">Oprav!</button>
<button type="button" id="commform-close">Zavřít</button>
<br/>
<textarea id="commform-text" cols=40 rows=10 name="txt"></textarea>
<br/>

View file

@ -34,10 +34,13 @@
<img src='{% static "korektury/imgs/tex.png" %}' alt='TeX'/>
</button>
<button type='button' class='notcomment' title='Korekturu nelze komentovat, protože už je uzavřená' disabled=''>
<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='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>
@ -84,8 +87,11 @@
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);
odkaz_editace.onclick = ev => { if (!confirm("Editace korektury je velmi pokročilá featura umožňující přesouvat korekturu nebo přidávat informované orgy, opravdu chceš pokračovat do adminu?")) ev.preventDefault(); };
this.htmlElement.addEventListener('mouseover', _ => this.pointer.dataset.highlight = 'true');
this.htmlElement.addEventListener('mouseout', _ => this.pointer.dataset.highlight = 'false');

View file

@ -45,6 +45,7 @@
}
const img_id = image.id.substring(4);
commform.show(img_id, dx, dy, '');
console.log("Pro přesun korektur: strana = " + img_id + ", x = " + dx + ", y = " + dy);
});
}
</script>