Skip to content

Commit

Permalink
Add contacts
Browse files Browse the repository at this point in the history
  • Loading branch information
ahosgood committed Jan 18, 2024
1 parent 0d5b766 commit 95e25fe
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
pretty_date,
pretty_number,
remove_all_whitespace,
url_encode,
replace_ext_ref,
slugify,
tna_html,
url_encode,
)
from config import Config, templates_config
from flask import Flask
Expand Down
3 changes: 1 addition & 2 deletions app/catalogue/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,8 @@ def render_record(id, record_data):


def render_archive(id, record_data):
address_parts = []
address_parts = record_data["contact_info"]["address_line_1"] or []
for address_part in [
"address_line_1",
"town",
"county",
"country",
Expand Down
2 changes: 1 addition & 1 deletion app/lib/template_filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,4 @@ def remove_all_whitespace(s):


def url_encode(s):
return urllib.parse.quote(s.replace("<br />", " "), safe='')
return urllib.parse.quote(s, safe="")
10 changes: 10 additions & 0 deletions app/templates/catalogue/archive.html
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,16 @@ <h2 class="tna-heading-l">Contact information</h2>
<dt>Fax</dt>
<dd>{{ data.contact_info.fax }}</dd>
{% endif %}
{% if data.contact_info.contacts %}
<dt>Contacts</dt>
<dd>
<ul class="tna-ul tna-ul--plain">
{% for contact in data.contact_info.contacts %}
<li>{{ contact.first_name }} {{ contact.last_name }}{% if contact.job_title %} &mdash; {{ contact.job_title }}{% endif %}</li>
{% endfor %}
</ul>
</dd>
{% endif %}
</dl>
</aside>
</div>
Expand Down

0 comments on commit 95e25fe

Please sign in to comment.