Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add loading info to journal toc articles page #2455

Merged
merged 2 commits into from
Mar 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cms/sass/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
"pages/error-page",
"pages/homepage",
"pages/journal-details",
"pages/journal-toc-articles",
"pages/search",
"pages/sponsors",
"pages/uploadmetadata",
Expand Down
5 changes: 5 additions & 0 deletions cms/sass/pages/_journal-toc-articles.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.articles-loading-placeholder {
display: flex;
flex-direction: column;
align-items: center;
}
11 changes: 10 additions & 1 deletion portality/templates-v2/public/toc_articles.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,16 @@

<section id="all-articles" class="row tabs__panel" role="tabpanel">
<div class="col-md-12">
<div id="journal_toc_articles"></div>
<div id="journal_toc_articles">
<div class="articles-loading-placeholder">
<h2>Loading {{ articles_no }} articles</h2>
<div class="loading">
<div id="first_dot"></div>
<div id="second_dot"></div>
<div id="third_dot"></div>
</div>
</div>
</div>
</div>
</section>

Expand Down
3 changes: 2 additions & 1 deletion portality/view/doaj.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,11 +356,12 @@ def toc_articles_legacy(identifier=None):
def toc_articles(identifier=None):
journal = find_toc_journal_by_identifier(identifier)
bibjson = journal.bibjson()
articles_no = journal.article_stats()["total"]
real_identifier = find_correct_redirect_identifier(identifier, bibjson)
if real_identifier:
return redirect(url_for('doaj.toc_articles', identifier=real_identifier), 301)
else:
return render_template(templates.PUBLIC_TOC_ARTICLES, journal=journal, bibjson=bibjson, tab="articles")
return render_template(templates.PUBLIC_TOC_ARTICLES, journal=journal, bibjson=bibjson, articles_no=articles_no, tab="articles")


# ~~->Article:Page~~
Expand Down