10112/mountain-range-form-change #4

Merged
mravi merged 14 commits from 10112/mountain-range-form-change into master 2022-01-17 18:21:11 +00:00
2 changed files with 17 additions and 13 deletions
Showing only changes of commit 14cad5b554 - Show all commits

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 = (
('', ''),