2022-11-05 13:17:27 -07:00
|
|
|
from django.views.generic import TemplateView
|
|
|
|
|
2022-11-11 21:02:43 -08:00
|
|
|
from activities.views.home import Home
|
2022-11-05 13:17:27 -07:00
|
|
|
from users.models import Identity
|
|
|
|
|
|
|
|
|
|
|
|
def homepage(request):
|
|
|
|
if request.user.is_authenticated:
|
|
|
|
return Home.as_view()(request)
|
|
|
|
else:
|
|
|
|
return LoggedOutHomepage.as_view()(request)
|
|
|
|
|
|
|
|
|
|
|
|
class LoggedOutHomepage(TemplateView):
|
|
|
|
|
|
|
|
template_name = "index.html"
|
|
|
|
|
|
|
|
def get_context_data(self):
|
|
|
|
return {
|
|
|
|
"identities": Identity.objects.filter(local=True),
|
|
|
|
}
|