diff --git a/.gitignore b/.gitignore index da5cb28..b5a13d9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ venv/ __pycache__/ +media/**/* db.sqlite3 \ No newline at end of file diff --git a/core/admin.py b/core/admin.py index 8c38f3f..548c894 100644 --- a/core/admin.py +++ b/core/admin.py @@ -1,3 +1,18 @@ from django.contrib import admin +from django_summernote.admin import SummernoteModelAdmin +from .models import * # Register your models here. + + +class PostModelAdmin(SummernoteModelAdmin): + summernote_fields = ['content'] + + +admin.site.register(Post, PostModelAdmin) + +admin.site.site_header = 'pdlzbs' +admin.site.site_title = 'pdlzbs' +admin.site.index_title = 'Panel administracyjny' +admin.site.site_url = '/' +admin.site.enable_nav_sidebar = False diff --git a/core/apps.py b/core/apps.py index 8115ae6..1bbf2e1 100644 --- a/core/apps.py +++ b/core/apps.py @@ -4,3 +4,4 @@ from django.apps import AppConfig class CoreConfig(AppConfig): default_auto_field = 'django.db.models.BigAutoField' name = 'core' + verbose_name = 'Baza danych' diff --git a/core/migrations/0001_initial.py b/core/migrations/0001_initial.py new file mode 100644 index 0000000..a9de8f4 --- /dev/null +++ b/core/migrations/0001_initial.py @@ -0,0 +1,28 @@ +# Generated by Django 4.0.5 on 2022-06-15 18:35 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='Post', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('title', models.CharField(max_length=250, verbose_name='Tytuł')), + ('content', models.TextField(verbose_name='Treść')), + ('created_at', models.DateTimeField(auto_now_add=True)), + ], + options={ + 'verbose_name': 'Ogłoszenie', + 'verbose_name_plural': 'Ogłoszenia', + 'ordering': ['-created_at'], + }, + ), + ] diff --git a/core/models.py b/core/models.py index 71a8362..12022c1 100644 --- a/core/models.py +++ b/core/models.py @@ -1,3 +1,17 @@ from django.db import models # Create your models here. + + +class Post(models.Model): + title = models.CharField('Tytuł', max_length=250) + content = models.TextField('Treść') + created_at = models.DateTimeField(auto_now_add=True) + + def __str__(self): + return self.title + + class Meta: + verbose_name = 'Ogłoszenie' + verbose_name_plural = 'Ogłoszenia' + ordering = ['-created_at'] diff --git a/core/static/css/dist/styles.css b/core/static/css/dist/styles.css index c640962..02eba8e 100644 --- a/core/static/css/dist/styles.css +++ b/core/static/css/dist/styles.css @@ -1134,6 +1134,11 @@ select { margin-right: auto; } +.my-4 { + margin-top: 1rem; + margin-bottom: 1rem; +} + .mt-\[40px\] { margin-top: 40px; } @@ -1146,6 +1151,14 @@ select { margin-left: -12px; } +.mb-0 { + margin-bottom: 0px; +} + +.mb-4 { + margin-bottom: 1rem; +} + .block { display: block; } @@ -1206,6 +1219,14 @@ select { flex-basis: 33.333333%; } +.basis-3\/5 { + flex-basis: 60%; +} + +.basis-2\/5 { + flex-basis: 40%; +} + .border-collapse { border-collapse: collapse; } @@ -1254,11 +1275,29 @@ select { border-bottom-width: 1px; } +.border-b-2 { + border-bottom-width: 2px; +} + +.border-dashed { + border-style: dashed; +} + .border-slate-400 { --tw-border-opacity: 1; border-color: rgb(148 163 184 / var(--tw-border-opacity)); } +.border-stone-500 { + --tw-border-opacity: 1; + border-color: rgb(120 113 108 / var(--tw-border-opacity)); +} + +.border-stone-400 { + --tw-border-opacity: 1; + border-color: rgb(168 162 158 / var(--tw-border-opacity)); +} + .bg-white { --tw-bg-opacity: 1; background-color: rgb(255 255 255 / var(--tw-bg-opacity)); @@ -1269,6 +1308,11 @@ select { background-color: rgb(249 250 251 / var(--tw-bg-opacity)); } +.py-4 { + padding-top: 1rem; + padding-bottom: 1rem; +} + .pb-1 { padding-bottom: 0.25rem; } @@ -1277,6 +1321,22 @@ select { padding-right: 50px; } +.pb-6 { + padding-bottom: 1.5rem; +} + +.pb-4 { + padding-bottom: 1rem; +} + +.pt-4 { + padding-top: 1rem; +} + +.pt-0 { + padding-top: 0px; +} + .text-center { text-align: center; } @@ -1293,11 +1353,26 @@ select { font-size: 15px; } +.text-2xl { + font-size: 1.5rem; + line-height: 2rem; +} + .text-5xl { font-size: 3rem; line-height: 1; } +.text-4xl { + font-size: 2.25rem; + line-height: 2.5rem; +} + +.text-3xl { + font-size: 1.875rem; + line-height: 2.25rem; +} + .font-bold { font-weight: 700; } @@ -1327,6 +1402,11 @@ select { color: rgb(255 255 255 / var(--tw-text-opacity)); } +.underline { + -webkit-text-decoration-line: underline; + text-decoration-line: underline; +} + .antialiased { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; diff --git a/core/templates/home.html b/core/templates/home.html index b2661a1..46c242e 100644 --- a/core/templates/home.html +++ b/core/templates/home.html @@ -1,47 +1,22 @@ {% extends 'base.html' %} {% block title %}Strona główna | pdlzbs{% endblock %} {% load static tailwind_tags %} {% block content %} -