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
772765b0
Commit
772765b0
authored
4 years ago
by
jan.bednarik
Browse files
Options
Downloads
Patches
Plain Diff
elections2021: Strip sup on program list page
parent
f1fc569f
No related branches found
No related tags found
2 merge requests
!277
release
,
!276
Volby
Pipeline
#3776
passed
4 years ago
Stage: build
Changes
2
Pipelines
3
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
elections2021/templates/elections2021/elections2021_program_page.html
+2
-2
2 additions, 2 deletions
...1/templates/elections2021/elections2021_program_page.html
elections2021/templatetags/elections2021_extras.py
+9
-0
9 additions, 0 deletions
elections2021/templatetags/elections2021_extras.py
with
11 additions
and
2 deletions
elections2021/templates/elections2021/elections2021_program_page.html
+
2
−
2
View file @
772765b0
{% extends "elections2021/base.html" %}
{% extends "elections2021/base.html" %}
{% load static wagtailcore_tags wagtailimages_tags wagtailroutablepage_tags %}
{% load static wagtailcore_tags wagtailimages_tags wagtailroutablepage_tags
elections2021_extras
%}
{% block content_header %}
{% block content_header %}
...
@@ -110,7 +110,7 @@
...
@@ -110,7 +110,7 @@
<div
class=
"card icon-card shadow-none bg-grey-125 card--hoveractive"
data-archetype=
"{% if show_archetype_icon %}{{ point.archetype }}{% endif %}"
>
<div
class=
"card icon-card shadow-none bg-grey-125 card--hoveractive"
data-archetype=
"{% if show_archetype_icon %}{{ point.archetype }}{% endif %}"
>
<div
class=
"card__body"
>
<div
class=
"card__body"
>
<h1
class=
"card-headline mb-8"
><a
href=
"{% pageurl point %}"
>
{{ point.title }}
</a></h1>
<h1
class=
"card-headline mb-8"
><a
href=
"{% pageurl point %}"
>
{{ point.title }}
</a></h1>
<div
class=
"card-body-text"
>
{{ point.annotation|richtext
}}
</div>
<div
class=
"card-body-text"
>
<a
href=
"{% pageurl point %}"
>
{{ point.annotation|richtext
|strip_sup }}
</a>
</div>
</div>
</div>
</div>
</div>
...
...
This diff is collapsed.
Click to expand it.
elections2021/templatetags/elections2021_extras.py
+
9
−
0
View file @
772765b0
...
@@ -57,3 +57,12 @@ def format_sources(value):
...
@@ -57,3 +57,12 @@ def format_sources(value):
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
"
,
id
=
"
reference
"
,
href
=
"
#zdroje
"
))
return
str
(
soup
)
return
str
(
soup
)
@register.filter
(
is_safe
=
True
)
@stringfilter
def
strip_sup
(
value
):
soup
=
bs4
.
BeautifulSoup
(
value
,
"
html.parser
"
)
for
sup
in
soup
.
find_all
(
"
sup
"
):
sup
.
decompose
()
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