Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Maják
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hemp
Maják
Commits
55e9b004
Commit
55e9b004
authored
4 years ago
by
jarmil
Browse files
Options
Downloads
Patches
Plain Diff
nswebs: text clanku zmenen z Markdown na Richtext
parent
ee38358f
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
district/templates/shared/article.html
+2
-2
2 additions, 2 deletions
district/templates/shared/article.html
shared/migrations/0014_auto_20201104_1134.py
+21
-0
21 additions, 0 deletions
shared/migrations/0014_auto_20201104_1134.py
shared/models.py
+17
-4
17 additions, 4 deletions
shared/models.py
with
40 additions
and
6 deletions
district/templates/shared/article.html
+
2
−
2
View file @
55e9b004
{% 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>
...
...
This diff is collapsed.
Click to expand it.
shared/migrations/0014_auto_20201104_1134.py
0 → 100644
+
21
−
0
View file @
55e9b004
# 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
"
),
),
]
This diff is collapsed.
Click to expand it.
shared/models.py
+
17
−
4
View file @
55e9b004
...
...
@@ -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
"
),
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment