combo/combo/apps/dataviz/templates/combo/chartngcell_form.html

34 lines
1.3 KiB
HTML

<div style="position: relative">
{{ form.as_p }}
{% if cell.statistic and cell.chart_type != "table" and cell.chart_type != "table-inverted" %}
<div style="position: absolute; right: 0; top: 0; width: 300px; height: 150px">
<embed type="image/svg+xml" src="{% url 'combo-dataviz-graph' cell=cell.id %}?width=300&height=150"/>
</div>
{% endif %}
</div>
<script>
$(function () {
start_field = $('#id_cdataviz_chartngcell-{{ cell.pk }}-time_range_start');
end_field = $('#id_cdataviz_chartngcell-{{ cell.pk }}-time_range_end');
start_field_template = $('#id_cdataviz_chartngcell-{{ cell.pk }}-time_range_start_template');
end_field_template = $('#id_cdataviz_chartngcell-{{ cell.pk }}-time_range_end_template');
$('#id_cdataviz_chartngcell-{{ cell.pk }}-time_range').change(function() {
if(this.value == 'range') {
start_field.parent().show();
end_field.parent().show();
} else {
start_field.parent().hide();
end_field.parent().hide();
}
if(this.value == 'range-template') {
start_field_template.parent().show();
end_field_template.parent().show();
} else {
start_field_template.parent().hide();
end_field_template.parent().hide();
}
}).change();
});
</script>