diff --git a/src/server/views/pages/dashboard.ejs b/src/server/views/pages/dashboard.ejs index 8057389..705c412 100644 --- a/src/server/views/pages/dashboard.ejs +++ b/src/server/views/pages/dashboard.ejs @@ -44,7 +44,7 @@
<% if (guilds && guilds.length) { %> <% guilds.sort((a,b)=> a.name.localeCompare(b.name)).forEach(g => { %> -
+
<% if (g.icon) { %> icon @@ -56,9 +56,6 @@
- <% if (typeof g.botInGuild === 'boolean' && !g.botInGuild) { %> - Invitar bot - <% } %>
@@ -84,12 +81,18 @@ document.addEventListener('click', ()=> userMenu.classList.add('hidden')); } - // clicking a guild row navigates + // clicking a guild row navigates or opens invite if bot not present document.getElementById('cardList')?.addEventListener('click', (e)=>{ let el = e.target; while (el && !el.dataset?.id) el = el.parentElement; if (el && el.dataset && el.dataset.id) { const id = el.dataset.id; + const bot = el.getAttribute('data-bot'); + const invite = el.getAttribute('data-invite'); + if (bot === '0' && invite) { + window.open(invite, '_blank', 'noopener'); + return; + } window.location.href = `/dashboard/${id}/overview`; } }); diff --git a/src/server/views/partials/dashboard_nav.ejs b/src/server/views/partials/dashboard_nav.ejs index 92ab0ad..1ebe646 100644 --- a/src/server/views/partials/dashboard_nav.ejs +++ b/src/server/views/partials/dashboard_nav.ejs @@ -24,16 +24,14 @@