Skip to content

Commit f5c0d97

Browse files
committed
remove done TODOs; clean up placeholders and help_text
1 parent 141e723 commit f5c0d97

File tree

1 file changed

+23
-16
lines changed

1 file changed

+23
-16
lines changed

tom_swift/swift.py

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,6 @@ class SwiftObservationForm(BaseObservationForm):
7676
choices=SWIFT_INSTRUMENT_CHOICES,
7777
initial=SWIFT_INSTRUMENT_CHOICES[1], # XRT is default
7878
)
79-
# TODO: display appropriate mode and justification fields according to
80-
# value of instrument ChoiceField (see observation_form.html)
8179

8280
urgency = forms.ChoiceField(
8381
required=True,
@@ -99,10 +97,13 @@ class SwiftObservationForm(BaseObservationForm):
9997
#
10098
# TODO: validation - answer at least one of these questions
10199
optical_magnitude = forms.FloatField(required=False, label='Optical Magnitude')
102-
optical_filter = forms.CharField(required=False, label='What filter was this measured in?',initial='u')
100+
optical_filter = forms.CharField(required=False, help_text='What filter was the optical magnitude measured in?', initial='u')
103101
xrt_countrate = forms.FloatField(required=False, label='XRT Count Rate [counts/second]')
104102
bat_countrate = forms.FloatField(required=False, label='BAT Count Rate [counts/second]')
105-
other_brightness = forms.CharField(required=False, label='Other Brightness')
103+
other_brightness = forms.CharField(
104+
required=False, label='Other Brightness',
105+
widget=forms.TextInput(attrs={'placeholder': 'Any other brightness information.'})
106+
)
106107

107108
#
108109
# GRB stuff
@@ -125,14 +126,16 @@ class SwiftObservationForm(BaseObservationForm):
125126
#
126127
immediate_objective = forms.CharField(
127128
required=False, label='Immediate Objective',
128-
initial="TOM Toolkit test by [email protected] (please contact if this is a problem)",
129-
widget=forms.Textarea(attrs={'rows': 4})
129+
widget=forms.Textarea(attrs={
130+
'rows': 2,
131+
'placeholder' : 'One sentence explanation of this TOO request.'})
130132
)
131133

132134
science_just = forms.CharField(
133135
required=False, label='Science Justification',
134-
initial="TOM Toolkit test by [email protected] (please contact if this is a problem)",
135-
widget=forms.Textarea(attrs={'rows': 8})
136+
widget=forms.Textarea(attrs={
137+
'rows': 8,
138+
'placeholder' : 'A pursuasive paragraph or two explaining why this object requires rapid observation.'})
136139
)
137140

138141
#
@@ -141,8 +144,9 @@ class SwiftObservationForm(BaseObservationForm):
141144
exposure = forms.FloatField(required=False, label='Exposure time requested [s]',initial=500)
142145
exp_time_just = forms.CharField(
143146
required=False, label='Exposure Time Justification',
144-
initial="TOM Toolkit test by [email protected] (please contact if this is a problem)",
145-
widget=forms.Textarea(attrs={'rows': 4})
147+
widget=forms.Textarea(attrs={
148+
'rows': 2,
149+
'placeholder': 'Briefly justify the exposure time requested.'}),
146150
)
147151

148152
#
@@ -152,8 +156,8 @@ class SwiftObservationForm(BaseObservationForm):
152156
num_of_visits= forms.IntegerField(
153157
required=False,
154158
label='Number of visits [integer]',
155-
help_text=('If number of visits more than one change next exposure'
156-
'time per visit and monitoring frequency, otherwise leave blank.'),
159+
help_text=('If number of visits is more than one, then complete exposure'
160+
' time per visit and monitoring frequency.'),
157161
initial=1)
158162
monitoring_freq = forms.IntegerField(required=False, label='Monitoring Frequency', initial=1)
159163
monitoring_units = forms.ChoiceField(
@@ -170,7 +174,6 @@ class SwiftObservationForm(BaseObservationForm):
170174
required=False, label='Trigger Justification',
171175
widget=forms.Textarea(attrs={'rows': 4}))
172176
proposal_pi = forms.CharField(required=False, label='Proposal PI name')
173-
# TODO: show/hide according to value of proposal BooleanField
174177

175178
#
176179
# Instrument mode
@@ -191,14 +194,18 @@ class SwiftObservationForm(BaseObservationForm):
191194
' href=https://www.swift.psu.edu/operations/mode_lookup.php>'
192195
'UVOT Mode Lookup Tool</a>'
193196
)),
194-
) # 0x9999 is the "Filter of the Day" and does not require justification
197+
) # 0x9999 is the "Filter of the Day" and does not require justification
195198

196199
# required unless uvot_mode is 0x9999 (Filter of the Day)
197200
uvot_just = forms.CharField(
198201
required=False,
199202
label='UVOT Mode Justification',
200-
initial="TOM Toolkit test by [email protected] (please contact if this is a problem)",
201-
widget=forms.Textarea(attrs={'rows': 4}))
203+
widget=forms.Textarea(attrs={
204+
'rows': 3,
205+
'placeholder': ('Required unless uvot_mode is 0x9999 (Filter of the Day).'
206+
' If you are not sure what filter mode to use, explain what you want here in words.')}
207+
),
208+
)
202209

203210
slew_in_place = forms.BooleanField(
204211
required=False,

0 commit comments

Comments
 (0)