diff options
-rw-r--r-- | css/public/style.css | 4 | ||||
-rw-r--r-- | js/components/detailsItem/detailsItem_controller.js | 33 | ||||
-rw-r--r-- | js/services/vCardProperties.js | 9 | ||||
-rw-r--r-- | templates/detailItems/n.html | 22 |
4 files changed, 64 insertions, 4 deletions
diff --git a/css/public/style.css b/css/public/style.css index 5554d06c..e8635522 100644 --- a/css/public/style.css +++ b/css/public/style.css @@ -239,6 +239,10 @@ detailsitem.details-item-adr .icon-delete { top: 57px; left: 331px; } +detailsitem.details-item-n .icon-delete { + top: 34px; + left: 331px; +} detailsitem.details-item-email select { margin-right: 0; diff --git a/js/components/detailsItem/detailsItem_controller.js b/js/components/detailsItem/detailsItem_controller.js index fdf970bb..e296da43 100644 --- a/js/components/detailsItem/detailsItem_controller.js +++ b/js/components/detailsItem/detailsItem_controller.js @@ -6,13 +6,18 @@ angular.module('contactsApp') ctrl.type = undefined; ctrl.isPreferred = false; ctrl.t = { - poBox : t('contacts', 'Post Office Box'), - postalCode : t('contacts', 'Postal Code'), + poBox : t('contacts', 'Post office box'), + postalCode : t('contacts', 'Postal code'), city : t('contacts', 'City'), state : t('contacts', 'State or province'), country : t('contacts', 'Country'), address: t('contacts', 'Address'), - newGroup: t('contacts', '(new group)') + newGroup: t('contacts', '(new group)'), + familyName: t('contacts', 'Last name'), + firstName: t('contacts', 'First name'), + additionalNames: t('contacts', 'Additional names'), + honorificPrefix: t('contacts', 'Prefix'), + honorificSuffix: t('contacts', 'Suffix') }; ctrl.availableOptions = ctrl.meta.options || []; @@ -54,6 +59,28 @@ angular.module('contactsApp') ctrl.model.updateContact(); }; + ctrl.updateDetailedName = function () { + var fn = ''; + if (ctrl.data.value[3]) { + fn += ctrl.data.value[3] + ' '; + } + if (ctrl.data.value[1]) { + fn += ctrl.data.value[1] + ' '; + } + if (ctrl.data.value[2]) { + fn += ctrl.data.value[2] + ' '; + } + if (ctrl.data.value[0]) { + fn += ctrl.data.value[0] + ' '; + } + if (ctrl.data.value[4]) { + fn += ctrl.data.value[4]; + } + + ctrl.model.contact.fullName(fn); + ctrl.model.updateContact(); + }; + ctrl.getTemplate = function() { var templateUrl = OC.linkTo('contacts', 'templates/detailItems/' + ctrl.meta.template + '.html'); return $templateRequest(templateUrl); diff --git a/js/services/vCardProperties.js b/js/services/vCardProperties.js index 56a640a6..eb7ce6d0 100644 --- a/js/services/vCardProperties.js +++ b/js/services/vCardProperties.js @@ -15,6 +15,13 @@ angular.module('contactsApp') readableName: t('contacts', 'Nickname'), template: 'text' }, + n: { + readableName: t('contacts', 'Detailed name'), + defaultValue: { + value:['', '', '', '', ''] + }, + template: 'n' + }, note: { readableName: t('contacts', 'Notes'), template: 'textarea' @@ -108,7 +115,7 @@ angular.module('contactsApp') }, 'X-SOCIALPROFILE': { multiple: true, - readableName: t('contacts', 'Social Network'), + readableName: t('contacts', 'Social network'), template: 'text', defaultValue: { value:[''], diff --git a/templates/detailItems/n.html b/templates/detailItems/n.html new file mode 100644 index 00000000..675fa405 --- /dev/null +++ b/templates/detailItems/n.html @@ -0,0 +1,22 @@ +<label ng-if="ctrl.availableOptions.length === 0" for="details-{{ctrl.name}}">{{ctrl.meta.readableName}}</label> +<div> + <label for="details-honorificPrefix">{{ctrl.t.honorificPrefix}}</label> + <input type="text" id="details-honorificPrefix" name="honorificPrefix" ng-model="ctrl.data.value[3]" ng-model-options="{ debounce: 500 }" ng-change="ctrl.updateDetailedName()" value="" /> +</div> +<div> + <label for="details-firstName">{{ctrl.t.firstName}}</label> + <input type="text" id="details-firstName" name="firstName" ng-model="ctrl.data.value[1]" ng-model-options="{ debounce: 500 }" ng-change="ctrl.updateDetailedName()" value="" /> +</div> +<div> + <label for="details-additionalNames">{{ctrl.t.additionalNames}}</label> + <input type="text" id="details-additionalNames" name="additionalNames" ng-model="ctrl.data.value[2]" ng-model-options="{ debounce: 500 }" ng-change="ctrl.updateDetailedName()" value="" /> +</div> +<div> + <label for="details-familyName">{{ctrl.t.familyName}}</label> + <input type="text" id="details-familyName" name="familyName" ng-model="ctrl.data.value[0]" ng-model-options="{ debounce: 500 }" ng-change="ctrl.updateDetailedName()" value="" /> +</div> +<div> + <label for="details-honorificSuffix">{{ctrl.t.honorificSuffix}}</label> + <input type="text" id="details-honorificSuffix" name="honorificSuffix" ng-model="ctrl.data.value[4]" ng-model-options="{ debounce: 500 }" ng-change="ctrl.updateDetailedName()" value="" /> +</div> +<button ng-click="ctrl.deleteField()" class="icon-delete" title="Delete"></button> |