-
Notifications
You must be signed in to change notification settings - Fork 196
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
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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
@@ -350,7 +350,7 @@ def contributors(): | |||
|
|||
@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.
@@ -5,59 +5,59 @@ | |||
</a> | |||
</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 class="link-text" href="/contributors/report-bug"> | ||
Working with bugs <span class="nested-sub"></span> | ||
</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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(oops, left my comments as part of a Review)
<a class="link-text" href="/contributors/report-bug"> | ||
Working with bugs <span class="nested-sub"></span> | ||
</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.
@@ -5,59 +5,59 @@ | |||
</a> | |||
</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.
@@ -16,8 +16,7 @@ | |||
About | |||
</a> | |||
</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.
@@ -40,33 +39,33 @@ | |||
</ul> | |||
|
|||
<!-- 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.
<a class="footer-item-link" href="/contributors/site-outreach">Site Outreach</a> | ||
</li> | ||
</ul> | ||
{% endif %} | ||
|
||
<!-- 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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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