Skip to content
Snippets Groups Projects
Commit 55e9b004 authored by jarmil's avatar jarmil
Browse files

nswebs: text clanku zmenen z Markdown na Richtext

parent ee38358f
No related branches found
No related tags found
No related merge requests found
{% extends "district/base.html" %}
{% load static wagtailcore_tags wagtailimages_tags shared_filters %}
{% load static wagtailcore_tags wagtailimages_tags %}
{% block content %}
......@@ -45,7 +45,7 @@
<div class="lg:w-2/3">
<div itemprop="description" class="w-full content-block">
<p><strong>{{ page.perex }}</strong></p>
{{ page.text|markdown }}
{{ page.text|richtext }}
</div>
</div>
......
# Generated by Django 3.1.1 on 2020-11-04 10:34
from django.db import migrations
import wagtail.core.fields
class Migration(migrations.Migration):
dependencies = [
("shared", "0013_auto_20201104_1053"),
]
operations = [
migrations.AlterField(
model_name="article",
name="text",
field=wagtail.core.fields.RichTextField(
blank=True, verbose_name="text článku"
),
),
]
......@@ -4,6 +4,7 @@ import random
import requests
import requests_cache
from django.core.validators import MaxValueValidator, MinValueValidator
from wagtail.core.fields import RichTextField
from django.db import models
from modelcluster.contrib.taggit import ClusterTaggableManager
from modelcluster.fields import ParentalKey
......@@ -39,7 +40,22 @@ class ArticleMixin(models.Model):
""" Spolecna pole vsech clanku """
perex = models.CharField("perex", max_length=250, blank=True)
text = models.TextField("text článku", blank=True)
text = RichTextField(
"text článku",
blank=True,
features=[
"h1",
"h2",
"h3",
"h4",
"bold",
"italic",
"ol",
"ul",
"link",
"document-link",
],
)
date = models.DateField("datum článku", blank=False, default=datetime.datetime.now)
tags = ClusterTaggableManager(through=ArticleTag, blank=True)
......@@ -70,9 +86,6 @@ class Article(ArticleMixin, Page, SharedSubpageMixin, MetadataPageMixin):
FieldPanel("perex"),
FieldPanel("date"),
FieldPanel("text"),
HelpPanel(
"""Text článku lze formátovat s použitím <a href="https://www.markdownguide.org/basic-syntax/">markdown</a>"""
),
FieldPanel("author"),
ImageChooserPanel("image"),
FieldPanel("tags"),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment