From 000bf734c6fc6d7911e7a038289df24a0fa85f02 Mon Sep 17 00:00:00 2001 From: yaemiku Date: Wed, 28 Sep 2022 20:48:08 +0200 Subject: [PATCH] [func] adm. data --- core/context_processors.py | 1 + core/templates/administration.html | 17 ++------------- db/administration/migrations/0011_data.py | 25 +++++++++++++++++++++++ db/administration/models.py | 12 +++++++++++ theme/static/css/dist/styles.css | 12 +++++++++++ 5 files changed, 52 insertions(+), 15 deletions(-) create mode 100644 db/administration/migrations/0011_data.py diff --git a/core/context_processors.py b/core/context_processors.py index 2ed1296..4ccec35 100644 --- a/core/context_processors.py +++ b/core/context_processors.py @@ -18,6 +18,7 @@ def load_config(request): 'uppernav': UpperButton.objects.all(), 'gpw': GrandPrixW.load(), 'posts': Post.objects.filter(published=True), + 'daneadresowe': Data.load(), 'czlonkowie': Member.objects.all(), 'statut': Statute.objects.first(), 'ogloszenia': Announcement.objects.all(), diff --git a/core/templates/administration.html b/core/templates/administration.html index 5a3fc5f..bce2b8d 100644 --- a/core/templates/administration.html +++ b/core/templates/administration.html @@ -2,7 +2,7 @@ {% block title %}Zarząd | pdlzbs{% endblock %} -{% load static tailwind_tags %} {% block content %} +{% load static tailwind_tags wysiwyg %} {% block content %}
@@ -56,20 +56,7 @@

Dane adresowe

-

- Adres Podlaskiego ZBS - 15-057 Białystok - ul. B. Chrobrego 5B m.33 - Konto: PKO SA O/B-tok - 43 1240 5211 1111 0000 4919 1721 - - NIP: 542 258 14 53 - REGON: 050816091 -

+
{% content daneadresowe %}

Członkowie

{% if czlonkowie %} diff --git a/db/administration/migrations/0011_data.py b/db/administration/migrations/0011_data.py new file mode 100644 index 0000000..f661930 --- /dev/null +++ b/db/administration/migrations/0011_data.py @@ -0,0 +1,25 @@ +# Generated by Django 4.0.5 on 2022-09-28 18:31 + +from django.db import migrations, models +import tinymce.models + + +class Migration(migrations.Migration): + + dependencies = [ + ('administration', '0010_alter_announcement_attachment_and_more'), + ] + + operations = [ + migrations.CreateModel( + name='Data', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('content', tinymce.models.HTMLField(blank=True, default='', verbose_name='Dane zarządu')), + ], + options={ + 'verbose_name': 'Dane zarządu', + 'verbose_name_plural': 'Dane zarządu', + }, + ), + ] diff --git a/db/administration/models.py b/db/administration/models.py index 7b581ae..d39cddd 100644 --- a/db/administration/models.py +++ b/db/administration/models.py @@ -2,6 +2,7 @@ from django.db import models from admin_ordering.models import OrderableModel from filebrowser.fields import FileBrowseField from core.utils import SingletonModel +from tinymce.models import HTMLField # Create your models here. @@ -35,6 +36,17 @@ class Announcement(AttachmentModel): verbose_name_plural = 'Ogłoszenia' +class Data(SingletonModel): + content = HTMLField('Dane zarządu', default='', blank=True) + + def __str__(self): + return 'Dane zarządu' + + class Meta: + verbose_name = 'Dane zarządu' + verbose_name_plural = 'Dane zarządu' + + class Member(OrderableModel): name = models.CharField('Imię i nazwisko', max_length=512) contact = models.CharField('Dane kontaktowe', max_length=512) diff --git a/theme/static/css/dist/styles.css b/theme/static/css/dist/styles.css index 34f6f36..692f6e7 100644 --- a/theme/static/css/dist/styles.css +++ b/theme/static/css/dist/styles.css @@ -1309,6 +1309,10 @@ select { margin-bottom: auto; } +.mt-0 { + margin-top: 0px; +} + .block { display: block; } @@ -1618,6 +1622,10 @@ select { line-height: 1.5; } +.leading-3 { + line-height: .75rem; +} + .tracking-normal { letter-spacing: 0em; } @@ -1775,6 +1783,10 @@ h4 { display: block; } +.prose-headings\:mt-0 :is(:where(h1, h2, h3, h4, th):not(:where([class~="not-prose"] *))) { + margin-top: 0px; +} + .prose-h2\:mb-2 :is(:where(h2):not(:where([class~="not-prose"] *))) { margin-bottom: 0.5rem; }