Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#Fixes #9945] Do not show the time configuration for raster datasets #9947

Merged
merged 1 commit into from
Sep 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions geonode/layers/templates/layouts/panels.html
Original file line number Diff line number Diff line change
Expand Up @@ -720,6 +720,7 @@
</div>
</div>
</div>
{% if resource.is_vector %}
<div class="col-xs-12 col-lg-4" id="settings_time_series">
<div class="panel-group">
<div class="panel panel-default">
Expand Down Expand Up @@ -752,6 +753,7 @@
</div>
</div>
</div>
{% endif %}
</div>
</div>

Expand Down
2 changes: 1 addition & 1 deletion geonode/layers/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -744,7 +744,7 @@ def dataset_metadata(

layer.has_time = dataset_form.cleaned_data.get('has_time', layer.has_time)

if timeseries_form.cleaned_data and ('has_time' in dataset_form.changed_data or timeseries_form.changed_data):
if layer.is_vector() and timeseries_form.cleaned_data and ('has_time' in dataset_form.changed_data or timeseries_form.changed_data):
ts = timeseries_form.cleaned_data
end_attr = layer.attributes.get(pk=ts.get("end_attribute")).attribute if ts.get("end_attribute") else None
start_attr = layer.attributes.get(pk=ts.get("attribute")).attribute if ts.get("attribute") else None
Expand Down
43 changes: 22 additions & 21 deletions geonode/templates/metadata_form_js.html
Original file line number Diff line number Diff line change
Expand Up @@ -416,34 +416,35 @@

$(document).ready(function() {

if($("#id_resource-has_time").is(":checked")) {
$("#settings_time_series").show();
if ($("#id_timeseries-presentation").val() == 'LIST') {
$("#precision_value").hide();
}
} else {
$("#settings_time_series").hide();
};

$("#id_resource-has_time").click(function() {
if($(this).is(":checked")) {
{% if resource.is_vector %}
if($("#id_resource-has_time").is(":checked")) {
$("#settings_time_series").show();
if ($("#id_timeseries-presentation").val() == 'LIST') {
$("#precision_value").hide();
}
} else {
$("#settings_time_series").hide();
}
});

$("#id_timeseries-presentation").change(function() {
if(this.value != 'LIST') {
$("#precision_value").show();
} else {
$("#precision_value").hide();
}
});
};

$("#id_resource-has_time").click(function() {
if($(this).is(":checked")) {
$("#settings_time_series").show();
if ($("#id_timeseries-presentation").val() == 'LIST') {
$("#precision_value").hide();
}
} else {
$("#settings_time_series").hide();
}
});

$("#id_timeseries-presentation").change(function() {
if(this.value != 'LIST') {
$("#precision_value").show();
} else {
$("#precision_value").hide();
}
});
{% endif %}
{% block hints %}

$('#completeness-hints .mandatory-hint').click(getTab.bind(null, 1));
Expand Down