Add a link from the Tools drop-down to the RRS if enabled

If the RRS is enabled, then add a link to it in the tools menu. I don't
expect this to be used a lot, but otherwise the only way you'd get there
would be either externally or via the link from the layer detail.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
This commit is contained in:
Paul Eggleton 2018-04-03 16:36:17 +12:00
parent 8e6975b1db
commit 9ebc94a1df
2 changed files with 6 additions and 1 deletions

View File

@ -8,6 +8,7 @@ from layerindex.models import Branch, LayerItem
from django.contrib.sites.models import Site
def layerindex_context(request):
import settings
site = Site.objects.get_current()
if site and site.name and site.name != 'example.com':
site_name = site.name
@ -17,5 +18,6 @@ def layerindex_context(request):
'all_branches': Branch.objects.exclude(name='oe-classic').order_by('sort_priority'),
'unpublished_count': LayerItem.objects.filter(status='N').count(),
'oe_classic': Branch.objects.filter(name='oe-classic'),
'site_name': site_name
'site_name': site_name,
'rrs_enabled': 'rrs' in settings.INSTALLED_APPS,
}

View File

@ -74,6 +74,9 @@
<li><a href="{% url 'duplicates' 'master' %}">Duplicates</a></li>
<li><a href="{% url 'update_list' %}">Updates</a></li>
<li><a href="{% url 'stats' %}">Statistics</a></li>
{% if rrs_enabled %}
<li><a href="{% url 'rrs_frontpage' %}">Recipe Maintenance</a></li>
{% endif %}
</ul>
</li>
{% endif %}