blob: 304b4350a1be03929836e7a356067ea656001faf [file] [log] [blame]
Copybara854996b2021-09-07 19:36:02 +00001# Copyright 2016 The Chromium Authors. All rights reserved.
2# Use of this source code is governed 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."""
7from __future__ import print_function
8from __future__ import division
9from __future__ import absolute_import
10
11import logging
12
13import ezt
14
15from features import activities
Adrià Vilanova Martínezde942802022-07-15 14:06:55 +020016from framework import flaskservlet
Copybara854996b2021-09-07 19:36:02 +000017from framework import servlet
18from framework import urls
19
20
21class ProjectUpdates(servlet.Servlet):
22 """ProjectUpdates page shows a list of past activities."""
23
24 _PAGE_TEMPLATE = 'project/project-updates-page.ezt'
Adrià Vilanova Martínezde942802022-07-15 14:06:55 +020025 _MAIN_TAB_MODE = flaskservlet.FlaskServlet.MAIN_TAB_UPDATES
Copybara854996b2021-09-07 19:36:02 +000026
27 def GatherPageData(self, mr):
28 """Build up a dictionary of data values to use when rendering the page."""
29
30 page_data = self._GatherUpdates(mr)
31 page_data['subtab_mode'] = None
32 page_data['user_updates_tab_mode'] = None
33 logging.info('project updates data is %r', page_data)
34 return page_data
35
36 def _GatherUpdates(self, mr):
37 """Gathers and returns activity streams data."""
38
39 url = '/p/%s%s' % (mr.project_name, urls.UPDATES_LIST)
40 return activities.GatherUpdatesData(
41 self.services, mr, project_ids=[mr.project_id],
42 ending='by_user', updates_page_url=url,
43 autolink=self.services.autolink)
Adrià Vilanova Martínezde942802022-07-15 14:06:55 +020044
45 # def GetProjectUpdatesPage(self, **kwargs):
46 # return self.handler(**kwargs)