Create new app for homepage

This commit is contained in:
Juhn-Vitus Saß
2025-02-14 16:27:57 +01:00
parent 01f28c0841
commit 897ee79237
21 changed files with 78 additions and 907 deletions

View File

3
core/homepage/admin.py Normal file
View File

@@ -0,0 +1,3 @@
from django.contrib import admin
# Register your models here.

6
core/homepage/apps.py Normal file
View File

@@ -0,0 +1,6 @@
from django.apps import AppConfig
class HomepageConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'homepage'

View File

3
core/homepage/models.py Normal file
View File

@@ -0,0 +1,3 @@
from django.db import models
# Create your models here.

View File

@@ -0,0 +1,9 @@
@import 'tailwindcss';
nav div ul.qp-nav-list li {
@apply text-white hover:scale-110 hover:border-b-2 hover:border-white transition duration-200;
}
a.qp-a-button {
@apply p-6 rounded-md font-extrabold hover:scale-105 transition duration-300 shadow-md;
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,15 @@
{% load static %}
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="{% static 'homepage/t-style.css' %}">
<title>qivip</title>
</head>
<body>
{% include 'homepage/partials/_nav.html' %}
{% block content%}{% endblock %}
{% include 'homepage/partials/_footer.html' %}
</body>
</html>

View File

@@ -0,0 +1,15 @@
{% extends 'homepage/base.html' %}
{% block content %}
<div class="absolute grid place-content-center md:h-screen h-150 w-full -z-50 top-0 p-4">
<div class="text-center">
<h2 class="font-bold md:text-8xl text-6xl md:mb-8 text-blue-600">qivip</h2>
<h3 class="italic font-extralight sm:text-2xl text-md">Interaktives Lernen neu definiert.</h3>
</div>
<div class="grid sm:grid-cols-3 place-items-stretch text-center mt-8 gap-4 p-4 border-3 bg-blue-100 border-blue-100 rounded-md">
<a class="qp-a-button bg-green-500 text-white" href="#">Teilnehmen</a>
<a class="qp-a-button bg-indigo-500 text-white" href="#">Eröffnen</a>
<a class="qp-a-button bg-purple-500 text-white" href="#">Verwalten</a>
</div>
</div>
{% endblock %}

View File

@@ -0,0 +1,7 @@
<div class="absolute bottom-0 grid place-content-center gap-2 w-full">
<div class="flex space-x-2 pb-4">
<p class="text-sm font-extralight"><a href="#">Impressum</a></p>
<p class="text-sm font-extralight"><a href="#">Datenschutz</a></p>
<p class="text-sm font-extralight"><a href="#">Repository</a></p>
</div>
</div>

View File

@@ -0,0 +1,15 @@
<nav class="flex justify-between bg-blue-600 h-12 px-4 sm:px-6 lg:px-8 rounded-lg m-2 shadow-md">
<div class="flex items-center">
<h2 class="text-xl font-bold text-white hover:scale-110 transition duration-200"><a href="{% url 'homepage:home' %}">qivip</a></h2>
</div>
<div class="flex items-center">
<ul class="flex space-x-4 qp-nav-list">
<li><a href="#">Bibliothek</a></li>
{% if user.is_authenticated %}
<li><a href="{% url 'accounts:home' %}">Konto</a></li>
{% else %}
<li><a href="{% url 'accounts:login' %}">Anmelden</a></li>
{% endif %}
</ul>
</div>
</nav>

3
core/homepage/tests.py Normal file
View File

@@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.

8
core/homepage/urls.py Normal file
View File

@@ -0,0 +1,8 @@
from django.urls import path
from . import views
app_name = 'homepage' # Verhindert Konflikt mit anderen Apps
urlpatterns = [
path('', views.home, name="home"),
]

4
core/homepage/views.py Normal file
View File

@@ -0,0 +1,4 @@
from django.shortcuts import render, redirect
def home(request):
return render(request, 'homepage/home.html')