forked from beba/foerderbarometer
Add request_url field and otrs_link.js integration to service admins with ordered fields
This commit is contained in:
parent
0db5cb7fd9
commit
b23cf3adb8
134
input/admin.py
134
input/admin.py
|
|
@ -52,7 +52,6 @@ class ProjectAdmin(admin.ModelAdmin):
|
||||||
js = ('dropdown/js/otrs_link.js',)
|
js = ('dropdown/js/otrs_link.js',)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@admin.register(BusinessCard)
|
@admin.register(BusinessCard)
|
||||||
class BusinessCardAdmin(admin.ModelAdmin):
|
class BusinessCardAdmin(admin.ModelAdmin):
|
||||||
save_as = True
|
save_as = True
|
||||||
|
|
@ -62,8 +61,31 @@ class BusinessCardAdmin(admin.ModelAdmin):
|
||||||
# action = ['export_as_csv']
|
# action = ['export_as_csv']
|
||||||
date_hierarchy = 'granted_date'
|
date_hierarchy = 'granted_date'
|
||||||
readonly_fields = ['service_id']
|
readonly_fields = ['service_id']
|
||||||
|
|
||||||
|
fields = [
|
||||||
|
'terms_accepted',
|
||||||
|
'realname',
|
||||||
|
'email',
|
||||||
|
'granted',
|
||||||
|
'granted_date',
|
||||||
|
'survey_mail_date',
|
||||||
|
'mail_state',
|
||||||
|
'survey_mail_send',
|
||||||
|
'username',
|
||||||
|
'project',
|
||||||
|
'data',
|
||||||
|
'variant',
|
||||||
|
'url_of_pic',
|
||||||
|
'sent_to',
|
||||||
|
'send_data_to_print',
|
||||||
|
'request_url',
|
||||||
|
'intern_notes',
|
||||||
|
'service_id',
|
||||||
|
]
|
||||||
|
|
||||||
class Media:
|
class Media:
|
||||||
js = ('dropdown/js/base.js',)
|
js = ('dropdown/js/base.js', 'dropdown/js/otrs_link.js')
|
||||||
|
|
||||||
|
|
||||||
@admin.register(Literature)
|
@admin.register(Literature)
|
||||||
class LiteratureAdmin(admin.ModelAdmin):
|
class LiteratureAdmin(admin.ModelAdmin):
|
||||||
|
|
@ -74,6 +96,31 @@ class LiteratureAdmin(admin.ModelAdmin):
|
||||||
date_hierarchy = 'granted_date'
|
date_hierarchy = 'granted_date'
|
||||||
readonly_fields = ['service_id']
|
readonly_fields = ['service_id']
|
||||||
|
|
||||||
|
fields = [
|
||||||
|
'terms_accepted',
|
||||||
|
'realname',
|
||||||
|
'email',
|
||||||
|
'granted',
|
||||||
|
'granted_date',
|
||||||
|
'survey_mail_date',
|
||||||
|
'mail_state',
|
||||||
|
'survey_mail_send',
|
||||||
|
'username',
|
||||||
|
'cost',
|
||||||
|
'notes',
|
||||||
|
'info',
|
||||||
|
'source',
|
||||||
|
'selfbuy',
|
||||||
|
'selfbuy_give_data',
|
||||||
|
'selfbuy_data',
|
||||||
|
'request_url',
|
||||||
|
'intern_notes',
|
||||||
|
'service_id',
|
||||||
|
]
|
||||||
|
|
||||||
|
class Media:
|
||||||
|
js = ('dropdown/js/otrs_link.js',)
|
||||||
|
|
||||||
|
|
||||||
@admin.register(Account)
|
@admin.register(Account)
|
||||||
class AccountAdmin(admin.ModelAdmin):
|
class AccountAdmin(admin.ModelAdmin):
|
||||||
|
|
@ -101,6 +148,27 @@ class LibraryAdmin(admin.ModelAdmin):
|
||||||
readonly_fields = ['service_id']
|
readonly_fields = ['service_id']
|
||||||
exclude = ['type']
|
exclude = ['type']
|
||||||
|
|
||||||
|
fields = [
|
||||||
|
'realname',
|
||||||
|
'email',
|
||||||
|
'granted',
|
||||||
|
'granted_date',
|
||||||
|
'survey_mail_date',
|
||||||
|
'mail_state',
|
||||||
|
'survey_mail_send',
|
||||||
|
'username',
|
||||||
|
'cost',
|
||||||
|
'notes',
|
||||||
|
'library',
|
||||||
|
'duration',
|
||||||
|
'request_url',
|
||||||
|
'intern_notes',
|
||||||
|
'service_id',
|
||||||
|
]
|
||||||
|
|
||||||
|
class Media:
|
||||||
|
js = ('dropdown/js/otrs_link.js',)
|
||||||
|
|
||||||
def get_queryset(self, request):
|
def get_queryset(self, request):
|
||||||
return super().get_queryset(request).filter(type=self.model.TYPE)
|
return super().get_queryset(request).filter(type=self.model.TYPE)
|
||||||
|
|
||||||
|
|
@ -124,6 +192,26 @@ class IFGAdmin(admin.ModelAdmin):
|
||||||
date_hierarchy = 'granted_date'
|
date_hierarchy = 'granted_date'
|
||||||
readonly_fields = ['service_id']
|
readonly_fields = ['service_id']
|
||||||
|
|
||||||
|
fields = [
|
||||||
|
'realname',
|
||||||
|
'email',
|
||||||
|
'granted',
|
||||||
|
'granted_date',
|
||||||
|
'survey_mail_date',
|
||||||
|
'mail_state',
|
||||||
|
'survey_mail_send',
|
||||||
|
'username',
|
||||||
|
'cost',
|
||||||
|
'notes',
|
||||||
|
'url',
|
||||||
|
'request_url',
|
||||||
|
'intern_notes',
|
||||||
|
'service_id',
|
||||||
|
]
|
||||||
|
|
||||||
|
class Media:
|
||||||
|
js = ('dropdown/js/otrs_link.js',)
|
||||||
|
|
||||||
@admin.register(Travel)
|
@admin.register(Travel)
|
||||||
class TravelAdmin(admin.ModelAdmin):
|
class TravelAdmin(admin.ModelAdmin):
|
||||||
save_as = True
|
save_as = True
|
||||||
|
|
@ -147,8 +235,28 @@ class EmailAdmin(admin.ModelAdmin):
|
||||||
date_hierarchy = 'granted_date'
|
date_hierarchy = 'granted_date'
|
||||||
radio_fields = {'adult': admin.VERTICAL}
|
radio_fields = {'adult': admin.VERTICAL}
|
||||||
readonly_fields = ['service_id']
|
readonly_fields = ['service_id']
|
||||||
|
|
||||||
|
fields = [
|
||||||
|
'terms_accepted',
|
||||||
|
'realname',
|
||||||
|
'email',
|
||||||
|
'granted',
|
||||||
|
'granted_date',
|
||||||
|
'survey_mail_date',
|
||||||
|
'mail_state',
|
||||||
|
'survey_mail_send',
|
||||||
|
'username',
|
||||||
|
'domain',
|
||||||
|
'address',
|
||||||
|
'other',
|
||||||
|
'adult',
|
||||||
|
'request_url',
|
||||||
|
'intern_notes',
|
||||||
|
'service_id',
|
||||||
|
]
|
||||||
|
|
||||||
class Media:
|
class Media:
|
||||||
js = ('dropdown/js/base.js',)
|
js = ('dropdown/js/base.js', 'dropdown/js/otrs_link.js')
|
||||||
|
|
||||||
|
|
||||||
@admin.register(List)
|
@admin.register(List)
|
||||||
|
|
@ -160,6 +268,26 @@ class ListAdmin(admin.ModelAdmin):
|
||||||
date_hierarchy = 'granted_date'
|
date_hierarchy = 'granted_date'
|
||||||
readonly_fields = ['service_id']
|
readonly_fields = ['service_id']
|
||||||
|
|
||||||
|
fields = [
|
||||||
|
'terms_accepted',
|
||||||
|
'realname',
|
||||||
|
'email',
|
||||||
|
'granted',
|
||||||
|
'granted_date',
|
||||||
|
'survey_mail_date',
|
||||||
|
'mail_state',
|
||||||
|
'survey_mail_send',
|
||||||
|
'username',
|
||||||
|
'domain',
|
||||||
|
'address',
|
||||||
|
'request_url',
|
||||||
|
'intern_notes',
|
||||||
|
'service_id',
|
||||||
|
]
|
||||||
|
|
||||||
|
class Media:
|
||||||
|
js = ('dropdown/js/otrs_link.js',)
|
||||||
|
|
||||||
# commented out because of the individual registering to control displays in admin panel
|
# commented out because of the individual registering to control displays in admin panel
|
||||||
|
|
||||||
#admin.site.register([
|
#admin.site.register([
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue