Added contact and term btn

This commit is contained in:
2024-05-25 11:20:11 +02:00
parent c05de5d325
commit a4a528b6ca
5 changed files with 85 additions and 7 deletions
+8 -3
View File
@@ -25,7 +25,7 @@
<input class="input is-small mt-2 is-hidden" type="text" id="conversation-name-input"
name="conversation-name-input" placeholder="Conversation name" autocomplete="off">
<div class="is-flex is-justify-content-space-between mt-4">
<button class="button is-small is-danger" id="delete-conversation-button"
<button disabled class="button is-small is-danger" id="delete-conversation-button"
hx-get="/deleteConversation" hx-swap="outerHTML" hx-target="#conversation-dropdown"
hx-vals="js:{conversationId: findSelectedConversationID()}">
<span class="icon">
@@ -61,6 +61,7 @@
function findSelectedConversationID() {
return document.getElementsByClassName('icon-conv selected')[0].getAttribute('data-id');
}
function toggleConversationSelection(element) {
const elements = Array.from(document.getElementsByClassName('icon-conv'));
@@ -86,8 +87,12 @@
element.classList.add('selected');
}
// Make an HTMX request to update the chat
// If the text inside the selected button is Default
if (element.textContent === 'Default') {
document.getElementById('delete-conversation-button').disabled = true;
} else {
document.getElementById('delete-conversation-button').disabled = false;
}
}
var sortable = new Sortable(document.getElementById('conversation-list'), {
+10 -2
View File
@@ -20,9 +20,9 @@
{% endfor %}
</div>
<div class="is-flex is-justify-content-space-between mt-4">
<button class="button is-small is-danger is-outlined" hx-get="/deleteLLM" hx-swap="outerHTML"
<button disabled class="button is-small is-danger" hx-get="/deleteLLM" hx-swap="outerHTML"
hx-target="#models-dropdown" hx-confirm="Are you sure?" hx-trigger="click"
hx-vals="js:{selectedLLMIds: getSelectedModelsIDs()}">
hx-vals="js:{selectedLLMIds: getSelectedModelsIDs()}" id="delete-model-button">
<span class="icon">
<i class="fa-solid fa-trash"></i>
</span>
@@ -199,6 +199,14 @@
element.classList.toggle('selected');
element.classList.toggle('unselected');
}
// If at least one model is selected, enable the delete button
if (document.getElementsByClassName('selected icon-llm').length > 0) {
document.getElementById('delete-model-button').disabled = false;
} else {
document.getElementById('delete-model-button').disabled = true;
}
toggleSendButton();
}
+13
View File
@@ -108,6 +108,19 @@
<span>Subscribe to JADE</span>
</a>
{% endif %}
<a class="button is-small mt-1" hx-get="/generateTermAndService" hx-target="#chat-container"
hx-swap="outerHTML" hx-trigger="click">
<span class="icon is-small">
<i class="fa-regular fa-file-lines"></i>
</span>
<span>Terms and conditions</span>
</a>
<a class="button is-small mt-1" href="mailto:adrien.bouvais.pro@gmail.com">
<span class="icon is-small">
<i class="fa-solid fa-address-card"></i>
</span>
<span>Contact</span>
</a>
<a class="button is-small mt-1" href="/signout">
<span class="icon is-small">
<i class="fa-solid fa-right-from-bracket"></i>