-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#66 add RNDT fields in advanced editing
- Loading branch information
1 parent
232a2db
commit 187de26
Showing
3 changed files
with
124 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{% extends "layers/layer_metadata_advanced.html" %} | ||
{% load i18n %} | ||
{% load static %} | ||
{% load floppyforms %} | ||
|
||
{% block other_tab %} | ||
<br> | ||
<div class="content"> | ||
{% include "rndt/data_constraints_tab.html" %} | ||
</div> | ||
{% endblock other_tab %} | ||
|
||
|
||
{% block layer_fields %} | ||
{% for field in layer_form %} | ||
{% if field.name != 'use_featureinfo_custom_template' and field.name != 'featureinfo_custom_template' and field.name != 'constraints_other' and field.name != 'restriction_code_type' %} | ||
<div> | ||
<span><label for="{{ field.id }}">{{ field.label }}</label></span> | ||
{{ field }} | ||
</div> | ||
{% endif %} | ||
{% endfor %} | ||
{% endblock layer_fields %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
{% load i18n %} | ||
{% load static %} | ||
{% load floppyforms %} | ||
{% load rndt_extra %} | ||
|
||
<div class="panel-group"> | ||
<div class="col-xs-12 col-lg-8"> | ||
<div class="panel panel-default"> | ||
<div class="panel-heading">{% trans "Data Constraints" %}</div> | ||
<div class="panel-body"> | ||
<div id="accessConstraintsInfo"> | ||
<!--span><label>{% trans "Access constraints" %}</label></span> | ||
{{ LayerRNDTForm.access_contraints }}--> | ||
<span><label for="id_access_contraints" class="control-label required-field">{% trans "Access constraints" %}</label></span> | ||
<select | ||
title="{% trans "Choose one of the following..." %}" | ||
name="access_contraints" | ||
id="id_access_contraints" | ||
class="selectpicker form-control" | ||
> | ||
{% for item in LayerRNDTForm.access_contraints.field.choices %} | ||
{% if item.0|get_access_contraints:layer.id %} | ||
<option selected value="{{ item.0 }}"> | ||
{% else %} | ||
<option value="{{ item.0 }}"> | ||
{% endif %} | ||
{{ item.1 }} | ||
</option> | ||
{% endfor %} | ||
</select> | ||
</div> | ||
<div id="useConstraintsInfo"> | ||
<span><label for="id_use_constraints" class="control-label required-field">{% trans "Use constraints" %}</label></span> | ||
<select | ||
title="{% trans "Choose one of the following..." %}" | ||
name="use_constraints" | ||
id="id_use_constraints" | ||
class="selectpicker form-control" | ||
> | ||
{% for item in LayerRNDTForm.use_constraints.field.choices %} | ||
{% if item.0|get_other_constraint:layer.id %} | ||
<option selected value="{{ item.0 }}"> | ||
{% else %} | ||
<option value="{{ item.0 }}"> | ||
{% endif %} | ||
{{ item.1 }} | ||
</option> | ||
{% endfor %} | ||
</select> | ||
</div> | ||
<div id="free_text" hidden> | ||
<span><label>{% trans "Free text" %}</label></span> | ||
{{ LayerRNDTForm.free_text }} | ||
</div> | ||
<script type="text/javascript"> | ||
$(document).ready(function() { | ||
$("select[name$='use_constraints']").change(function() { | ||
if ($(this).val() == 'freetext') { | ||
$("#free_text").show(); | ||
} else { | ||
$("#free_text").hide(); | ||
} | ||
}); | ||
var x = $("#id_use_constraints"); | ||
if ((x.val() == 'freetext' || x.val() == '') && "{{layer.constraints_other}}"==='None') { | ||
$("select[id$='id_use_constraints']").val(""); | ||
$("textarea[id$='free_text']").val(""); | ||
} | ||
else if ((x.val() == 'freetext' || x.val() == '') && "{{layer.constraints_other}}") { | ||
$("select[id$='id_use_constraints']").val("freetext"); | ||
$("textarea[id$='free_text']").val("{{layer.constraints_other}}"); | ||
$("div[id$='free_text']").show(); | ||
} | ||
}); | ||
</script> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="col-xs-12 col-lg-4"> | ||
<div> | ||
<span><label for="id_resolution" class="control-label required-field">{% trans "Resolution" %}</label></span><br> | ||
<div class="custom"> | ||
<div class="input-group resolution"> | ||
<div class="input-group-addon">mt</div> | ||
{{ LayerRNDTForm.resolution|get_resolution_value:layer.id }} | ||
</div> | ||
</div> | ||
<span><label for="id_accuracy" class="control-label required-field">{% trans "Positional Accuracy" %}</label></span><br> | ||
<div class="custom"> | ||
<div class="input-group accuracy"> | ||
<div class="input-group-addon">mt</div> | ||
{{ LayerRNDTForm.accuracy|get_accuracy_value:layer.id }} | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> |