Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
footnotes-3486079
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Issue forks
footnotes-3486079
Commits
35a9fe87
Commit
35a9fe87
authored
4 months ago
by
Scott Euser
Browse files
Options
Downloads
Patches
Plain Diff
twig deprecation fix
parent
95b6cc36
Branches
2.0.x
Branches containing commit
Tags
2.0.0
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
templates/footnote-link.html.twig
+2
-4
2 additions, 4 deletions
templates/footnote-link.html.twig
templates/footnote-links.html.twig
+11
-13
11 additions, 13 deletions
templates/footnote-links.html.twig
templates/footnote-list.html.twig
+32
-34
32 additions, 34 deletions
templates/footnote-list.html.twig
with
45 additions
and
51 deletions
templates/footnote-link.html.twig
+
2
−
4
View file @
35a9fe87
{%
apply
spaceless
%}
{# footnotes/footnote-link.html.twig #}
<a
class=
"footnote__citation js-footnote-citation"
id=
"
{{
fn.ref_id
}}
"
title=
"
{{
fn.text_clean
}}
"
href=
"#
{{
fn.fn_id
}}
"
>
{{
fn.value
|
render
|
trim
}}
</a>
{%
endapply
%}
\ No newline at end of file
{# footnotes/footnote-link.html.twig #}
<a
class=
"footnote__citation js-footnote-citation"
id=
"
{{
fn.ref_id
}}
"
title=
"
{{
fn.text_clean
}}
"
href=
"#
{{
fn.fn_id
}}
"
>
{{
fn.value
|
render
|
trim
}}
</a>
This diff is collapsed.
Click to expand it.
templates/footnote-links.html.twig
+
11
−
13
View file @
35a9fe87
{%
apply
spaceless
%}
{# footnotes/footnote-links.html.twig #}
{%
-
if
footnote_links
-
%}
<span
class=
"footnote__citations-wrapper"
>
{%
-
for
footnote_link
in
footnote_links
-
%}
{%
if
not
loop.first
%}
<span
class=
"footnote__citation-separator"
>
,
</span>
{%
endif
%}
{{
footnote_link
}}
{%
-
endfor
-
%}
</span>
{%
-
endif
-
%}
{%
endapply
%}
\ No newline at end of file
{# footnotes/footnote-links.html.twig #}
{%
-
if
footnote_links
-
%}
<span
class=
"footnote__citations-wrapper"
>
{%
-
for
footnote_link
in
footnote_links
-
%}
{%
if
not
loop.first
%}
<span
class=
"footnote__citation-separator"
>
,
</span>
{%
endif
%}
{{
footnote_link
}}
{%
-
endfor
-
%}
</span>
{%
-
endif
-
%}
This diff is collapsed.
Click to expand it.
templates/footnote-list.html.twig
+
32
−
34
View file @
35a9fe87
...
...
@@ -3,41 +3,39 @@
block. Additionally, the footnotes_group ID should be remain in place.
Similarly, .js-is-auto is required to fix auto-numbering when grouping
together via JS. #}
{%
apply
spaceless
%}
{%
if
footnotes
|
length
>
0
%}
<ul
class=
"footnotes js-footnotes"
{{
is_block
?
' id="footnotes_group"'
}}
>
{%
for
footnote_id
,
footnote_group
in
footnotes
%}
{%
set
first_footnote
=
footnote_group
|
first
%}
{%
if
not
first_footnote.is_same_text
%}
{%
if
footnotes
|
length
>
0
%}
<ul
class=
"footnotes js-footnotes"
{{
is_block
?
' id="footnotes_group"'
}}
>
{%
for
footnote_id
,
footnote_group
in
footnotes
%}
{%
set
first_footnote
=
footnote_group
|
first
%}
{%
if
not
first_footnote.is_same_text
%}
{# The texts are not the same, output each footnote as a separate
line even though they have the same backlink number. #}
{%
for
footnote
in
footnote_group
%}
<li
class=
"footnotes__item-wrapper js-footnote-reference"
>
<span
class=
"footnotes__item-backlinks"
>
<a
class=
"footnotes__item-backlink
{{
footnote.is_auto
?
' js-is-auto'
}}
"
href=
"#
{{
footnote.ref_id
}}
"
id=
"
{{
footnote.fn_id
}}
"
>
{{
footnote.backlink_value
}}
</a>
</span>
<span
class=
"footnotes__item-text js-footnote-reference-text"
>
{{
footnote.text
|
raw
}}
</span>
</li>
{%
endfor
%}
{%
else
%}
{# The values and texts are the same, combine them into a single
line and output multiple backlinks. #}
<li
class=
"footnotes__item-wrapper js-footnote-reference
{{
footnote_group
|
length
>
1
?
' has-multiple'
}}
"
>
{# The texts are not the same, output each footnote as a separate
line even though they have the same backlink number. #}
{%
for
footnote
in
footnote_group
%}
<li
class=
"footnotes__item-wrapper js-footnote-reference"
>
<span
class=
"footnotes__item-backlinks"
>
{%
for
footnote
in
footnote_group
%}
<a
class=
"footnotes__item-backlink
{{
footnote.is_auto
?
' js-is-auto'
}}{{
loop.last
?
''
:
' has-next'
}}
"
href=
"#
{{
footnote.ref_id
}}
"
id=
"
{{
footnote.fn_id
}}
"
>
{{
footnote.backlink_value
}}
</a>
{%
endfor
%}
<a
class=
"footnotes__item-backlink
{{
footnote.is_auto
?
' js-is-auto'
}}
"
href=
"#
{{
footnote.ref_id
}}
"
id=
"
{{
footnote.fn_id
}}
"
>
{{
footnote.backlink_value
}}
</a>
</span>
<span
class=
"footnotes__item-text js-footnote-reference-text"
>
{{
first_
footnote.text
|
raw
}}
</span>
<span
class=
"footnotes__item-text js-footnote-reference-text"
>
{{
footnote.text
|
raw
}}
</span>
</li>
{%
endif
%}
{%
endfor
%}
</ul>
{%
elseif
is_block
%}
{# Empty placeholder block is needed even if no footnotes when loaded via the Block. #}
<ul
class=
"footnotes"
id=
"footnotes_group"
></ul>
{%
endif
%}
{%
endapply
%}
{%
endfor
%}
{%
else
%}
{# The values and texts are the same, combine them into a single
line and output multiple backlinks. #}
<li
class=
"footnotes__item-wrapper js-footnote-reference
{{
footnote_group
|
length
>
1
?
' has-multiple'
}}
"
>
<span
class=
"footnotes__item-backlinks"
>
{%
for
footnote
in
footnote_group
%}
<a
class=
"footnotes__item-backlink
{{
footnote.is_auto
?
' js-is-auto'
}}{{
loop.last
?
''
:
' has-next'
}}
"
href=
"#
{{
footnote.ref_id
}}
"
id=
"
{{
footnote.fn_id
}}
"
>
{{
footnote.backlink_value
}}
</a>
{%
endfor
%}
</span>
<span
class=
"footnotes__item-text js-footnote-reference-text"
>
{{
first_footnote.text
|
raw
}}
</span>
</li>
{%
endif
%}
{%
endfor
%}
</ul>
{%
elseif
is_block
%}
{# Empty placeholder block is needed even if no footnotes when loaded via the Block. #}
<ul
class=
"footnotes"
id=
"footnotes_group"
></ul>
{%
endif
%}
This diff is collapsed.
Click to expand it.
Scott Euser
@scotteuser
mentioned in commit
0ec4f762
·
4 months ago
mentioned in commit
0ec4f762
mentioned in commit 0ec4f762dbbae14120bcae51845d3fb488baffbe
Toggle commit list
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