def GatherPageData(self, _mr): """Build up a dictionary of data values to use when rendering the page.""" available_access_levels = project_helpers.BuildProjectAccessOptions( None) offer_access_level = len(available_access_levels) > 1 if settings.default_access_level: access_view = project_views.ProjectAccessView( settings.default_access_level) else: access_view = None return { 'initial_name': '', 'initial_summary': '', 'initial_description': '', 'initial_project_home': '', 'initial_docs_url': '', 'initial_source_url': '', 'initial_logo_gcs_id': '', 'initial_logo_file_name': '', 'logo_view': tracker_views.LogoView(None), 'labels': [], 'max_project_name_length': framework_constants.MAX_PROJECT_NAME_LENGTH, 'offer_access_level': ezt.boolean(offer_access_level), 'initial_access': access_view, 'available_access_levels': available_access_levels, }
def GatherPageData(self, mr): """Build up a dictionary of data values to use when rendering the page.""" available_access_levels = project_helpers.BuildProjectAccessOptions( mr.project) offer_access_level = len(available_access_levels) > 1 access_view = project_views.ProjectAccessView(mr.project.access) return { 'admin_tab_mode': self.ADMIN_TAB_META, 'initial_summary': mr.project.summary, 'initial_project_home': mr.project.home_page, 'initial_docs_url': mr.project.docs_url, 'initial_source_url': mr.project.source_url, 'initial_logo_gcs_id': mr.project.logo_gcs_id, 'initial_logo_file_name': mr.project.logo_file_name, 'logo_view': tracker_views.LogoView(mr.project), 'initial_description': mr.project.description, 'issue_notify': mr.project.issue_notify_address, 'process_inbound_email': ezt.boolean( mr.project.process_inbound_email), 'email_from_addr': emailfmt.FormatFromAddr(mr.project), 'only_owners_remove_restrictions': ezt.boolean( mr.project.only_owners_remove_restrictions), 'only_owners_see_contributors': ezt.boolean( mr.project.only_owners_see_contributors), 'offer_access_level': ezt.boolean(offer_access_level), 'initial_access': access_view, 'available_access_levels': available_access_levels, }