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
badc8896
Commit
badc8896
authored
2 years ago
by
OndraRehounek
Browse files
Options
Downloads
Patches
Plain Diff
main: codestyle fixes
parent
e449ac6f
Branches
Branches containing commit
No related tags found
3 merge requests
!607
Pirati.cz
,
!594
Feature/pirati cz quidecek
,
!575
Feature/pirati cz
Pipeline
#9541
passed
2 years ago
Stage: build
Changes
1
Pipelines
1
Hide 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 @
badc8896
...
...
@@ -18,50 +18,49 @@
<div
class=
"grid-container article-section"
>
<div
class=
"grid-full mb-8"
>
<div
id=
"searchResultWrapper"
>
{% include 'main/blocks/articles_block.html' with article_data_list=article_data_list %}
</div>
{% if show_next_articles %}
<div
id=
"searchResultWrapper"
>
{% include 'main/blocks/articles_block.html' with article_data_list=article_data_list %}
</div>
{% if show_next_articles %}
<div
class=
"text-center"
>
<a
onclick=
"showMoreArticles(event, this)"
href=
"#"
data-url=
"{{ page_url }}?months="
data-months=
"2"
class=
"btn btn__slide__wrap"
>
<span
class=
"btn text-sm bg-black text-white w-32 lg:text-base"
>
Zobrazit další
</span>
<span
class=
"btn text-sm bg-white text-black w-32 lg:text-base"
>
Zobrazit další
</span>
</a>
<a
onclick=
"showMoreArticles(event, this)"
href=
"#"
data-url=
"{{ page_url }}?months="
data-months=
"2"
class=
"btn btn__slide__wrap"
>
<span
class=
"btn text-sm bg-black text-white w-32 lg:text-base"
>
Zobrazit další
</span>
<span
class=
"btn text-sm bg-white text-black w-32 lg:text-base"
>
Zobrazit další
</span>
</a>
</div>
</div>
</div>
{% endif %}
{% endif %}
</div>
</main>
<script
type=
"text/javascript"
>
function
showMoreArticles
(
event
,
article
)
{
event
.
preventDefault
()
let
btn
=
article
;
let
searchResultWrapper
=
document
.
getElementById
(
'
searchResultWrapper
'
);
let
url
=
article
.
getAttribute
(
'
data-url
'
)
+
article
.
getAttribute
(
'
data-months
'
)
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
)
});
}
</script>
<script
type=
"text/javascript"
>
async
function
showMoreArticles
(
event
,
btn
)
{
event
.
preventDefault
()
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
"
},
})
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