Browse Source

Uklid v CSS korektur.

export_seznamu_prednasek
parent
commit
e90d6a6f83
  1. 87
      korektury/static/korektury/opraf.css
  2. 35
      korektury/static/korektury/opraf.js
  3. 19
      korektury/templates/korektury/opraf.html

87
korektury/static/korektury/opraf.css

@ -13,72 +13,46 @@ body,
img{background:white;} img{background:white;}
/* Barvy korektur */
.k_oprave {
--rgb: 255, 0, 0;
}
.opraveno {
--rgb: 0, 0, 255;
}
.neni_chyba {
--rgb: 128, 128, 128;
}
.k_zaneseni {
--rgb: 0, 255, 0;
}
.pointer-hi, .pointer-hi,
.pointer, .pointer{
.pointer-wontfix,
.pointer-wontfix-hi,
.pointer-ready,
.pointer-ready-hi,
.pointer-done,
.pointer-done-hi {
position:absolute; position:absolute;
/*border-bottom-left-radius: 10px; */ /*border-bottom-left-radius: 10px; */
border-left: 2px solid yellow; border-left: 2px solid yellow;
border-bottom: 2px solid yellow; border-bottom: 2px solid yellow;
border-color: rgb(var(--rgb),var(--alpha));
} }
.pointer-done-hi, .pointer {
.pointer-wontfix-hi, border-width: 1px;
.pointer-ready-hi, --alpha: 0.35;
.pointer-hi {
border-width: 3px;
} }
.pointer {
border-color: #F00; /*IE*/
border-color: rgba(255, 0, 0, 0.35);
}
.pointer-hi { .pointer-hi {
border-color: #F00; /*IE*/ border-width: 3px;
border-color: rgba(255, 0, 0, 1); --alpha: 1;
}
.pointer-done {
border-color: #00F; /*IE*/
border-color: rgba(0, 0, 255, 0.2);
}
.pointer-done-hi {
border-color: #00F; /*IE*/
border-color: rgba(0, 0, 255, 1);
}
.pointer-wontfix {
border-color: #000; /*IE*/
border-color: rgba(128, 128, 128, 0.2);
}
.pointer-wontfix-hi {
border-color: #000; /*IE*/
border-color: rgba(128, 128, 128, 1);
}
.pointer-ready {
border-color: #0F0; /*IE*/
border-color: rgba(0, 255, 0, 0.2);
}
.pointer-ready-hi {
border-color: #0F0; /*IE*/
border-color: rgba(0, 255, 0, 1);
} }
.box:hover,
.box-done:hover, .box:hover{
.box-ready:hover,
.box-wontfix:hover{
border-width:3px; border-width:3px;
margin: 0px; margin: 0px;
} }
.box, .box {
.box-done,
.box-ready,
.box-wontfix {
margin: 1px; margin: 1px;
background-color: white; background-color: white;
width:300px; width:300px;
@ -86,18 +60,7 @@ img{background:white;}
padding: 3px; padding: 3px;
border: 2px solid black; border: 2px solid black;
border-radius: 10px; border-radius: 10px;
} border-color: rgb(var(--rgb));
.box {
border-color: red;
}
.box-done {
border-color: blue;
}
.box-ready {
border-color: rgba(0,255,0,1);
}
.box-wontfix {
border-color: grey;
} }
form { form {
display:inline; display:inline;

35
korektury/static/korektury/opraf.js

@ -212,45 +212,22 @@ function show_form(img_id, dx, dy, id, text, action) {
textarea.focus(); textarea.focus();
return true; return true;
} }
function box_onmouseover(box, stat) function box_onmouseover(box)
{ {
var id = box.id; var id = box.id;
var pointer = document.getElementById(box.id + '-pointer'); var pointer = document.getElementById(box.id + '-pointer');
switch (stat){ pointer.classList.remove('pointer');
case 'done': pointer.classList.add('pointer-hi');
pointer.className = 'pointer-done-hi';
break;
case 'wontfix':
pointer.className = 'pointer-wontfix-hi';
break;
case 'ready':
pointer.className = 'pointer-ready-hi';
break;
default:
pointer.className = 'pointer-hi';
}
} }
function box_onmouseout(box, stat) function box_onmouseout(box)
{ {
var id = box.id; var id = box.id;
var pointer = document.getElementById(box.id + '-pointer'); var pointer = document.getElementById(box.id + '-pointer');
switch (stat){ pointer.classList.remove('pointer-hi');
case 'done': pointer.classList.add('pointer');
pointer.className = 'pointer-done';
break;
case 'wontfix':
pointer.className = 'pointer-wontfix';
break;
case 'ready':
pointer.className = 'pointer-ready';
break;
default:
pointer.className = 'pointer';
}
} }
function save_scroll(form) function save_scroll(form)

19
korektury/templates/korektury/opraf.html

@ -20,6 +20,17 @@
          |           |
<a href="/">hlavní stránka</a> | <a href="/">hlavní stránka</a> |
<a href="https://mam.mff.cuni.cz/wiki">wiki</a> | <a href="https://mam.mff.cuni.cz/wiki">wiki</a> |
<hr />
Zobrazit:
<input type="checkbox" id="k_oprave_checkbox" name="k_oprave_checkbox" checked>
<label for="k_oprave_checkbox">K opravě</labe>
<input type="checkbox" id="opraveno_checkbox" name="opraveno_checkbox" checked>
<label for="opraveno_checkbox">Opraveno</labe>
<input type="checkbox" id="neni_chyba_checkbox" name="neni_chyba_checkbox" checked>
<label for="neni_chyba_checkbox">Není chyba</labe>
<input type="checkbox" id="k_zaneseni_checkbox" name="k_zaneseni_checkbox" checked>
<label for="k_zaneseni_checkbox">K opravě</labe>
<hr/> <hr/>
<div id="commform-div"> <div id="commform-div">
@ -81,12 +92,12 @@
{% for o in opravy %} {% for o in opravy %}
<div onclick='img_click(this,event)' <div onclick='img_click(this,event)'
id='op{{o.id}}-pointer' id='op{{o.id}}-pointer'
class='pointer{%if o.status == 'opraveno' %}-done{% elif o.status == 'neni_chyba' %}-wontfix{% elif o.status == 'k_zaneseni' %}-ready{% endif %}'> class='pointer {{o.status}}'>
</div> </div>
<div name='op{{o.id}}' id='op{{o.id}}' <div name='op{{o.id}}' id='op{{o.id}}'
class='box{%if o.status == 'opraveno' %}-done{% elif o.status == 'neni_chyba' %}-wontfix{% elif o.status == 'k_zaneseni' %}-ready{% endif %}' class='box {{o.status}}'
onmouseover='box_onmouseover(this,{% if o.status == 'opraveno' %}"done"{% elif o.status == 'neni_chyba' %}"wontfix"{% elif o.status == 'k_zaneseni' %}"ready"{% else %}""{% endif %})' onmouseover='box_onmouseover(this)'
onmouseout='box_onmouseout(this, {% if o.status == 'opraveno' %}"done"{% elif o.status == 'neni_chyba' %}"wontfix"{% elif o.status == 'k_zaneseni' %}"ready"{% else %}""{% endif %})'> onmouseout='box_onmouseout(this)'>
<div class='corr-header'> <div class='corr-header'>
<span class='author' id='op{{o.id}}-autor'>{{o.autor}}</span> <span class='author' id='op{{o.id}}-autor'>{{o.autor}}</span>

Loading…
Cancel
Save