Skip to content

Commit 38156e1

Browse files
authored
Merge pull request #130 from ccmdesign/119-back-button
[#119] Fix "Back to list" button behavior
2 parents 98c7f33 + b10b1dc commit 38156e1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

prefix_finder/frontend/templates/sidebar.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,11 @@
7272
</form>
7373

7474
{% else %}
75-
<a href="{% url "results" %}" class="button button--main-color button--block"><i class="material-icons">arrow_back</i><span>Back to List</span></a>
75+
{% if request.META.HTTP_REFERER %}
76+
<a href="{{ request.META.HTTP_REFERER }}" class="button button--main-color button--block"><i class="material-icons">arrow_back</i><span>Back to List</span></a>
77+
{% else %}
78+
<a href="{% url "results" %}" class="button button--main-color button--block"><i class="material-icons">arrow_back</i><span>Back to List</span></a>
79+
{% endif %}
7680
{% endif %}
7781
</div>
7882

0 commit comments

Comments
 (0)