From 082ac2f5a52f7dac13dea9afb212cc1749613349 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Sat, 5 Feb 2022 00:19:06 -0500 Subject: [PATCH] "Forum list" is now more or less in its final form. --- webcit-ng/room_functions.c | 1 - webcit-ng/static/css/webcit.css | 24 ++++++++++----------- webcit-ng/static/js/roomlist.js | 38 +++++++++++++++++++-------------- 3 files changed, 33 insertions(+), 30 deletions(-) diff --git a/webcit-ng/room_functions.c b/webcit-ng/room_functions.c index 14fc60413..da325f32a 100644 --- a/webcit-ng/room_functions.c +++ b/webcit-ng/room_functions.c @@ -1,4 +1,3 @@ -// // Room functions // // Copyright (c) 1996-2022 by the citadel.org team diff --git a/webcit-ng/static/css/webcit.css b/webcit-ng/static/css/webcit.css index 3ab856f2c..e5d1ddc62 100644 --- a/webcit-ng/static/css/webcit.css +++ b/webcit-ng/static/css/webcit.css @@ -155,19 +155,6 @@ blockquote pre { padding: 0.5vw; margin-bottom: 0.5vw; width: 100%; - text-align: left; - display: flex; - flex-direction: row; - /* justify-content: center; */ - align-items: center; -} - -.ctdl-roomlist-roomname { - font-size: large; -} - -.ctdl-roomlist-roomname-hasnewmsgs { - font-weight: bold; } .ctdl-roomlist-roomicon { @@ -188,3 +175,14 @@ blockquote pre { background-color: blue; color: white; } + +.ctdl-roomlist-roomname { + font-size: large; +} + +.ctdl-roomlist-roomname-hasnewmsgs { + font-weight: bold; +} + +.ctdl-roomlist-mtime { +} diff --git a/webcit-ng/static/js/roomlist.js b/webcit-ng/static/js/roomlist.js index ee62602f1..7cb3053fd 100644 --- a/webcit-ng/static/js/roomlist.js +++ b/webcit-ng/static/js/roomlist.js @@ -17,7 +17,6 @@ function render_room_list() { document.getElementById("ctdl-main").innerHTML = ""; // show throbber while loading fetch_room_list = async() => { - floor_response = await fetch("/ctdl/f/"); floor_list = await(floor_response.json()); room_response = await fetch("/ctdl/r/"); @@ -35,6 +34,8 @@ function render_room_list() { // Renderer for display_room_list() function display_room_list_renderer(floor_list, room_list) { + + // First sort by the room order indicated by the server room_list = room_list.sort(function(a,b) { if (a.floor != b.floor) { return(a.floor - b.floor); @@ -45,34 +46,39 @@ function display_room_list_renderer(floor_list, room_list) { return(a.name < b.name); }); + // Then split the sorted list out into floors output = []; - for (var f in floor_list) { output[floor_list[f].num] = ""; } for (var i in room_list) { if (room_list[i].current_view == views.VIEW_BBS) { - output[room_list[i].floor] += "
"; - output[room_list[i].floor] += ""; - output[room_list[i].floor] += escapeHTML(room_list[i].name); - output[room_list[i].floor] += "
"; + output[room_list[i].floor] += + "
" + + "" + + escapeHTML(room_list[i].name) + + "" + + convertTimestamp(room_list[i].mtime) + + "
"; } } final_output = "
"; for (var f in floor_list) { - final_output += "
"; - final_output += "
" + floor_list[f].name + "
"; - final_output += "
"; - final_output += output[floor_list[f].num]; - final_output += "
"; + final_output += + "
" + + "
" + floor_list[f].name + "
" + + "
" + + output[floor_list[f].num] + + "
"; } final_output += "
"; - document.getElementById("ctdl-main").innerHTML = final_output ; + document.getElementById("ctdl-main").innerHTML = final_output; } -- 2.39.2