move admin_site_links out of default/site (fixes failed NoReverseMatch tests for me)
This commit is contained in:
Родитель
390f30d97f
Коммит
9957cfad7b
|
@ -0,0 +1,42 @@
|
|||
from jingo import register
|
||||
|
||||
from amo.urlresolvers import reverse
|
||||
|
||||
|
||||
@register.function
|
||||
def admin_site_links():
|
||||
return {
|
||||
'addons': [
|
||||
('Search for add-ons by name or id', reverse('zadmin.addon-search')),
|
||||
('Featured add-ons', reverse('zadmin.features')),
|
||||
('Discovery Pane promo modules', reverse('discovery.module_admin')),
|
||||
('Monthly Pick', reverse('zadmin.monthly_pick')),
|
||||
('Upgrade jetpack add-ons', reverse('zadmin.jetpack')),
|
||||
('Bulk add-on validation', reverse('zadmin.validation')),
|
||||
('Fake mail', reverse('zadmin.mail')),
|
||||
('Flagged reviews', reverse('zadmin.flagged')),
|
||||
('ACR Reports', reverse('zadmin.compat')),
|
||||
('Email Add-on Developers', reverse('zadmin.email_devs')),
|
||||
],
|
||||
'users': [
|
||||
('Configure groups', reverse('admin:access_group_changelist')),
|
||||
],
|
||||
'settings': [
|
||||
('View site settings', reverse('zadmin.settings')),
|
||||
('Django admin pages', reverse('zadmin.home')),
|
||||
('Site Events', reverse('zadmin.site_events')),
|
||||
('Update prices', reverse('zadmin.price_tiers')),
|
||||
],
|
||||
'tools': [
|
||||
('View request environment', reverse('amo.env')),
|
||||
('Manage elasticsearch', reverse('zadmin.elastic')),
|
||||
('Purge data from memcache', reverse('zadmin.memcache')),
|
||||
('Purge pages from zeus', reverse('zadmin.hera')),
|
||||
('Create a new OAuth Consumer',
|
||||
reverse('zadmin.oauth-consumer-create')),
|
||||
('View event log', reverse('admin:editors_eventlog_changelist')),
|
||||
('View addon log', reverse('admin:devhub_activitylog_changelist')),
|
||||
('Generate error', reverse('zadmin.generate-error')),
|
||||
('Site Status', reverse('amo.monitor')),
|
||||
],
|
||||
}
|
|
@ -24,7 +24,6 @@ data-default-locale="en-us"
|
|||
{% block search_form %}
|
||||
{% endblock %}
|
||||
|
||||
{% set links = admin_site_links() %}
|
||||
{% macro ul(links, section) %}
|
||||
<ul>
|
||||
{% for title, link in links[section] %}
|
||||
|
@ -33,6 +32,8 @@ data-default-locale="en-us"
|
|||
</ul>
|
||||
{% endmacro %}
|
||||
|
||||
{% set links = mkt_admin_site_links() if settings.MARKETPLACE else admin_site_links() %}
|
||||
|
||||
{% block navbar %}
|
||||
<div id="navbar">
|
||||
<ul class="top">
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
from lib.settings_base import *
|
||||
|
||||
ROOT_URLCONF = 'default.urls'
|
||||
INSTALLED_APPS += ('default.site',)
|
||||
|
|
|
@ -1,48 +0,0 @@
|
|||
from django.conf import settings
|
||||
|
||||
from jingo import register
|
||||
|
||||
from amo.helpers import url
|
||||
|
||||
from mkt.site.helpers import admin_site_links as mkt_admin_site_links
|
||||
|
||||
|
||||
@register.function
|
||||
def admin_site_links():
|
||||
if settings.MARKETPLACE:
|
||||
return mkt_admin_site_links()
|
||||
return {
|
||||
'addons': [
|
||||
('Search for add-ons by name or id', url('zadmin.addon-search')),
|
||||
('Featured add-ons', url('zadmin.features')),
|
||||
('Discovery Pane promo modules', url('discovery.module_admin')),
|
||||
('Monthly Pick', url('zadmin.monthly_pick')),
|
||||
('Upgrade jetpack add-ons', url('zadmin.jetpack')),
|
||||
('Bulk add-on validation', url('zadmin.validation')),
|
||||
('Fake mail', url('zadmin.mail')),
|
||||
('Flagged reviews', url('zadmin.flagged')),
|
||||
('ACR Reports', url('zadmin.compat')),
|
||||
('Email Add-on Developers', url('zadmin.email_devs')),
|
||||
],
|
||||
'users': [
|
||||
('Configure groups', url('admin:access_group_changelist')),
|
||||
],
|
||||
'settings': [
|
||||
('View site settings', url('zadmin.settings')),
|
||||
('Django admin pages', url('zadmin.home')),
|
||||
('Site Events', url('zadmin.site_events')),
|
||||
('Update prices', url('zadmin.price_tiers')),
|
||||
],
|
||||
'tools': [
|
||||
('View request environment', url('amo.env')),
|
||||
('Manage elasticsearch', url('zadmin.elastic')),
|
||||
('Purge data from memcache', url('zadmin.memcache')),
|
||||
('Purge pages from zeus', url('zadmin.hera')),
|
||||
('Create a new OAuth Consumer',
|
||||
url('zadmin.oauth-consumer-create')),
|
||||
('View event log', url('admin:editors_eventlog_changelist')),
|
||||
('View addon log', url('admin:devhub_activitylog_changelist')),
|
||||
('Generate error', url('zadmin.generate-error')),
|
||||
('Site Status', url('amo.monitor')),
|
||||
],
|
||||
}
|
|
@ -353,7 +353,7 @@ def timelabel(context, time):
|
|||
|
||||
|
||||
@register.function
|
||||
def admin_site_links():
|
||||
def mkt_admin_site_links():
|
||||
return {
|
||||
'addons': [
|
||||
('Search for apps by name or id', reverse('zadmin.addon-search')),
|
||||
|
|
|
@ -1,28 +1,3 @@
|
|||
{% extends 'admin/base.html' %}
|
||||
|
||||
{% block title %} | Marketplace Admin{% endblock %}
|
||||
|
||||
{% block navbar %}
|
||||
<div id="navbar">
|
||||
<ul class="top">
|
||||
<li class="top">
|
||||
<a href="{{ url('zadmin.home') }}" class="controller">Manage Apps</a>
|
||||
{{ ul(links, 'addons') }}
|
||||
</li>
|
||||
<li class="top">
|
||||
<a href="" class="controller">Manage Users</a>
|
||||
{{ ul(links, 'users') }}
|
||||
</li>
|
||||
<li class="top">
|
||||
<a href="" class="controller">Site Settings</a>
|
||||
{{ ul(links, 'settings') }}
|
||||
</li>
|
||||
<li class="top">
|
||||
<a href="" class="controller">Server Tools</a>
|
||||
{{ ul(links, 'tools') }}
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block footer %}{% endblock %}
|
||||
|
|
Загрузка…
Ссылка в новой задаче