diff --git a/activity/views.py b/activity/views.py index 55e187ba..c2b87944 100755 --- a/activity/views.py +++ b/activity/views.py @@ -493,7 +493,7 @@ def admin_configurations(request): 'form_label': data.get('form_label'), 'stakeholder_label': data.get('stakeholder_label'), 'date_format': data.get('date_format'), - 'beneficiary_label': data.get('beneficiary_label'), + 'individual_label': data.get('individual_label'), 'training_label': data.get('training_label'), 'distribution_label': data.get('distribution_label'), # 'default_currency': data.get('default_currency') diff --git a/assets/rrima.html b/assets/rrima.html index f5c1ec0e..b99dd245 100644 --- a/assets/rrima.html +++ b/assets/rrima.html @@ -130,14 +130,14 @@ div.cell { display: block; page-break-inside: avoid; - } - div.output_wrapper { + } + div.output_wrapper { display: block; - page-break-inside: avoid; + page-break-inside: avoid; } - div.output { + div.output { display: block; - page-break-inside: avoid; + page-break-inside: avoid; } } @@ -311,7 +311,7 @@ function(Bokeh) { Bokeh.set_log_level("info"); }, - + function(Bokeh) { Bokeh.$("#bd76ffdd-a07e-407a-abc2-13299e48d39f").text("BokehJS successfully loaded"); }, @@ -375,7 +375,7 @@ frameborder="0" allowfullscreen > - + @@ -389,8 +389,8 @@
In [60]:
-
#import cleaned version of Izmir beneficiary data - removed merged cells in headers etc
-izmir = pd.read_excel('/Users/samlilienfeld/Google Drive/RRIMA/RRIMA Datasets_Forms/Datasets/Turkey Datasets/Clean datasets/CLEAN Beneficiary Database.31052016.xlsx')
+
#import cleaned version of Izmir individual data - removed merged cells in headers etc
+izmir = pd.read_excel('/Users/samlilienfeld/Google Drive/RRIMA/RRIMA Datasets_Forms/Datasets/Turkey Datasets/Clean datasets/CLEAN Individual Database.31052016.xlsx')
 
@@ -454,7 +454,7 @@
In [64]:
-
#code sex and age group of the beneficiary being surveyed - add to already disaggregated family members
+
#code sex and age group of the individual being surveyed - add to already disaggregated family members
 #izmir_lim['MC_OLD_M>=60'] = np.where((izmir_lim.Gender == 'M') & (izmir_lim.Age >= 60),izmir_lim['MC_OLD_M>=60'] + 1, izmir_lim['MC_OLD_M>=60'])
 #izmir_lim['MC_OLD_F>=60'] = np.where((izmir_lim.Gender == 'F') & (izmir_lim.Age >= 60),izmir_lim['MC_OLD_F>=60'] + 1, izmir_lim['MC_OLD_F>=60'])
 #izmir_lim['MC_OLD_M>18'] = np.where((izmir_lim.Gender == 'M') & (izmir_lim.Age < 60) & (izmir_lim.Age > 18),izmir_lim['MC_OLD_M>18'] + 1, izmir_lim['MC_OLD_M>18'])
@@ -519,7 +519,7 @@
  'MC_OLD_M>=60':'Male',
  'MC_OLD_M_Child<5':'Male'}
 
-izmir_agg['gender_text'] = izmir_agg.variable.map(lambda x: genders[x]) 
+izmir_agg['gender_text'] = izmir_agg.variable.map(lambda x: genders[x])
 
@@ -616,21 +616,21 @@ 'Total number of MEN between age 18 to 59','Total number of WOMEN between age 18 to 59', 'Total number of MEN between age 5 to 17','Total number of WOMEN between age 5 to 17', 'Total number of BOYS under 5 years old','Total number of GIRLS under 5 years old']] - + temp_trans = pd.melt(temp) - + temp_agg = temp_trans.groupby('variable').aggregate({'value':'sum'}).reset_index().rename(columns={'value':'Total_Beneficiaries'}) - + temp_agg['gender_text'] = temp_agg.variable.map(lambda x: gender_code[x]) temp_agg['age_group'] = temp_agg.variable.map(lambda x: age_code[x]) temp_agg['country'] = country - + temp_agg['srt'] = temp_agg.age_group.map(lambda x: age_group_sort[x]) - + temp_agg.sort_values(by='srt',ascending=True,inplace=True) - + agg_sets[country] = temp_agg - +
@@ -732,7 +732,7 @@ frameborder="0" allowfullscreen > - +
@@ -752,29 +752,29 @@ #add circle markers for number of benes in each location - try and loop through df for i in range (0,len(izmir_district_totals)): - + popup_table = izmir_district_agg.loc[izmir_district_agg.District == izmir_district_totals.ix[i,1],['from_where','from_where_district']] - popup_table['Beneficiary Location'] = izmir_district_totals.ix[i,1] + popup_table['Individual Location'] = izmir_district_totals.ix[i,1] popup_table = popup_table.rename(columns={'from_where':'Original Location','from_where_district':'Beneficiaries'}) - popup_table = popup_table[['Beneficiary Location','Original Location','Beneficiaries']] + popup_table = popup_table[['Iindividual Location','Original Location','Beneficiaries']] popup_table['Beneficiaries'] = popup_table.Beneficiaries.astype(int) popup_table.sort_values(by='Beneficiaries',ascending=False,inplace=True) - + chart = Bar(popup_table,label=CatAttr(columns=['Original Location'],sort=False),values='Beneficiaries', title=izmir_district_totals.ix[i,1],xlabel='Original Location in Syria',ylabel='Beneficiaries',plot_width=700) - + hover = HoverTool(point_policy='follow_mouse') hover.tooltips=[('Beneficiaries','@height'),('Current Location',izmir_district_totals.ix[i,1]),('Original Location in Syria','@{Original Location}')] chart.add_tools(hover) - + html = file_html(chart, CDN, "my plot") - - + + #html = popup_table.to_html(index=False) iframe = folium.element.IFrame(html=html, width=1200, height=800) - + popup = folium.Popup(iframe, max_width=700) - + marker = folium.CircleMarker(izmir_district_totals.ix[i,3], radius=izmir_district_totals.ix[i,2] * 2, color='#3186cc', @@ -836,7 +836,7 @@ frameborder="0" allowfullscreen > - + @@ -850,7 +850,7 @@
In [79]:
-
#Izmir beneficiary graph
+
#Izmir individual graph
 
 izmir_benes_graph = Bar(izmir_agg,label=CatAttr(columns=['age_group'],sort=False),values='Total_Beneficiaries',group='gender_text',
                        xlabel='Age Group',ylabel='Beneficiaries',title='Izmir',
@@ -878,22 +878,22 @@
 
     
{% endblock %} -{% endblock content %} \ No newline at end of file +{% endblock content %} diff --git a/templates/base.html b/templates/base.html index 2c4d5d0e..a7386d52 100755 --- a/templates/base.html +++ b/templates/base.html @@ -163,7 +163,7 @@ aria-expanded="false">Form Library
- +
- {% if form_component != 'beneficiary_list' %} + {% if form_component != 'individual_list' %}
diff --git a/templates/formlibrary/form-sections/beneficiary/details.html b/templates/formlibrary/form-sections/individual/details.html similarity index 90% rename from templates/formlibrary/form-sections/beneficiary/details.html rename to templates/formlibrary/form-sections/individual/details.html index 5e2a12fe..cd6c671b 100644 --- a/templates/formlibrary/form-sections/beneficiary/details.html +++ b/templates/formlibrary/form-sections/individual/details.html @@ -1,7 +1,7 @@ {% load crispy_forms_tags %}
- {{ form.beneficiary_name | as_crispy_field }} + {{ form.first_name | as_crispy_field }}
diff --git a/templates/formlibrary/form-sections/beneficiary/related.html b/templates/formlibrary/form-sections/individual/related.html similarity index 100% rename from templates/formlibrary/form-sections/beneficiary/related.html rename to templates/formlibrary/form-sections/individual/related.html diff --git a/templates/formlibrary/form-sections/beneficiary/services.html b/templates/formlibrary/form-sections/individual/services.html similarity index 100% rename from templates/formlibrary/form-sections/beneficiary/services.html rename to templates/formlibrary/form-sections/individual/services.html diff --git a/templates/formlibrary/beneficiary_confirm_delete.html b/templates/formlibrary/individual_confirm_delete.html similarity index 87% rename from templates/formlibrary/beneficiary_confirm_delete.html rename to templates/formlibrary/individual_confirm_delete.html index 48eff6d1..69b9cb23 100644 --- a/templates/formlibrary/beneficiary_confirm_delete.html +++ b/templates/formlibrary/individual_confirm_delete.html @@ -1,6 +1,6 @@