Browse Source

DIV-255: Updated alias type to always use also known as

pull/160/head
Charles Shin 8 years ago
parent
commit
510ff1e836
2 changed files with 13 additions and 8 deletions
  1. +3
    -2
      edivorce/apps/core/static/js/functions.js
  2. +10
    -6
      edivorce/apps/core/templates/partials/alias_field.html

+ 3
- 2
edivorce/apps/core/static/js/functions.js View File

@ -118,9 +118,10 @@ var getValue = function(el, question){
} }
// for adding other_name fields, create list of [aliasType, alias] // for adding other_name fields, create list of [aliasType, alias]
else if (question == "other_name_you" || question == "other_name_spouse"){ else if (question == "other_name_you" || question == "other_name_spouse"){
var aliasType;
var aliasType = "also known as";
$('#other_names_fields').find("input[type=text]").each(function () { $('#other_names_fields').find("input[type=text]").each(function () {
aliasType = $(this).val() == '' ? '' : $(this).siblings(".alias-type").val();
// as per request, alias type will always be also known as for now
// aliasType = $(this).val() == '' ? '' : $(this).siblings(".alias-type").val();
value.push([aliasType, $(this).val()]); value.push([aliasType, $(this).val()]);
}); });
return JSON.stringify(value); return JSON.stringify(value);


+ 10
- 6
edivorce/apps/core/templates/partials/alias_field.html View File

@ -1,11 +1,15 @@
{% load input_field %} {% load input_field %}
<div class="form-inline clearfix"> <div class="form-inline clearfix">
<select class="response-dropdown alias-type form-control" name={{name}}>
<option value="also known as" {% if alias_type == 'also known as' %} selected {% endif %}>Also known as</option>
<option value="now known as" {% if alias_type == 'now known as' %} selected {% endif %}>Now known as</option>
<option value="otherwise known as" {% if alias_type == 'otherwise known as' %} selected {% endif %}>Otherwise known as</option>
<option value="with assumed name of" {% if alias_type == 'with assumed name of' %} selected {% endif %}>With assumed name of</option>
</select>
{% comment As per request, alias type will fixed to "also know as" %}
<select class="response-dropdown alias-type form-control" name={{name}}>
<option value="also known as" {% if alias_type == 'also known as' %} selected {% endif %}>Also known as</option>
<option value="now known as" {% if alias_type == 'now known as' %} selected {% endif %}>Now known as</option>
<option value="otherwise known as" {% if alias_type == 'otherwise known as' %} selected {% endif %}>Otherwise known as</option>
<option value="with assumed name of" {% if alias_type == 'with assumed name of' %} selected {% endif %}>With assumed name of</option>
</select>
{% endcomment %}
<label>Also known as</label>
{% input_field type="text" name=name value=value multiple="true" class="form-control response-textbox" %} {% input_field type="text" name=name value=value multiple="true" class="form-control response-textbox" %}
<input type="button" class="btn btn-danger btn-delete-name form-control" value="Delete" /> <input type="button" class="btn btn-danger btn-delete-name form-control" value="Delete" />
</div> </div>

Loading…
Cancel
Save