Skip to content

Commit

Permalink
Merge pull request #184 from andylolz/183-preview-banner
Browse files Browse the repository at this point in the history
Show preview banner on /results (when previewing a non-`master` branch)
  • Loading branch information
Bjwebb authored Jan 18, 2018
2 parents f6cc9da + 7a014b5 commit 35519dd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion prefix_finder/frontend/static/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ code {

.sidebar {
width: 300px;
position: fixed;
position: absolute;
left: 0;
top: 0;
bottom: 0;
Expand Down
5 changes: 4 additions & 1 deletion prefix_finder/frontend/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ def home(request):


def results(request):
branch = request.session.get('branch', 'master')
use_branch = request.session.get('branch', 'master')
query = {key: value for key, value in request.GET.items() if value and value != 'all'}
context = {
'lookups': {
Expand All @@ -490,8 +490,11 @@ def results(request):
if query:
context['lookups'] = get_lookups(query, branch)

context['branch'] = use_branch

return render(request, 'results.html', context=context)


def list_details(request, prefix):
use_branch = request.session.get('branch', 'master')

Expand Down

0 comments on commit 35519dd

Please sign in to comment.