Skip to content

Commit 4a67ec2

Browse files
committed
Add Policies FAQ to links and restructure links to make them more obvious
1 parent de2c6f8 commit 4a67ec2

File tree

3 files changed

+19
-35
lines changed

3 files changed

+19
-35
lines changed

src/olympia/devhub/templates/devhub/includes/agreement.html

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,18 @@
44
{{ agreement_message }}
55
</p>
66
<ul class="agreement-links">
7-
<li>{{ agreement_form.distribution_agreement }}<a href="{{ url('devhub.docs', 'policies/agreement') }}" target="_blank" rel="noopener noreferrer">{{ _('Firefox Add-on Distribution Agreement') }}</a> {{ agreement_form.distribution_agreement.errors }}</li>
8-
<li>{{ agreement_form.review_policy }}<a href="{{ url('devhub.docs', 'policies/reviews') }}" target="_blank" rel="noopener noreferrer">{{ _('Review Policies and Rules') }}</a> {{ agreement_form.review_policy.errors }}</li>
7+
<li>
8+
{{ agreement_form.distribution_agreement }}
9+
{{ _('Firefox Add-on Distribution Agreement') }}
10+
(<a href="{{ url('devhub.docs', 'policies/agreement') }}" target="_blank" rel="noopener noreferrer">{{ _('link') }}</a>)
11+
{{ agreement_form.distribution_agreement.errors }}
12+
</li>
13+
<li>
14+
{{ agreement_form.review_policy }}
15+
{{ _('Review Policies and Rules') }}
16+
(<a href="{{ url('devhub.docs', 'policies/reviews') }}" target="_blank" rel="noopener noreferrer">{{ _('link') }}</a> <a href="{{ url('devhub.docs', 'policies/faq') }}" target="_blank" rel="noopener noreferrer">{{ _('faq') }}</a>)
17+
{{ agreement_form.review_policy.errors }}
18+
</li>
919
</ul>
1020
<p>
1121
{{ _('I have read and accept this Agreement and the Rules and Policies') }}.

src/olympia/devhub/tests/test_views.py

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2054,25 +2054,6 @@ def test_doc_urls(self):
20542054
assert '/en-US/developers/docs/te' == reverse('devhub.docs', args=['te'])
20552055
assert '/en-US/developers/docs/te/st', reverse('devhub.docs', args=['te/st'])
20562056

2057-
urls = [
2058-
(reverse('devhub.docs', args=['getting-started']), 301),
2059-
(reverse('devhub.docs', args=['how-to']), 301),
2060-
(reverse('devhub.docs', args=['how-to/other-addons']), 301),
2061-
(reverse('devhub.docs', args=['fake-page']), 404),
2062-
(reverse('devhub.docs', args=['how-to/fake-page']), 404),
2063-
(reverse('devhub.docs'), 301),
2064-
]
2065-
2066-
index = reverse('devhub.index')
2067-
2068-
for url in urls:
2069-
response = self.client.get(url[0])
2070-
assert response.status_code == url[1]
2071-
2072-
if url[1] == 302: # Redirect to the index page
2073-
self.assert3xx(response, index)
2074-
2075-
20762057
class TestRemoveLocale(TestCase):
20772058
fixtures = ['base/users', 'base/addon_3615']
20782059

src/olympia/devhub/views.py

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1952,26 +1952,19 @@ def request_review(request, addon_id, addon):
19521952

19531953

19541954
def docs(request, doc_name=None):
1955-
mdn_docs = {
1955+
developer_docs = {
19561956
None: '',
1957-
'getting-started': '',
1958-
'reference': '',
1959-
'how-to': '',
1960-
'how-to/getting-started': '',
1961-
'how-to/extension-development': '#Extensions',
1962-
'how-to/other-addons': '#Other_types_of_add-ons',
1963-
'how-to/thunderbird-mobile': '#Application-specific',
1964-
'how-to/theme-development': '#Themes',
1965-
'themes': '/Themes/Background',
1966-
'themes/faq': '/Themes/Background/FAQ',
19671957
'policies': '/AMO/Policy',
19681958
'policies/reviews': '/AMO/Policy/Reviews',
1969-
'policies/contact': '/AMO/Policy/Contact',
1959+
'policies/faq': '/AMO/Policy/FAQ',
19701960
'policies/agreement': '/AMO/Policy/Agreement',
19711961
}
19721962

1973-
if doc_name in mdn_docs:
1974-
return redirect(MDN_BASE + mdn_docs[doc_name], permanent=True)
1963+
if doc_name in developer_docs:
1964+
return redirect(
1965+
settings.EXTENSION_WORKSHOP_URL + developer_docs[doc_name],
1966+
permanent=True,
1967+
)
19751968

19761969
raise http.Http404()
19771970

0 commit comments

Comments
 (0)