-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #229 from GeriLife/develop
0.11 release
- Loading branch information
Showing
287 changed files
with
2,327 additions
and
457 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,5 @@ | |
.meteor/meteorite | ||
server/smtp.js | ||
node_modules | ||
.idea | ||
*.pyc |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
5 changes: 5 additions & 0 deletions
5
app/client/views/home/residents/resident/activeOnDate/activeOnDate.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<template name="homeResidentActiveOnDate"> | ||
{{# if residentActiveOnDate }} | ||
<i class="fa fa-check" aria-hidden="true"></i> | ||
{{/ if }} | ||
</template> |
47 changes: 47 additions & 0 deletions
47
app/client/views/home/residents/resident/activeOnDate/activeOnDate.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
Template.homeResidentActiveOnDate.onCreated(function () { | ||
const templateInstance = this; | ||
|
||
// Get resident ID and date from template data context | ||
const residentId = this.data.resident._id; | ||
const date = this.data.day; | ||
|
||
// Create ISO date string (YYYY-mm-dd) from date | ||
const isoYMD = moment(date).format('YYYY-mm-dd'); | ||
|
||
// Create string to request activity count for resident ID and current date (YMD) | ||
const countName = `residentId-${ residentId }-activityCountOn-${ isoYMD }`; | ||
|
||
// Subscribe to resident activity count for current date | ||
templateInstance.subscribe('residentActivityCountOnDate', residentId, date); | ||
|
||
// Create reactive variable to hold resident activity count | ||
templateInstance.residentActivityCountOnDate = new ReactiveVar(); | ||
|
||
templateInstance.autorun(function () { | ||
// Get count of activities for resident ID and current date (see above) | ||
const activityCount = Counts.get(countName); | ||
|
||
// Set activity count to template reactive variable | ||
templateInstance.residentActivityCountOnDate.set(activityCount); | ||
}) | ||
}); | ||
|
||
Template.homeResidentActiveOnDate.helpers({ | ||
residentActiveOnDate () { | ||
// Get reference to template instance | ||
const templateInstance = Template.instance(); | ||
|
||
// Residents are inactive by default, until there is a known activity count | ||
let residentActiveOnDate = false; | ||
|
||
// Get activity count, from reactive variable | ||
const activityCount = templateInstance.residentActivityCountOnDate.get(); | ||
|
||
// If resident has activity count, they are considered active on date | ||
if (activityCount > 0) { | ||
residentActiveOnDate = true; | ||
} | ||
|
||
return residentActiveOnDate; | ||
} | ||
}) |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<template name="homeResident"> | ||
<tr id="resident-{{ _id }}" class="resident"> | ||
<td>{{ resident.firstName }} {{ resident.lastInitial }}</td> | ||
<td class="activity-count"> | ||
{{ recentActiveDaysCount }} | ||
</td> | ||
<td class="{{ activityLabelClass }}"> | ||
{{#if activityLabelText }} | ||
{{ activityLabelText }} | ||
{{/ if }} | ||
</td> | ||
{{# each day in pastSevenDays }} | ||
<td> | ||
{{> homeResidentActiveOnDate resident=resident day=day }} | ||
</td> | ||
{{/ each }} | ||
</tr> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<template name="homeResidents"> | ||
<table class="table table-striped table-compact"> | ||
<caption> | ||
{{_ "homeResidents-tableCaption" }} | ||
</caption> | ||
<thead> | ||
<tr> | ||
<th colspan="3"></th> | ||
<th colspan="7"> | ||
{{_ "homeResidents-tableHeader-pastWeek" }} | ||
</th> | ||
</tr> | ||
<tr> | ||
<th> | ||
<i class="fa fa-lg fa-user"></i> | ||
{{_ "homeResidents-tableHeader-residentName" }} | ||
</th> | ||
<th> | ||
<i class="fa fa-lg fa-heartbeat"></i> | ||
{{_ "homeResidents-tableHeader-activeDaysCount" }} | ||
</th> | ||
<th> | ||
<i class="fa fa-lg fa-heartbeat"></i> | ||
{{_ "homeResidents-tableHeader-activityLevel" }} | ||
</th> | ||
{{# each day in pastSevenDays }} | ||
<th>{{ abbreviatedWeekday day }}</th> | ||
{{/ each }} | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{{# if residents }} | ||
{{# each resident in residents }} | ||
{{> homeResident resident=resident pastSevenDays=pastSevenDays }} | ||
{{/ each }} | ||
{{ else }} | ||
<tr> | ||
<td> | ||
{{_ "homeResidents-loadingMessage" }} | ||
</td> | ||
</tr> | ||
{{/ if }} | ||
</tbody> | ||
</table> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import d3 from 'd3'; | ||
import moment from 'moment'; | ||
import 'moment/locale/fi'; | ||
|
||
Template.homeResidents.helpers({ | ||
abbreviatedWeekday (date) { | ||
// Get user language | ||
const locale = TAPi18n.getLanguage(); | ||
|
||
// Set locale based on user browser language | ||
moment.locale(locale); | ||
|
||
// Format the date to display abbreviated weekday in user language | ||
return moment(date).format('dd'); | ||
}, | ||
pastSevenDays () { | ||
// Get date seven days ago | ||
const sevenDaysAgo = moment().subtract(7, 'days').toDate(); | ||
|
||
// Get array of past seven days including today | ||
const pastSevenDays = d3.utcDay.range(sevenDaysAgo, new Date()); | ||
|
||
return pastSevenDays; | ||
} | ||
}); |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.