def _q_lookup(self, request, num): if not num.isdigit(): raise TraversalError num = int(num) team = Team.get_by_uid(self.team_uid) actions = get_team_feed(team.id).get_actions(start=num, stop=num+PAGE_ACTIONS_COUNT-1) length = len(actions) render_html = render_actions(actions, show_avatar=True) return {'result': render_html, 'length': length}
def _q_lookup(self, request, num): if not num.isdigit(): raise TraversalError num = int(num) team = Team.get_by_uid(self.team_uid) actions = get_team_feed(team.id).get_actions(start=num, stop=num + PAGE_ACTIONS_COUNT - 1) length = len(actions) render_html = render_actions(actions, show_avatar=True) return {'result': render_html, 'length': length}
def news(self, request): user = request.user team = Team.get_by_uid(self.team_uid) if not team: raise TraversalError feed = get_team_feed(team.id) actions = feed.get_actions(stop=PAGE_ACTIONS_COUNT - 1) projects = team.projects is_admin = False if user and team.is_owner(user.name): is_admin = True return st("/teams/news.html", **locals())
def news(self, request): user = request.user team = Team.get_by_uid(self.team_uid) if not team: raise TraversalError feed = get_team_feed(team.id) actions = feed.get_actions(stop=PAGE_ACTIONS_COUNT - 1) projects = team.projects is_admin = False if user and team.is_owner(user.name): is_admin = True return st('/teams/news.html', **locals())