Web M&M
https://mam.matfyz.cz
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
214 lines
8.4 KiB
214 lines
8.4 KiB
{% load staticfiles %}
|
|
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
|
<link rel="stylesheet" type="text/css" media="screen, projection" href="{% static "korektury/opraf.css"%}" />
|
|
<script src="{% static "korektury/opraf.js"%}"></script>
|
|
<title>Korektury {{pdf.nazev}}</title>
|
|
</head>
|
|
<body {% if pdf.status = 'zanaseni'%} class="comitting" {% elif pdf.status = 'zastarale' %} class="deprecated" {% endif %} onload='place_comments()'>
|
|
<h1>Korektury {{pdf.nazev}}</h1>
|
|
{% if pdf.status = 'zanaseni' %} <h2> Probíhá zanášení korektur, zvažte, zda chcete přidávat nové </h2> {% endif %}
|
|
{% if pdf.status = 'zastarale' %} <h2> Toto PDF je již zastaralé, nepřidávejte nové korektury </h2> {% endif %}
|
|
<i>{{pdf.komentar}}</i>
|
|
<br>
|
|
<i>Klikni na chybu, napiš komentář</i> |
|
|
<a href="../">seznam souborů</a> |
|
|
<a href="/admin/korektury/korekturovanepdf/">Spravovat PDF</a> |
|
|
<a href="../help">nápověda</a> |
|
|
|
|
|
<a href="/">hlavní stránka</a> |
|
|
<a href="https://mam.mff.cuni.cz/wiki">wiki</a> |
|
|
<hr/>
|
|
|
|
<div id="commform-div">
|
|
<!-- Pridat korekturu / komentar !-->
|
|
<form action='' onsubmit='save_scroll(this)' id="commform" method="POST">
|
|
{% csrf_token %}
|
|
<input size="24" name="au" value="{{user.first_name}} {{user.last_name}}" readonly/>
|
|
<input type=submit value="Oprav!"/>
|
|
<button type="button" onclick="close_commform()">Zavřít</button>
|
|
<br/>
|
|
<textarea onkeypress="textarea_onkey(event);" id="commform-text" cols=40 rows=10 name="txt"></textarea>
|
|
<br/>
|
|
<input type="hidden" size="3" name="pdf" value='{{pdf.id}}'/>
|
|
<input type="hidden" size="3" id="commform-x" name="x"/>
|
|
<input type="hidden" size="3" id="commform-y" name="y"/>
|
|
<input type="hidden" size="3" id="commform-img-id" name="img-id"/>
|
|
<input type="hidden" size="3" id="commform-id" name="id"/>
|
|
<input type="hidden" size="3" id="commform-action" name="action"/>
|
|
<input type="hidden" size="3" id="commform-action" name="scroll"/>
|
|
</form>
|
|
<!-- /Pridat korekturu / komentar !-->
|
|
</div>
|
|
|
|
{% for i in img_indexes %}
|
|
<div class='imgdiv'>
|
|
<img width='1021' height='1448'
|
|
onclick='img_click(this,event)' id='img-{{i}}'
|
|
src='/media/korektury/img/{{img_name}}-{{i}}.png'/>
|
|
</div>
|
|
<hr/>
|
|
{% endfor %}
|
|
|
|
<!-- Smazat vsechny komentare !-->
|
|
<form method="post">
|
|
{% csrf_token %}
|
|
<input type='hidden' name='action' value='delall'/>
|
|
<input type='submit' value='Smazat všechny komentáře'/>
|
|
<input type='hidden' name='pdf' value='{{pdf.id}}'/>
|
|
<input type='checkbox' name='yes'/> Souhlasím se smazáním všech kometářů
|
|
</form>
|
|
<!-- /Smazat vsechny komentare !-->
|
|
<hr/>
|
|
<h4>Změnit stav PDF:</h4>
|
|
<i>Aktuální: {{pdf.status}}</i>
|
|
<br>
|
|
<!-- Zmenit stav PDF !-->
|
|
<form method="post">
|
|
{% csrf_token %}
|
|
<input type='hidden' name='action' value='set-state'/>
|
|
<input type='hidden' name='pdf' value='{{pdf.id}}'/>
|
|
<input type="radio" name="state" value="adding" {% if pdf.status = 'pridavani' %} checked {% endif %}>Přidávání korektur
|
|
<br>
|
|
<input type="radio" name="state" value="comitting" {% if pdf.status = 'zanaseni' %} checked {% endif %}>Zanášení korektur
|
|
<br>
|
|
<input type="radio" name="state" value="deprecated" {% if pdf.status = 'zastarale' %} checked {% endif %}>Zastaralé, nekorigovat
|
|
<br>
|
|
<input type='submit' value='Změnit stav PDF'/>
|
|
</form>
|
|
|
|
<!-- /Zmenit stav PDF !-->
|
|
<hr/>
|
|
<p>
|
|
Děkujeme opravovatelům:
|
|
{% for z in zasluhy %}
|
|
{{z.autor}} ({{z.pocet}}){% if not forloop.last %},{% endif %}
|
|
{% endfor %}</p>
|
|
<hr>
|
|
|
|
{% for o in opravy %}
|
|
<div onclick='img_click(this,event)'
|
|
id='op{{o.id}}-pointer'
|
|
class='pointer{%if o.status = 'opraveno' %}-done{% elif o.status = 'neni_chyba' %}-wontfix{% endif %}'>
|
|
</div>
|
|
<div name='op{{o.id}}' id='op{{o.id}}'
|
|
class='box{%if o.status = 'opraveno' %}-done{% elif o.status = 'neni_chyba' %}-wontfix{% endif %}'
|
|
onmouseover='box_onmouseover(this,{% if o.status = 'opraveno' %}"done"{% elif o.status = 'neni_chyba' %}"wontfix"{%else%}""{% endif %})'
|
|
onmouseout='box_onmouseout(this,{% if o.status = 'opraveno' %}"done"{% elif o.status = 'neni_chyba' %}"wontfix"{%else%}""{% endif %})'>
|
|
|
|
<div class='corr-header'>
|
|
<span class='author' id='op{{o.id}}-autor'>{{o.autor}}</span>
|
|
<span class='float-right'>
|
|
<span id='op{{o.id}}-buttons'>
|
|
<!-- Existujici korektura !-->
|
|
<form action='' onsubmit='save_scroll(this)' method='POST'>
|
|
{% csrf_token %}
|
|
<input type='hidden' name="au" value="{{o.autor}}"/>
|
|
<input type='hidden' name='pdf' value='{{pdf.id}}'>
|
|
<input type='hidden' name='id' value='{{o.id}}'>
|
|
<input type='hidden' name='scroll'>
|
|
|
|
{% if o.komentare %}
|
|
<button name='action' value='del' type='button'
|
|
title="Opravu nelze smazat – už ji někdo okomentoval">
|
|
<img src="{% static "korektury/imgs/delete-gr.png"%}"/>
|
|
</button>
|
|
{% else %}
|
|
<button type='submit' name='action' value='del' title='Smaž opravu'>
|
|
<img src="{% static "korektury/imgs/delete.png"%}"/>
|
|
</button>
|
|
{% endif %}
|
|
|
|
{% if o.status = 'opraveno' or o.status = 'neni_chyba' %}
|
|
<button type='submit' name='action' value='undone' title='Označ jako neopravené'>
|
|
<img src="{% static "korektury/imgs/undo.png"%}"/>
|
|
</button>
|
|
{% else %}
|
|
<button type='submit' name='action' value='done' title='Označ jako opravené'>
|
|
<img src="{% static "korektury/imgs/check.png"%}"/>
|
|
</button>
|
|
<button type='submit' name='action' value='wontfix' title='Označ jako irelevantní '>
|
|
<img src="{% static "korektury/imgs/cross.png" %}"/>
|
|
</button>
|
|
{% endif %}
|
|
</form>
|
|
<!-- /Existujici korektura !-->
|
|
|
|
{% if o.komentare %}
|
|
<button type='button' title="Korekturu nelze upravit – už ji někdo okomentoval">
|
|
<img src="{% static "korektury/imgs/edit-gr.png" %}"/>
|
|
</button>
|
|
{% else %}
|
|
<button type='button' onclick='box_edit(this,"update");' title='Oprav opravu'>
|
|
<img src="{% static "korektury/imgs/edit.png" %}"/>
|
|
</button>
|
|
{% endif %}
|
|
{% if o.status = 'opraveno' or o.status = 'neni_chyba' %}
|
|
<button type='button' title='Korekturu nelze komentovat, protože už je uzavřená'>
|
|
<img src="{% static "korektury/imgs/comment-gr.png" %}"/>
|
|
</button>
|
|
{% else %}
|
|
<button type='button' onclick='box_edit(this, "comment");' title='Komentovat'>
|
|
<img src="{% static "korektury/imgs/comment.png" %}"/>
|
|
</button>
|
|
{% endif %}
|
|
|
|
</span>
|
|
<button type='button' onclick='toggle_visibility(this);' title='Skrýt/Zobrazit'>
|
|
<img src="{% static "korektury/imgs/hide.png" %}"/>
|
|
</button>
|
|
|
|
</span>
|
|
</div>
|
|
<div class='corr-body' id='op{{o.id}}-body'>
|
|
<div id='op{{o.id}}-text'>{{o.text}}</div>
|
|
|
|
{% for k in o.komentare %}
|
|
<hr>
|
|
<div class='comment' id='k{{k.id}}'>
|
|
<span class='corr-header'>
|
|
<div class='author'>{{k.autor}}</div>
|
|
<span class="float-right">
|
|
<!-- Komentar !-->
|
|
<form action='' onsubmit='save_scroll(this)' method='POST'>
|
|
{% csrf_token %}
|
|
<input type='hidden' name='pdf' value='{{pdf.id}}'>
|
|
<input type='hidden' name='id' value='{{k.id}}'>
|
|
<input type='hidden' name='scroll'>
|
|
<button type='submit' name='action' value='del-comment' title='Smaž komentář'
|
|
onclick='return confirm("Opravdu smazat komentář?")'>
|
|
<img src="{% static "korektury/imgs/delete.png" %}"/>
|
|
</button>
|
|
</form>
|
|
<!-- /Komentar !-->
|
|
<button type='button' onclick='update_comment(this);' title='Uprav komentář'>
|
|
<img src="{% static "korektury/imgs/edit.png"%}"/>
|
|
</button>
|
|
</div>
|
|
</span>
|
|
<div id='kt{{k.id}}'>{{k.text}}</div>
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
</div>
|
|
{% endfor %}
|
|
|
|
<script>
|
|
var comments = [
|
|
{% for s in opravy_strany %}
|
|
["img-{{s.strana}}", [{% for o in s.op_id %}["op{{o.id}}",{{o.x}},{{o.y}}],{% endfor %}[]]],
|
|
{% endfor %}
|
|
[]]
|
|
function place_comments() {
|
|
for (var i=0; i < comments.length-1; i++) {
|
|
place_comments_one_div(comments[i][0], comments[i][1])
|
|
}
|
|
}
|
|
{% if scroll %}
|
|
window.scrollTo(0,{{scroll}});
|
|
{% endif %}
|
|
</script>
|
|
</body>
|
|
</html>
|
|
|