Compare commits

...

6 Commits

Author SHA1 Message Date
pcoder116 14cad5b554 Merge branch 'master' into 10112/mountain-range-form-change 2022-01-17 18:20:34 +00:00
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
PCoder 1b9bd6df48 Resource: Fix Atlas showing up as default type for empty one 2022-01-17 20:58:56 +05:30
PCoder caef9906bd Organisation list view update
Show org_num instead of the name (which can be empty)
2022-01-17 20:13:56 +05:30
2 changed files with 17 additions and 13 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']
@ -198,7 +203,7 @@ class OrganizationAdmin(admin.ModelAdmin):
]
readonly_fields = ('org_num1',)
search_fields = ['organisation_search', 'org_alpha_search', 'organisation_2', 'organisation_3', 'subject']
list_display = ['organisation_english', 'organisation_2', 'country']
list_display = ['org_num1', 'organisation_english', 'organisation_2', 'country']
fieldsets = (
(None, {
'fields': (

View File

@ -163,7 +163,8 @@ class Resource(models.Model):
("*****", "*****"),
)
TYPE_CHOICES = (
("", "Atlas"),
("", ""),
("Atlas", "Atlas"),
("Book", "Book"),
("Book chapter", "Book chapter"),
("Case study", "Case study"),
@ -575,9 +576,7 @@ class Person(models.Model):
MR_MRS_CHOICES = (
('', ''),
('Ms', 'Ms'),
('Ms.', 'Ms.'),
('Mr', 'Mr'),
('Mr.', 'Mr.'),
)
GMBA_FUNCTION_CHOICES = (
('', ''),