hiddenfields
This commit is contained in:
@@ -151,8 +151,8 @@ class InstantPlanSelectForm(forms.Form):
|
|||||||
# Instroke Metrics interactive chart form
|
# Instroke Metrics interactive chart form
|
||||||
class InstrokeForm(forms.Form):
|
class InstrokeForm(forms.Form):
|
||||||
metric = forms.ChoiceField(label='metric',choices=(('a','a'),('b','b')))
|
metric = forms.ChoiceField(label='metric',choices=(('a','a'),('b','b')))
|
||||||
spm_min = forms.IntegerField(initial=15,label='SPM Min')
|
spm_min = forms.IntegerField(initial=15,label='SPM Min',widget=HiddenInput)
|
||||||
spm_max = forms.IntegerField(initial=45,label='SPM Max')
|
spm_max = forms.IntegerField(initial=45,label='SPM Max',widget=HiddenInput)
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs): # pragma: no cover
|
def __init__(self, *args, **kwargs): # pragma: no cover
|
||||||
choices = kwargs.pop('choices', [])
|
choices = kwargs.pop('choices', [])
|
||||||
|
|||||||
@@ -60,10 +60,13 @@ $( function() {
|
|||||||
range: true,
|
range: true,
|
||||||
min: 0,
|
min: 0,
|
||||||
max: 60,
|
max: 60,
|
||||||
values: [ 15, 45 ],
|
values: [ {{ spm_min }}, {{ spm_max }} ],
|
||||||
slide: function( event, ui ) {
|
slide: function( event, ui ) {
|
||||||
$( "#id_spm_min" ).val( ui.values[ 0 ]);
|
$( "#id_spm_min" ).val( ui.values[ 0 ]);
|
||||||
$( "#id_spm_max" ).val(ui.values[ 1 ] );
|
$( "#id_spm_max" ).val(ui.values[ 1 ] );
|
||||||
|
$( "#spm_min_info" ).text( ui.values[ 0 ]);
|
||||||
|
$( "#spm_max_info" ).text(ui.values[ 1 ] );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
@@ -101,7 +104,10 @@ $( function() {
|
|||||||
{{ form.as_table }}
|
{{ form.as_table }}
|
||||||
</table>
|
</table>
|
||||||
<div id="slider-container">
|
<div id="slider-container">
|
||||||
<span>Stroke Rate Slider</span>
|
<span>SPM (slide to change):</span>
|
||||||
|
<span id="spm_min_info">{{ spm_min }}</span>
|
||||||
|
<span> - </span>
|
||||||
|
<span id="spm_max_info">{{ spm_max }}</span>
|
||||||
<hr id="slider-range" />
|
<hr id="slider-range" />
|
||||||
</div>
|
</div>
|
||||||
<input name='form' class="button" type="submit" value="Submit">
|
<input name='form' class="button" type="submit" value="Submit">
|
||||||
|
|||||||
@@ -2987,6 +2987,8 @@ def instroke_chart_interactive(request, id=0):
|
|||||||
'form':form,
|
'form':form,
|
||||||
'the_script': script,
|
'the_script': script,
|
||||||
'the_div': div,
|
'the_div': div,
|
||||||
|
'spm_min': spm_min,
|
||||||
|
'spm_max': spm_max,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user