<s> from django . contrib import admin <EOL> from django . utils . translation import ugettext_lazy as _ <EOL> from helpdesk . models import Queue , Ticket , FollowUp , PreSetReply , KBCategory <EOL> from helpdesk . models import EscalationExclusion , EmailTemplate , KBItem <EOL> from helpdesk . models import TicketChange , Attachment , IgnoreEmail <EOL> from helpdesk . models import CustomField <EOL> class QueueAdmin ( admin . ModelAdmin ) : <EOL> list_display = ( '<STR_LIT:title>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> prepopulated_fields = { "<STR_LIT>" : ( "<STR_LIT:title>" , ) } <EOL> class TicketAdmin ( admin . ModelAdmin ) : <EOL> list_display = ( '<STR_LIT:title>' , '<STR_LIT:status>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , ) <EOL> date_hierarchy = '<STR_LIT>' <EOL> list_filter = ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT:status>' ) <EOL> def hidden_submitter_email ( self , ticket ) : <EOL> if ticket . submitter_email : <EOL> username , domain = ticket . submitter_email . split ( "<STR_LIT:@>" ) <EOL> username = username [ : <NUM_LIT:2> ] + "<STR_LIT:*>" * ( len ( username ) - <NUM_LIT:2> ) <EOL> domain = domain [ : <NUM_LIT:1> ] + "<STR_LIT:*>" * ( len ( domain ) - <NUM_LIT:2> ) + domain [ - <NUM_LIT:1> : ] <EOL> return "<STR_LIT>" % ( username , domain ) <EOL> else : <EOL> return ticket . submitter_email <EOL> hidden_submitter_email . short_description = _ ( '<STR_LIT>' ) <EOL> class TicketChangeInline ( admin . StackedInline ) : <EOL> model = TicketChange <EOL> class AttachmentInline ( admin . StackedInline ) : <EOL> model = Attachment <EOL> class FollowUpAdmin ( admin . ModelAdmin ) : <EOL> inlines = [ TicketChangeInline , AttachmentInline ] <EOL> class KBItemAdmin ( admin . ModelAdmin ) : <EOL> list_display = ( '<STR_LIT>' , '<STR_LIT:title>' , '<STR_LIT>' , ) <EOL> list_display_links = ( '<STR_LIT:title>' , ) <EOL> class CustomFieldAdmin ( admin . ModelAdmin ) : <EOL> list_display = ( '<STR_LIT:name>' , '<STR_LIT:label>' , '<STR_LIT>' ) <EOL> class EmailTemplateAdmin ( admin . ModelAdmin ) : <EOL> list_display = ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> list_filter = ( '<STR_LIT>' , ) <EOL> admin . site . register ( Ticket , TicketAdmin ) <EOL> admin . site . register ( Queue , QueueAdmin ) <EOL> admin . site . register ( FollowUp , FollowUpAdmin ) <EOL> admin . site . register ( PreSetReply ) <EOL> admin . site . register ( EscalationExclusion ) <EOL> admin . site . register ( EmailTemplate , EmailTemplateAdmin ) <EOL> admin . site . register ( KBCategory ) <EOL> admin . site . register ( KBItem , KBItemAdmin ) <EOL> admin . site . register ( IgnoreEmail ) <EOL> admin . site . register ( CustomField , CustomFieldAdmin ) </s>
