def person_picker(self): field = copy_field( ISnap['owner'], vocabularyName='AllUserTeamsParticipationPlusSelfSimpleDisplay') return InlinePersonEditPickerWidget( self.context, field, format_link(self.context.owner), header='Change owner', step_title='Select a new owner')
def maintainer_widget(self): return InlinePersonEditPickerWidget( self.context, IDistribution['owner'], format_link(self.context.owner), header='Change maintainer', edit_view='+reassign', step_title='Select a new maintainer', show_create_team=True)
def maintainer_widget(self): return InlinePersonEditPickerWidget( self.context, IProjectGroup['owner'], format_link(self.context.owner, empty_value="Not yet selected"), header='Change maintainer', edit_view='+reassign', step_title='Select a new maintainer', null_display_value="Not yet selected", show_create_team=True)
def driver_widget(self): return InlinePersonEditPickerWidget( self.context, IProjectGroup['driver'], format_link(self.context.driver, empty_value="Not yet selected"), header='Change driver', edit_view='+driver', step_title='Select a new driver', null_display_value="Not yet selected", help_link="/+help-registry/driver.html", show_create_team=True)
def mirror_admin_widget(self): if canWrite(self.context, 'mirror_admin'): empty_value = ' Specify a mirror administrator' else: empty_value = 'None' return InlinePersonEditPickerWidget( self.context, IDistribution['mirror_admin'], format_link(self.context.mirror_admin, empty_value=empty_value), header='Change the mirror administrator', edit_view='+selectmirroradmins', null_display_value=empty_value, step_title='Select a new mirror administrator')
def members_widget(self): if canWrite(self.context, 'members'): empty_value = ' Specify the members team' else: empty_value = 'None' return InlinePersonEditPickerWidget( self.context, IDistribution['members'], format_link(self.context.members, empty_value=empty_value), header='Change the members team', edit_view='+selectmemberteam', null_display_value=empty_value, step_title='Select a new members team')
def driver_widget(self): if canWrite(self.context, 'driver'): empty_value = 'Specify a driver' else: empty_value = 'None' return InlinePersonEditPickerWidget( self.context, IDistribution['driver'], format_link(self.context.driver, empty_value=empty_value), header='Change driver', edit_view='+driver', null_display_value=empty_value, step_title='Select a new driver', show_create_team=True)
def getWidget(self, widget_value, show_create_team=False, **kwargs): class ITest(Interface): test_field = Choice(**kwargs) class Test: implements(ITest) def __init__(self): self.test_field = widget_value context = Test() return InlinePersonEditPickerWidget(context, ITest['test_field'], None, edit_url='fake', show_create_team=show_create_team)