+ + Co nowego na forum? +
+ +- - Oś czasu -
-+ + Oś czasu +
+${activity.excerpt}
${activity.excerpt}
-diff --git a/resources/js/pages/homepage.js b/resources/js/pages/homepage.js index ccc9ee32f..eb5599737 100644 --- a/resources/js/pages/homepage.js +++ b/resources/js/pages/homepage.js @@ -64,12 +64,20 @@ function switchForumTab(index) { axios.post('/User/Settings/Ajax', {'homepage_mode': index}); } +function switchTimeline(index) { + axios.post('/User/Settings/Ajax', {'homepage_timeline': index}) + .finally(() => window.location.reload()); +} + function switchReputationTab(index) { axios.post('/User/Settings/Ajax', {'homepage_reputation': index}); } (function () { - new PerfectScrollbar(document.getElementById('stream')); + const stream = document.getElementById('stream'); + if (stream) { + new PerfectScrollbar(stream); + } const forumTabs = document.querySelectorAll('#forum-tabs .nav-link'); for (let i = 0; i < forumTabs.length; i++) { @@ -80,4 +88,9 @@ function switchReputationTab(index) { for (let i = 0; i < reputationTabs.length; i++) { reputationTabs[i].addEventListener('click', () => switchReputationTab(i)); } + + const timelineTabs = document.querySelectorAll('#timeline-switch .nav-item'); + for (let i = 0; i < timelineTabs.length; i++) { + timelineTabs[i].addEventListener('click', () => switchTimeline(i)); + } })(); diff --git a/resources/views/home.twig b/resources/views/home.twig index 644902607..d2a5016ab 100644 --- a/resources/views/home.twig +++ b/resources/views/home.twig @@ -13,18 +13,70 @@ -
${activity.excerpt}
${activity.excerpt}
-