Index: openacs-4/packages/chat/www/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/chat/www/index.tcl,v diff -u -r1.18 -r1.19 --- openacs-4/packages/chat/www/index.tcl 1 Oct 2018 12:17:00 -0000 1.18 +++ openacs-4/packages/chat/www/index.tcl 3 Sep 2024 15:37:36 -0000 1.19 @@ -15,6 +15,7 @@ } set package_id [ad_conn package_id] +set base_url [ad_conn package_url] set user_id [ad_conn user_id] set actions [list] set room_create_p [permission::permission_p -object_id $package_id -privilege chat_room_create] @@ -24,14 +25,23 @@ lappend actions "#chat.Create_a_new_room#" room-edit "#chat.Create_a_new_room#" } -db_multirow -extend { active_users last_activity room_url} rooms rooms_list {} { +db_multirow -extend { + active_users + last_activity + room_url + toggle_active_url +} rooms rooms_list {} { set room [::chat::Chat create new -volatile -chat_id $room_id] set active_users [$room nr_active_users] set last_activity [$room last_activity] + if {[permission::permission_p -object_id $package_id \ + -party_id $user_id -privilege chat_room_edit]} { + set toggle_active_url toggle-active?room_id=$room_id + } + if { $active_p } { - set room_url [export_vars -base "room-enter" {room_id}] - set room_url [ns_quotehtml $room_url] + set room_url [export_vars -base "chat" {room_id}] } } @@ -48,12 +58,18 @@ label "#chat.Active#" html { style "text-align: center" } display_template { - - #chat.Room_active# + + - - #chat.Room_no_active# - + + #chat.Room_active# + + + #chat.Room_no_active# + + + + } } pretty_name { @@ -83,7 +99,7 @@ display_template { #chat.Transcripts# - #chat.room_admin# + #chat.room_admin# } }