Skip to content

Commit

Permalink
Merge pull request #265 from RyabykinIlya/dev
Browse files Browse the repository at this point in the history
Navigation back from Detail to List with filters preserved
  • Loading branch information
newpanjing committed Jun 22, 2020
2 parents 05fa46a + b9db782 commit 536de73
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion simpleui/templates/admin/change_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
el: '.page-header',
methods: {
goBack: function () {
window.location.href = '{% get_model_url %}'
window.location.href = '{% get_previous_url %}'
}
}
})
Expand Down
4 changes: 4 additions & 0 deletions simpleui/templatetags/simpletags.py
Original file line number Diff line number Diff line change
Expand Up @@ -478,3 +478,7 @@ def get_boolean_choices():
('True', _('Yes')),
('False', _('No'))
)

@register.simple_tag(takes_context=True)
def get_previous_url(context):
return context.request.META.get('HTTP_REFERER')

0 comments on commit 536de73

Please sign in to comment.