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 %} + +

Classifications

+{% classif_sun object %} +{% classif_scatter object %} \ No newline at end of file diff --git a/tom_classifications/templates/tom_targets/target_detail.html b/tom_classifications/templates/tom_targets/target_detail.html deleted file mode 100644 index 94d207d..0000000 --- a/tom_classifications/templates/tom_targets/target_detail.html +++ /dev/null @@ -1,122 +0,0 @@ -{% extends 'tom_common/base.html' %} -{% load comments bootstrap4 tom_common_extras targets_extras observation_extras dataproduct_extras classification_plots static cache %} -{% block title %}Target {{ object.name }}{% endblock %} -{% block additional_css %} - - -{% endblock %} -{% block content %} - -
-
-
- {% target_feature object %} - {% if object.future_observations %} -
- {{ object.future_observations|length }} upcoming observation{{ object.future_observations|pluralize }} -
- {% endif %} - {% target_unknown_statuses object %} - {% target_buttons object %} - {% target_data object %} - {% recent_photometry object limit=3 %} - {% if object.type == 'SIDEREAL' %} - {% aladin object %} - {% endif %} - -
-
-
- -
-
-

Observe

- {% observing_buttons object %} -
- {% observationtemplate_run object %} -
-

Plan

- {% if object.type == 'SIDEREAL' %} - {% target_plan %} - {% moon_distance object %} - {% elif target.type == 'NON_SIDEREAL' %} -

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 %} -
-
- {% existing_observation_form object %} -

Observations

- Update Observations Status - {% observation_list object %} -
-
- {% if user.is_authenticated %} - {% upload_dataproduct object %} - {% endif %} - {% dataproduct_list_for_target object %} -
-
- {% target_groups target %} -
-
- {% photometry_for_target target %} -
-
- {% spectroscopy_for_target target %} -
-
-

Classifications

- {% classif_sun object %} - {% classif_scatter object %} -
- {% comments_enabled as comments_are_enabled %} -
-
Comments
- {% if comments_are_enabled %} - {% render_comment_list for object %} - {% url 'targets:detail' object.id as next %} - {% if user.is_authenticated %} - {% render_comment_form for object %} - {% endif %} - {% endif %} -
-
-
-{% endblock %}