31 lines
1003 B
JavaScript
31 lines
1003 B
JavaScript
/**
|
|
*/
|
|
|
|
class ProjectFundingDocumentsView extends EICDomContent {
|
|
|
|
DOMContentLoaded(options) {
|
|
|
|
for(let model in options.models) this[model] = options.models[model];
|
|
|
|
this.components = ui.eicfy(this.el);
|
|
|
|
this.project.documents(this.project.current.project.number)
|
|
.then(this.fill.bind(this))
|
|
}
|
|
|
|
fill(data) {
|
|
let content = this.find('section');
|
|
for(let section of data) {
|
|
content.append(ui.create(`<label large><b>${section.category}</b></label>`));
|
|
let files = ui.create(`<ul bulleted small>`)
|
|
content.append(files);
|
|
for(let file of section.attachments) {
|
|
let url = app.config.api['/files'].get.uri
|
|
url = url.replace('{id}', file.id)
|
|
files.append(ui.create(`<li><a href="${url}" noroute target="_blank">${file.label}</a></li>`));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
app.registerClass('ProjectFundingDocumentsView',ProjectFundingDocumentsView); |