Better correction display

This commit is contained in:
nemunaire 2022-09-02 11:58:39 +02:00
parent 3d772704b7
commit cb147e2b96

View File

@ -92,11 +92,13 @@
class:form-check-label={!live}
class:btn={live}
class:btn-lg={live}
class:btn-primary={live && !corrections && value.indexOf(proposal.id.toString()) != -1}
class:btn-outline-primary={live && !corrections && value.indexOf(proposal.id.toString()) == -1}
class:btn-primary={live && !corrections && value && value.indexOf(proposal.id.toString()) != -1}
class:btn-outline-primary={live && !corrections && (!value || value.indexOf(proposal.id.toString()) == -1)}
class:btn-success={live && corrections && corrections[proposal.id] == 0}
class:btn-outline-warning={live && corrections && corrections[proposal.id] != 0 && corrections[proposal.id] != -100}
class:btn-outline-danger={live && corrections && corrections[proposal.id] == -100}
class:btn-warning={live && corrections && corrections[proposal.id] != 0 && corrections[proposal.id] != -100 && value && value.indexOf(proposal.id.toString()) != -1}
class:btn-danger={live && corrections && corrections[proposal.id] == -100 && value && value.indexOf(proposal.id.toString()) != -1}
class:btn-outline-warning={live && corrections && corrections[proposal.id] != 0 && corrections[proposal.id] != -100 && (!value || value.indexOf(proposal.id.toString()) == -1)}
class:btn-outline-danger={live && corrections && corrections[proposal.id] == -100 && (!value || value.indexOf(proposal.id.toString()) == -1)}
for={prefixid + 'p' + proposal.id}
>
{proposal.label}