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

41 lines
1.4 KiB
HTML

{% load gadjo %}
<div style="position: relative">
{{ form|with_template }}
{% 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_p');
end_field = $('#id_cdataviz_chartngcell-{{ cell.pk }}-time_range_end_p');
start_field_template = $('#id_cdataviz_chartngcell-{{ cell.pk }}-time_range_start_template_p');
end_field_template = $('#id_cdataviz_chartngcell-{{ cell.pk }}-time_range_end_template_p');
$('#id_cdataviz_chartngcell-{{ cell.pk }}-time_range').change(function() {
if(this.value == 'range') {
start_field.show();
end_field.show();
} else {
start_field.hide();
end_field.hide();
}
if(this.value == 'range-template') {
start_field_template.show();
end_field_template.show();
} else {
start_field_template.hide();
end_field_template.hide();
}
}).change();
$('div#panel-dataviz_chartngcell-{{ cell.pk }}-general div.content').change(function() {
$('div#cell-dataviz_chartngcell-{{ cell.pk }} button.save').click();
});
});
</script>