Commit e3af7ccc authored by Nicolas Joyard's avatar Nicolas Joyard
Browse files

Add postal addresses

parent a79996b7
......@@ -24,3 +24,9 @@ def website_link(url):
short_url = re.sub(r'^https?://([^/]+).*', '\\1', url)
return mark_safe(link.format(network='website', url=url,
label=short_url))
@register.filter
def email_link(address):
return mark_safe(link.format(network='email', url='mailto:%s' % address,
label=address))
.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 }}
.street {{ address.number }} {{ address.street }}
.city {{ address.city }} {{ address.postcode }}, {{ address.country.name }}
......@@ -57,3 +57,19 @@
%td
- for site in representative.other_websites
= site.url|website_link
.row
%h2 Contact information
%table.table.table-condensed.detail-view
- for email in representative.email_set.all
%tr
%th E-mail
%td
= email.email|email_link
- for address in representative.address_set.all
%tr
%th
= address.name
%td
- include 'representatives/_address_block.html' with address=address
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment