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
Container registry
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
TO
Maják
Commits
a0892adf
Commit
a0892adf
authored
3 years ago
by
jan.bednarik
Browse files
Options
Downloads
Patches
Plain Diff
elections2021: Format headings between checks
parent
a3c45b03
No related branches found
No related tags found
2 merge requests
!304
Release
,
!303
Pdf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
elections2021/templates/elections2021/elections2021_program_point_page.html
+2
-2
2 additions, 2 deletions
...lates/elections2021/elections2021_program_point_page.html
elections2021/templatetags/elections2021_extras.py
+10
-1
10 additions, 1 deletion
elections2021/templatetags/elections2021_extras.py
with
12 additions
and
3 deletions
elections2021/templates/elections2021/elections2021_program_point_page.html
+
2
−
2
View file @
a0892adf
...
@@ -151,7 +151,7 @@
...
@@ -151,7 +151,7 @@
<h3
class=
"head-alt-base mb-8"
>
Jak to chceme udělat?
</h3>
<h3
class=
"head-alt-base mb-8"
>
Jak to chceme udělat?
</h3>
<div
class=
"content-block"
>
<div
class=
"content-block"
>
{{ page.proposal|richtext|format_sources }}
{{ page.proposal|richtext|format_sources
|style_h4
}}
</div>
</div>
<div
id=
"kolik-na-to-chceme-casu"
class=
"grid grid-cols-1 gap-8 my-20"
>
<div
id=
"kolik-na-to-chceme-casu"
class=
"grid grid-cols-1 gap-8 my-20"
>
...
@@ -211,7 +211,7 @@
...
@@ -211,7 +211,7 @@
<h3
id=
"co-pro-to-uz-delame"
class=
"head-alt-base mt-20 mb-10"
>
Co pro to už děláme
</h3>
<h3
id=
"co-pro-to-uz-delame"
class=
"head-alt-base mt-20 mb-10"
>
Co pro to už děláme
</h3>
<div
class=
"content-block"
>
<div
class=
"content-block"
>
{{ page.already_done|richtext|format_sources }}
{{ page.already_done|richtext|format_sources
|style_h4
}}
</div>
</div>
<h3
id=
"na-co-se-nas-casto-ptate"
class=
"head-alt-base mb-8 mt-20"
>
Na co se nás často ptáte
</h3>
<h3
id=
"na-co-se-nas-casto-ptate"
class=
"head-alt-base mb-8 mt-20"
>
Na co se nás často ptáte
</h3>
...
...
This diff is collapsed.
Click to expand it.
elections2021/templatetags/elections2021_extras.py
+
10
−
1
View file @
a0892adf
...
@@ -55,7 +55,7 @@ def format_sources_block(value):
...
@@ -55,7 +55,7 @@ def format_sources_block(value):
def
format_sources
(
value
):
def
format_sources
(
value
):
soup
=
bs4
.
BeautifulSoup
(
value
,
"
html.parser
"
)
soup
=
bs4
.
BeautifulSoup
(
value
,
"
html.parser
"
)
for
sup
in
soup
.
find_all
(
"
sup
"
):
for
sup
in
soup
.
find_all
(
"
sup
"
):
sup
.
wrap
(
soup
.
new_tag
(
"
a
"
,
id
=
"
reference
"
,
href
=
"
#zdroje
"
))
sup
.
wrap
(
soup
.
new_tag
(
"
a
"
,
href
=
"
#zdroje
"
))
return
str
(
soup
)
return
str
(
soup
)
...
@@ -71,3 +71,12 @@ def strip_sup(value):
...
@@ -71,3 +71,12 @@ def strip_sup(value):
@register.filter
@register.filter
def
dictitem
(
dictionary
,
key
):
def
dictitem
(
dictionary
,
key
):
return
dictionary
.
get
(
key
)
return
dictionary
.
get
(
key
)
@register.filter
(
is_safe
=
True
)
@stringfilter
def
style_h4
(
value
):
soup
=
bs4
.
BeautifulSoup
(
value
,
"
html.parser
"
)
for
h4
in
soup
.
find_all
(
"
h4
"
):
h4
[
"
class
"
]
=
"
pl-11 font-bold text-xl mb-4
"
return
str
(
soup
)
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