pclubuiet / website

Programming club, PU official website.
https://pclubuiet.herokuapp.com
GNU General Public License v3.0
14 stars 70 forks source link

Improve how navbar items are handled #144

Closed gurpreetsingh00885 closed 6 years ago

gurpreetsingh00885 commented 6 years ago

The navbar currently uses separate blocks for each item in the navbar. This makes the code to handle the navbar clumsy as it is split over the templates.

{{ request.resolver_match.url_name }} in a template returns the name of the view that is rendering the template. We already have names for all the views. So this can be used in base.html along with a few {% ifequal %} statements to set a navbar item as active.