41 lines
1.4 KiB
HTML
41 lines
1.4 KiB
HTML
{% extends "base.html" %}
|
|
|
|
{% block content %}
|
|
<script>
|
|
function sendquote(id) {
|
|
select = document.getElementById("space_option");
|
|
space_id = select[select.selectedIndex].value;
|
|
space_name = select[select.selectedIndex].text;
|
|
if (space_id === "NaN") {
|
|
alert("Please select a space");
|
|
return
|
|
}
|
|
|
|
let confirmation = confirm(`Send quote to ${space_name}`)
|
|
if (confirmation === true) {
|
|
let send_url = "{{ url_for('chatbot.send_quote', space='AAAAAA', _external=True) }}"
|
|
send_url = send_url.replace("AAAAAA",space_id)
|
|
fetch(send_url, {method: "POST",headers: {"Content-Type": "application/json"},body: JSON.stringify({"quote_id": id})})
|
|
.then((response) => console.log(response))
|
|
}
|
|
|
|
}
|
|
</script>
|
|
|
|
<div class="fcontainer" >
|
|
{% for i in quotes %}
|
|
<div class=" has-text-left m-1 innercontainer p-4">
|
|
<div class="fquote" id="quote_{{ i[1] }}">
|
|
{{ i[0] }}
|
|
</div>
|
|
|
|
<div class="fbuttons">
|
|
<button class="button is-primary is-outlined m-1 sel-button" {% if not current_user.administrator %} disabled title="Administrator Privs required" {% endif %} onclick="sendquote({{ i[1] }})">Send</button>
|
|
<button class="button is-primary is-outlined m-1 del-button" {% if not current_user.administrator %} disabled title="Administrator Privs required" {% endif %} onclick="sendquote({{ i[1] }})">Delete</button>
|
|
</div>
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
{% endblock %}
|
|
|