Skip to content

Commit

Permalink
templates: add history navigation in ideas/topics
Browse files Browse the repository at this point in the history
  • Loading branch information
m4ra authored and hklarner committed Sep 13, 2023
1 parent 341bd17 commit a34a8a4
Show file tree
Hide file tree
Showing 10 changed files with 58 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
{% endblock %}

{% block phase_content %}
<div class="l-top-overlap">
<div class="l-top-overlap" id="index">
<div class="row">
<div class="col-md-10 col-lg-8 offset-md-1 offset-lg-2">
{% include "a4_candy_contrib/includes/map_filter_and_sort.html" with filter=view.filter mode=view.mode %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
<div class="filter-bar__spaced">
{% if mode == 'map' %}
{% combined_url_parameter request.GET mode='list' as url_par %}
<a class="btn btn--light me-1 mt-2" href="{{ url_par }}" aria-label="{% translate 'View as list' %}">
<a class="btn btn--light me-1 mt-2" href="{{ url_par }}#index" aria-label="{% translate 'View as list' %}">
<i class="fa fa-list" aria-hidden="true"></i>
{% translate 'View' %}
</a>
{% else %}
{% combined_url_parameter request.GET mode='map' as url_par %}
<a class="btn btn--light me-1 mt-2" href="{{ url_par }}" aria-label="{% translate 'View as map' %}">
<a class="btn btn--light me-1 mt-2" href="{{ url_par }}#index" aria-label="{% translate 'View as map' %}">
<i class="fa fa-map" aria-hidden="true"></i>
{% translate 'View' %}
</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<li class="pagination-item">
{% if page_obj.has_previous %}
{% combined_url_parameter request.GET page=page_obj.previous_page_number as url_par %}
<a class="d-none d-sm-block" href="{{ url_par }}">{% translate 'Previous page' %}</a>
<a class="d-none d-sm-block" href="{{ url_par }}#index">{% translate 'Previous page' %}</a>
<a aria-label="{% translate 'Previous page' %}" class="d-block d-sm-none" href="{{ url_par }}"><i class="fas fa-angle-left" aria-hidden="true"></i></a>
{% endif %}
</li>
Expand All @@ -16,7 +16,7 @@
<li class="pagination-item">
{% if page_obj.has_next %}
{% combined_url_parameter request.GET page=page_obj.next_page_number as url_par %}
<a class="d-none d-sm-block" href="{{ url_par }}">{% translate 'Next page' %}</a>
<a class="d-none d-sm-block" href="{{ url_par }}#index">{% translate 'Next page' %}</a>
<a aria-label="{% translate 'Next page' %}" class="d-block d-sm-none" href="{{ url_par }}"><i class="fas fa-angle-right" aria-hidden="true"></i></a>
{% endif %}
</li>
Expand Down
15 changes: 12 additions & 3 deletions apps/contrib/templates/a4_candy_contrib/item_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,19 @@
<nav class="breadcrumbs" aria-label="{% translate 'breadcrumbs' %}">
<ul>
<li>
<a href="{{ module.get_detail_url }}">
{% with navigate_url=request.META.HTTP_REFERER %}
{% if module.get_detail_url in navigate_url %}
<a href="{{navigate_url}}#index">
<i class="fa fa-arrow-left" aria-hidden="true"></i>
{% translate 'go back' %}
</a>
{% translate 'go back' %}
</a>
{% else %}
<a href="{{ module.get_detail_url }}#index">
<i class="fa fa-arrow-left" aria-hidden="true"></i>
{% translate 'go to overview' %}
</a>
{% endif %}
{% endwith %}
</li>
</ul>
</nav>
Expand Down
17 changes: 13 additions & 4 deletions apps/debate/templates/a4_candy_debate/subject_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,19 @@
<nav class="breadcrumbs" aria-label="{% translate 'breadcrumbs' %}">
<ul>
<li>
<a href="{{ module.get_detail_url }}">
<i class="fa fa-arrow-left" aria-hidden="true"></i>
{% translate 'go back' %}
</a>
{% with navigate_url=request.META.HTTP_REFERER %}
{% if module.get_detail_url in navigate_url %}
<a href="{{navigate_url}}#index">
<i class="fa fa-arrow-left" aria-hidden="true"></i>
{% translate 'go back' %}
</a>
{% else %}
<a href="{{ module.get_detail_url }}#index">
<i class="fa fa-arrow-left" aria-hidden="true"></i>
{% translate 'go to overview' %}
</a>
{% endif %}
{% endwith %}
</li>
</ul>
</nav>
Expand Down
2 changes: 1 addition & 1 deletion apps/ideas/templates/a4_candy_ideas/idea_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
{% endblock %}

{% block phase_content %}
<div class="l-top-overlap">
<div class="l-top-overlap" id="index">
<div class="row">
<div class="col-md-10 col-lg-8 offset-md-1 offset-lg-2">
{% include "a4_candy_contrib/includes/filter_and_sort.html" with filter=view.filter %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
{% endblock %}

{% block phase_content %}
<div class="l-top-overlap">
<div class="l-top-overlap" id="index">
<div class="row">
<div class="col-md-10 col-lg-8 offset-md-1 offset-lg-2">
{% include "a4_candy_contrib/includes/map_filter_and_sort.html" with filter=view.filter mode=view.mode %}
Expand Down
15 changes: 12 additions & 3 deletions apps/topicprio/templates/a4_candy_topicprio/topic_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,19 @@
<nav class="breadcrumbs" aria-label="{% translate 'breadcrumbs' %}">
<ul>
<li>
<a href="{{ module.get_detail_url }}">
{% with navigate_url=request.META.HTTP_REFERER %}
{% if module.get_detail_url in navigate_url %}
<a href="{{navigate_url}}#index">
<i class="fa fa-arrow-left" aria-hidden="true"></i>
{% translate 'go back' %}
</a>
{% translate 'go back' %}
</a>
{% else %}
<a href="{{ module.get_detail_url }}#index">
<i class="fa fa-arrow-left" aria-hidden="true"></i>
{% translate 'go to overview' %}
</a>
{% endif %}
{% endwith %}
</li>
</ul>
</nav>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{% load i18n module_tags rules static maps_tags %}

{% block phase_content %}
<div class="l-top-overlap">
<div class="l-top-overlap" id="index">
<div class="row">
<div class="col-md-10 col-lg-8 offset-md-1 offset-lg-2">
{% include "a4_candy_contrib/includes/filter_and_sort.html" with filter=view.filter %}
Expand Down
13 changes: 13 additions & 0 deletions changelog/7429.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
### Added

- in contrib templates for item_detail:
request http referer for go back/overview to filtered/paginated list
- in topicprio templates for topic_detail:
request http referer for go back/overview to filtered/paginated list
- in budgeting, idea, mapidea, topicprio:
index id to be used with href anchor to navigate back to item list
- in contrib templates for map_filter_and_sort and pagination:
index id to be used with href anchor to navigate back to item list



0 comments on commit a34a8a4

Please sign in to comment.