Copybara | 854996b | 2021-09-07 19:36:02 +0000 | [diff] [blame] | 1 | # 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 | """View objects to help display users and groups in UI templates.""" |
| 7 | from __future__ import print_function |
| 8 | from __future__ import division |
| 9 | from __future__ import absolute_import |
| 10 | |
| 11 | import logging |
| 12 | |
| 13 | |
| 14 | class GroupView(object): |
| 15 | """Class to make it easier to display user group metadata.""" |
| 16 | |
| 17 | def __init__(self, name, num_members, group_settings, group_id): |
| 18 | self.name = name |
| 19 | self.num_members = num_members |
| 20 | self.who_can_view_members = str(group_settings.who_can_view_members) |
| 21 | self.group_id = group_id |
| 22 | |
| 23 | self.detail_url = '/g/%s/' % group_id |