Skip to content

Commit

Permalink
#15 Contact data is taken from Company
Browse files Browse the repository at this point in the history
  • Loading branch information
Treblast committed Mar 10, 2017
1 parent 82ee7aa commit 6c9e202
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 14 deletions.
2 changes: 2 additions & 0 deletions src/main/webapp/app/entities/company/companies.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ <h2 data-translate="assessoriaTorrellesApp.company.home.title">Companies</h2>
</div>
</div>
<br/>
<h3 data-translate="assessoriaTorrellesApp.company.home.note"></h3>
<br/>
<div class="table-responsive">
<table class="jh-table table table-striped">
<thead>
Expand Down
22 changes: 19 additions & 3 deletions src/main/webapp/app/entities/contact/contact.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,35 @@
.module('assessoriaTorrellesApp')
.controller('ContactController', ContactController);

ContactController.$inject = ['$scope', '$state', 'Contact'];
ContactController.$inject = ['$scope', '$state', 'Contact', 'Company'];

function ContactController ($scope, $state, Contact) {
function ContactController ($scope, $state, Contact, Company) {
var vm = this;

vm.contacts = [];
vm.companies = [];

vm.companyInfo = {
"name": "",
"phone": "",
"email": "",
"cif": ""
};

loadAll();

function loadAll() {
Contact.query(function(result) {
vm.contacts = result;
});
Company.query(function (result) {
vm.companies = result;
vm.companyInfo.name = vm.companies[0].name;
vm.companyInfo.phone = vm.companies[0].phone;
vm.companyInfo.email = vm.companies[0].email;
vm.companyInfo.cif = vm.companies[0].cif;
});
}

}
})();
13 changes: 5 additions & 8 deletions src/main/webapp/app/entities/contact/contacts.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
<h2 data-translate="contact.title1"></h2>
<h3 data-translate="contact.title2"></h3>
</div>

<div class="blog-text contact">
<div class="row">
<div class="col-md-8 col-sm-7">
Expand Down Expand Up @@ -39,17 +38,15 @@ <h3 data-translate="contact.title2"></h3>
</div>
<div class="col-md-4 col-sm-5">
<address>
<strong>AvriqqLabs, Inc.</strong><br>
231 Yogyakarta, INA 55791<br>
[email protected]<br>
http://www.domain.com <br>
<abbr title="Phone">Telp.</abbr> (0274) 441-5000
<strong>{{vm.companyInfo.name}}</strong><br>
{{vm.companyInfo.phone}}<br>
{{vm.companyInfo.email}}<br>
{{vm.companyInfo.cif}}
</address>
</div>
</div>
</div>
</div>


</div>
</div>
</div>
Expand Down
3 changes: 2 additions & 1 deletion src/main/webapp/i18n/ca/company.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"title": "Companies",
"createLabel": "Create a new Company",
"createOrEditLabel": "Create or edit a Company",
"search": "Search for Company"
"search": "Search for Company",
"note": "Nota: recorda que la informació de l'empresa ha d'estar a la primera (id=1)."
},
"created": "A new Company is created with identifier {{ param }}",
"updated": "A Company is updated with identifier {{ param }}",
Expand Down
3 changes: 2 additions & 1 deletion src/main/webapp/i18n/en/company.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"title": "Companies",
"createLabel": "Create a new Company",
"createOrEditLabel": "Create or edit a Company",
"search": "Search for Company"
"search": "Search for Company",
"note": "Note: remember that correct data of the company must be in the first one (id=1)."
},
"created": "A new Company is created with identifier {{ param }}",
"updated": "A Company is updated with identifier {{ param }}",
Expand Down
3 changes: 2 additions & 1 deletion src/main/webapp/i18n/es/company.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"title": "Companies",
"createLabel": "Crear nuevo Company",
"createOrEditLabel": "Crear o editar Company",
"search": "Search for Company"
"search": "Search for Company",
"note": "Nota: recuerda que la información de la empresa debe estar en la primera (id=1)."
},
"created": "Un nuevo Company ha sido creado con el identificador {{ param }}",
"updated": "Un Company ha sido actualizado con el identificador {{ param }}",
Expand Down

0 comments on commit 6c9e202

Please sign in to comment.