startpage: flexibilize root section
parent
2c49c216dc
commit
3eaaf1727c
@ -0,0 +1,18 @@
|
|||||||
|
# Generated by Django 4.0.1 on 2024-11-23 17:00
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('startpage', '0001_initial'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='section',
|
||||||
|
name='show_in_navigation',
|
||||||
|
field=models.BooleanField(default=True, verbose_name='Show in navigation'),
|
||||||
|
),
|
||||||
|
]
|
||||||
@ -0,0 +1,19 @@
|
|||||||
|
# Generated by Django 4.0.1 on 2024-11-23 17:41
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
import django.db.models.deletion
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('startpage', '0002_section_show_in_navigation'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='post',
|
||||||
|
name='section',
|
||||||
|
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='startpage.section', verbose_name='section'),
|
||||||
|
),
|
||||||
|
]
|
||||||
@ -0,0 +1,21 @@
|
|||||||
|
{% extends "startpage/base_subsite.html" %}
|
||||||
|
{% load static %}
|
||||||
|
{% load markdownify %}
|
||||||
|
{% load markdown_extras %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<h1>Berichte</h1>
|
||||||
|
|
||||||
|
{% for post in posts %}
|
||||||
|
|
||||||
|
<div class="post-preview">
|
||||||
|
<a href="{% url 'startpage:post' post_name=post.urlname section_name='berichte' %}"><h3>{{ post.title }}</h3></a>
|
||||||
|
<p>
|
||||||
|
{{ post.website_text|markdownify|truncatechars:200 }}
|
||||||
|
<a href="{% url 'startpage:post' post_name=post.urlname section_name='berichte' %}">weiterlesen</a>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
{% endblock %}
|
||||||
Loading…
Reference in New Issue