Skip to content

Simplify footer.html template conditionals #2337

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
miketaylr opened this issue Mar 28, 2018 · 0 comments
Closed

Simplify footer.html template conditionals #2337

miketaylr opened this issue Mar 28, 2018 · 0 comments

Comments

@miketaylr
Copy link
Member

In the following 3 spots in footer.html, it should be possible to make this a little more DRY by doing something like if request.url_rule.endpoint.includes('foo_')

<li class="footer-item{% if request.url_rule.endpoint in

{% if request.url_rule.endpoint in ['contributors_report_bug', 'contributors_reproduce_bug', 'contributors_diagnose_bug', 'contributors_site_outreach'] %}

{% if request.url_rule.endpoint in ['contributors_build_tools', 'contributors_web_platform_research', 'contributors_organize_webcompat_events'] %}

We probably need to come up with meaningful groupings and rename the route method names so this trick would work:

@app.route('/contributors')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants