Compare commits

...

3 Commits

Author SHA1 Message Date
PCoder 35094de8a8 PersonAdmin: Remove Mr. and Ms. options for mr_mrs choices 2022-01-17 23:14:48 +05:30
PCoder 9cba842a18 PersonAdmin: Move profile_on_web and newsletter to the top 2022-01-17 23:14:09 +05:30
PCoder 3a29b96513 PersonAdmin: Show organization_url 2022-01-17 23:13:33 +05:30
2 changed files with 14 additions and 11 deletions

View File

@ -22,16 +22,16 @@ class PersonAdmin(admin.ModelAdmin):
PeopleResourceInline,
PeopleRangeInline
]
readonly_fields = ['id']
readonly_fields = ['id', 'organization_url']
search_fields = ['title', 'first_name', 'last_name', 'organisation', 'position', 'country__short_name', 'contact_email']
fieldsets = (
(None, {
'fields': (
('id'),
('id', 'profile_on_web', 'news_letter'),
('mr_mrs', 'title','full_name', 'position'),
('first_name', 'last_name', 'search_name', 'status'),
('contact_email', 'email_2', 'skype', 'professional_phone'),
'organization',
('organization', 'organization_url'),
'personal_url',
'biography',
'field_of_expertise',
@ -55,12 +55,12 @@ class PersonAdmin(admin.ModelAdmin):
}),
('Others', {
'classes': ('collapse',),
'fields': ('orcid', 'web_of_science', 'twitter', 'instagram', 'updated',
('news_letter', 'profile_on_web'),
'entry_date',
'country',
'gmba_function'
),
'fields': (
'orcid', 'web_of_science', 'twitter', 'instagram', 'updated',
'entry_date',
'country',
'gmba_function'
),
}),
)
list_display = ['id', 'full_name', 'organization']
@ -69,6 +69,11 @@ class PersonAdmin(admin.ModelAdmin):
ordering = ['full_name']
# list_display_links = ['id']
def organization_url(self, instance):
return format_html('<a href="{0}" target="_blank">{1}</a>',
str(instance.organization.url).strip("#") if instance.organization.url else "",
str(instance.organization.url).strip("#") if instance.organization.url else "")
class ResourceKeywordInline(admin.TabularInline):
autocomplete_fields = ['keyword']

View File

@ -576,9 +576,7 @@ class Person(models.Model):
MR_MRS_CHOICES = (
('', ''),
('Ms', 'Ms'),
('Ms.', 'Ms.'),
('Mr', 'Mr'),
('Mr.', 'Mr.'),
)
GMBA_FUNCTION_CHOICES = (
('', ''),