<% if (m.mode == 'new_fields') { %>
	<div id="organizer_field_type_list_outer" class="field_type_list_outer">
		<div class="field_type_list_header field_type_section">
			<h5>Add a field</h5>
			<input class="form_settings" type="button" value="Form settings"/>
		</div>
		<div class="field_type_list_header field_type_section header_content">
			<h5>Fields linked with <a href="{{m.link_to_dataset|e}}" target="_blank">Users dataset</a></h5>
		</div>
		<div id="organizer_linked_field_type_list" class="field_type_list field_type_section header_content">
			{{zenarioT.microTemplate('zenario_organizer_form_builder_dataset_tab', m.datasetTabs)}}
		</div>
		
		<div class="field_type_list_header field_type_section header_content">
			<h5>Decorative</h5>
		</div>
		<div id="organizer_field_type_list" class="field_type_list field_type_section field_type_section_simple header_content">
			<div class="types_list">
				<div class="field_type" data-type="section_description"><span class="section_description"></span><h4>Subheading</h4></div>
				<div class="field_type" data-type="section_spacer"><span class="section_spacer"></span><h4>Spacer</h4></div>
			</div>
		</div>
		
		<div class="field_type_list_header field_type_section header_content">
			<h5>Custom form fields</h5>
		</div>
		<div id="organizer_field_type_list" class="field_type_list field_type_section field_type_section_simple header_content">
			<div class="types_list">
				<div class="field_type" data-type="checkbox"><span class="checkbox"></span><h4>Checkbox</h4></div>
				<div class="field_type" data-type="checkboxes"><span class="checkboxes"></span><h4>Checkboxes</h4></div>
				<div class="field_type" data-type="date"><span class="date"></span><h4>Date</h4></div>
				<div class="field_type" data-type="radios"><span class="radios"></span><h4>Radios</h4></div>
				<div class="field_type" data-type="select"><span class="select"></span><h4>Select list</h4></div>
				<div class="field_type" data-type="text"><span class="text"></span><h4>Text</h4></div>
				<div class="field_type" data-type="textarea"><span class="textarea"></span><h4>Textarea</h4></div>
				<div class="field_type" data-type="url"><span class="url"></span><h4>URL</h4></div>
				<div class="field_type" data-type="attachment"><span class="attachment"></span><h4>Attachment</h4></div>
				<div class="field_type" data-type="sortable_selection"><span class="sortable_selection"></span><h4>Sortable selection</h4></div>
				<div class="field_type" data-type="restatement"><span class="restatement"></span><h4>Mirrored</h4></div>
				<div class="field_type" data-type="document_upload"><span class="document_upload"></span><h4>Multi-upload</h4></div>
				<div class="field_type" data-type="repeat_start"><span class="repeat_start"></span><h4>Repeating section</h4></div>
				<div class="field_type" data-type="calculated"><span class="calculated"></span><h4>Calculated</h4></div>
			</div>
		</div>
		
		<div class="field_type_list_header field_type_section header_content">
			<h5>Centralised data source fields</h5>
		</div>
		<div id="organizer_centralised_field_type_list" class="field_type_list field_type_section header_content">
			<!-- Centralised radios are removed as of 10.3. It is possible to edit existing ones but not add new ones. -->
			<!-- Centralised select lists are added by looping through zenario/js/panel_type_form_builder.js. -->
			<% if (m.centralised_lists) { %>
				<% foreach (m.centralised_lists as source => centralised_list) { %>
					<div class="field_type" data-type="centralised_select" data-source="{{source}}" data-label="{{centralised_list.label}}"><span class="centralised_select"></span><h4>{{centralised_list.label}}</h4></div>
				<% } %>
			<% } %>
		</div>
	</div>
<% } else if (m.mode == 'edit_field' || m.mode == 'edit_page') { %>
	<div id="organizer_field_details_outer" class="field_details_outer" >
		<div id="organizer_field_details_inner" class="field_details_inner">
			<form id="organizer_field_details_form">
				<div class="field_details_header">
					<div class="field_details_header_options">
						<input class="form_settings" type="button" value="Form settings"/>
					</div>
					<div id="zenario_field_details_header_content" class="field_details_header_content">
						<div class="field_name {{m.type|e}}">
							
							<div class="view_mode">
								<h5 id="field_display__name">{{m.name|e}}</h5>
								<span class="edit_field_name_button">Edit</span>
							</div>
							<div class="edit_mode" style="display:none;">
								<% if (m.mode == 'edit_field') { %>
									<input name="name" id="field__name" type="text" value="{{m.name|e}}" maxlength="255" placeholder="Field name"/>
								<% } else if (m.mode == 'edit_page') { %>
									<input name="name" id="field__name" type="text" value="{{m.name|e}}" maxlength="255" placeholder="Step name"/>
								<% } %>
								
								<span class="done_field_name_button">Done</span>
							</div>
							
						</div>
						<div class="field_buttons">
							<span class="add_new_field">Done</span>
						</div>
						<div class="field_info">
							<span class="field_type_message">{{m.type_phrase|e}}</span>
							<% if (m.mode == 'edit_page' && m.status == 'active') { %>
								<span id="organizer_remove_form_page" class="delete_field">Delete step</span>
							<% } %> 
						</div> 
					</div>
				</div>
				<% if (!m.hide_tab_bar) { %>
					<div id="organizer_field_details_tabs" class="field_details_tabs">
						<!-- TUIX tabs -->
					</div>
				<% } %>
				<div id="organizer_field_details" class="field_details">
					<!-- TUIX fields -->
				</div>
			</form>
		</div>
	</div>
<% } %>
