diff --git a/app/__init__.py b/app/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/app/admin.py b/app/admin.py new file mode 100644 index 0000000000000000000000000000000000000000..8c38f3f3dad51e4585f3984282c2a4bec5349c1e --- /dev/null +++ b/app/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/app/apps.py b/app/apps.py new file mode 100644 index 0000000000000000000000000000000000000000..ed327d22f5ad028ff7fae6c967945e1da8438a82 --- /dev/null +++ b/app/apps.py @@ -0,0 +1,6 @@ +from django.apps import AppConfig + + +class AppConfig(AppConfig): + default_auto_field = 'django.db.models.BigAutoField' + name = 'app' diff --git a/app/migrations/__init__.py b/app/migrations/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/app/models.py b/app/models.py new file mode 100644 index 0000000000000000000000000000000000000000..71a836239075aa6e6e4ecb700e9c42c95c022d91 --- /dev/null +++ b/app/models.py @@ -0,0 +1,3 @@ +from django.db import models + +# Create your models here. diff --git a/app/tests.py b/app/tests.py new file mode 100644 index 0000000000000000000000000000000000000000..7ce503c2dd97ba78597f6ff6e4393132753573f6 --- /dev/null +++ b/app/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/app/urls.py b/app/urls.py new file mode 100644 index 0000000000000000000000000000000000000000..37899e7a8a0029b36294d275f0c526a84d08b429 --- /dev/null +++ b/app/urls.py @@ -0,0 +1,9 @@ +from django.urls import path + +from app import views + +app_name = "app" + +urlpatterns = [ + path("", views.home, name="home"), +] \ No newline at end of file diff --git a/app/views.py b/app/views.py new file mode 100644 index 0000000000000000000000000000000000000000..e6ed2caa04dc4361b46f7237874069f0b573e01b --- /dev/null +++ b/app/views.py @@ -0,0 +1,7 @@ +from allauth.account.decorators import verified_email_required +from django.shortcuts import render + +# Create your views here. +@verified_email_required +def home(request): + return render(request, "app/home.html") \ No newline at end of file diff --git a/attendio/settings.py b/attendio/settings.py index 3d97daf57fcf217a8485b7f919ee52d75075cc95..67553d181d103023af0139eb6363438b7f29a864 100644 --- a/attendio/settings.py +++ b/attendio/settings.py @@ -42,7 +42,8 @@ INSTALLED_APPS = [ 'allauth', 'allauth.account', 'allauth.mfa', - 'publicweb.apps.PublicwebConfig' + 'publicweb.apps.PublicwebConfig', + 'app.apps.AppConfig' ] MIDDLEWARE = [ diff --git a/attendio/urls.py b/attendio/urls.py index 9272d889b7427c068c677c9d9e3b8885d3d900a6..760ad2bb62efaa48a78c53a0f4e3cc525e95e1ce 100644 --- a/attendio/urls.py +++ b/attendio/urls.py @@ -26,5 +26,6 @@ urlpatterns = [ path('admin/', admin.site.urls), path('accounts/', include('allauth.urls')), path("accounts/profile/", TemplateView.as_view(template_name="profile.html")), + path("app/", include("app.urls", "app")), path("", include("publicweb.urls")), ] diff --git a/templates/app/base.html b/templates/app/base.html index 0f21b8d1af67d9463c1e38b55c2c5a9714058c27..334f49ea05ee21db07b18fcb8464894af4ac46f9 100644 --- a/templates/app/base.html +++ b/templates/app/base.html @@ -7,7 +7,7 @@ <header> <nav class="navbar navbar-expand-lg bg-body-tertiary"> <div class="container-fluid"> - <a class="navbar-brand" href="{% url "index" %}">attendio</a> + <a class="navbar-brand" href="{% if user.is_authenticated %}{% url "app:home" %}{% else %}{% url "index" %}{% endif %}">attendio</a> <button class="navbar-toggler" type="button" data-bs-toggle="collapse" @@ -22,10 +22,7 @@ aria-label="Project links" class="navbar-nav me-auto mb-2 mb-lg-0"> <li class="nav-item"> - <a class="nav-link active" href="https://docs.allauth.org/">Documentation</a> - </li> - <li class="nav-item"> - <a class="nav-link" href="https://codeberg.org/allauth/django-allauth">Repository</a> + <a class="nav-link" href="https://docs.allauth.org/">Documentation</a> </li> </ul> <div class="d-flex flex-column flex-sm-row gap-2 col-lg-3 justify-content-lg-end text-nowrap"> diff --git a/templates/app/home.html b/templates/app/home.html index a77210a59febb3e7b6f622c58e5c97342ea1d25f..c9f745e2b47e32e9d0f1f69439cd01256727060e 100644 --- a/templates/app/home.html +++ b/templates/app/home.html @@ -1,8 +1,8 @@ {% extends 'app/base.html' %} {% load django_bootstrap5 %} -{% block title %}django-bootstrap5{% endblock %} +{% block title %}Attendio Home{% endblock %} {% block content %} - This is <em>bootstrap5</em> for <strong>Django</strong>. + Browse the companies you are a part of here. {% endblock %} \ No newline at end of file diff --git a/templates/pub/index.html b/templates/pub/index.html index a77210a59febb3e7b6f622c58e5c97342ea1d25f..446c7a882de46e535a1ad296dc64aca83103df14 100644 --- a/templates/pub/index.html +++ b/templates/pub/index.html @@ -1,7 +1,7 @@ {% extends 'app/base.html' %} {% load django_bootstrap5 %} -{% block title %}django-bootstrap5{% endblock %} +{% block title %}Attendio{% endblock %} {% block content %} This is <em>bootstrap5</em> for <strong>Django</strong>.