diff --git a/README.md b/README.md index 91d9b60..873e429 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,4 @@ The documentation and a more detailed readme will come later. 3. Migrate your TOM's database to install the new database tables: `./manage.py migrate` -4. Copy the data files from "tom_classifications/data" to the data/ directory of your TOM. - -5. Copy the target_detail.py into your TOM: -`cp tom_classifications/tom_classifications/templates/tom_targets/target_detail.html [PATH]/mytom/templates/tom_targets/target_detail.html` +4. Copy the data files from "tom_classifications/data" to the data/ directory of your TOM. \ No newline at end of file diff --git a/tom_classifications/apps.py b/tom_classifications/apps.py index 9c4c914..882d856 100644 --- a/tom_classifications/apps.py +++ b/tom_classifications/apps.py @@ -4,3 +4,20 @@ class TomClassificationsConfig(AppConfig): default_auto_field = 'django.db.models.BigAutoField' name = 'tom_classifications' + + def target_detail_tabs(self): + """ + Integration point for adding tabs to the target detail page. + + This method should return a list of dictionaries that include a `partial` key pointing to the path of the html + target_detail_tab partial. + The `context` key should point to the dot separated string path to the templatetag + that will return a dictionary containing new context for the accompanying partial. + The `label` key will represent the label string to put in the tab and use as a tab reference id. + This partial will be displayed within the tab on the target detail page. + + """ + return [{'partial': f'{self.name}/partials/classification_tab.html', + 'label': 'Classification', + # 'context': f'{self.name}.templatetags.classification_plots' + }] \ No newline at end of file diff --git a/tom_classifications/templates/tom_classifications/partials/classification_tab.html b/tom_classifications/templates/tom_classifications/partials/classification_tab.html new file mode 100644 index 0000000..a6ab820 --- /dev/null +++ b/tom_classifications/templates/tom_classifications/partials/classification_tab.html @@ -0,0 +1,5 @@ +{% load classification_plots %} + +
Airmass plotting for non-sidereal targets is not currently supported. If you would like to add this functionality, please check out the non-sidereal airmass plugin.
- {% endif %} -