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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TO
Maják
Commits
07102aee
Commit
07102aee
authored
Aug 29, 2022
by
quido.zientek
Browse files
Options
Downloads
Plain Diff
Merge remote-tracking branch 'origin/feature/pirati-cz-quidecek' into feature/pirati-cz-quidecek
parents
36be84d8
badc8896
Branches
Branches containing commit
No related tags found
3 merge requests
!607
Pirati.cz
,
!598
Feature/pirati cz quidecek
,
!575
Feature/pirati cz
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
main/templates/main/main_articles_page.html
+39
-40
39 additions, 40 deletions
main/templates/main/main_articles_page.html
with
39 additions
and
40 deletions
main/templates/main/main_articles_page.html
+
39
−
40
View file @
07102aee
...
...
@@ -28,7 +28,8 @@
href=
"#"
data-url=
"{{ page_url }}?months="
data-months=
"2"
class=
"btn btn__slide__wrap"
>
class=
"btn btn__slide__wrap"
>
<span
class=
"btn text-sm bg-black text-white w-32 lg:text-base"
>
Zobrazit další
</span>
...
...
@@ -42,26 +43,24 @@
{% endif %}
</div>
</main>
<script
type=
"text/javascript"
>
function
showMoreArticles
(
event
,
article
)
{
async
function
showMoreArticles
(
event
,
btn
)
{
event
.
preventDefault
()
let
btn
=
article
;
let
searchResultWrapper
=
document
.
getElementById
(
'
searchResultWrapper
'
);
let
url
=
article
.
getAttribute
(
'
data-url
'
)
+
article
.
getAttribute
(
'
data-months
'
)
fetch
(
url
,
{
const
searchResultWrapper
=
document
.
getElementById
(
'
searchResultWrapper
'
)
const
url
=
btn
.
getAttribute
(
'
data-url
'
)
+
btn
.
getAttribute
(
'
data-months
'
)
const
response
=
await
fetch
(
url
,
{
method
:
"
GET
"
,
headers
:
{
"
X-Requested-With
"
:
"
XMLHttpRequest
"
,
},
}).
then
((
response
)
=>
response
.
json
())
.
then
((
data
)
=>
{
if
(
data
.
last_article
)
btn
.
hide
();
searchResultWrapper
.
innerHTML
=
data
.
html
;
let
dataMonths
=
parseInt
(
article
.
getAttribute
(
'
data-months
'
))
+
1
article
.
setAttribute
(
'
data-months
'
,
dataMonths
)
});
headers
:
{
"
X-Requested-With
"
:
"
XMLHttpRequest
"
},
})
const
data
=
await
response
.
json
()
if
(
data
.
last_article
)
{
btn
.
hide
()
}
searchResultWrapper
.
innerHTML
=
data
.
html
btn
.
setAttribute
(
'
data-months
'
,
parseInt
(
btn
.
getAttribute
(
'
data-months
'
))
+
1
)
}
</script>
{% endblock content %}
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