Skip to content
Snippets Groups Projects
Commit a0892adf authored by jan.bednarik's avatar jan.bednarik
Browse files

elections2021: Format headings between checks

parent a3c45b03
No related branches found
No related tags found
2 merge requests!304Release,!303Pdf
...@@ -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>
......
...@@ -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)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment