diff --git a/app/templates/jobs/job.html.j2 b/app/templates/jobs/job.html.j2 index e2aa21f6..cc35b938 100644 --- a/app/templates/jobs/job.html.j2 +++ b/app/templates/jobs/job.html.j2 @@ -206,7 +206,7 @@ switch(operation.op) { case "add": if (pathArray[1] === "results") { - this.setResult(operation.value); + this.setResults([operation.value]); } break; case "delete": @@ -238,30 +238,20 @@ } setResults(results) { - let resultElement, resultsElement, resultDownloadElement, - resultDownloadButtonElement, resultDownloadButtonIconElement, - resultTitleElement; + let resultsElement; resultsElement = document.getElementById("results"); for (let result of results) { - resultElement = document.createElement("tr"); - resultTitleElement = document.createElement("td"); - resultTitleElement.innerText = result.filename; - resultElement.append(resultTitleElement); - resultDownloadElement = document.createElement("td"); - resultDownloadButtonElement = document.createElement("a"); - resultDownloadButtonElement.classList.add("waves-effect", "waves-light", - "btn-small"); - resultDownloadButtonElement.href = `/jobs/${result.job_id}/results/${result.id}/download`; - resultDownloadButtonElement.setAttribute("download", ""); - resultDownloadButtonIconElement = document.createElement("i"); - resultDownloadButtonIconElement.classList.add("material-icons"); - resultDownloadButtonIconElement.innerText = "file_download"; - resultDownloadButtonElement.append(resultDownloadButtonIconElement); - resultDownloadElement.append(resultDownloadButtonElement) - resultElement.append(resultDownloadElement); - resultsElement.append(resultElement); + resultsElement.insertAdjacentHTML("beforeend", ` +