Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Anthony
memopol
Commits
e3af7ccc
Commit
e3af7ccc
authored
Jun 02, 2016
by
Nicolas Joyard
Browse files
Add postal addresses
parent
a79996b7
Changes
3
Hide whitespace changes
Inline
Side-by-side
memopol/templatetags/memopol_tags.py
View file @
e3af7ccc
...
...
@@ -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
))
templates/representatives/_address_block.haml
0 → 100644
View file @
e3af7ccc
.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 }}
templates/representatives/_representative_block.haml
View file @
e3af7ccc
...
...
@@ -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
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment