changed the rooms page

This commit is contained in:
Fedor_Kitanin 2024-09-12 14:43:53 +03:00
parent 5d4d1149d4
commit 1eb3f08b2c
3 changed files with 160 additions and 62 deletions

View File

@ -16,57 +16,61 @@
let userinfo = {% PUT jsinsert userinfo %}; let userinfo = {% PUT jsinsert userinfo %};
let initial_chatListUpdResp = {% PUT jsinsert initial_chatListUpdResp %}; let initial_chatListUpdResp = {% PUT jsinsert initial_chatListUpdResp %};
</script> </script>
<!-- Chat creation popup window -->
<div id="chat-creation-win" class="popup-window"> <div id="chat-creation-win" class="popup-window">
<h1 class="popup-window-msg">{%w pres.list-rooms.new-chat-header %}</h1> <h1 class="popup-window-header">{%w pres.list-rooms.new-chat-header %}</h1>
<table class="id-str-input-table"> <table class="form-table">
<tr> <tr>
<td class="id-str-input-td1"> <td class="form-label">
<label for="chat-nickname-input">{%w pres.list-rooms.directive-nickname %}</label> <label for="chat-nickname-input">{%w pres.list-rooms.directive-nickname %}</label>
</td> </td>
<td class="id-str-input-td2"> <td>
<input id="chat-nickname-input" type="text" class="one-line-input" <input id="chat-nickname-input" type="text" class="form-input" placeholder="{%w pres.list-rooms.placeholder-nickname %}" required>
placeholder="{%w pres.list-rooms.placeholder-nickname %}" required>
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="id-str-input-td1"> <td class="form-label">
<label for="chat-name-input">{%w pres.list-rooms.directive-name %}</label> <label for="chat-name-input">{%w pres.list-rooms.directive-name %}</label>
</td> </td>
<td class="id-str-input-td2"> <td>
<input id="chat-name-input" type="text" class="one-line-input" <input id="chat-name-input" type="text" class="form-input" placeholder="{%w pres.list-rooms.placeholder-name %}" required>
placeholder="{%w pres.list-rooms.placeholder-name %}" required>
</td> </td>
</tr> </tr>
</table> </table>
<h1 class="popup-window-msg">{%w pres.list-rooms.reask-create-new-chat %}</h1> <h1 class="popup-window-subheader">{%w pres.list-rooms.reask-create-new-chat %}</h1>
<button class="popup-window-btn-yes" id="chat-creation-win-yes">{%w pres.list-rooms.yes-create %}</button> <div class="popup-actions">
<button class="popup-window-btn-no" id="chat-creation-win-no">{%w pres.list-rooms.no-create %}</button> <button class="popup-btn" id="chat-creation-win-yes">{%w pres.list-rooms.yes-create %}</button>
<button class="popup-btn" id="chat-creation-win-no">{%w pres.list-rooms.no-create %}</button>
</div>
</div> </div>
<!-- Chat renunciation popup window -->
<div id="chat-renunciation-win" class="popup-window"> <div id="chat-renunciation-win" class="popup-window">
<!-- header will actually be rewritten before showing the window to include chat nickname --> <h1 id="chat-renunciation-win-title" class="popup-window-header">||||||||||</h1>
<h1 id="chat-renunciation-win-title" class="popup-window-msg">||||||||||</h1> <div class="popup-actions">
<button class="popup-window-btn-yes" id="chat-renunciation-win-yes">{%w pres.list-rooms.yes-leave %}</button> <button class="popup-btn" id="chat-renunciation-win-yes">{%w pres.list-rooms.yes-leave %}</button>
<button class="popup-window-btn-no" id="chat-renunciation-win-no">{%w pres.list-rooms.no-leave %}</button> <button class="popup-btn" id="chat-renunciation-win-no">{%w pres.list-rooms.no-leave %}</button>
</div>
</div> </div>
<div class="document-container resp-container"> <!-- Main content container -->
<div class="document-container">
<div id="navigation-panel" class="panel"> <div id="navigation-panel" class="panel">
<a href="/user/{%w userinfo.nickname %}" id="go-to-my-profile" class="panel-thing"> <a href="/user/{%w userinfo.nickname %}" id="go-to-my-profile" class="profile-link">
<img alt="Go to my profile" src="/assets/img/user.svg" width="32px"> <img alt="Go to my profile" src="/assets/img/user.svg" class="profile-icon">
</a> </a>
<p class="panel-thing panel-header-txt"> <p class="panel-description">
{%w pres.list-rooms.page-description %} {%w pres.list-rooms.page-description %}
</p> </p>
</div> </div>
<div class="dynamic-block-list"> <div class="chat-list-container">
<img id="CL-bacbe" class="button-add centered-block-el" alt="New chat" src="/assets/img/add.svg"> <img id="CL-bacbe" class="button-add" alt="New chat" src="/assets/img/add.svg">
<div class="dynamic-block-list-el-container" id="CL-dblec"> <div class="chat-list" id="CL-dblec"></div>
</div>
</div>
</div>
</div>
</div>
<script src="/assets/js/common.js"></script> <script src="/assets/js/common.js"></script>
<script src="/assets/js/common-popup.js"></script> <script src="/assets/js/common-popup.js"></script>
<script src="/assets/js/list-rooms.js"></script> <script src="/assets/js/list-rooms.js"></script>

View File

@ -1,51 +1,145 @@
#CL-bacbe { /* General container styling */
margin-top: 6px; .document-container {
margin-bottom: 4px;
}
.CL-my-chat-box {
display: flex; display: flex;
flex-direction: row; flex-direction: column;
max-width: 1200px;
margin: 0 auto;
padding: 20px;
background-color: #f9f9f9;
border-radius: 8px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
} }
.CL-my-chat-box-nickname { /* Navigation panel */
margin-left: 8px; #navigation-panel {
justify-self: flex-start; display: flex;
align-items: center;
background-color: #1e90ff;
padding: 10px;
border-radius: 8px;
margin-bottom: 20px;
color: white;
} }
.CL-my-chat-box-name { .profile-link {
margin-left: 14px; margin-right: 15px;
justify-self: flex-start;
} }
.CL-my-chat-box-my-role { .profile-icon {
margin-left: auto; width: 40px;
justify-self: flex-end; height: 40px;
border-radius: 50%;
} }
.CL-my-chat-box-leave-btn { .panel-description {
margin-left: 10px; font-size: 1.2em;
margin-right: 8px; font-weight: bold;
justify-self: flex-end;
width: 16px;
cursor: pointer;
} }
/* The morbid thing */ /* Popup window styles */
table.id-str-input-table { .popup-window {
display: none;
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
background-color: white;
padding: 20px;
border-radius: 8px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
z-index: 100;
}
.popup-window-header {
font-size: 1.5em;
margin-bottom: 15px;
color: #333;
}
.popup-window-subheader {
font-size: 1.2em;
margin-bottom: 20px;
color: #666;
}
.form-table {
width: 100%; width: 100%;
border-collapse: collapse; /* Combine borders */ margin-bottom: 20px;
} }
.id-str-input-td1, .id-str-input-td2 {
border: none; .form-label {
}
.id-str-input-td1 {
text-align: left; text-align: left;
padding-right: 5px; padding-right: 10px;
white-space: nowrap; /* Prevent text wrap, keeping it in one line */ font-weight: bold;
overflow: hidden; /* Hide overflow content */ color: #333;
text-overflow: ellipsis; /* Show ellipsis for overflowing text */
} }
.id-str-input-td2 {
.form-input {
width: 100%; width: 100%;
padding: 8px;
border: 1px solid #ddd;
border-radius: 4px;
}
.popup-actions {
display: flex;
justify-content: space-between;
}
.popup-btn {
background-color: #1e90ff;
color: white;
border: none;
padding: 10px 20px;
border-radius: 4px;
cursor: pointer;
font-size: 1em;
}
.popup-btn:hover {
background-color: #005fbb;
}
/* Chat list */
.chat-list-container {
display: flex;
flex-direction: column;
background-color: #fff;
padding: 20px;
border-radius: 8px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}
.button-add {
margin-bottom: 10px;
cursor: pointer;
width: 40px;
}
.chat-list {
display: flex;
flex-direction: column;
}
/* Custom scrollbar */
.chat-list {
max-height: 400px;
overflow-y: auto;
}
.chat-list::-webkit-scrollbar {
width: 8px;
}
.chat-list::-webkit-scrollbar-track {
background: #f1f1f1;
}
.chat-list::-webkit-scrollbar-thumb {
background: #888;
border-radius: 8px;
}
.chat-list::-webkit-scrollbar-thumb:hover {
background: #555;
} }

View File

@ -76,7 +76,7 @@ namespace iu9cawebchat {
int ret = sqlite3_prepare_v2(connection.hand, req_statement.c_str(), -1, &stmt_obj, NULL); int ret = sqlite3_prepare_v2(connection.hand, req_statement.c_str(), -1, &stmt_obj, NULL);
if (ret != 0) { if (ret != 0) {
int err_pos = sqlite3_error_offset(connection.hand); int err_pos = -1;
een9_THROW("Compilation of request\n" + req_statement + "\nfailed" + een9_THROW("Compilation of request\n" + req_statement + "\nfailed" +
((err_pos >= 0) ? " with offset " + std::to_string(err_pos) : "")); ((err_pos >= 0) ? " with offset " + std::to_string(err_pos) : ""));
} }