LT-55: Adding generate report button

This commit is contained in:
Bruno Alves de Faria 2017-01-26 13:09:16 -02:00
parent 0b91972bee
commit d49963f5b2
3 changed files with 31 additions and 6 deletions

View File

@ -1,10 +1,12 @@
<template name="measurementTableView"> <template name="measurementTableView">
<div class="measurementTableView scrollArea"> <div class="measurementTableView scrollArea">
{{#let config=measurementConfiguration}} {{#let config=measurementConfiguration groups=measurementGroups.get}}
{{#each measurementGroup in measurementGroups.get}} {{#each measurementGroup in groups}}
{{>measurementTableHeaderRow (clone this {{! #if hasMeasurements measurementGroup.toolGroup.id}}
toolGroup=measurementGroup.toolGroup {{>measurementTableHeaderRow (clone this
measurementRows=measurementGroup.measurementRows)}} toolGroup=measurementGroup.toolGroup
measurementRows=measurementGroup.measurementRows)}}
{{! /if}}
{{#each rowItem in measurementGroup.measurementRows}} {{#each rowItem in measurementGroup.measurementRows}}
{{>measurementTableRow (clone this rowItem=rowItem)}} {{>measurementTableRow (clone this rowItem=rowItem)}}
{{/each}} {{/each}}
@ -31,6 +33,10 @@
{{/let}} {{/let}}
{{/if}} {{/if}}
{{/let}} {{/let}}
<div class="btn btn-primary js-pdf">Export PDF</div> {{#if or (hasMeasurements 'targets') (hasMeasurements 'nonTargets')}}
<div class="report-area">
<div class="btn btn-sm js-pdf">Generate Report</div>
</div>
{{/if}}
</div> </div>
</template> </template>

View File

@ -24,6 +24,13 @@ Template.measurementTableView.events({
}); });
Template.measurementTableView.helpers({ Template.measurementTableView.helpers({
hasMeasurements(toolGroupId) {
const instance = Template.instance();
const groups = instance.data.measurementGroups.get();
const group = _.find(groups, item => item.toolGroup.id === toolGroupId);
return !!group.measurementRows.length;
},
getNewMeasurementType(tool) { getNewMeasurementType(tool) {
// TODO: Check Conformance criteria here. // TODO: Check Conformance criteria here.
// RECIST should be nonTargets, irRC should be targets // RECIST should be nonTargets, irRC should be targets

View File

@ -13,3 +13,15 @@
&::-webkit-scrollbar &::-webkit-scrollbar
display: none display: none
.report-area
theme('background-color', '$uiGrayDarker')
margin-top: 2px
padding: 10px 0
.btn.js-pdf
theme('background-color', '$activeColor')
theme('border', '1px solid $uiBorderColorActive')
color: #000
display: table
margin: 0 auto