diff --git a/elections2021/templates/elections2021/elections2021_program_point_page.html b/elections2021/templates/elections2021/elections2021_program_point_page.html index e5e236a74fcd15b2fd07b8c5c16620b2fdd1ca05..1a70dcb86bc60ec8cb53bbeaef6b097cbb060b48 100644 --- a/elections2021/templates/elections2021/elections2021_program_point_page.html +++ b/elections2021/templates/elections2021/elections2021_program_point_page.html @@ -151,7 +151,7 @@ <h3 class="head-alt-base mb-8">Jak to chceme udělat?</h3> <div class="content-block"> - {{ page.proposal|richtext|format_sources }} + {{ page.proposal|richtext|format_sources|style_h4 }} </div> <div id="kolik-na-to-chceme-casu" class="grid grid-cols-1 gap-8 my-20"> @@ -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> <div class="content-block"> - {{ page.already_done|richtext|format_sources }} + {{ page.already_done|richtext|format_sources|style_h4 }} </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> diff --git a/elections2021/templatetags/elections2021_extras.py b/elections2021/templatetags/elections2021_extras.py index 4f8feb0cc76c3a2a09d5af381c7cce01504c0e31..762674efa9e4166b450490c28fa6a38c3995dbf9 100644 --- a/elections2021/templatetags/elections2021_extras.py +++ b/elections2021/templatetags/elections2021_extras.py @@ -55,7 +55,7 @@ def format_sources_block(value): def format_sources(value): soup = bs4.BeautifulSoup(value, "html.parser") 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) @@ -71,3 +71,12 @@ def strip_sup(value): @register.filter def dictitem(dictionary, 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)