OLD | NEW |
(Empty) | |
| 1 # Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is govered by a BSD-style |
| 3 # license that can be found in the LICENSE file or at |
| 4 # https://developers.google.com/open-source/licenses/bsd |
| 5 |
| 6 """A class to display a paginated list of activity stream updates.""" |
| 7 |
| 8 import logging |
| 9 |
| 10 from third_party import ezt |
| 11 |
| 12 from features import activities |
| 13 from framework import servlet |
| 14 from framework import urls |
| 15 |
| 16 |
| 17 class ProjectUpdates(servlet.Servlet): |
| 18 """ProjectUpdates page shows a list of past activities.""" |
| 19 |
| 20 _PAGE_TEMPLATE = 'project/project-updates-page.ezt' |
| 21 _MAIN_TAB_MODE = servlet.Servlet.MAIN_TAB_UPDATES |
| 22 |
| 23 def GatherPageData(self, mr): |
| 24 """Build up a dictionary of data values to use when rendering the page.""" |
| 25 |
| 26 page_data = self._GatherUpdates(mr) |
| 27 page_data['subtab_mode'] = None |
| 28 page_data['user_updates_tab_mode'] = None |
| 29 logging.info('project updates data is %r', page_data) |
| 30 return page_data |
| 31 |
| 32 def _GatherUpdates(self, mr): |
| 33 """Gathers and returns activity streams data.""" |
| 34 |
| 35 url = '/p/%s%s' % (mr.project_name, urls.UPDATES_LIST) |
| 36 return activities.GatherUpdatesData( |
| 37 self.services, mr, self.profiler, project_ids=[mr.project_id], |
| 38 ending='by_user', updates_page_url=url, |
| 39 autolink=self.services.autolink) |
OLD | NEW |