From c4f6f451837b4f472fe2ead83f52b88ba48dfe07 Mon Sep 17 00:00:00 2001 From: JR Date: Fri, 6 Nov 2015 11:57:45 -0500 Subject: [PATCH] in 05-bbclear.js and template.html add support for genders other than male --- themes/official/js/05-bbclear.js | 4 ++++ themes/official/template.html | 9 ++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/themes/official/js/05-bbclear.js b/themes/official/js/05-bbclear.js index a257ffd..015bfda 100644 --- a/themes/official/js/05-bbclear.js +++ b/themes/official/js/05-bbclear.js @@ -209,8 +209,12 @@ var filters = { }, gender_pronoun: function(input, possessive, absolute){ + // sanitize input + input = input.toLowerCase(); if(input == "female"){ return possessive ? (absolute ? "hers" : "her") : "she"; + }else if(input == "other"){ + return possessive ? (absolute ? "theirs" : "their") : "they"; }else{ return possessive ? "his" : "he"; } diff --git a/themes/official/template.html b/themes/official/template.html index ba30960..9ebef29 100644 --- a/themes/official/template.html +++ b/themes/official/template.html @@ -33,11 +33,13 @@

{{demographics.name|full_name}}

{{demographics.name|display_name}} is a {% if demographics.dob %}{{demographics.dob|age}} year old{% endif %} - {% if demographics.race %}{{demographics.race}} {% endif %}{% if demographics.marital_status %}{{demographics.marital_status|lower}} {% endif %}{{demographics.gender|lower}} + {% if demographics.race %}{{demographics.race}}{% endif %} + {% if demographics.marital_status %}{{demographics.marital_status|lower}} {% endif %} + {{demographics.gender|lower}}{% if demographics.gender == "Other" %}/non-binary{% endif %} {% if demographics.religion or demographics.language %}who {% if demographics.religion %}is {{demographics.religion}}{% if demographics.language %} and {% endif %}{% endif %}{% if demographics.language %}speaks {{demographics.language|isolanguage|title}}{% endif %}{% endif %}. - {{demographics.gender|gender_pronoun|title}} has {{allergies|max_severity}} allergies. + {{demographics.gender|gender_pronoun|title}} {% if demographics.gender == "Other" %} have {{gender_pronoun}} {% else %} has {% endif %} {{allergies|max_severity}} allergies. In the past year, {{demographics.gender|gender_pronoun}} @@ -47,7 +49,8 @@

{{demographics.name|full_name}}

{% else %} had medical encounters {% endif %} - and has + and {% if demographics.gender == "Other" %} have {{gender_pronoun}} {% else %} has {% endif %} + {% if medications|since_days(365)|strict_length == 0 %} not had any medications prescribed. {% else %}