 
 
 (comment
-  [:div.col-md-12
-     [:dl
-      [:dt "Number Of Storeys"] [:dd (get profile_data :number_of_storeys "")]
-      [:dt "Air Tightness Equipment"] [:dd (get profile_data :air_tightness_equipment "")]
-      [:dt "Gross Internal Area"] [:dd (get profile_data :gross_internal_area "")]
-      [:dt "Category"] [:dd (get profile_data :category "")]
-      [:dt "SAP Performed On"] [:dd (get profile_data :sap_performed_on "")]
-      [:dt "Used Passivehaus Principles"] [:dd (get profile_data :used_passivehaus_principles "")]
-      [:dt "SAP Version Issue"] [:dd (get profile_data :sap_version_issue "")]
-      [:dt "Air Tightness Rate"] [:dd (get profile_data :air_tightness_rate "")]
-      [:dt "Multiple Glazing Type"] [:dd (get profile_data :multiple_glazing_type "")]
-      [:dt "Total Volume"] [:dd (get profile_data :total_volume "")]
-      [:dt "Appliances Strategy"] [:dd (get profile_data :appliances_strategy "")]
-      [:dt "Profile Noise"] [:dd (get profile_data :profile_noise "")]
-      [:dt "Space Heating Requirement"] [:dd (get profile_data :space_heating_requirement "")]
-      [:dt "Flat Heat Loss Corridor"] [:dd (get profile_data :flat_heat_loss_corridor "")]
-      [:dt "Primary Energy Requirement"] [:dd (get profile_data :primary_energy_requirement "")]
-      [:dt "Passive Solar Strategy"] [:dd (get profile_data :passive_solar_strategy "")]
-      [:dt "Profile Comfort"] [:dd (get profile_data :profile_comfort "")]
-      [:dt "Annual Space Heating Requirement"] [:dd (get profile_data :annual_space_heating_requirement "")]
-      [:dt "Onsite Days"] [:dd (get profile_data :onsite_days "")]
-      [:dt "Completeness"] [:dd (get profile_data :completeness "")]
-      [:dt "Renewable Contribution Elec"] [:dd (get profile_data :renewable_contribution_elec "")]
-      [:dt "Best U Value For Floors"] [:dd (get profile_data :best_u_value_for_floors "")]
-      [:dt "Profile Needs"] [:dd (get profile_data :profile_needs "")]
-      [:dt "Open Fireplaces"] [:dd (get profile_data :open_fireplaces "")]
-      [:dt "SAP Assessor"] [:dd (get profile_data :sap_assessor "")]
-      [:dt "Occupant Change"] [:dd (get profile_data :occupant_change "")]
-      [:dt "Controls Strategy"] [:dd (get profile_data :controls_strategy "")]
-      [:dt "Property Id"] [:dd (get profile_data :property_id "")]
-      [:dt "Heat Storage Present"] [:dd (get profile_data :heat_storage_present "")]
-      [:dt "SAP Regulations Date"] [:dd (get profile_data :sap_regulations_date "")]
-      [:dt "Best U Value For Windows"] [:dd (get profile_data :best_u_value_for_windows "")]
-      [:dt "Best U Value For Roof"] [:dd (get profile_data :best_u_value_for_roof "")]
-      [:dt "Co Heating Assessor"] [:dd (get profile_data :co_heating_assessor "")]
-      [:dt "Modelling Software Methods Used"] [:dd (get profile_data :modelling_software_methods_used "")]
-      [:dt "Best U Value For Walls"] [:dd (get profile_data :best_u_value_for_walls "")]
-      [:dt "Profile Air In Summer"] [:dd (get profile_data :profile_air_in_summer "")]
-      [:dt "SAP Software"] [:dd (get profile_data :sap_software "")]
-      [:dt "Intervention Start Date"] [:dd (get profile_data :intervention_start_date "")]
-      [:dt "Co Heating Loss"] [:dd (get profile_data :co_heating_loss "")]
-      [:dt "Intention Ofpassvhaus"] [:dd (get profile_data :intention_ofpassvhaus "")]
-      [:dt "Dwelling U Value Other"] [:dd (get profile_data :dwelling_u_value_other "")]
-      [:dt "Occupancy 18 To 60"] [:dd (get profile_data :occupancy_18_to_60 "")]
-      [:dt "Profile Bus Report Url"] [:dd (get profile_data :profile_bus_report_url "")]
-      [:dt "Orientation"] [:dd (get profile_data :orientation "")]
-      [:dt "Co Heating Equipment"] [:dd (get profile_data :co_heating_equipment "")]
-      [:dt "Ventilation Approach"] [:dd (get profile_data :ventilation_approach "")]
-      [:dt "Sealed Fireplaces"] [:dd (get profile_data :sealed_fireplaces "")]
-      [:dt "Intervention Description"] [:dd (get profile_data :intervention_description "")]
-      [:dt "Footprint"] [:dd (get profile_data :footprint "")]
-      [:dt "Estimated Cost New Build"] [:dd (get profile_data :estimated_cost_new_build "")]
-      [:dt "Mains Gas"] [:dd (get profile_data :mains_gas "")]
-      [:dt "SAP Version Year"] [:dd (get profile_data :sap_version_year "")]
-      [:dt "Annual Heating Load"] [:dd (get profile_data :annual_heating_load "")]
-      [:dt "Glazing Area Percentage"] [:dd (get profile_data :glazing_area_percentage "")]
-      [:dt "Profile Image To Visitors"] [:dd (get profile_data :profile_image_to_visitors "")]
-      [:dt "Profile Temperature In Summer"] [:dd (get profile_data :profile_temperature_in_summer "")]
-      [:dt "Renewable Contribution Heat"] [:dd (get profile_data :renewable_contribution_heat "")]
-      [:dt "Profile Design"] [:dd (get profile_data :profile_design "")]
-      [:dt "TER"] [:dd (get profile_data :ter "")]
-      [:dt "Onsite Days New Build"] [:dd (get profile_data :onsite_days_new_build "")]
-      [:dt "Total Area"] [:dd (get profile_data :total_area "")]
-      [:dt "Frame Type"] [:dd (get profile_data :frame_type "")]
-      [:dt "Multiple Glazing Area Percentage"] [:dd (get profile_data :multiple_glazing_area_percentage "")]
-      [:dt "Flat Floor Heat Loss Type"] [:dd (get profile_data :flat_floor_heat_loss_type "")]
-      [:dt "Airtightness And Ventilation Strategy"] [:dd (get profile_data :airtightness_and_ventilation_strategy "")]
-      [:dt "Overheating Cooling Strategy"] [:dd (get profile_data :overheating_cooling_strategy "")]
-      [:dt "Moisture Condensation Mould Strategy"] [:dd (get profile_data :moisture_condensation_mould_strategy "")]
-      [:dt "Intervention Completion Date"] [:dd (get profile_data :intervention_completion_date "")]
-      [:dt "Thermal Bridging Strategy"] [:dd (get profile_data :thermal_bridging_strategy "")]
-      [:dt "Draught Proofing Location"] [:dd (get profile_data :draught_proofing_location "")]
-      [:dt "Roof Rooms Present"] [:dd (get profile_data :roof_rooms_present "")]
-      [:dt "Innovation Approaches"] [:dd (get profile_data :innovation_approaches "")]
-      [:dt "Flat Floors In Block"] [:dd (get profile_data :flat_floors_in_block "")]
-      [:dt "Lighting Strategy"] [:dd (get profile_data :lighting_strategy "")]
-      [:dt "Total Budget"] [:dd (get profile_data :total_budget "")]
-      [:dt "Final Cost New Build"] [:dd (get profile_data :final_cost_new_build "")]
-      [:dt "SAP Rating"] [:dd (get profile_data :sap_rating "")]
-      [:dt "Pipe Lagging"] [:dd (get profile_data :pipe_lagging "")]
-      [:dt "Occupancy Over 60"] [:dd (get profile_data :occupancy_over_60 "")]
-      [:dt "BER"] [:dd (get profile_data :ber "")]
-      [:dt "ID"] [:dd (get profile_data :id "")]
-      [:dt "Profile Temperature In Winter"] [:dd (get profile_data :profile_temperature_in_winter "")]
-      [:dt "Total Envelope Area"] [:dd (get profile_data :total_envelope_area "")]
-      [:dt "Bedroom Count"] [:dd (get profile_data :bedroom_count "")]
-      [:dt "Profile Productivity"] [:dd (get profile_data :profile_productivity "")]
-      [:dt "Flat Length Sheltered Wall"] [:dd (get profile_data :flat_length_sheltered_wall "")]
-      [:dt "Multiple Glazing U Value"] [:dd (get profile_data :multiple_glazing_u_value "")]
-      [:dt "Glazing Area Glass Only"] [:dd (get profile_data :glazing_area_glass_only "")]
-      [:dt "Multiple Glazing Type Other"] [:dd (get profile_data :multiple_glazing_type_other "")]
-      [:dt "Air Tightness Performed On"] [:dd (get profile_data :air_tightness_performed_on "")]
-      [:dt "Air Tightness Assessor"] [:dd (get profile_data :air_tightness_assessor "")]
-      [:dt "Best U Value Party Walls"] [:dd (get profile_data :best_u_value_party_walls "")]
-      [:dt "Fabric Energy Efficiency"] [:dd (get profile_data :fabric_energy_efficiency "")]
-      [:dt "Construction Time New Build"] [:dd (get profile_data :construction_time_new_build "")]
-      [:dt "Profile Air In Winter"] [:dd (get profile_data :profile_air_in_winter "")]
-      [:dt "External Perimeter"] [:dd (get profile_data :external_perimeter "")]
-      [:dt "Cellar Basement Issues"] [:dd (get profile_data :cellar_basement_issues "")]
-      [:dt "Best U Value For Doors"] [:dd (get profile_data :best_u_value_for_doors "")]
-      [:dt "Heat Loss Parameter Hlp"] [:dd (get profile_data :heat_loss_parameter_hlp "")]
-      [:dt "Co Heating Performed On"] [:dd (get profile_data :co_heating_performed_on "")]
-      [:dt "Frame Type Other"] [:dd (get profile_data :frame_type_other "")]
-      [:dt "Design Guidance"] [:dd (get profile_data :design_guidance "")]
-      [:dt "Electricity Meter Type"] [:dd (get profile_data :electricity_meter_type "")]
-      [:dt "Ventilation Approach Other"] [:dd (get profile_data :ventilation_approach_other "")]
-      [:dt "Heated Habitable Rooms"] [:dd (get profile_data :heated_habitable_rooms "")]
-      [:dt "Profile Bus Summary Index"] [:dd (get profile_data :profile_bus_summary_index "")]
-      [:dt "Total Budget New Build"] [:dd (get profile_data :total_budget_new_build "")]
-      [:dt "Electricity Storage Present"] [:dd (get profile_data :electricity_storage_present "")]
-      [:dt "Flat Heat Loss Corridor Other"] [:dd (get profile_data :flat_heat_loss_corridor_other "")]
-      [:dt "Water Saving Strategy"] [:dd (get profile_data :water_saving_strategy "")]
-      [:dt "Conservation Issues"] [:dd (get profile_data :conservation_issues "")]
-      [:dt "Habitable Rooms"] [:dd (get profile_data :habitable_rooms "")]
-      [:dt "Best U Value For Other"] [:dd (get profile_data :best_u_value_for_other "")]
-      [:dt "Profile Lightning"] [:dd (get profile_data :profile_lightning "")]
-      [:dt "Total Rooms"] [:dd (get profile_data :total_rooms "")]
-      [:dt "Inadequate Heating"] [:dd (get profile_data :inadequate_heating "")]
-      [:dt "Flat Floor Position"] [:dd (get profile_data :flat_floor_position "")]
-      [:dt "Planning Considerations"] [:dd (get profile_data :planning_considerations "")]
-      [:dt "Draught Proofing"] [:dd (get profile_data :draught_proofing "")]
-      [:dt "Occupancy Under 18"] [:dd (get profile_data :occupancy_under_18 "")]
-      [:dt "Profile Health"] [:dd (get profile_data :profile_health "")]]])
+
+  (text-control profile_data state owner :number_of_storeys "" "Number Of Storeys")
+  (text-control profile_data state owner :air_tightness_equipment "" "Air Tightness Equipment")
+  (text-control profile_data state owner :gross_internal_area "" "Gross Internal Area")
+  (text-control profile_data state owner :category "" "Category")
+  (text-control profile_data state owner :sap_performed_on "" "SAP Performed On")
+  (text-control profile_data state owner :used_passivehaus_principles "" "Used Passivehaus Principles")
+  (text-control profile_data state owner :sap_version_issue "" "SAP Version Issue")
+  (text-control profile_data state owner :air_tightness_rate "" "Air Tightness Rate")
+  (text-control profile_data state owner :multiple_glazing_type "" "Multiple Glazing Type")
+  (text-control profile_data state owner :total_volume "" "Total Volume")
+  (text-control profile_data state owner :appliances_strategy "" "Appliances Strategy")
+  (text-control profile_data state owner :profile_noise "" "Profile Noise")
+  (text-control profile_data state owner :space_heating_requirement "" "Space Heating Requirement")
+  (text-control profile_data state owner :flat_heat_loss_corridor "" "Flat Heat Loss Corridor")
+  (text-control profile_data state owner :primary_energy_requirement "" "Primary Energy Requirement")
+  (text-control profile_data state owner :passive_solar_strategy "" "Passive Solar Strategy")
+  (text-control profile_data state owner :profile_comfort "" "Profile Comfort")
+  (text-control profile_data state owner :annual_space_heating_requirement "" "Annual Space Heating Requirement")
+  (text-control profile_data state owner :onsite_days "" "Onsite Days")
+  (text-control profile_data state owner :completeness "" "Completeness")
+  (text-control profile_data state owner :renewable_contribution_elec "" "Renewable Contribution Elec")
+  (text-control profile_data state owner :best_u_value_for_floors "" "Best U Value For Floors")
+  (text-control profile_data state owner :profile_needs "" "Profile Needs")
+  (text-control profile_data state owner :open_fireplaces "" "Open Fireplaces")
+  (text-control profile_data state owner :sap_assessor "" "SAP Assessor")
+  (text-control profile_data state owner :occupant_change "" "Occupant Change")
+  (text-control profile_data state owner :controls_strategy "" "Controls Strategy")
+  (text-control profile_data state owner :property_id "" "Property Id")
+  (text-control profile_data state owner :heat_storage_present "" "Heat Storage Present")
+  (text-control profile_data state owner :sap_regulations_date "" "SAP Regulations Date")
+  (text-control profile_data state owner :best_u_value_for_windows "" "Best U Value For Windows")
+  (text-control profile_data state owner :best_u_value_for_roof "" "Best U Value For Roof")
+  (text-control profile_data state owner :co_heating_assessor "" "Co Heating Assessor")
+  (text-control profile_data state owner :modelling_software_methods_used "" "Modelling Software Methods Used")
+  (text-control profile_data state owner :best_u_value_for_walls "" "Best U Value For Walls")
+  (text-control profile_data state owner :profile_air_in_summer "" "Profile Air In Summer")
+  (text-control profile_data state owner :sap_software "" "SAP Software")
+  (text-control profile_data state owner :intervention_start_date "" "Intervention Start Date")
+  (text-control profile_data state owner :co_heating_loss "" "Co Heating Loss")
+  (text-control profile_data state owner :intention_ofpassvhaus "" "Intention Ofpassvhaus")
+  (text-control profile_data state owner :dwelling_u_value_other "" "Dwelling U Value Other")
+  (text-control profile_data state owner :occupancy_18_to_60 "" "Occupancy 18 To 60")
+  (text-control profile_data state owner :profile_bus_report_url "" "Profile Bus Report Url")
+  (text-control profile_data state owner :orientation "" "Orientation")
+  (text-control profile_data state owner :co_heating_equipment "" "Co Heating Equipment")
+  (text-control profile_data state owner :ventilation_approach "" "Ventilation Approach")
+  (text-control profile_data state owner :sealed_fireplaces "" "Sealed Fireplaces")
+  (text-control profile_data state owner :intervention_description "" "Intervention Description")
+  (text-control profile_data state owner :footprint "" "Footprint")
+  (text-control profile_data state owner :estimated_cost_new_build "" "Estimated Cost New Build")
+  (text-control profile_data state owner :mains_gas "" "Mains Gas")
+  (text-control profile_data state owner :sap_version_year "" "SAP Version Year")
+  (text-control profile_data state owner :annual_heating_load "" "Annual Heating Load")
+  (text-control profile_data state owner :glazing_area_percentage "" "Glazing Area Percentage")
+  (text-control profile_data state owner :profile_image_to_visitors "" "Profile Image To Visitors")
+  (text-control profile_data state owner :profile_temperature_in_summer "" "Profile Temperature In Summer")
+  (text-control profile_data state owner :renewable_contribution_heat "" "Renewable Contribution Heat")
+  (text-control profile_data state owner :profile_design "" "Profile Design")
+  (text-control profile_data state owner :ter "" "TER")
+  (text-control profile_data state owner :onsite_days_new_build "" "Onsite Days New Build")
+  (text-control profile_data state owner :total_area "" "Total Area")
+  (text-control profile_data state owner :frame_type "" "Frame Type")
+  (text-control profile_data state owner :multiple_glazing_area_percentage "" "Multiple Glazing Area Percentage")
+  (text-control profile_data state owner :flat_floor_heat_loss_type "" "Flat Floor Heat Loss Type")
+  (text-control profile_data state owner :airtightness_and_ventilation_strategy "" "Airtightness And Ventilation Strategy")
+  (text-control profile_data state owner :overheating_cooling_strategy "" "Overheating Cooling Strategy")
+  (text-control profile_data state owner :moisture_condensation_mould_strategy "" "Moisture Condensation Mould Strategy")
+  (text-control profile_data state owner :intervention_completion_date "" "Intervention Completion Date")
+  (text-control profile_data state owner :thermal_bridging_strategy "" "Thermal Bridging Strategy")
+  (text-control profile_data state owner :draught_proofing_location "" "Draught Proofing Location")
+  (text-control profile_data state owner :roof_rooms_present "" "Roof Rooms Present")
+  (text-control profile_data state owner :innovation_approaches "" "Innovation Approaches")
+  (text-control profile_data state owner :flat_floors_in_block "" "Flat Floors In Block")
+  (text-control profile_data state owner :lighting_strategy "" "Lighting Strategy")
+  (text-control profile_data state owner :total_budget "" "Total Budget")
+  (text-control profile_data state owner :final_cost_new_build "" "Final Cost New Build")
+  (text-control profile_data state owner :sap_rating "" "SAP Rating")
+  (text-control profile_data state owner :pipe_lagging "" "Pipe Lagging")
+  (text-control profile_data state owner :occupancy_over_60 "" "Occupancy Over 60")
+  (text-control profile_data state owner :ber "" "BER")
+  (text-control profile_data state owner :id "" "ID")
+  (text-control profile_data state owner :profile_temperature_in_winter "" "Profile Temperature In Winter")
+  (text-control profile_data state owner :total_envelope_area "" "Total Envelope Area")
+  (text-control profile_data state owner :bedroom_count "" "Bedroom Count")
+  (text-control profile_data state owner :profile_productivity "" "Profile Productivity")
+  (text-control profile_data state owner :flat_length_sheltered_wall "" "Flat Length Sheltered Wall")
+  (text-control profile_data state owner :multiple_glazing_u_value "" "Multiple Glazing U Value")
+  (text-control profile_data state owner :glazing_area_glass_only "" "Glazing Area Glass Only")
+  (text-control profile_data state owner :multiple_glazing_type_other "" "Multiple Glazing Type Other")
+  (text-control profile_data state owner :air_tightness_performed_on "" "Air Tightness Performed On")
+  (text-control profile_data state owner :air_tightness_assessor "" "Air Tightness Assessor")
+  (text-control profile_data state owner :best_u_value_party_walls "" "Best U Value Party Walls")
+  (text-control profile_data state owner :fabric_energy_efficiency "" "Fabric Energy Efficiency")
+  (text-control profile_data state owner :construction_time_new_build "" "Construction Time New Build")
+  (text-control profile_data state owner :profile_air_in_winter "" "Profile Air In Winter")
+  (text-control profile_data state owner :external_perimeter "" "External Perimeter")
+  (text-control profile_data state owner :cellar_basement_issues "" "Cellar Basement Issues")
+  (text-control profile_data state owner :best_u_value_for_doors "" "Best U Value For Doors")
+  (text-control profile_data state owner :heat_loss_parameter_hlp "" "Heat Loss Parameter Hlp")
+  (text-control profile_data state owner :co_heating_performed_on "" "Co Heating Performed On")
+  (text-control profile_data state owner :frame_type_other "" "Frame Type Other")
+  (text-control profile_data state owner :design_guidance "" "Design Guidance")
+  (text-control profile_data state owner :electricity_meter_type "" "Electricity Meter Type")
+  (text-control profile_data state owner :ventilation_approach_other "" "Ventilation Approach Other")
+  (text-control profile_data state owner :heated_habitable_rooms "" "Heated Habitable Rooms")
+  (text-control profile_data state owner :profile_bus_summary_index "" "Profile Bus Summary Index")
+  (text-control profile_data state owner :total_budget_new_build "" "Total Budget New Build")
+  (text-control profile_data state owner :electricity_storage_present "" "Electricity Storage Present")
+  (text-control profile_data state owner :flat_heat_loss_corridor_other "" "Flat Heat Loss Corridor Other")
+  (text-control profile_data state owner :water_saving_strategy "" "Water Saving Strategy")
+  (text-control profile_data state owner :conservation_issues "" "Conservation Issues")
+  (text-control profile_data state owner :habitable_rooms "" "Habitable Rooms")
+  (text-control profile_data state owner :best_u_value_for_other "" "Best U Value For Other")
+  (text-control profile_data state owner :profile_lightning "" "Profile Lightning")
+  (text-control profile_data state owner :total_rooms "" "Total Rooms")
+  (text-control profile_data state owner :inadequate_heating "" "Inadequate Heating")
+  (text-control profile_data state owner :flat_floor_position "" "Flat Floor Position")
+  (text-control profile_data state owner :planning_considerations "" "Planning Considerations")
+  (text-control profile_data state owner :draught_proofing "" "Draught Proofing")
+  (text-control profile_data state owner :occupancy_under_18 "" "Occupancy Under 18")
+  (text-control profile_data state owner :profile_health "Profile Health")
+  )

    om/IRenderState
    (render-state [_ state]
      (html
       [:div.col-md-12
        (for [profile profiles]
          (let [category (get-in profile [:profile_data :category] "Intervention")
                timestamp (format-time-inst  (:timestamp profile) "yyyy-MM-dd")]

               (text-control profile_data state owner :electricity_storage_present "Electricity Storage Present")
               (text-control profile_data state owner :heat_storage_present "Heat Storage Present")])]))]))))

(defn efficiency-row [profiles owner]
  (reify
    om/IRenderState
    (render-state [_ state]
      (html
       [:div.col-md-12
        (for [profile profiles]
          (let [profile_data (:profile_data profile)]
            [:div {:class (profile-column-width)}
             (bs/panel
              "Efficiency"
              [:div
               (text-control profile_data state owner :pipe_lagging "Pipe Lagging")
               (text-control profile_data state owner :draught_proofing  "Draught Proofing")
               (text-control profile_data state owner :draught_proofing_location  "Draught Proofing Location")])]))]))))

(defn flats-row [profiles owner]
  (reify
    om/IRenderState
    (render-state [_ state]
      (html
       [:div.col-md-12
        (for [profile profiles]
          (let [profile_data (:profile_data profile)]
            [:div {:class (profile-column-width)}
             (bs/panel
              "Flats"
              [:div
               (text-control profile_data state owner :flat_floors_in_block "Floors In Block")
               (text-control profile_data state owner :flat_floor_position "Floor Position")
               (text-control profile_data state owner :flat_heat_loss_corridor "Heat Loss Corridor")
               (text-control profile_data state owner :flat_heat_loss_corridor_other "Heat Loss Corridor Other")
               (text-control profile_data state owner :flat_length_sheltered_wall "Length of Sheltered Wall (m)")
               (text-control profile_data state owner :flat_floor_heat_loss_type "Floor Heat Loss Type")])]))]))))


(defn profile-rows [profiles owner]
