diff --git a/apps/tb/migrations/0042_auto_20190617_1458.py b/apps/tb/migrations/0042_auto_20190617_1458.py new file mode 100644 index 000000000..abd109065 --- /dev/null +++ b/apps/tb/migrations/0042_auto_20190617_1458.py @@ -0,0 +1,66 @@ +# Generated by Django 2.0.13 on 2019-06-17 14:58 + +from django.conf import settings +from django.db import migrations, models +import django.db.models.deletion +import opal.models + + +class Migration(migrations.Migration): + + dependencies = [ + ('opal', '0037_auto_20181114_1445'), + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ('tb', '0041_auto_20190418_1515'), + ] + + operations = [ + migrations.CreateModel( + name='IndexCase', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('created', models.DateTimeField(blank=True, null=True)), + ('updated', models.DateTimeField(blank=True, null=True)), + ('consistency_token', models.CharField(max_length=8)), + ('ltbr_number', models.CharField(blank=True, max_length=200, null=True, verbose_name='LTBR Number')), + ('hospital_number', models.CharField(blank=True, max_length=200, null=True)), + ('sputum_smear', models.CharField(blank=True, choices=[('+ve', '+ve'), ('-ve', '-ve'), ('Unknown', 'Unknown')], max_length=200, null=True)), + ('culture', models.CharField(blank=True, choices=[('+ve', '+ve'), ('-ve', '-ve'), ('Unknown', 'Unknown')], max_length=200, null=True)), + ('drug_susceptibility', models.CharField(blank=True, choices=[('Fully sensitive', 'Fully sensitive'), ('Not fully sensitive', 'Not fully sensitive'), ('Unknown', 'Unknown')], max_length=200, null=True)), + ('index_case_diagnosis_year', models.IntegerField(blank=True, null=True)), + ('index_case_diagnosis_month', models.IntegerField(blank=True, null=True)), + ('index_case_diagnosis_day', models.IntegerField(blank=True, null=True)), + ('relationship', models.CharField(blank=True, choices=[('Household', 'Household'), ('Healthcare (workor)', 'Healthcare (worker)'), ('Healthcare (patient)', 'Healthcare (patient)'), ('Workplace (non healthcare)', 'Workplace (non healthcare)'), ('Education', 'Education'), ('Prison', 'Prison')], max_length=200, null=True, verbose_name='Relationship to index case')), + ('relationship_other', models.CharField(blank=True, max_length=200, null=True)), + ('details', models.TextField(blank=True)), + ('index_case_site_of_tb_ft', models.CharField(blank=True, default='', max_length=255, null=True)), + ('created_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='created_tb_indexcase_subrecords', to=settings.AUTH_USER_MODEL)), + ('index_case_site_of_tb_fk', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='tb.TBSite')), + ('patient', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='opal.Patient')), + ('updated_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='updated_tb_indexcase_subrecords', to=settings.AUTH_USER_MODEL)), + ], + options={ + 'abstract': False, + }, + bases=(opal.models.UpdatesFromDictMixin, opal.models.ToDictMixin, models.Model), + ), + migrations.AlterModelOptions( + name='tbhistory', + options={'verbose_name': 'Personal history of TB', 'verbose_name_plural': 'Personal histories of TB'}, + ), + migrations.AddField( + model_name='tbhistory', + name='diagnosis_date_day', + field=models.IntegerField(blank=True, null=True), + ), + migrations.AddField( + model_name='tbhistory', + name='diagnosis_date_month', + field=models.IntegerField(blank=True, null=True), + ), + migrations.AddField( + model_name='tbhistory', + name='diagnosis_date_year', + field=models.IntegerField(blank=True, null=True), + ), + ] diff --git a/apps/tb/migrations/0043_auto_20190617_1458.py b/apps/tb/migrations/0043_auto_20190617_1458.py new file mode 100644 index 000000000..faa759c5a --- /dev/null +++ b/apps/tb/migrations/0043_auto_20190617_1458.py @@ -0,0 +1,36 @@ +# Generated by Django 2.0.13 on 2019-06-17 14:58 + +from django.db import migrations + + +def forwards(apps, schema_editor): + TBHistory = apps.get_model( + 'tb', 'TBHistory' + ) + IndexCase = apps.get_model( + 'tb', 'IndexCase' + ) + tb_histories = TBHistory.objects.exclude(previous_tb_contact=False) + for tb_history in tb_histories: + IndexCase.objects.get_or_create( + patient=tb_history.patient, + details=tb_history.previous_tb_contact_details, + created_by_id=tb_history.updated_by_id + ) + + +def backwards(apps, schema_editor): + pass + + +class Migration(migrations.Migration): + + dependencies = [ + ('tb', '0042_auto_20190617_1458'), + ] + + operations = [ + migrations.RunPython( + forwards, backwards + ) + ] diff --git a/apps/tb/migrations/0044_auto_20190617_1530.py b/apps/tb/migrations/0044_auto_20190617_1530.py new file mode 100644 index 000000000..8bd1e53e3 --- /dev/null +++ b/apps/tb/migrations/0044_auto_20190617_1530.py @@ -0,0 +1,28 @@ +# Generated by Django 2.0.13 on 2019-06-17 15:30 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('tb', '0043_auto_20190617_1458'), + ] + + operations = [ + migrations.RenameField( + model_name='indexcase', + old_name='index_case_diagnosis_day', + new_name='diagnosis_day', + ), + migrations.RenameField( + model_name='indexcase', + old_name='index_case_diagnosis_month', + new_name='diagnosis_month', + ), + migrations.RenameField( + model_name='indexcase', + old_name='index_case_diagnosis_year', + new_name='diagnosis_year', + ), + ] diff --git a/apps/tb/models.py b/apps/tb/models.py index 35cac78d5..dcdc377f3 100644 --- a/apps/tb/models.py +++ b/apps/tb/models.py @@ -298,7 +298,6 @@ class Treatment(models.Treatment): TB = "tb" - class TBHistory(models.PatientSubrecord): """ Used if the person has clicked that they have a personal history of TB in the @@ -315,6 +314,8 @@ class TBHistory(models.PatientSubrecord): _is_singleton = True + # TODO After we get sign off from the doctors the below + # fields can be removed previous_tb_contact = fields.BooleanField( default=False, verbose_name="Previous TB contact" @@ -343,6 +344,17 @@ class TBHistory(models.PatientSubrecord): diagnosis_how_long_ago_days = fields.IntegerField( blank=True, null=True ) + # end todo + + diagnosis_date_year = fields.IntegerField( + blank=True, null=True + ) + diagnosis_date_month = fields.IntegerField( + blank=True, null=True + ) + diagnosis_date_day = fields.IntegerField( + blank=True, null=True + ) how_long_treated_years = fields.IntegerField( blank=True, null=True @@ -368,8 +380,106 @@ class TBHistory(models.PatientSubrecord): diagnosis_details = fields.TextField(default="") class Meta: - verbose_name = "TB Exposure" - verbose_name_plural = "TB Exposures" + verbose_name = "Personal history of TB" + verbose_name_plural = "Personal histories of TB" + + +class IndexCase(models.PatientSubrecord): + _icon = 'fa fa-chain' + + POS_NEG = ( + ("+ve", "+ve"), + ("-ve", "-ve"), + ("Unknown", "Unknown"), + ) + + DRUG_susceptibility = ( + ("Fully sensitive", "Fully sensitive",), + ("Not fully sensitive", "Not fully sensitive",), + ("Unknown", "Unknown"), + ) + + RELATIONSHIP = ( + ("Household", "Household",), + ("Healthcare (workor)", "Healthcare (worker)",), + ("Healthcare (patient)", "Healthcare (patient)",), + ( + "Workplace (non healthcare)", + "Workplace (non healthcare)", + ), + ( + "Education", + "Education", + ), + ( + "Prison", + "Prison", + ), + ) + + ltbr_number = fields.CharField( + max_length=200, + blank=True, + null=True, + verbose_name="LTBR Number" + ) + hospital_number = fields.CharField( + max_length=200, + blank=True, + null=True, + ) + sputum_smear = fields.CharField( + max_length=200, + blank=True, + null=True, + choices=POS_NEG + ) + culture = fields.CharField( + max_length=200, + blank=True, + null=True, + choices=POS_NEG + ) + drug_susceptibility = fields.CharField( + max_length=200, + blank=True, + null=True, + choices=DRUG_susceptibility + ) + + diagnosis_year = fields.IntegerField( + blank=True, null=True + ) + + diagnosis_month = fields.IntegerField( + blank=True, null=True + ) + + diagnosis_day = fields.IntegerField( + blank=True, null=True + ) + + index_case_site_of_tb = ForeignKeyOrFreeText( + TBSite, verbose_name="Site of TB" + ) + + relationship = fields.CharField( + max_length=200, + blank=True, + null=True, + choices=RELATIONSHIP, + verbose_name="Relationship to index case" + ) + + relationship_other = fields.CharField( + max_length=200, + blank=True, + null=True, + ) + + details = fields.TextField( + blank=True + ) class Allergies(models.Allergies): diff --git a/apps/tb/templates/detail/tb.html b/apps/tb/templates/detail/tb.html index bd8efb3f7..2b1c2864c 100644 --- a/apps/tb/templates/detail/tb.html +++ b/apps/tb/templates/detail/tb.html @@ -14,6 +14,7 @@ {% include 'panels/nationality.html' %} {% record_panel models.Travel %} {% record_panel models.TBHistory %} + {% record_panel models.IndexCase title="Index Cases" %} {% include "panels/symptoms.html" %} {% record_panel models.Allergies %} {% record_panel models.SocialHistory %} @@ -113,4 +114,4 @@ {% include "inline_forms/patient_consultation.html" %} - \ No newline at end of file + diff --git a/apps/tb/templates/forms/index_case_form.html b/apps/tb/templates/forms/index_case_form.html new file mode 100644 index 000000000..effbcb33a --- /dev/null +++ b/apps/tb/templates/forms/index_case_form.html @@ -0,0 +1,28 @@ +{% load forms %} +{% load elcid_forms %} +{% input field="IndexCase.ltbr_number" %} +{% input field="IndexCase.hospital_number" %} +{% radio_columns field="IndexCase.relationship" %} +{% radio field="IndexCase.sputum_smear" %} +{% radio field="IndexCase.culture" %} +{% radio field="IndexCase.drug_susceptibility" %} +
+ +
+
+
+ +
+
+ +
+
+ +
+
+
+
+{% input field="IndexCase.index_case_site_of_tb" %} +{% textarea field="IndexCase.details" %} diff --git a/apps/tb/templates/forms/tb_history_form.html b/apps/tb/templates/forms/tb_history_form.html index 646c043e6..40e29d72e 100644 --- a/apps/tb/templates/forms/tb_history_form.html +++ b/apps/tb/templates/forms/tb_history_form.html @@ -1,68 +1,41 @@ {% load forms %} -{% checkbox field="TBHistory.previous_tb_diagnosis" %} -
- {% input field="TBHistory.tb_type" %} - {% input field="TBHistory.site_of_tb" %} -
- -
-
-
- -
-
- -
-
- -
-
-
-
-
- -
-
-
- -
-
- -
-
- -
-
-
-
- {% textarea field="TBHistory.diagnosis_details" label="Details" %} +{% input field="TBHistory.tb_type" %} +{% input field="TBHistory.site_of_tb" %} +
+ +
+
+
+ +
+
+ +
+
+ +
+
+
- -
-{% checkbox field="TBHistory.previous_tb_contact" %} -
-
- -
-
-
- -
-
- -
-
- -
-
-
-
- {% textarea field="TBHistory.previous_tb_contact_details" label="Details" %} -
\ No newline at end of file +
+ +
+
+
+ +
+
+ +
+
+ +
+
+
+
+{% textarea field="TBHistory.diagnosis_details" label="Details" %} diff --git a/apps/tb/templates/modals/index_case_modal.html b/apps/tb/templates/modals/index_case_modal.html new file mode 100644 index 000000000..b75730706 --- /dev/null +++ b/apps/tb/templates/modals/index_case_modal.html @@ -0,0 +1,7 @@ +{% extends "base_templates/form_modal_base.html" %} +{% block title %} + Index Case + + For [[ editingName]] + +{% endblock %} \ No newline at end of file diff --git a/apps/tb/templates/records/index_case.html b/apps/tb/templates/records/index_case.html new file mode 100644 index 000000000..5aac4dc18 --- /dev/null +++ b/apps/tb/templates/records/index_case.html @@ -0,0 +1,61 @@ + + + LTBR number: + + [[ item.ltbr_number ]] +
+
+ + + Hospital number: + + [[ item.hospital_number ]] +
+
+ + + Relationship: + + [[ item.relationship ]] + [[ item.relationship_other ]] +
+
+ + + Sputum smear: + + [[ item.sputum_smear ]] +
+
+ + + Culture: + + [[ item.culture ]] +
+
+ + + Drug suceptablity: + + [[ item.drug_susceptibility ]] +
+
+ + + Site of TB: + + [[ item.index_case_site_of_tb ]] +
+
+ + + Diagnosis date: + + [[ item.diagnosis_day ]] [[ item.diagnosis_month|month ]] [[ item.diagnosis_year ]] +
+
+ + [[ item.details ]] +
+
diff --git a/apps/tb/templates/records/tb_history.html b/apps/tb/templates/records/tb_history.html index 109302556..ad4f38041 100644 --- a/apps/tb/templates/records/tb_history.html +++ b/apps/tb/templates/records/tb_history.html @@ -1,60 +1,31 @@ -
- Previous [[ item.tb_type ]] [[ item.site_of_tb ]] TB Diagnosis - - - - - [[ item.contact_how_long_ago_years ]] [[ 'year'|plural:item.contact_how_long_ago_years ]] - - - [[ item.contact_how_long_ago_months ]] [[ 'month'|plural:item.contact_how_long_ago_months ]] - - - [[ item.contact_how_long_ago_days ]] [[ 'day'|plural:item.contact_how_long_ago_days ]] - - ago -
-
- - Treated for - - [[ item.how_long_treated_years ]] [[ 'year'|plural:item.how_long_treated_years ]] - - - [[ item.how_long_treated_months ]] [[ 'month'|plural:item.how_long_treated_months ]] - - - [[ item.how_long_treated_days ]] [[ 'day'|plural:item.how_long_treated_days ]] - -
-
- - In [[ item.country_treated ]] [[ item.treatment_centre ]] - - - [[ item.diagnosis_details ]] -
-
-
+Previous [[ item.tb_type ]] [[ item.site_of_tb ]] TB Diagnosis + + - + [[ item.diagnosis_date_day ]] [[ item.diagnosis_date_month|month ]] [[ item.diagnosis_date_year ]] +
+
-
- Previous TB Contact - - - - - [[ item.contact_how_long_ago_years ]] [[ 'year'|plural:item.contact_how_long_ago_years ]] - - - [[ item.contact_how_long_ago_months ]] [[ 'month'|plural:item.contact_how_long_ago_months ]] - - - [[ item.contact_how_long_ago_days ]] [[ 'day'|plural:item.contact_how_long_ago_days ]] - - ago -
-
- - [[ item.previous_tb_contact_details ]] -
-
-
+ + + + Treated for + + [[ item.how_long_treated_years ]] [[ 'year'|plural:item.how_long_treated_years ]] + + + [[ item.how_long_treated_months ]] [[ 'month'|plural:item.how_long_treated_months ]] + + + [[ item.how_long_treated_days ]] [[ 'day'|plural:item.how_long_treated_days ]] + +
+
+ + In [[ item.country_treated ]] [[ item.treatment_centre ]] + + + [[ item.diagnosis_details ]] +
+
+ diff --git a/apps/tb/templates/tb/letters/ltbi_follow_up.html b/apps/tb/templates/tb/letters/ltbi_follow_up.html index 9f5198980..ec801db43 100644 --- a/apps/tb/templates/tb/letters/ltbi_follow_up.html +++ b/apps/tb/templates/tb/letters/ltbi_follow_up.html @@ -1,13 +1,15 @@ -{% extends 'letters/base.html' %} {% block letter_content %} +{% extends 'letters/base.html' %} +{% block letter_content %}

Primary diagnosis:
{% if primary_diagnosis_list.exists %} {% for diagnosis in primary_diagnosis_list %} - {{ diagnosis.condition }} - {% if diagnosis.provisional %}?{% endif %} - {% if diagnosis.details %} - {{ diagnosis.details }} - {% endif %} + {{ diagnosis.condition }} + {% if diagnosis.provisional %}?{% endif %} + {% if diagnosis.details %} +
+ {{ diagnosis.details }} + {% endif %}
{% endfor %} {% else %} @@ -20,9 +22,10 @@ Secondary diagnos{{ secondary_diagnosis_list|pluralize:"is,es" }}:
{% if secondary_diagnosis_list.exists %} {% for diagnosis in secondary_diagnosis_list %} - {{ diagnosis.condition }} + - {{ diagnosis.condition }} {% if diagnosis.provisional %}?{% endif %} {% if diagnosis.details %} +
{{ diagnosis.details }} {% endif %}
@@ -86,23 +89,16 @@ Travel: No recorded travel
{% endif %} - Previous TB diagnosis: - {% if tb_history.tb_type %} - {{ tb_history.tb_type }} - {% else %} - None recorded - {% endif %} -
- Previous TB contact: - {% if tb_history.previous_tb_contact_details %} - {{ tb_history.previous_tb_contact_details }} - {% else %} - None recorded - {% endif %} -
Place of birth: {{ demographics.birth_place }}

+

+ {% include "tb/letters/partials/tb_history.html" %} +

+

+ {% include "tb/letters/partials/index_case.html" %} +

+

Progress:
diff --git a/apps/tb/templates/tb/letters/ltbi_initial_assessment.html b/apps/tb/templates/tb/letters/ltbi_initial_assessment.html index 40726b306..95c37225d 100644 --- a/apps/tb/templates/tb/letters/ltbi_initial_assessment.html +++ b/apps/tb/templates/tb/letters/ltbi_initial_assessment.html @@ -6,6 +6,7 @@ {{ diagnosis.condition }} {% if diagnosis.provisional %}?{% endif %} {% if diagnosis.details %} +
{{ diagnosis.details }} {% endif %}
@@ -20,9 +21,10 @@ Secondary diagnos{{ secondary_diagnosis_list|pluralize:"is,es" }}:
{% if secondary_diagnosis_list.exists %} {% for diagnosis in secondary_diagnosis_list %} - {{ diagnosis.condition }} + - {{ diagnosis.condition }} {% if diagnosis.provisional %}?{% endif %} {% if diagnosis.details %} +
{{ diagnosis.details }} {% endif %}
@@ -45,9 +47,11 @@

Language:
- {{ communication_considerations.language }} - {% if communication_considerations.needs_an_interpreter %} - (needs an interpreter) + {% if not communication_considerations.language == "English" %} + {{ communication_considerations.language }} + {% if communication_considerations.needs_an_interpreter %} + (needs an interpreter) + {% endif %} {% endif %}

@@ -71,25 +75,15 @@ Travel: No recorded travel
{% endif %} - Previous TB diagnosis: - {% if tb_history.tb_type %} - {{ tb_history.tb_type }} - {% else %} - None recorded - {% endif %} -
- Previous TB contact: - {% if tb_history.previous_tb_contact_details %} - {{ tb_history.previous_tb_contact_details }} - {% else %} - None recorded - {% endif %} -
Place of birth: {{ demographics.birth_place }}

- - +

+ {% include "tb/letters/partials/tb_history.html" %} +

+

+ {% include "tb/letters/partials/index_case.html" %} +

Symptoms:
{% for symptom_complex in symptom_complex_list %} @@ -191,7 +185,7 @@ {% endif %}

- Discussion:
+ Discussion:

diff --git a/apps/tb/templates/tb/letters/partials/index_case.html b/apps/tb/templates/tb/letters/partials/index_case.html new file mode 100644 index 000000000..4adff53d0 --- /dev/null +++ b/apps/tb/templates/tb/letters/partials/index_case.html @@ -0,0 +1,37 @@ +{% if index_case_list.exists %} + + {{ models.IndexCase.get_display_name }}{{ index_case_list|pluralize}}: + + {% for index_case in index_case_list %} +
+ - + {% if index_case.ltbr_number or index_case.hospital_number or index_case.diagnosis_day or index_case.diagnosis_month or index_case.diagnosis_year %} + {% if index_case.ltbr_number %} + LTBI: {{ index_case.ltbr_number }} + {% endif %} + {% if index_case.hospital_number %} + # {{ index_case.hospital_number }} + {% endif %} + {% if index_case.diagnosis_day or index_case.diagnosis_month or index_case.diagnosis_year %} + {{ index_case.diagnosis_day }} [[{{ index_case.diagnosis_month }}|month ]] {{ index_case.diagnosis_year }} + {% endif %} +
+ {% endif %} + {% if index_case.sputum_smear or index_case.culture or index_case.drug_susceptibility %} + {% if index_case.sputum_smear %} + Sputum smear: +ve +   + {% endif %} + {% if index_case.culture %} + Culture: +ve +   + {% endif %} + {% if index_case.drug_susceptibility %} + Susceptability: {{ index_case.drug_susceptibility }} + {% endif %} +
+ {% endif %} + {{ index_case.details }} +
+ {% endfor %} +{% endif %} \ No newline at end of file diff --git a/apps/tb/templates/tb/letters/partials/tb_history.html b/apps/tb/templates/tb/letters/partials/tb_history.html new file mode 100644 index 000000000..0f4e43272 --- /dev/null +++ b/apps/tb/templates/tb/letters/partials/tb_history.html @@ -0,0 +1,36 @@ + + Previous TB Diagnosis: + +
+{% if tb_history.tb_type %} + {{ tb_history.tb_type }} {{ tb_history.site_of_tb }} + {% if tb_history.diagnosis_date_year or tb_history.diagnosis_date_month or tb_history.diagnosis_date_day %} + - + {{ tb_history.diagnosis_date_day }} [[ {{ tb_history.diagnosis_date_month }}|month ]] {{ tb_history.diagnosis_date_year }} + {% endif %} +
+ + {% if tb_history.how_long_treated_years or tb_history.how_long_treated_months or tb_history.how_long_treated_days %} + Treated for + {% if tb_history.how_long_treated_years %} + {{ tb_history.how_long_treated_years }} year{{ tb_history.how_long_treated_years|pluralize }} + {% endif %} + {% if tb_history.how_long_treated_months %} + {{ tb_history.how_long_treated_months }} month{{ tb_history.how_long_treated_months|pluralize }} + {% endif %} + {% if tb_history.how_long_treated_days %} + {{ tb_history.how_long_treated_days }} day{{ tb_history.how_long_treated_days|pluralize }} + {% endif %} +
+ {% endif %} + + {% if tb_history.country_treated or tb_history.treatment_centre %} + In {{ tb_history.country_treated }} {{ tb_history.treatment_centre }} + {% endif %} + {% if tb_history.diagnosis_details %} + {{ tb_history.diagnosis_details }} +
+ {% endif %} +{% else %} + None recorded +{% endif %} \ No newline at end of file diff --git a/apps/tb/views.py b/apps/tb/views.py index 2dbb05220..1159cf61e 100644 --- a/apps/tb/views.py +++ b/apps/tb/views.py @@ -50,6 +50,7 @@ def get_context_data(self, *args, **kwargs): ctx["allergies_list"] = patient.allergies_set.all() ctx["imaging_list"] = episode.imaging_set.all() ctx["tb_history"] = patient.tbhistory_set.get() + ctx["index_case_list"] = patient.indexcase_set.all() ctx["other_investigation_list"] = episode.otherinvestigation_set.all() consultation_datetime = self.object.when if consultation_datetime: diff --git a/elcid/assets/js/elcid/filters.js b/elcid/assets/js/elcid/filters.js index c1ca8804b..efb7faeca 100644 --- a/elcid/assets/js/elcid/filters.js +++ b/elcid/assets/js/elcid/filters.js @@ -7,3 +7,49 @@ filters.filter('range', function(){ return res; }; }); + +filters.filter('month', function(){ + /* + * A simple function that takes an integer and + * returns the relevant month + */ + return function(input){ + if(input == 1){ + return "Jan"; + } + if(input == 2){ + return "Feb"; + } + if(input == 3){ + return "Mar"; + } + if(input == 4){ + return "Apr"; + } + if(input == 5){ + return "May"; + } + if(input == 6){ + return "Jun"; + } + if(input == 7){ + return "Jul"; + } + if(input == 8){ + return "Aug"; + } + if(input == 9){ + return "Sep"; + } + if(input == 10){ + return "Oct"; + } + if(input == 11){ + return "Nov"; + } + if(input == 12){ + return "Dec"; + } + return ""; + } + }); \ No newline at end of file diff --git a/elcid/templates/_helpers/radio_columns.html b/elcid/templates/_helpers/radio_columns.html new file mode 100644 index 000000000..a03916d45 --- /dev/null +++ b/elcid/templates/_helpers/radio_columns.html @@ -0,0 +1,31 @@ +
+ +
+
+
+ +
+
+
+
+ +
+
+ {% if required %} +
+
+ + {{ label }} is required + +
+
+ {% endif %} +
+
\ No newline at end of file diff --git a/elcid/templatetags/__init__.py b/elcid/templatetags/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/elcid/templatetags/elcid_forms.py b/elcid/templatetags/elcid_forms.py new file mode 100644 index 000000000..1621a8a3e --- /dev/null +++ b/elcid/templatetags/elcid_forms.py @@ -0,0 +1,9 @@ +from django import template +from opal.templatetags.forms import _radio +register = template.Library() + + +@register.inclusion_tag('_helpers/radio_columns.html') +def radio_columns(*args, **kwargs): + return _radio(*args, **kwargs) +