From caef9906bd94346fb050d56e201d69f3e89fcc97 Mon Sep 17 00:00:00 2001 From: PCoder Date: Mon, 17 Jan 2022 20:13:37 +0530 Subject: [PATCH 1/5] Organisation list view update Show org_num instead of the name (which can be empty) --- app/admin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/admin.py b/app/admin.py index 041acd9..03f7b51 100644 --- a/app/admin.py +++ b/app/admin.py @@ -200,7 +200,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': ( From 1b9bd6df48804fd1fc14271f5e143fe7e34716b8 Mon Sep 17 00:00:00 2001 From: PCoder Date: Mon, 17 Jan 2022 20:58:49 +0530 Subject: [PATCH 2/5] Resource: Fix Atlas showing up as default type for empty one --- app/models.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/models.py b/app/models.py index 4980def..2acc466 100644 --- a/app/models.py +++ b/app/models.py @@ -163,7 +163,8 @@ class Resource(models.Model): ("*****", "*****"), ) TYPE_CHOICES = ( - ("", "Atlas"), + ("", ""), + ("Atlas", "Atlas"), ("Book", "Book"), ("Book chapter", "Book chapter"), ("Case study", "Case study"), From 3a29b96513b857a4bfb5b5cdfb19f7fe5c559645 Mon Sep 17 00:00:00 2001 From: PCoder Date: Mon, 17 Jan 2022 23:13:33 +0530 Subject: [PATCH 3/5] PersonAdmin: Show organization_url --- app/admin.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/admin.py b/app/admin.py index 03f7b51..f653ee4 100644 --- a/app/admin.py +++ b/app/admin.py @@ -22,7 +22,7 @@ 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, { @@ -31,7 +31,7 @@ class PersonAdmin(admin.ModelAdmin): ('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', @@ -69,6 +69,11 @@ class PersonAdmin(admin.ModelAdmin): ordering = ['full_name'] # list_display_links = ['id'] + def organization_url(self, instance): + return format_html('{1}', + 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'] From 9cba842a18e1e8be1d729f1e651f16bbf8ca4ef8 Mon Sep 17 00:00:00 2001 From: PCoder Date: Mon, 17 Jan 2022 23:14:09 +0530 Subject: [PATCH 4/5] PersonAdmin: Move profile_on_web and newsletter to the top --- app/admin.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/app/admin.py b/app/admin.py index f653ee4..4681234 100644 --- a/app/admin.py +++ b/app/admin.py @@ -27,7 +27,7 @@ class PersonAdmin(admin.ModelAdmin): 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'), @@ -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'] From 35094de8a82e0545574005bd501c43bb025dc74c Mon Sep 17 00:00:00 2001 From: PCoder Date: Mon, 17 Jan 2022 23:14:41 +0530 Subject: [PATCH 5/5] PersonAdmin: Remove Mr. and Ms. options for mr_mrs choices --- app/models.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/models.py b/app/models.py index 2acc466..4911206 100644 --- a/app/models.py +++ b/app/models.py @@ -576,9 +576,7 @@ class Person(models.Model): MR_MRS_CHOICES = ( ('', ''), ('Ms', 'Ms'), - ('Ms.', 'Ms.'), ('Mr', 'Mr'), - ('Mr.', 'Mr.'), ) GMBA_FUNCTION_CHOICES = ( ('', ''),