Hide apps not installed
This commit is contained in:
parent
4727a02914
commit
b03d7457a7
@ -1,5 +1,5 @@
|
||||
# Society Self-Service
|
||||
# Copyright © 2018 Yingtong Li (RunasSudo)
|
||||
# Copyright © 2018-2019 Yingtong Li (RunasSudo)
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as published by
|
||||
@ -19,11 +19,16 @@ from django.conf.urls.static import static
|
||||
from django.contrib import admin
|
||||
from django.urls import include, path
|
||||
|
||||
urlpatterns = [
|
||||
path('admin/', admin.site.urls),
|
||||
path('auth/', include('social_django.urls', namespace='social')),
|
||||
path('treasury/', include('sstreasury.urls')),
|
||||
path('promotions/', include('sspromotions.urls')),
|
||||
path('membership/', include('ssmembership.urls')),
|
||||
path('', include('ssmain.urls')),
|
||||
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
|
||||
urlpatterns = []
|
||||
urlpatterns.append(path('admin/', admin.site.urls))
|
||||
urlpatterns.append(path('auth/', include('social_django.urls', namespace='social')))
|
||||
|
||||
if 'sstreasury' in settings.INSTALLED_APPS:
|
||||
urlpatterns.append(path('treasury/', include('sstreasury.urls')))
|
||||
if 'sspromotions' in settings.INSTALLED_APPS:
|
||||
urlpatterns.append(path('promotions/', include('sspromotions.urls')))
|
||||
if 'ssmembership' in settings.INSTALLED_APPS:
|
||||
urlpatterns.append(path('membership/', include('ssmembership.urls')))
|
||||
|
||||
urlpatterns.append(path('', include('ssmain.urls')))
|
||||
urlpatterns.extend(static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT))
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
{#
|
||||
Society Self-Service
|
||||
Copyright © 2018 Yingtong Li (RunasSudo)
|
||||
Copyright © 2018-2019 Yingtong Li (RunasSudo)
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
@ -30,6 +30,7 @@
|
||||
|
||||
{% block content %}
|
||||
<div class="ui cards">
|
||||
{% if 'sstreasury' in apps %}
|
||||
<a class="ui card" href="{{ url('treasury') }}">
|
||||
<div class="content">
|
||||
<div class="header">Treasury Connect</div>
|
||||
@ -41,6 +42,7 @@
|
||||
Enter
|
||||
</div>
|
||||
</a>
|
||||
{% endif %}
|
||||
{#
|
||||
<a class="ui card" href="#">
|
||||
<div class="content">
|
||||
@ -53,6 +55,7 @@
|
||||
</div>
|
||||
</a>
|
||||
#}
|
||||
{% if 'sspromotions' in apps %}
|
||||
<a class="ui card" href="{{ url('promotions') }}">
|
||||
<div class="content">
|
||||
<div class="header">Promotions Hub</div>
|
||||
@ -63,6 +66,8 @@
|
||||
Enter
|
||||
</div>
|
||||
</a>
|
||||
{% endif %}
|
||||
{% if 'ssmembership' in apps %}
|
||||
<a class="ui card" href="{{ url('membership') }}">
|
||||
<div class="content">
|
||||
<div class="header">Membership Portal</div>
|
||||
@ -73,5 +78,6 @@
|
||||
Enter
|
||||
</div>
|
||||
</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
@ -17,6 +17,7 @@
|
||||
from django.contrib.auth import logout as auth_logout
|
||||
from django.contrib.auth.decorators import login_required
|
||||
|
||||
from django.conf import settings
|
||||
from django.http import HttpResponse
|
||||
from django.shortcuts import render, redirect
|
||||
from django.urls import reverse
|
||||
@ -40,4 +41,4 @@ def logout(request):
|
||||
|
||||
@login_required
|
||||
def splash(request):
|
||||
return render(request, 'ssmain/splash.html')
|
||||
return render(request, 'ssmain/splash.html', {'apps': settings.INSTALLED_APPS})
|
||||
|
Loading…
Reference in New Issue
Block a user