{% if (print_labels is not defined or print_labels==true) and fieldinfo.type.name != "picklist" and fieldinfo.type.name != "multipicklist" %}
<label for="{{fieldinfo.name}}">{{fieldinfo.label|trans}} {% if fieldinfo.nullable != 1 %}*{% endif %}</label>
{% endif %}
	
{% if fieldinfo.type.name == "picklist" %}
	<select name="record[{{fieldinfo.name}}]" id="{{fieldinfo.name}}" {% if fieldinfo.nullable != 1 %}required{% endif %} >
		{% for option in fieldinfo.type.picklistValues %}
			<option value="{{option.value}}"  {% if record[fieldinfo.name] is defined and option.value == record[fieldinfo.name] %}selected="selected"{%endif%}>{{option.label}}</option>
		{% endfor %}
	</select>

{% elseif fieldinfo.type.name == "multipicklist" %}
	{% set multivals = record[fieldinfo.name] | split(' |##| ') %}
	<select name="record[{{fieldinfo.name}}][]" id="{{fieldinfo.name}}" {% if fieldinfo.nullable != 1 %}required{% endif %} multiple >
		{% for option in fieldinfo.type.picklistValues %}
			<option value="{{option.value}}" {% if option.value in multivals %}selected="selected"{%endif%}>{{option.label}}</option>
		{% endfor %}
	</select>
	
{% elseif fieldinfo.type.name == "text" %}	
	<textarea id="{{fieldinfo.name}}" name="record[{{fieldinfo.name}}]" class="materialize-textarea" placeholder="{{fieldinfo.label|trans|raw}}" {% if fieldinfo.nullable != 1 %}required{% endif %}>{% if record[fieldinfo.name] is defined %}{{record[fieldinfo.name]}}{% endif %}</textarea>
	
{% elseif fieldinfo.type.name == "string" %}
	<input id="{{fieldinfo.name}}" name="record[{{fieldinfo.name}}]" type="text" class="validate" placeholder="{{fieldinfo.label|trans|raw}}" {% if record[fieldinfo.name] is defined %}value="{{record[fieldinfo.name]}}"{% endif %} {% if fieldinfo.nullable != 1 %}required{% endif %}>

{% elseif fieldinfo.type.name == "date" %}	
	 <input type="date" class="datepicker" id="{{fieldinfo.name}}" name="record[{{fieldinfo.name}}]" {% if fieldinfo.nullable != 1 %}required{% endif %} {% if record[fieldinfo.name] is defined %}value="{{record[fieldinfo.name]}}"{% endif %} placeholder="{{fieldinfo.label|trans|raw}}">
	
{% elseif fieldinfo.type.name == "datetime" %}	
	 <input type="date" class="datepicker" id="{{fieldinfo.name}}" name="record[{{fieldinfo.name}}]" {% if fieldinfo.nullable != 1 %}required{% endif %} {% if record[fieldinfo.name] is defined %}value="{{record[fieldinfo.name]}}"{% endif %} placeholder="{{fieldinfo.label|trans|raw}}">

{% elseif fieldinfo.type.name == "time" %}	
	 <input type="time" class="timepicker" id="{{fieldinfo.name}}" name="record[{{fieldinfo.name}}]" {% if fieldinfo.nullable != 1 %}required{% endif %} {% if record[fieldinfo.name] is defined %}value="{{record[fieldinfo.name]}}"{% endif %}>
		 
	 

{% elseif fieldinfo.type.name == "double" or  fieldinfo.type.name == "integer" %}	
	 <input id="{{fieldinfo.name}}" name="record[{{fieldinfo.name}}]" type="number" class="validate" step="1" placeholder="{{fieldinfo.label|trans|raw}}" {% if fieldinfo.nullable != 1 %}required{% endif %} {% if record[fieldinfo.name] is defined %}value="{{record[fieldinfo.name]}}"{% endif %}>

{% elseif fieldinfo.type.name == "boolean" %}	
	 <p>
      <input type="checkbox" class="filled-in" name="record[{{fieldinfo.name}}]" id="{{fieldinfo.name}}" checked="checked" {% if fieldinfo.nullable != 1 %}required{% endif %}/>
      <label for="{{fieldinfo.name}}">{{fieldinfo.name|trans|raw}}</label>
     </p>
     
{% elseif fieldinfo.type.name == "phone" %}	
	<input type="tel" name="record[{{fieldinfo.name}}]" id="{{fieldinfo.name}}" {% if fieldinfo.nullable != 1 %}required{% endif %} {% if record[fieldinfo.name] is defined %}value="{{record[fieldinfo.name]}}"{% endif %}  placeholder="{{fieldinfo.label|trans|raw}}">
	
{% elseif fieldinfo.type.name == "url" %}	
	<input type="url" name="record[{{fieldinfo.name}}]" id="{{fieldinfo.name}}" {% if fieldinfo.nullable != 1 %}required{% endif %} {% if record[fieldinfo.name] is defined %}value="{{record[fieldinfo.name]}}"{% endif %}  placeholder="{{fieldinfo.label|trans|raw}}">	
	
{% elseif fieldinfo.type.name == "email" %}
	<input type="email" name="record[{{fieldinfo.name}}]" id="{{fieldinfo.name}}" {% if fieldinfo.nullable != 1 %}required{% endif %} {% if record[fieldinfo.name] is defined %}value="{{record[fieldinfo.name]}}"{% endif %}  placeholder="{{fieldinfo.label|trans|raw}}">	
{% elseif fieldinfo.type.name == "reference" %}
	<input type="text" readonly id="{{fieldinfo.name}}_label" {% if fieldinfo.nullable != 1 %}required{% endif %} {% if record[fieldinfo.name] is defined %}value="{{record['processed_info'][fieldinfo.name]}}"{% endif %}  placeholder="{{fieldinfo.label|trans|raw}}">
	<input type="hidden" name="record[{{fieldinfo.name}}]" id="{{fieldinfo.name}}" {% if fieldinfo.nullable != 1 %}required{% endif %} {% if record[fieldinfo.name] is defined %}value="{{record[fieldinfo.name]}}"{% endif %}>	
	{% for relmod in fieldinfo.type.refersTo %}
	
	{% if app.assigned_routes[relmod] is defined and app.modules[app.assigned_routes[relmod]] is defined and app.modules[app.assigned_routes[relmod]].enabled %}
	
	<a class="btn btn-small {{app.config.theme_basic_color}}" onclick="window.open('{{app.config.base_url}}/{{app.modules[app.assigned_routes[relmod]].route.route}}/popup/?field={{fieldinfo.name}}', '', 'width=700, height=600, status=no, menubar=no, toolbar=no');"><i class="material-icons left">{{app.modules[app.assigned_routes[relmod]].icon}}</i>{{"LBL_SELECT"|trans}} {{relmod|trans}}</a>&nbsp;
	
	{% endif %}
	
	{% endfor %}
	

{% else %}
	EDIT NOT AVAILABLE FOR THIS FIELD TYPE [{{fieldinfo.type.name}}]

{% endif %}

{% if (print_labels is not defined or print_labels==true) and (fieldinfo.type.name == "picklist" or fieldinfo.type.name == "multipicklist") %}
<label for="{{fieldinfo.name}}">{{fieldinfo.label|trans}} {% if fieldinfo.nullable != 1 %}*{% endif %}</label>
{% endif %}
