summaryrefslogtreecommitdiffstats
path: root/templates/contactDetails.html
blob: a0462755972e6990572a0fc2f89cb42ca5690521 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<div class="contact-details-wrapper wrapper-show"
	 ng-class="{'mobile-show': ctrl.show, 'icon-loading': ctrl.loading}">
	<div id="app-navigation-toggle-back" class="details-back icon-download" ng-click="ctrl.clearContact()"></div>
	<div ng-if="ctrl.contact===undefined && !ctrl.loading && !ctrl.init">
		<div id="emptycontent">
			<div class="icon-contacts-dark"></div>
			<h2>{{ctrl.t.noContacts}}</h2>
		</div>
	</div>
	<div ng-if="ctrl.init">
		<div id="emptycontent">
			<div class="icon-contacts-dark"></div>
			<h2>{{ctrl.t.loading}}</h2>
		</div>
	</div>
	<div ng-if="ctrl.contact!==undefined">
		<header class="contactdetails__header" ng-style="{'background-color': (ctrl.contact.uid() | contactColor)}">
			<avatar data="ctrl.contact" ng-class="{'avatar--missing': ctrl.contact.photo()===undefined}"></avatar>
			<div id="details-contact-infos">
				<h2>
					<input type="text" id="details-fullName" class="contactdetails__name" placeholder="{{ctrl.t.placeholderName}}" autocomplete="off" autocorrect="off" spellcheck="false"
						   name="fullname" ng-model="ctrl.contact.fullName" ng-model-options="{ getterSetter: true, debounce: 500 }" ng-change="ctrl.updateContact()" value=""
						   ng-disabled="ctrl.addressBook.readOnly" />
				</h2>
				<div id="details-org-container">
					<input type="text" id="details-org" class="contactdetails__org" placeholder="{{ctrl.t.placeholderOrg}}" autocomplete="off" autocorrect="off" spellcheck="false"
						   name="org" ng-model="ctrl.contact.org" ng-model-options="{ getterSetter: true, debounce: 500 }" ng-change="ctrl.updateContact()" value=""
						   inputresize size="{{ctrl.contact.org().length > 1 ? ctrl.contact.org().length : '1'}}"
						   ng-disabled="ctrl.addressBook.readOnly" />
					<input type="text" id="details-title" class="contactdetails__title" placeholder="{{ctrl.t.placeholderTitle}}" autocomplete="off" autocorrect="off" spellcheck="false"
						   name="title" ng-model="ctrl.contact.title" ng-model-options="{ getterSetter: true, debounce: 500 }" ng-change="ctrl.updateContact()" value=""
						   inputresize size="{{ctrl.contact.title().length > 1 ? ctrl.contact.title().length : '1'}}"
						   ng-disabled="ctrl.addressBook.readOnly" />
				</div>
			</div>
			<div id="details-actions">
				<button id="contact-failed-save" ng-click="ctrl.updateContact()" class="icon-checkmark-white" ng-if="ctrl.contact.failedProps.length>0" title="{{ctrl.t.save}}"></button>
				<a href="{{ctrl.contact.data.url}}" id="contact-export-link"
				   class="icon-download-white" title="{{ctrl.t.download}}"
				   download="{{ ctrl.contact.readableFilename() }}"></a>
				<button ng-click="ctrl.deleteContact()" ng-if="!ctrl.addressBook.readOnly" class="icon-delete-white" title="{{ctrl.t.delete}}"></button>
			</div>
		</header>
		<section>
			<propertyGroup ng-repeat="prop in ctrl.contact.props | toArray | orderDetailItems:'$key'" data="prop" name="prop.$key"></propertyGroup>

			<div class="select-addressbook" ng-if="ctrl.addressBooks.length > 1 && !ctrl.addressBook.readOnly">
				<label for="details-addressbook">{{ctrl.t.addressBook}}</label>
				<select ng-model="ctrl.addressBook" ng-change="ctrl.changeAddressBook(ctrl.addressBook)" id="details-addressbook"
						ng-options="book.displayName for book in ctrl.addressBooks | filter: {readOnly: false}">
				</select>
			</div>
			<select class="add-field" ng-model="ctrl.field" ng-change="ctrl.addField(ctrl.field)" ng-if="!ctrl.addressBook.readOnly">
				<option value=''>{{ctrl.t.selectField}}</option>
				<option ng-repeat="field in ctrl.fieldDefinitions | fieldFilter: ctrl.contact | orderBy : 'name'" value="{{field.id}}">{{field.name}}</option>
			</select>
		</section>
	</div>
</div>