Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
French Tax and Benefit Tables
baremes-ipp-views
Commits
3fb58f12
Commit
3fb58f12
authored
Nov 19, 2018
by
Florian Pagnoux
Browse files
Revert "Use relative links"
dd522b54
parent
b883060a
Changes
1
Hide whitespace changes
Inline
Side-by-side
pages/section.js
View file @
3fb58f12
...
...
@@ -16,8 +16,7 @@ function renderSubParams(item, key, path) {
if
(
item
.
exclude
&&
includes
(
item
.
exclude
,
subParam
.
name
))
{
return
}
const
target
=
path
?
`
${
path
}
/
${
key
}
`
:
key
return
renderItem
(
subParam
,
subParam
.
name
,
target
)
return
renderItem
(
subParam
,
subParam
.
name
,
`
${
path
}${
key
}
/`
)
})
}
...
...
@@ -31,13 +30,13 @@ function renderItem(item, key, path) {
<
/li
>
}
if
(
item
.
table
)
{
const
target
=
path
?
`
${
path
}
/
${
key
}
`
:
key
return
<
li
key
=
{
key
}
><
a
href
=
{
target
}
>
{
item
.
title
||
item
.
table
.
description
||
item
.
table
.
id
}
<
/a></
li
>
return
<
li
key
=
{
key
}
><
a
href
=
{
`
${
path
}${
key
}
`
}
>
{
item
.
title
||
item
.
table
.
description
||
item
.
table
.
id
}
<
/a></
li
>
}
}
const
Section
=
(
props
)
=>
{
const
section
=
props
.
router
.
query
const
path
=
props
.
router
.
asPath
.
endsWith
(
'
/
'
)
?
props
.
router
.
asPath
:
props
.
router
.
asPath
+
'
/
'
const
subParams
=
flow
([
x
=>
map
(
x
,
(
subParam
,
name
)
=>
Object
.
assign
({},
subParam
,
{
name
})),
x
=>
sortBy
(
x
,
subParam
=>
section
?.
metadata
?.
order
.
indexOf
(
subParam
.
name
))
...
...
@@ -48,7 +47,7 @@ const Section = (props) => {
<
div
className
=
"
entry-content text
"
>
<
h4
>
Sommaire
<
/h4
>
<
ol
>
{
map
(
subParams
,
subParam
=>
renderItem
(
subParam
,
subParam
.
name
,
''
))}
{
map
(
subParams
,
subParam
=>
renderItem
(
subParam
,
subParam
.
name
,
path
))}
<
/ol
>
<
/div
>
<
/Layout
>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment