Example #1
0
 def inject_event_header(self, event, **kwargs):
     chatrooms = ChatroomEventAssociation.find_for_event(event).all()
     if not chatrooms:
         return ''
     how_to_connect = self.settings.get('how_to_connect')
     return render_plugin_template('event_header.html', event=event, event_chatrooms=chatrooms,
                                   how_to_connect=how_to_connect, chat_links=self.settings.get('chat_links'))
Example #2
0
 def _process(self):
     chatrooms = ChatroomEventAssociation.find_for_event(self._conf).all()
     cols = set()
     if any(c.chatroom.description for c in chatrooms):
         cols.add('description')
     if any(c.chatroom.password for c in chatrooms):
         cols.add('password')
     return WPChatEventPage.render_template('event_page.html', self._conf, event_chatrooms=chatrooms, cols=cols,
                                            chat_links=current_plugin.settings.get('chat_links'))
Example #3
0
 def _process(self):
     chatrooms = ChatroomEventAssociation.find_for_event(self.event, include_hidden=True,
                                                         _eager='chatroom.events').all()
     logs_enabled = current_plugin.settings.get('log_url')
     attach_form = self._get_attach_form()
     if not attach_form.chatroom._get_object_list():
         attach_form = None
     return WPChatEventMgmt.render_template('manage_event.html', self.event, event_chatrooms=chatrooms,
                                            chat_links=current_plugin.settings.get('chat_links'),
                                            logs_enabled=logs_enabled, attach_form=attach_form)
 def _process(self):
     chatrooms = ChatroomEventAssociation.find_for_event(self.event, include_hidden=True,
                                                         _eager='chatroom.events').all()
     logs_enabled = current_plugin.settings.get('log_url')
     attach_form = self._get_attach_form()
     if not attach_form.chatroom._get_object_list():
         attach_form = None
     return WPChatEventMgmt.render_template('manage_event.html', self._conf, event_chatrooms=chatrooms,
                                            event=self.event, chat_links=current_plugin.settings.get('chat_links'),
                                            logs_enabled=logs_enabled, attach_form=attach_form)
 def inject_event_header(self, event, **kwargs):
     chatrooms = ChatroomEventAssociation.find_for_event(event).all()
     if not chatrooms:
         return ''
     how_to_connect = self.settings.get('how_to_connect')
     return render_plugin_template(
         'event_header.html',
         event=event,
         event_chatrooms=chatrooms,
         how_to_connect=how_to_connect,
         chat_links=self.settings.get('chat_links'))
Example #6
0
 def _process(self):
     chatrooms = ChatroomEventAssociation.find_for_event(self.event).all()
     cols = set()
     if any(c.chatroom.description for c in chatrooms):
         cols.add('description')
     if any(c.chatroom.password for c in chatrooms):
         cols.add('password')
     return WPChatEventPage.render_template(
         'event_page.html',
         self.event,
         event_chatrooms=chatrooms,
         cols=cols,
         chat_links=current_plugin.settings.get('chat_links'))
 def event_deleted(self, event, **kwargs):
     for event_chatroom in ChatroomEventAssociation.find_for_event(
             event, include_hidden=True):
         chatroom_deleted = event_chatroom.delete()
         notify_deleted(event_chatroom.chatroom, event, None,
                        chatroom_deleted)
Example #8
0
 def event_deleted(self, event, **kwargs):
     for event_chatroom in ChatroomEventAssociation.find_for_event(event, include_hidden=True):
         chatroom_deleted = event_chatroom.delete()
         notify_deleted(event_chatroom.chatroom, event, None, chatroom_deleted)
Example #9
0
 def extend_event_menu(self, sender, **kwargs):
     return MenuEntryData(_('Chat Rooms'), 'chatrooms', 'chat.event_page', position=-1,
                          visible=lambda event: bool(ChatroomEventAssociation.find_for_event(event).count()))