From 1eb3f08b2c8cd6709fe655806ff091dcaa56133b Mon Sep 17 00:00:00 2001 From: Fedor_Kitanin Date: Thu, 12 Sep 2024 14:43:53 +0300 Subject: [PATCH] changed the rooms page --- assets/HypertextPages/list-rooms.nytl.html | 56 +++--- assets/css/list-rooms.css | 164 ++++++++++++++---- .../iu9_ca_web_chat_lib/sqlite3_wrapper.cpp | 2 +- 3 files changed, 160 insertions(+), 62 deletions(-) diff --git a/assets/HypertextPages/list-rooms.nytl.html b/assets/HypertextPages/list-rooms.nytl.html index 94bf6c6..7d58710 100644 --- a/assets/HypertextPages/list-rooms.nytl.html +++ b/assets/HypertextPages/list-rooms.nytl.html @@ -16,57 +16,61 @@ let userinfo = {% PUT jsinsert userinfo %}; let initial_chatListUpdResp = {% PUT jsinsert initial_chatListUpdResp %}; + + + -
+ +
-
- New chat -
- -
+
+ New chat +
+ diff --git a/assets/css/list-rooms.css b/assets/css/list-rooms.css index 392ba5b..ff65e12 100644 --- a/assets/css/list-rooms.css +++ b/assets/css/list-rooms.css @@ -1,51 +1,145 @@ -#CL-bacbe { - margin-top: 6px; - margin-bottom: 4px; -} - -.CL-my-chat-box { +/* General container styling */ +.document-container { 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 { - margin-left: 8px; - justify-self: flex-start; +/* Navigation panel */ +#navigation-panel { + display: flex; + align-items: center; + background-color: #1e90ff; + padding: 10px; + border-radius: 8px; + margin-bottom: 20px; + color: white; } -.CL-my-chat-box-name { - margin-left: 14px; - justify-self: flex-start; +.profile-link { + margin-right: 15px; } -.CL-my-chat-box-my-role { - margin-left: auto; - justify-self: flex-end; +.profile-icon { + width: 40px; + height: 40px; + border-radius: 50%; } -.CL-my-chat-box-leave-btn { - margin-left: 10px; - margin-right: 8px; - justify-self: flex-end; - width: 16px; - cursor: pointer; +.panel-description { + font-size: 1.2em; + font-weight: bold; } -/* The morbid thing */ -table.id-str-input-table { +/* Popup window styles */ +.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%; - border-collapse: collapse; /* Combine borders */ + margin-bottom: 20px; } -.id-str-input-td1, .id-str-input-td2 { - border: none; -} -.id-str-input-td1 { + +.form-label { text-align: left; - padding-right: 5px; - white-space: nowrap; /* Prevent text wrap, keeping it in one line */ - overflow: hidden; /* Hide overflow content */ - text-overflow: ellipsis; /* Show ellipsis for overflowing text */ + padding-right: 10px; + font-weight: bold; + color: #333; } -.id-str-input-td2 { + +.form-input { width: 100%; -} \ No newline at end of file + 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; +} diff --git a/src/web_chat/iu9_ca_web_chat_lib/sqlite3_wrapper.cpp b/src/web_chat/iu9_ca_web_chat_lib/sqlite3_wrapper.cpp index cf73016..3196e33 100644 --- a/src/web_chat/iu9_ca_web_chat_lib/sqlite3_wrapper.cpp +++ b/src/web_chat/iu9_ca_web_chat_lib/sqlite3_wrapper.cpp @@ -76,7 +76,7 @@ namespace iu9cawebchat { int ret = sqlite3_prepare_v2(connection.hand, req_statement.c_str(), -1, &stmt_obj, NULL); if (ret != 0) { - int err_pos = sqlite3_error_offset(connection.hand); + int err_pos = -1; een9_THROW("Compilation of request\n" + req_statement + "\nfailed" + ((err_pos >= 0) ? " with offset " + std::to_string(err_pos) : "")); }