<div class="popups">
	<div class="modal hide b-contacts-content" data-bind="modal: modalVisibility">
		<div class="modal-header b-header-toolbar g-ui-user-select-none">
			<button type="button" class="close" data-bind="command: cancelCommand">&times;</button>
			<div class="btn-toolbar">
				
				<div class="btn-group">
					<a class="btn button-create-contact" data-bind="command: newCommand">
						<i class="icon-plus"></i>
						&nbsp;&nbsp;
						<span class="i18n" data-i18n-text="CONTACTS/BUTTON_ADD_CONTACT"></span>
					</a>
				</div>

				<div class="btn-group">
					<a class="btn dropdown-toggle buttonMore" data-toggle="dropdown">
						<i data-bind="css: {'icon-list': !contacts.importing(), 'icon-spinner animated': contacts.importing()}"></i>
					</a>
					<ul class="dropdown-menu g-ui-menu">
						<li class="e-item">
							<a class="e-link" data-bind="initDom: importUploaderButton">
								<i class="icon-list-add"></i>
								&nbsp;&nbsp;
								<span class="i18n" data-i18n-text="CONTACTS/BUTTON_IMPORT"></span>
							</a>
						</li>
					</ul>
				</div>

				<div class="btn-group">
					<a class="btn btn-success button-new-message" data-bind="command: newMessageCommand">
						<i class="icon-mail icon-white"></i>
					</a>
				</div>

				<div class="btn-group">
					<a class="btn btn-danger button-delete" data-bind="command: deleteCommand">
						<i class="icon-trash icon-white"></i>
						<span data-bind="text: 1 < contactsCheckedOrSelected().length ? ' (' + contactsCheckedOrSelected().length + ')' : ''"></span>
					</a>
				</div>
			</div>
		</div>
		<div class="modal-body" style="position: relative">
			<div class="b-list-toopbar">
				<input class="i18n span3 e-search" type="text" placeholder="Search" data-18n-placeholder="CONTACS/SEARCH_INPUT_PLACEHOLDER" data-bind="value: search" />
			</div>
<!--
			<div class="btn-toolbar b-list-toopbar g-ui-user-select-none">
				<div class="btn-group">
					<input class="i18n span3 e-search" type="text" placeholder="Search" data-18n-placeholder="CONTACS/SEARCH_INPUT_PLACEHOLDER" data-bind="value: search" />
				</div>
				<div class="btn-group pull-right">
					<a class="btn dropdown-toggle button-filter" data-toggle="dropdown">
						<i class="icon-bolt"></i>
					</a>
					<ul class="dropdown-menu g-ui-menu">
						<li class="e-item">
							<a class="e-link">
								Personal address book
							</a>
						</li>
						<li class="e-item">
							<a class="e-link">
								Collected
							</a>
						</li>
					</ul>
				</div>
			</div>
			-->
			<div class="b-list-content g-ui-user-select-none" data-bind="nano: true, css: {'hideContactListCheckbox': !useCheckboxesInList()}">
				<div class="content g-scrollbox">
					<div class="content-wrapper">
						<div class="listClear" data-bind="visible: viewClearSearch() && '' !== search()">
							<span class="g-ui-link i18n" data-i18n-text="CONTACTS/CLEAR_SEARCH" data-bind="command: clearCommand"></span>
						</div>
						<div class="listEmptyList" data-bind="visible: 0 === contacts().length && '' === search() && !contacts.loading()">
							<span class="i18n" data-i18n-text="CONTACTS/EMPTY_LIST"></span>
						</div>
						<div class="listEmptyListLoading" data-bind="visible: 0 === contacts().length && '' === search() && contacts.loading()">
							<span class="i18n" data-i18n-text="CONTACTS/LIST_LOADING"></span><span class="textLoadingAnimationD1">.</span><span class="textLoadingAnimationD2">.</span><span class="textLoadingAnimationD3">.</span>
						</div>
						<div class="listEmptySearchList" data-bind="visible: 0 === contacts().length && '' !== search() && !contacts.loading()">
							<span class="i18n" data-i18n-text="CONTACTS/EMPTY_SEARCH"></span>
						</div>
						<div class="e-contact-foreach g-ui-user-select-none" data-bind="foreach: contacts, visible: 0 < contacts().length">
							<div class="e-contact-item g-ui-user-select-none" data-bind="css: lineAsCcc()">
								<div class="sidebarParent">
									&nbsp;
								</div>
								<div class="delimiter"></div>
								<div class="wrapper">
									<div class="checkedParent">
										<i class="checkboxItem" data-bind="css: checked() || selected() ? 'checkboxMessage icon-checkbox-checked' : 'checkboxMessage icon-checkbox-unchecked'"></i>
									</div>
									<div class="shareParent actionHandle">
										<i class="icon-share"></i>
									</div>
									<div class="nameParent actionHandle">
										<span class="listName" data-bind="text: display"></span>
										&nbsp;
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
			<div class="b-list-footer-toopbar">
				<div class="pull-right footer-pager">
					<!-- ko template: { name: 'Pagenator', data: contactsPagenator } --><!-- /ko -->
				</div>
			</div>
			<div class="b-view-content" data-bind="nano: true, css: {'read-only': viewReadOnly}">
				<div class="content g-scrollbox">
					<div class="content-wrapper">
						<div class="b-contact-view-desc" data-bind="visible: emptySelection">
							<span class="i18n" data-i18n-text="CONTACTS/CONTACT_VIEW_DESC"></span>
						</div>
						<div data-bind="visible: !emptySelection()">
							<div class="form-horizontal top-part">
								<div class="control-group" data-bind="visible: !viewReadOnly() || 0 < viewPropertiesEmailsNonEmpty().length">
									<label class="control-label remove-padding-top fix-width">
										<i class="icon-user iconsize24"></i>
									</label>
									<div class="controls fix-width" data-bind="foreach: viewPropertiesNames">
										<div class="property-line">
											<span class="contactValueStatic" data-bind="text: value" />
											<input type="text" class="contactValueInput" placeholder="" data-bind="value: value, hasFocus: focused, valueUpdate: 'keyup', attr: {'placeholder': placeholderValue}" />
										</div>
									</div>
								</div>
								<div class="control-group" data-bind="visible: !viewReadOnly() || 0 < viewPropertiesEmails().length">
									<label class="control-label remove-padding-top fix-width">
										<i class="icon-at iconsize24" data-placement="left" data-bind="tooltip: 'CONTACTS/LABEL_EMAIL'"></i>
									</label>
									<div class="controls fix-width">
										<div data-bind="foreach: viewPropertiesEmails">
											<div class="property-line">
												<span class="contactValueStatic" data-bind="text: value" />
												<input type="email" class="contactValueInput" data-bind="value: value, hasFocus: focused, valueUpdate: 'keyup'" />
											</div>
										</div>
										<a href="javascript:void(0);" class="g-ui-link add-link i18n" data-bind="visible: !viewReadOnly(), click: addNewEmail" data-i18n-text="CONTACTS/LINK_ADD_EMAIL"></a>
									</div>
								</div>
								<div class="control-group" data-bind="visible: !viewReadOnly() || 0 < viewPropertiesPhones().length">
									<label class="control-label remove-padding-top fix-width">
										<i class="icon-telephone iconsize24" data-placement="left" data-bind="tooltip: 'CONTACTS/LABEL_PHONE'"></i>
									</label>
									<div class="controls fix-width">
										<div data-bind="foreach: viewPropertiesPhones">
											<div class="property-line">
												<span class="contactValueStatic" data-bind="text: value" />
												<input type="text" class="contactValueInput" data-bind="value: value, hasFocus: focused, valueUpdate: 'keyup'" />
											</div>
										</div>
										<a href="javascript:void(0);" class="g-ui-link add-link i18n" data-bind="visible: !viewReadOnly(), click: addNewPhone" data-i18n-text="CONTACTS/LINK_ADD_PHONE"></a>
									</div>
								</div>
								<div class="control-group">
									<div class="controls fix-width">
										<br />
										<br />
									</div>
								</div>
							</div>
							
							<div class="e-read-only-sign">
								<i class="icon-lock iconsize24" data-placement="left" data-bind="tooltip: 'CONTACTS/LABEL_READ_ONLY'"></i>
							</div>

							<div class="e-share-sign" data-bind="visible: contactsSharingIsAllowed">
								<div class="btn-group pull-right">
									<a class="btn dropdown-toggle" data-placement="left" data-toggle="dropdown" data-bind="tooltip: 'CONTACTS/LABEL_SHARE'">
										<i data-bind="css: shareIcon"></i>
										&nbsp;&nbsp;
										<span class="caret"></span>
									</a>
									<ul class="dropdown-menu g-ui-menu">
										<li class="e-item" data-bind="css: {'selected': shareToNone}">
											<a class="e-link" data-bind="click: setShareToNone">
												<i class="icon-none"></i>
												&nbsp;&nbsp;
												<span class="i18n" data-i18n-text="CONTACTS/BUTTON_SHARE_NONE"></span>
											</a>
										</li>
										<li class="e-item" data-bind="css: {'selected': shareToAll}">
											<a class="e-link" data-bind="click: setShareToAll">
												<i class="icon-earth"></i>
												&nbsp;&nbsp;
												<span class="i18n" data-i18n-text="CONTACTS/BUTTON_SHARE_ALL"></span>
											</a>
										</li>
									</ul>
								</div>
							</div>
							
							<button class="btn button-save-contact" data-bind="command: saveCommand, css: {'dirty': watchDirty}">
								<i data-bind="css: {'icon-ok': !viewSaving(), 'icon-spinner animated': viewSaving()}"></i>
								&nbsp;&nbsp;
								<span class="i18n" data-i18n-text="CONTACTS/BUTTON_CREATE_CONTACT" data-bind="visible: '' === viewID()"></span>
								<span class="i18n" data-i18n-text="CONTACTS/BUTTON_UPDATE_CONTACT" data-bind="visible: '' !== viewID()"></span>
							</button>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
