From 4a62edaca767d3185ff9a488bbe9c66f38192094 Mon Sep 17 00:00:00 2001 From: Nicolas Joyard <joyard.nicolas@gmail.com> Date: Thu, 2 Jun 2016 08:10:21 +0200 Subject: [PATCH] Add phone numbers --- templates/representatives/_address_block.haml | 8 ++------ templates/representatives/_representative_block.haml | 9 ++++++++- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/templates/representatives/_address_block.haml b/templates/representatives/_address_block.haml index 232aa0f7..16eb4b4b 100644 --- a/templates/representatives/_address_block.haml +++ b/templates/representatives/_address_block.haml @@ -1,9 +1,5 @@ .address - - if address.floor or address.office_number - .detail - - if address.floor - %span.floor Floor {{ address.floor }} - - if address.office_number - %span.office Office {{ address.office_number }} + - if address.floor and address.office_number + .office Floor {{ address.floor }} - office {{ address.office_number }} .street {{ address.number }} {{ address.street }} .city {{ address.city }} {{ address.postcode }}, {{ address.country.name }} diff --git a/templates/representatives/_representative_block.haml b/templates/representatives/_representative_block.haml index 4ba44cdb..cc991450 100644 --- a/templates/representatives/_representative_block.haml +++ b/templates/representatives/_representative_block.haml @@ -67,9 +67,16 @@ %td = email.email|email_link + - if representative.phone_set.all|length > 0 + %tr + %th Phone numbers + %td + - for phone in representative.phone_set.all + .phone {{ phone.number }} + - for address in representative.address_set.all %tr %th = address.name %td - - include 'representatives/_address_block.html' with address=address + - include 'representatives/_address_block.html' with address=address \ No newline at end of file -- GitLab