2024-04-09 13:39:11 +00:00
{% extends "base.html" %}
{% block title %} annotation {% endblock %}
{% block content%}
< div class = "container" id = "top-info" >
< table class = "table top-info" >
< thead class = "thead-dark" >
< tr >
< th > Email< / th >
< th > Počet anotovaných jednotiek< / th >
< / tr >
< / thead >
< tr >
< td > {{ email }}< / td >
< td > {{ annotated_count }}< / td >
< / tr >
< / table >
< / div >
2024-04-13 09:46:38 +00:00
2024-04-17 12:30:55 +00:00
< p class = "anot-text" class = "container anot-nav" > Nenávistná reč označuje akúkoľvek komunikáciu, ktorá podnecuje násilie alebo diskrimináciu voči jednotlivcom alebo skupinám na základe rasových, etnických, náboženských, sexuálnych orientácií alebo postihnutia.< / p >
2024-04-09 13:39:11 +00:00
< div class = "container" >
< div class = "anot" >
< p class = "anot-text" > {{ text }}< / p >
< button id = "post" class = "btn btn-primary" onclick = "postBcknd('offensive', {{ sample_id }})" > Ofenzívny< / button >
< button id = "post" class = "btn btn-primary" onclick = "postBcknd('dont_know', {{ sample_id }})" > Neviem< / button >
2024-04-16 09:22:02 +00:00
< button id = "post" class = "btn btn-primary" onclick = "postBcknd('not_offensive', {{ sample_id }})" > Neofenzívny< / button >
2024-04-17 12:30:55 +00:00
< / div >
< / div >
2024-04-09 13:39:11 +00:00
< button id = "get" class = "btn btn-primary logout-btn" onclick = "logout()" > Odhlásiť sa< / button >
< script >
function postBcknd(value, sample_id){
var xhr = new XMLHttpRequest();
xhr.open('POST', '/process_anot', true);
xhr.setRequestHeader('Content-Type', 'application/json');
xhr.onload = function () {
if(xhr.status === 200) {
console.log('request sent succesfully');
window.location.href = '/anot';
} else {
console.log('request failed');
}
};
xhr.send(JSON.stringify({value: value, sample_id: sample_id}));
}
function logout() {
var xhr = new XMLHttpRequest();
xhr.open('GET', '/', true);
xhr.onload = function () {
if (xhr.status === 200) {
console.log('Logout successful');
window.location.href = '/';
} else {
console.log('Logout request failed');
}
}
xhr.send(); // Send the request
}
< / script >
2024-04-16 09:22:02 +00:00
{% endblock %}