""" open/dulcinea/lib/ui/user/search.qpy """ from dulcinea.ui.lib.search import SearchForm from dulcinea.user import text_format_user from dulcinea.common import format_user from qp.pub.common import get_user class DulcineaUserSearchForm(SearchForm): def get_search_text_fields(self, user): return [text_format_user(user)] def get_title(self): return 'Users' def format_search_results_headings:xml(self): 'User' if get_user().is_admin(): 'Is Admin?' 'Can create users?' def format_search_results_table_row:xml(self, user): '%s' % format_user(user) if get_user().is_admin(): '%s' % ((user.is_admin() and 'Yes') or 'No') if user.is_granted('create-users'): 'Yes' else: 'No' def format_matches:xml(self): '' class DisabledDulcineaUserSearchForm(SearchForm): def get_search_text_fields(self, user): return [text_format_user(user)] def get_title(self): return 'Disabled Users' def format_search_results_headings:xml(self): ''' User ''' def format_search_results_table_row:xml(self, user): '%s' % format_user(user) def format_matches:xml(self): ''