File tree 2 files changed +12
-6
lines changed
2 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -6,16 +6,18 @@ var ProjectReportsViewModel = function (project) {
6
6
var reportService = new ReportService ( { } ) ;
7
7
8
8
self . projectId = project . projectId ;
9
- self . organisationId = project . orgIdSvcProvider || project . organisationId ;
10
- self . organisationName = project . serviceProviderName || project . organisationName ;
11
9
self . name = project . name ;
12
10
self . grantId = project . grantId || '' ;
13
11
self . associatedProgram = project . associatedProgram ;
14
12
self . associatedSubProgram = project . associatedSubProgram ;
15
13
self . submittedReportCount = 0 ;
16
14
self . recommendAsCaseStudy = ko . observable ( project . promoteOnHomepage ) ;
17
15
self . activityCount = project . activityCount || 0 ;
18
-
16
+ self . currentAssociatedOrgs = _ . filter ( project . associatedOrgs , function ( org ) {
17
+ var toDate = ko . utils . unwrapObservable ( org . toDate ) ;
18
+ var fromDate = ko . utils . unwrapObservable ( org . fromDate ) ;
19
+ return ( ! toDate || toDate >= new Date ( ) . toISOStringNoMillis ( ) ) && ( ! fromDate || fromDate <= new Date ( ) . toISOStringNoMillis ( ) ) ;
20
+ } ) ;
19
21
self . reports = [ ] ;
20
22
self . extendedStatus = [ ] ;
21
23
var reportingTimeSum = 0 ;
Original file line number Diff line number Diff line change 22
22
<td data-bind =" text:associatedSubProgram" ></td >
23
23
<td ><a data-bind =" attr:{href:fcConfig.projectViewUrl+'/'+projectId}" ><span data-bind =" text:name" ></span ></a ></td >
24
24
<td >
25
- <a data-bind =" if:organisationId, attr:{href:fcConfig.organisationViewUrl+'/'+organisationId}" ><span data-bind =" text:organisationName" ></span ></a >
26
- <!-- ko if:!organisationId -->
27
- <span data-bind =" text:organisationName" ></span >
25
+ <!-- ko foreach:currentAssociatedOrgs -->
26
+ <div class =" organisationName" >
27
+ <a data-bind =" visible:ko.utils.unwrapObservable($data.organisationId),attr:{href:fcConfig.organisationLinkBaseUrl+'/'+ko.utils.unwrapObservable($data.organisationId)}" >
28
+ <span data-bind =" text:$data.name" ></span >
29
+ </a >
30
+ <span data-bind =" visible:!ko.utils.unwrapObservable($data.organisationId),text:$data.name" ></span >
31
+ </div >
28
32
<!-- /ko -->
29
33
</td >
30
34
<td >
You can’t perform that action at this time.
0 commit comments