Skip to content

Commit

Permalink
Merge pull request PGScatalog#325 from fyvon/curation_tracker/1.2
Browse files Browse the repository at this point in the history
Curation tracker/1.2
  • Loading branch information
ens-lgil authored Jan 12, 2024
2 parents 1e42d16 + 24adf1f commit ccaae3d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
11 changes: 9 additions & 2 deletions curation_tracker/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,9 @@ class Meta:
'eligibility': 'Eligibility automatically assigned (default: Yes)'
}
exclude = ()
widgets = {
'PMID': forms.TextInput(attrs={'size': 6})
}

def clean(self):
""" Used as a form validator (on some of the fields) """
Expand Down Expand Up @@ -268,7 +271,7 @@ class CurationPublicationAnnotationAdmin(MultiDBModelAdmin):
"curation_status","display_first_level_curation_status","display_first_level_curator",
"display_second_level_curation_status","display_second_level_curator",
"priority")
list_filter = ("curation_status","first_level_curator","second_level_curator","priority",("publication_date",PublicationDateFilter),)
list_filter = ("curation_status","first_level_curator","second_level_curator","priority",("publication_date",PublicationDateFilter),"created_on")
search_fields = ["id","study_name","pgp_id","doi","PMID","first_level_curation_status","second_level_curation_status","curation_status","reported_trait"]
ordering = ('-id',)
list_per_page = 25 # No of records per page
Expand Down Expand Up @@ -760,12 +763,16 @@ def confirm_litsuggest_formset(self,request):
display_created_on.admin_order_field = 'created_on'

# Batch actions
actions = ["mark_as_released"]
actions = ["mark_as_imported","mark_as_released"]

@admin.action(permissions=["change"],description="Mark selected studies as Released")
def mark_as_released(self, request, queryset):
queryset.update(curation_status='Released')

@admin.action(permissions=["change"],description="Mark selected studies as Imported")
def mark_as_imported(self, request, queryset):
queryset.update(curation_status='Imported - Awaiting Release')


### Email Templates ###
class EmailTemplateForm(forms.ModelForm):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ <h2>Curation Release Ready</h2>
<h5>Content</h5>
<ul>
<li><a class="mr-2" href="#import_ready">Studies ready for <b>import</b></a> <span class="badge badge-pill badge-pgs">{{ studies_to_import_count }}</span></li>
<li class="mb-1"><a class="mr-2" href="#scores">Studies ready for <b>release</b></a> <span class="badge badge-pill badge-pgs">{{ studies_to_release_count }}</span></li>
<li class="mb-1"><a class="mr-2" href="#release_ready">Studies ready for <b>release</b></a> <span class="badge badge-pill badge-pgs">{{ studies_to_release_count }}</span></li>
</ul>
</nav>
</div>
Expand Down

0 comments on commit ccaae3d

Please sign in to comment.