Adrià Vilanova MartÃnez | f19ea43 | 2024-01-23 20:20:52 +0100 | [diff] [blame^] | 1 | # Copyright 2016 The Chromium Authors |
| 2 | # Use of this source code is governed by a BSD-style license that can be |
| 3 | # found in the LICENSE file. |
Copybara | 854996b | 2021-09-07 19:36:02 +0000 | [diff] [blame] | 4 | |
| 5 | """View objects to help display users and groups in UI templates.""" |
| 6 | from __future__ import print_function |
| 7 | from __future__ import division |
| 8 | from __future__ import absolute_import |
| 9 | |
| 10 | import logging |
| 11 | |
| 12 | |
| 13 | class GroupView(object): |
| 14 | """Class to make it easier to display user group metadata.""" |
| 15 | |
| 16 | def __init__(self, name, num_members, group_settings, group_id): |
| 17 | self.name = name |
| 18 | self.num_members = num_members |
| 19 | self.who_can_view_members = str(group_settings.who_can_view_members) |
| 20 | self.group_id = group_id |
| 21 | |
| 22 | self.detail_url = '/g/%s/' % group_id |