Skip to content

Commit

Permalink
Merge pull request #1803 from uktrade/develop
Browse files Browse the repository at this point in the history
Staging/UAT release
  • Loading branch information
webbyfox authored Jun 21, 2022
2 parents cca8a40 + 29c581f commit 4988f5c
Show file tree
Hide file tree
Showing 9 changed files with 50 additions and 25 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

### Bugs fixed

- GLS-223 - Multiple office for single region

### Enhancements

- GLS-257 - rollout Market Guide v1 with data pipeline stats
Expand Down
3 changes: 2 additions & 1 deletion contact/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def retrieve_regional_office(postcode):
def extract_regional_office_details(all_offices):
matches = [office for office in all_offices if office['is_match']]
formatted_office_details = format_office_details(matches)
return formatted_office_details[0] if formatted_office_details else None
return formatted_office_details if formatted_office_details else None


def extract_other_offices_details(all_offices):
Expand All @@ -35,6 +35,7 @@ def format_office_details(office_list):
address.append(office['address_postcode'])
office = {'address': '\n'.join(address), **office}
offices.append(office)

return offices if len(offices) > 0 else None


Expand Down
38 changes: 24 additions & 14 deletions contact/templates/domestic/contact/office-finder.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,35 +29,45 @@ <h1 class="heading-large">Find your local trade office</h1>
</form>
</section>

{% if not office_details and other_offices %}
<p> We couldn’t find an exact match for your postcode. You can contact a DIT office near you.</p>
{% endif %}
{% if not office_details and other_offices %}
<p> We couldn’t find an exact match for your postcode. You can contact a DIT office near you.</p>
{% endif %}

{% if office_details %}
{% if not office_details.override_office_details %}

<section class="width-half" id="results">

<h2 class="heading-medium">Your local Trade office{%if office_details|length > 1 %}s{% endif %} for {{ form.cleaned_data.postcode }} is</h2>
<hr>
</section>

{% for office in office_details %}
{% if not office.override_office_details %}
<section class="width-half" id="results">
<h2 class="heading-medium">Your local Trade office for {{ form.cleaned_data.postcode }} is</h2>
<hr>
<h3 class="heading-medium" id="office-name">{{ office_details.name }}</h3>
{{ office_details.address|linebreaks }}
<h3 class="heading-medium" id="office-name">{{ office.name }}</h3>
{{ office.address|linebreaks }}
<h3 class="heading-medium">Telephone</h3>
<p><a class="link" href="tel:{{ office_details.phone }}">{{ office_details.phone }}</a></p>
<p><a class="link" href="tel:{{ office.phone }}">{{ office.phone }}</a></p>
{% if office_details.phone_other %}
<h3 class="heading-medium">{{ office_details.phone_other_comment }}</h3>
<p><a class="link" href="tel:{{ office_details.phone_other }}">{{ office_details.phone_other }}</a></p>
<h3 class="heading-medium">{{ office.phone_other_comment }}</h3>
<p><a class="link" href="tel:{{ office.phone_other }}">{{ office.phone_other }}</a></p>
{% endif %}
<br>
<a href="{% url 'contact:office-finder-contact' postcode=form.cleaned_data.postcode %}" class="button">Contact {{ office_details.name }} office</a>
<a href="{% url 'contact:office-finder-contact' postcode=form.cleaned_data.postcode %}" class="button">Contact {{ office.name }} office</a>

</section>
{% else %}
<section class="width-half" id="results">
<h2 class="heading-medium">Your local Trade office for {{ form.cleaned_data.postcode }} is</h2>
<hr>
<h3 class="heading-medium" id="office-name">{{ office_details.name }}</h3>
{{ office_details.override_office_details|safe }}
<h3 class="heading-medium" id="office-name">{{ office.name }}</h3>
{{ office.override_office_details|safe }}
<hr>
</section>
</div>
</div>
{% endif %}
{% endfor %}
{% endif %}
</div>

Expand Down
22 changes: 16 additions & 6 deletions domestic/sass/office-finder.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@
@import './partials/colours';
@import './components/form-wizard';

button {
margin-top: 30px;
}

#content {
input, textarea, select {

input,
textarea,
select {
width: 100%;
}

Expand All @@ -19,43 +18,54 @@ button {
}

h1 {
margin-bottom: 15px;
margin-bottom: 15px;
}

form p {
margin-bottom: 30px;
}
}

#search-section {
padding-bottom: 45px;

button {
margin-top: 30px;
}
}

#results {
background-color: #F6F4F0;
margin: 0;
padding: 1px 30px 40px;

hr {
background: $mid-grey;
}
}

#other-results {
padding-bottom: 0;

h2 {
margin-bottom: 45px;
margin-top: 60px;
}

h3 {
margin-top: 0;
margin-bottom: 15px;
}

.grid-row {
padding: 0;
}

hr {
margin-left: 0;
background: $mid-grey;
}

}

#office-name {
Expand Down
2 changes: 1 addition & 1 deletion domestic/static/styles/office-finder.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 4988f5c

Please sign in to comment.