forked from forem/forem
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make dashboard sidebar render async and adjust dashboard pagination (f…
…orem#21324) * Make dashboard sidebar render async and adjust dashboard pagination * Adjust dashboard system spec to test sidebar * Adjust dashboard system spec to test sidebar * Adjust dashboard * Remove count header needs * Remove test for analytics org rendering * Adjust tests
- Loading branch information
1 parent
01e0afb
commit 086a6a2
Showing
15 changed files
with
154 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
<header class="crayons-page-header block"> | ||
<h1 class="crayons-title"><%= page_title %></h1> | ||
<div id="dashboard-mobile-sidebar-wrapper"> | ||
<div class="block m:hidden pt-3"> | ||
<select class="crayons-select"></select> | ||
</div> | ||
</div> | ||
<%= render "analytics" if params[:action] == "show" %> | ||
</header> | ||
|
||
<div class="crayons-layout__sidebar-left"> | ||
<div id="dashboard-main-sidebar-wrapper"> | ||
<nav class="hidden m:block" aria-label="Dashboards"> | ||
<ul class="list-none p-0"> | ||
<li> | ||
<a class="crayons-link crayons-link--block" href="/dashboard"> | ||
<%= t("views.dashboard.actions.posts") %> | ||
</a> | ||
</li> | ||
|
||
<li> | ||
<a class="crayons-link crayons-link--block " href="/admin_mcadmin/series"> | ||
<%= t("views.dashboard.actions.series") %> | ||
</a> | ||
</li> | ||
|
||
<li> | ||
<a class="crayons-link crayons-link--block " href="/dashboard/user_followers"> | ||
<%= t("views.dashboard.actions.followers") %> | ||
</a> | ||
</li> | ||
|
||
<li> | ||
<a class="crayons-link crayons-link--block js-following-tags-link " href="/dashboard/following_tags"> | ||
<%= t("views.dashboard.actions.following_tags") %> | ||
</a> | ||
</li> | ||
|
||
<li> | ||
<a class="crayons-link crayons-link--block " href="/dashboard/following_users"> | ||
<%= t("views.dashboard.actions.following_users") %> | ||
</a> | ||
</li> | ||
|
||
<li> | ||
<a class="crayons-link crayons-link--block " href="/dashboard/following_organizations"> | ||
<%= t("views.dashboard.actions.following_orgs") %> | ||
</a> | ||
</li> | ||
|
||
<li> | ||
<a class="crayons-link crayons-link--block " href="/dashboard/following_podcasts"> | ||
<%= t("views.dashboard.actions.following_pods") %> | ||
</a> | ||
</li> | ||
<li> | ||
<a class="crayons-link crayons-link--block" href="/dashboard/analytics"> | ||
<%= t("views.dashboard.actions.analytics") %> | ||
</a> | ||
</li> | ||
|
||
<li> | ||
<a class="crayons-link crayons-link--block js-hidden-tags-link " href="/dashboard/hidden_tags"> | ||
<%= t("views.dashboard.actions.hidden_tags") %> | ||
</a> | ||
</li> | ||
</ul> | ||
</nav> | ||
</div> | ||
</div> | ||
|
||
<script> | ||
fetch('/dashboard/sidebar?state=<%= params[:action] %>&which=<%= params[:which] %>') | ||
.then(response => response.text()) | ||
.then(html => { | ||
document.getElementById('dashboard-main-sidebar-wrapper').innerHTML = html; | ||
}); | ||
window.fetch('/dashboard/sidebar?type_of=mobile&state=<%= params[:action] %>&which=<%= params[:which] %>') | ||
.then(response => response.text()) | ||
.then(html => { | ||
document.getElementById('dashboard-mobile-sidebar-wrapper').innerHTML = html; | ||
let navtrigger = document.getElementById('mobile_nav_dashboard'); | ||
if (navtrigger) { | ||
navtrigger.addEventListener('change', (event) => { | ||
let url = event.target.value; | ||
InstantClick.preload(url); | ||
InstantClick.display(url); | ||
}); | ||
} | ||
}); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<% if params[:type_of] == "mobile" %> | ||
<%= render "actions_mobile" %> | ||
<% else %> | ||
<%= render "actions" %> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.