diff --git a/tom_observations/templates/tom_observations/partials/observation_list.html b/tom_observations/templates/tom_observations/partials/observation_list.html index 8013053d8..8e8e865c2 100644 --- a/tom_observations/templates/tom_observations/partials/observation_list.html +++ b/tom_observations/templates/tom_observations/partials/observation_list.html @@ -1,9 +1,14 @@ - + {% for observation in observations %} + {% if observation.url %} + + {% else %} + + {% endif %} diff --git a/tom_observations/views.py b/tom_observations/views.py index 6ea0dcf26..09f7c0d21 100644 --- a/tom_observations/views.py +++ b/tom_observations/views.py @@ -467,9 +467,9 @@ def form_valid(self, form): ) observation_id = form.cleaned_data['observation_id'] messages.success(self.request, f'Successfully associated observation record {observation_id}') - return redirect(reverse( - 'tom_targets:detail', kwargs={'pk': form.cleaned_data['target_id']}) - ) + base_url = reverse('tom_targets:detail', kwargs={'pk': form.cleaned_data['target_id']}) + query_params = urlencode({'tab': 'observations'}) + return redirect(f'{base_url}?{query_params}') class ObservationRecordDetailView(DetailView): diff --git a/tom_targets/templates/tom_targets/target_detail.html b/tom_targets/templates/tom_targets/target_detail.html index 5fdac4eac..23006fece 100644 --- a/tom_targets/templates/tom_targets/target_detail.html +++ b/tom_targets/templates/tom_targets/target_detail.html @@ -7,20 +7,31 @@ {% endblock %} {% block content %}
@@ -39,7 +50,7 @@ {% if object.type == 'SIDEREAL' %} {% aladin object %} {% endif %} - +
diff --git a/tom_targets/views.py b/tom_targets/views.py index ac7d39bfb..9bbc942f0 100644 --- a/tom_targets/views.py +++ b/tom_targets/views.py @@ -435,7 +435,7 @@ def get(self, request, *args, **kwargs): 'Did you know updating observation statuses can be automated? Learn how in' '' ' the docs.')) - return redirect(reverse('tom_targets:detail', args=(target_id,))) + return redirect(reverse('tom_targets:detail', args=(target_id,)) + '?tab=observations') obs_template_form = ApplyObservationTemplateForm(request.GET) if obs_template_form.is_valid():
FacilityCreatedStatusScheduledSaved dataView
FacilityObservation IDCreatedStatusScheduledSaved dataView
{{ observation.facility }}{{ observation.observation_id }}{{ observation.observation_id }}{{ observation.created }} {{ observation.status }} {{ observation.scheduled_start }}