diff options
-rw-r--r-- | css/public/style.css | 17 | ||||
-rw-r--r-- | js/components/contactList/contactList_controller.js | 16 | ||||
-rw-r--r-- | js/filters/newContact_filter.js | 6 | ||||
-rw-r--r-- | l10n/pt_PT.js | 6 | ||||
-rw-r--r-- | l10n/pt_PT.json | 6 | ||||
-rw-r--r-- | templates/contact.html | 2 | ||||
-rw-r--r-- | templates/contactList.html | 11 |
7 files changed, 42 insertions, 22 deletions
diff --git a/css/public/style.css b/css/public/style.css index 0ef26a1f..83af8bba 100644 --- a/css/public/style.css +++ b/css/public/style.css @@ -194,7 +194,7 @@ detailsitem.details-item-adr { } detailsitem.details-item-adr .icon-delete { top: 57px; - left: 290px; + left: 331px; } detailsitem.details-item-email select { @@ -318,7 +318,10 @@ li.addressBook-share-item span.shareeIdentifier { - +/* Contacts List */ +#new-contact-button { + margin: 14px auto; /* to have the same height than a contact*/ +} @@ -485,17 +488,17 @@ detailsitem .select2-container { box-shadow: 0 0 100px rgba(100, 100, 100, .9); position: absolute; } - + .wrapper-show:not(.mobile-show), .contacts-list:not(.mobile-show) { display: none; } - - + + #app-navigation-toggle.showdetails { transform: translate(-50px, 0); } - + #app-navigation-toggle-back { position: fixed; display: inline-block !important; @@ -522,4 +525,4 @@ detailsitem .select2-container { } #app-navigation-toggle-back { display: none; -}
\ No newline at end of file +} diff --git a/js/components/contactList/contactList_controller.js b/js/components/contactList/contactList_controller.js index 32eb9d5f..4ecd1713 100644 --- a/js/components/contactList/contactList_controller.js +++ b/js/components/contactList/contactList_controller.js @@ -7,6 +7,7 @@ angular.module('contactsApp') ctrl.contactList = []; ctrl.searchTerm = ''; ctrl.show = true; + ctrl.invalid = false; ctrl.t = { addContact : t('contacts', 'Add contact'), @@ -69,9 +70,13 @@ angular.module('contactsApp') // Get contacts ContactService.getAll().then(function(contacts) { - $scope.$apply(function() { - ctrl.contacts = contacts; - }); + if(contacts.length>0) { + $scope.$apply(function() { + ctrl.contacts = contacts; + }); + } else { + ctrl.loading = false; + } }); // Wait for ctrl.contactList to be updated, load the first contact and kill the watch @@ -145,6 +150,11 @@ angular.module('contactsApp') } }); + // Watch if we have an invalid contact + $scope.$watch('ctrl.contactList[0].fullName()', function(fullName) { + ctrl.invalid = fullName === ''; + }); + ctrl.createContact = function() { ContactService.create().then(function(contact) { ['tel', 'adr', 'email'].forEach(function(field) { diff --git a/js/filters/newContact_filter.js b/js/filters/newContact_filter.js new file mode 100644 index 00000000..80b63485 --- /dev/null +++ b/js/filters/newContact_filter.js @@ -0,0 +1,6 @@ +angular.module('contactsApp') +.filter('newContact', function() { + return function(input) { + return input !== '' ? input : t('contacts', 'New contact'); + }; +}); diff --git a/l10n/pt_PT.js b/l10n/pt_PT.js index 00733b7e..5548f3a0 100644 --- a/l10n/pt_PT.js +++ b/l10n/pt_PT.js @@ -1,9 +1,9 @@ OC.L10N.register( "contacts", { - "Contacts" : "Contatos", + "Contacts" : "Contactos", "Address book name" : "Nome do livro de endereços", - "No contacts in here" : "Nenhum contato aqui", + "No contacts in here" : "Nenhum contacto aqui", "Name" : "Nome", "Organization" : "Organização", "Title" : "Título ", @@ -11,7 +11,7 @@ OC.L10N.register( "Import" : "Importar", "Add contact" : "Adicionar contacto", "No search result for {query}" : "Sem resultados de procura para {query}", - "All contacts" : "Todos os contatos", + "All contacts" : "Todos os contactos", "Not grouped" : "Não agrupados", "Post Office Box" : "Caixa Postal", "Postal Code" : "Código Postal", diff --git a/l10n/pt_PT.json b/l10n/pt_PT.json index f886d3b5..8b9aa9b3 100644 --- a/l10n/pt_PT.json +++ b/l10n/pt_PT.json @@ -1,7 +1,7 @@ { "translations": { - "Contacts" : "Contatos", + "Contacts" : "Contactos", "Address book name" : "Nome do livro de endereços", - "No contacts in here" : "Nenhum contato aqui", + "No contacts in here" : "Nenhum contacto aqui", "Name" : "Nome", "Organization" : "Organização", "Title" : "Título ", @@ -9,7 +9,7 @@ "Import" : "Importar", "Add contact" : "Adicionar contacto", "No search result for {query}" : "Sem resultados de procura para {query}", - "All contacts" : "Todos os contatos", + "All contacts" : "Todos os contactos", "Not grouped" : "Não agrupados", "Post Office Box" : "Caixa Postal", "Postal Code" : "Código Postal", diff --git a/templates/contact.html b/templates/contact.html index cf7c9ced..11d1e7c1 100644 --- a/templates/contact.html +++ b/templates/contact.html @@ -2,6 +2,6 @@ <img class="app-content-list-item-icon contact__icon" ng-show="ctrl.contact.photo()!==undefined" data-ng-src="data:image/png;base64,{{ctrl.contact.photo()}}" /> <div class="app-content-list-item-icon contact__icon" ng-show="ctrl.contact.photo()===undefined" ng-style="{'background-color': (ctrl.contact.uid() | contactColor) }">{{ ctrl.contact.fullName() | firstCharacter }}</div> <div class="app-content-list-item-star icon-star" data-starred="false"></div> - <div class="app-content-list-item-line-one" ng-class="{'no-line-two':!ctrl.contact.email()}">{{ctrl.contact.fullName()}}</div> + <div class="app-content-list-item-line-one" ng-class="{'no-line-two':!ctrl.contact.email()}">{{ ctrl.contact.fullName() | newContact }}</div> <div class="app-content-list-item-line-two">{{ctrl.contact.email()}}</div> </a> diff --git a/templates/contactList.html b/templates/contactList.html index 602904b7..dd865a46 100644 --- a/templates/contactList.html +++ b/templates/contactList.html @@ -1,10 +1,11 @@ <div style="height: 90%" class="contacts-list" ng-class="{loading: ctrl.loading, 'mobile-show': ctrl.show}"> - <button ng-show="!ctrl.loading" class="app-content-list-button" type="button" name="button" ng-click="ctrl.createContact()">{{ctrl.t.addContact}}</button> + <button ng-show="!ctrl.loading && !ctrl.invalid" class="app-content-list-button" id="new-contact-button" + type="button" name="button" ng-click="ctrl.createContact()">{{ctrl.t.addContact}}</button> <div class="app-content-list-item" - ng-repeat="contact in ctrl.contactList = (ctrl.contacts | contactGroupFilter:ctrl.routeParams.gid | orderBy:'fullName()' | filter:query) track by contact.uid()" - contact data="contact" - ng-click="setSelected(contact.uid())" - ng-class="{active: contact.uid() === ctrl.getSelectedId()}"> + ng-repeat="contact in ctrl.contactList = (ctrl.contacts | contactGroupFilter:ctrl.routeParams.gid | orderBy:'fullName()' | filter:query) track by contact.uid()" + contact data="contact" + ng-click="setSelected(contact.uid())" + ng-class="{active: contact.uid() === ctrl.getSelectedId()}"> </div> <div ng-show="!ctrl.contactList.length && !ctrl.loading && ctrl.searchTerm !== ''"> <div id="emptycontent" class="emptycontent-search"> |