I have an archive.html template that is used by two views: myapp:paginated_view and myapp:whole_view.
Both views can be shown in a reversed or in a normal way. Now I want to create a link to change in between the ways.
That means there are four cases: (after the arrow what happens when you click that link)
I wonder if I had to declare all cases with if-clauses in the template or work with absolute url-pathes or create multiple templates, but these are my only ideas. Is there a better way? (I hope for something like: {% url current_page reverse=not reverse %}
My url conf: (in myapp)
urlpatterns = [
url(r'^archive/(?P<reverse>[n]{0,1})/?$', views.ArchivePagedView.as_view(), name="paged_archive"),
url(r'^archive/all/(?P<reverse>[n]{0,1})/?$', views.WholeArchiveView.as_view(), name='whole_archive'),
]
As you can see, in the url-conf reverse can be n or it's empty/doesn't exist. In my template it's true or false.
How to deal with this?