Fixes #2337: Refactor contributor routes for simpler nav/sub-nav templates.#2387
Fixes #2337: Refactor contributor routes for simpler nav/sub-nav templates.#2387
Conversation
…d by substring.
…emplate groups.
There was a problem hiding this comment.
@miketaylr Thanks.
My bad for NOT (edited) noticing this before. Aka the templates contained these rules with endpoint before, while we could have used rule. But we have an opportunity to change that. So I'm sending this with a weak request changes. Your PR is working as-is. but we probably don't have to change views.py
| @app.route('/contributors/report-bug') | ||
| @cache_policy(private=True, uri_max_age=0, must_revalidate=True) | ||
| def contributors_report_bug(): | ||
| def contributors_bug_report(): |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
| </li> | ||
|
|
||
| <li class="sub-nav-item {% if request.url_rule.endpoint in ['contributors_report_bug', 'contributors_reproduce_bug', 'contributors_diagnose_bug', 'contributors_site_outreach'] %} active {% endif %}"> | ||
| <li class="sub-nav-item {% if 'contributors_bug_' in request.url_rule.endpoint %} active {% endif %}"> |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
| </a> | ||
| <ol class="nested-sub-nav"> | ||
| <li class="nested-sub-nav-item {% if request.url_rule.endpoint == 'contributors_report_bug' %} sub-nav-active{% endif %}"> | ||
| <li class="nested-sub-nav-item {% if request.url_rule.endpoint == 'contributors_bug_report' %} sub-nav-active{% endif %}"> |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
| @@ -5,59 +5,59 @@ | |||
| </a> | |||
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
Yep, makes sense! Happy to make the changes. edit: looking at this more, I think it's a little nicer to use |
miketaylr
left a comment
There was a problem hiding this comment.
(oops, left my comments as part of a Review)
| </a> | ||
| <ol class="nested-sub-nav"> | ||
| <li class="nested-sub-nav-item {% if request.url_rule.endpoint == 'contributors_report_bug' %} sub-nav-active{% endif %}"> | ||
| <li class="nested-sub-nav-item {% if request.url_rule.endpoint == 'contributors_bug_report' %} sub-nav-active{% endif %}"> |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
| </li> | ||
|
|
||
| <li class="sub-nav-item {% if request.url_rule.endpoint in ['contributors_report_bug', 'contributors_reproduce_bug', 'contributors_diagnose_bug', 'contributors_site_outreach'] %} active {% endif %}"> | ||
| <li class="sub-nav-item {% if 'contributors_bug_' in request.url_rule.endpoint %} active {% endif %}"> |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
| </li> | ||
| <li class="footer-item{% if request.url_rule.endpoint in | ||
| ['contributors_build_tools', 'contributors_web_platform_research', 'contributors_organize_webcompat_events', 'contributors', 'contributors_report_bug', 'contributors_reproduce_bug', 'contributors_diagnose_bug', 'contributors_site_outreach'] %} active{% endif %}"> | ||
| <li class="footer-item{% if 'contributors' in request.url_rule.endpoint %} active{% endif %}"> |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
|
|
||
| <!-- sub nav for contribute > working with bugs --> | ||
| {% if request.url_rule.endpoint in ['contributors_report_bug', 'contributors_reproduce_bug', 'contributors_diagnose_bug', 'contributors_site_outreach'] %} | ||
| {% if 'contributors_bug_' in request.url_rule.endpoint %} |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
|
|
||
| <!-- sub nav for contribute > other contributions --> | ||
| {% if request.url_rule.endpoint in ['contributors_build_tools', 'contributors_web_platform_research', 'contributors_organize_webcompat_events'] %} | ||
| {% if 'contributors_other_' in request.url_rule.endpoint %} |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
karlcow
left a comment
There was a problem hiding this comment.
ok understood! Indeed it makes sense.
@miketaylr Thanks for the explanations. Super useful.
|
Thanks @karlcow for your review, I didn't know about |
|
As a kind of followup on this #2391 |
r? @karlcow