44 lines
1.2 KiB
JavaScript
44 lines
1.2 KiB
JavaScript
/**
|
|
*/
|
|
|
|
class ProjectFundingTeamView extends EICDomContent {
|
|
|
|
DOMContentLoaded(options) {
|
|
|
|
for(let model in options.models) this[model] = options.models[model];
|
|
|
|
this.components = ui.eicfy(this.el);
|
|
|
|
this.project.contributors(this.project.current.project.number)
|
|
.then(this.fill.bind(this))
|
|
}
|
|
|
|
fill(data) {
|
|
let list = this.find('ul.list');
|
|
|
|
for(let member of data) {
|
|
let roles = member.roles.map(o => this.translateRole(o.role))
|
|
let el = ui.create(`<li>
|
|
<div medium><b>${member.information.name.firstName} ${member.information.name.lastName}</b></div>
|
|
<div xsmall><a href="mailto:${member.information.contacts.email}">${member.information.contacts.email}</a></div>
|
|
<div small>${roles.join(' | ')}</div>
|
|
</li>`);
|
|
|
|
list.append(el)
|
|
}
|
|
}
|
|
|
|
translateRole(role) {
|
|
let s = role.replace('PROJECT_', '');
|
|
|
|
switch(s) {
|
|
case 'TechDDExpert':
|
|
s = 'TechDD Expert';
|
|
break;
|
|
}
|
|
|
|
return s;
|
|
}
|
|
}
|
|
|
|
app.registerClass('ProjectFundingTeamView',ProjectFundingTeamView); |