def wall_settings(self): defaults = { 'events': list(set(Event.event_types()) - \ set(c.user.ignored_events_list)) } return htmlfill.render(self._wall_settings_form(), defaults=defaults)
def update_wall_settings(self): if hasattr(self, 'form_result'): events = set(self.form_result.get('events', [])) events = list(set(Event.event_types()) - events) c.user.update_ignored_events(events) meta.Session.commit() h.flash(_('Your wall settings have been updated.')) redirect(url(controller='profile', action='wall_settings'))
def eventcomment_reply(self, event_id): event = Event.get(event_id) if event is None: abort(404) comment = EventComment(c.user, self.form_result['message']) event.post_comment(comment) meta.Session.commit() if request.params.has_key('js'): return render_mako_def('/sections/wall_entries.mako', 'thread_reply', id=comment.id, author_id=comment.created.id, message=comment.content, created_on=comment.created_on, allow_comment_deletion=True) else: self._redirect()
def _wall_settings_form(self): c.event_types = event_types_grouped(Event.event_types()) c.tabs = self._account_settings_tabs() c.current_tab = 'wall' return render('profile/settings_wall.mako')