[func] post with no title

[fix] homepage 1/2 basis
main
yaemiku 2022-07-25 22:28:58 +02:00
parent 759823b83a
commit 0f417511c1
Signed by: podlaskizbs
GPG Key ID: ADC039636B3E4AAB
5 changed files with 34 additions and 6 deletions

View File

@ -2,12 +2,12 @@
{% load static tailwind_tags %} {% block content %}
<div class="flex flex-col lg:flex-row gap-8">
<article
class="basis-3/5 mb-auto prose max-w-full bg-white shadow-md rounded-md p-4"
class="basis-1/2 mb-auto prose max-w-full bg-white shadow-md rounded-md p-4"
>
<h1>Grand Prix Województwa</h1>
{{ gpw.content | safe }}
</article>
<div class="flex flex-col items-center gap-4">
<div class="basis-1/2 flex flex-col items-center gap-4">
<h1
class="text-[2.25rem] font-medium w-full lg:text-right bg-white shadow-md rounded-md px-4 py-2"
>
@ -15,8 +15,10 @@
</h1>
<hr class="w-36 border-b border-stone-300 border-dashed" />
{% for post in posts %}
<article class="prose max-w-full py-4 bg-white shadow-md rounded-md p-4">
<h2 class="text-center">{{ post.title }}</h2>
<article
class="prose max-w-full w-full py-4 bg-white shadow-md rounded-md p-4"
>
<h2 class="text-center font-medium">{{ post.title }}</h2>
<div>{{ post.content | safe }}</div>
</article>
{% if not forloop.last %}

View File

@ -7,7 +7,7 @@ from .models import *
@admin.register(Post)
class PostModelAdmin(OrderableAdmin, admin.ModelAdmin):
list_display = ['title', 'ordering']
list_display = ['__str__', 'ordering']
list_editable = ['ordering']
ordering_field_hide_input = True
exclude = ['ordering']

View File

@ -0,0 +1,22 @@
# Generated by Django 4.0.5 on 2022-07-25 20:26
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('main', '0002_alter_post_options_post_ordering'),
]
operations = [
migrations.AlterModelOptions(
name='post',
options={'ordering': ['ordering'], 'verbose_name': 'Aktualność PodlZBS', 'verbose_name_plural': 'Aktualności PodlZBS'},
),
migrations.AlterField(
model_name='post',
name='title',
field=models.CharField(blank=True, default='', max_length=250, verbose_name='Tytuł'),
),
]

View File

@ -12,7 +12,7 @@ class Post(OrderableModel):
created_at = models.DateTimeField(auto_now_add=True)
def __str__(self):
return self.title
return self.title or '(brak tytułu)'
class Meta(OrderableModel.Meta):
verbose_name = 'Aktualność PodlZBS'

View File

@ -1326,6 +1326,10 @@ select {
flex-basis: 60%;
}
.basis-1\/2 {
flex-basis: 50%;
}
.border-collapse {
border-collapse: collapse;
}