17
17
from zulipterminal .helper import (
18
18
Message , asynch , edit_mode_captions , match_stream , match_user ,
19
19
)
20
- from zulipterminal .ui_tools .boxes import PanelSearchBox
20
+ from zulipterminal .ui_tools .boxes import MessageBox , PanelSearchBox
21
21
from zulipterminal .ui_tools .buttons import (
22
22
HomeButton , MentionedButton , MessageLinkButton , PMButton , StarredButton ,
23
23
StreamButton , TopicButton , UnreadPMButton , UserButton ,
@@ -1087,18 +1087,22 @@ def __init__(self, controller: Any, stream_id: int) -> None:
1087
1087
stream_marker = (STREAM_MARKER_PRIVATE if stream ['invite_only' ]
1088
1088
else STREAM_MARKER_PUBLIC )
1089
1089
title = '{} {}' .format (stream_marker , stream ['name' ])
1090
+ rendered_desc = stream ['rendered_description' ]
1091
+ self .markup_desc , * _ = MessageBox .transform_content (
1092
+ rendered_desc ,
1093
+ self .controller .model .server_url ,
1094
+ )
1095
+ desc = urwid .Text (self .markup_desc )
1096
+
1097
+ stream_info_content = [
1098
+ ('Stream Details' , [
1099
+ ('Weekly Message Count' , str (weekly_msg_count )),
1100
+ ('Stream Members' , '{} (Press {} to view list)' .format (
1101
+ total_members , member_keys )),
1102
+ ]),
1103
+ ('Stream settings' , []),
1104
+ ] # type: PopUpViewTableContent
1090
1105
1091
- desc = stream ['description' ]
1092
-
1093
- stream_info_content = [('' , [desc ]),
1094
- ('Stream Details' , [
1095
- ('Weekly Message Count' ,
1096
- str (weekly_msg_count )),
1097
- ('Stream Members' ,
1098
- '{} (Press {} to view list)' .format (
1099
- total_members , member_keys ))
1100
- ]),
1101
- ('Stream settings' , [])]
1102
1106
popup_width , column_widths = self .calculate_table_widths (
1103
1107
stream_info_content , len (title ))
1104
1108
@@ -1117,9 +1121,14 @@ def __init__(self, controller: Any, stream_id: int) -> None:
1117
1121
# Manual because calculate_table_widths does not support checkboxes.
1118
1122
# Add 4 to checkbox label to accomodate the checkbox itself.
1119
1123
popup_width = max (popup_width , len (muted_setting .label ) + 4 ,
1120
- len (pinned_setting .label ) + 4 )
1124
+ len (pinned_setting .label ) + 4 , desc . pack ()[ 0 ] )
1121
1125
self .widgets = self .make_table_with_categories (stream_info_content ,
1122
1126
column_widths )
1127
+
1128
+ # Stream description.
1129
+ self .widgets .insert (0 , desc )
1130
+ self .widgets .insert (1 , urwid .Text ('' )) # Add a newline.
1131
+
1123
1132
self .widgets .append (muted_setting )
1124
1133
self .widgets .append (pinned_setting )
1125
1134
super ().__init__ (controller , self .widgets , 'STREAM_DESC' , popup_width ,
0 commit comments