#162 Info über qivip
This commit is contained in:
@@ -1,8 +1,12 @@
|
||||
from django.contrib import admin
|
||||
from .models import QivipFaq
|
||||
from .models import QivipFaq, QivipDescription
|
||||
# Register your models here.
|
||||
class QivipFaqAdmin(admin.ModelAdmin):
|
||||
list_display = ('question','answer',)
|
||||
|
||||
class QivipDescriptionAdmin(admin.ModelAdmin):
|
||||
list_display = ('title','description',)
|
||||
|
||||
# Registrierung der Modelle im Admin
|
||||
admin.site.register(QivipFaq, QivipFaqAdmin)
|
||||
admin.site.register(QivipDescription, QivipDescriptionAdmin)
|
||||
21
django/homepage/migrations/0004_qivipinfos.py
Normal file
21
django/homepage/migrations/0004_qivipinfos.py
Normal file
@@ -0,0 +1,21 @@
|
||||
# Generated by Django 5.1.7 on 2025-11-27 17:41
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('homepage', '0003_alter_qivipfaq_answer_alter_qivipfaq_question'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='QivipInfos',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('title', models.TextField(max_length=200)),
|
||||
('description', models.TextField(max_length=1000)),
|
||||
],
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,17 @@
|
||||
# Generated by Django 5.1.7 on 2025-11-27 17:42
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('homepage', '0004_qivipinfos'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RenameModel(
|
||||
old_name='QivipInfos',
|
||||
new_name='QivipInfo',
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,24 @@
|
||||
# Generated by Django 5.1.7 on 2025-11-27 17:55
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('homepage', '0005_rename_qivipinfos_qivipinfo'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='QivipDescription',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('title', models.TextField(help_text='Funktion von qivip', max_length=200)),
|
||||
('description', models.TextField(help_text='Beschreibung derFunktion von qivip', max_length=1000)),
|
||||
],
|
||||
),
|
||||
migrations.DeleteModel(
|
||||
name='QivipInfo',
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 5.1.7 on 2025-11-27 17:57
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('homepage', '0006_qivipdescription_delete_qivipinfo'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='qivipdescription',
|
||||
name='description',
|
||||
field=models.TextField(help_text='Beschreibung der Funktion von qivip', max_length=1000),
|
||||
),
|
||||
]
|
||||
@@ -4,3 +4,7 @@ from django.db import models
|
||||
class QivipFaq(models.Model):
|
||||
question = models.TextField(max_length=200)
|
||||
answer = models.TextField(max_length=1000)
|
||||
|
||||
class QivipDescription(models.Model): # Was kann man mit qivip machen ...
|
||||
title = models.TextField(max_length=200, help_text="Funktion von qivip")
|
||||
description= models.TextField(max_length=1000, help_text="Beschreibung der Funktion von qivip")
|
||||
@@ -1,9 +1,10 @@
|
||||
from django.shortcuts import render, redirect
|
||||
from .models import QivipFaq
|
||||
from .models import QivipFaq, QivipDescription
|
||||
|
||||
def home(request):
|
||||
faqs=QivipFaq.objects.all()
|
||||
context={"faqs": faqs}
|
||||
descriptions=QivipDescription.objects.all()
|
||||
context={"faqs": faqs, "descriptions": descriptions}
|
||||
return render(request, 'homepage/home.html', context)
|
||||
|
||||
def impress(request):
|
||||
|
||||
@@ -22,6 +22,35 @@
|
||||
|
||||
</style>
|
||||
|
||||
{% if descriptions %}
|
||||
<div class="container mx-auto px-4 sm:px-6 lg:px-8 mt-8 mb-6">
|
||||
<div class="flex items-center gap-3">
|
||||
<h2 class="text-2xl font-bold text-gray-900 dark:text-white">Was kann qivip?</h2>
|
||||
<div class="h-0.5 flex-grow bg-gradient-to-r from-blue-600 to-transparent rounded-full"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container mx-auto px-4 sm:px-6 lg:px-8 mb-16">
|
||||
|
||||
<div class="max-w-full p-4 mt-8 rounded-2xl bg-gray-100 dark:bg-transparent shadow-sm">
|
||||
<p class="text-lg font-bold text-gray-800 dark:text-white dark:bg-transparent mb-3">
|
||||
Mit qivip kann man:
|
||||
</p>
|
||||
|
||||
<div class="space-y-2 text-gray-700 dark:text-white ">
|
||||
{% for description in descriptions %}
|
||||
<p>
|
||||
<li class="ml-4"><span class="font-bold">{{ description.title }}</span> {{ description.description }}</li>
|
||||
</p>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endif %}
|
||||
|
||||
|
||||
|
||||
{% if faqs %}
|
||||
<div class="container mx-auto px-4 sm:px-6 lg:px-8 mt-8 mb-6">
|
||||
<div class="flex items-center gap-3">
|
||||
|
||||
Reference in New Issue
Block a user