Skip to content

Commit

Permalink
[feature] admin panel tabs working
Browse files Browse the repository at this point in the history
  • Loading branch information
akhilsharmaa committed Jan 11, 2025
1 parent cfd1346 commit e964aed
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion routes/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ router.get('/inbox', async (req, res) => {

try{
const result = await RecordModel.find(
{label: "new"}
{label: "inbox"}
);
res.status(200).render('pages/admin/inbox',
{"result": result}
Expand Down
2 changes: 1 addition & 1 deletion views/components/customercard.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<input type="hidden" name="phone" value="<%= phone %>" />
<input type="hidden" name="label" value="<%= label %>" />
<button type="submit" class="py-2.5 px-5 me-2 mb-2 text-sm font-medium text-gray-900 focus:outline-none bg-white rounded-full border border-gray-200 hover:bg-gray-100 hover:text-blue-700 focus:z-10 focus:ring-4 focus:ring-gray-100 dark:focus:ring-gray-700 dark:bg-gray-800 dark:text-gray-400 dark:border-gray-600 dark:hover:text-white dark:hover:bg-gray-700">
Mark as <%= label %>
Move to <%= label %>
</button>
</form>
</div>
Expand Down
10 changes: 5 additions & 5 deletions views/pages/admin/archived.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,24 @@
<ul class="space-y-2 font-medium">

<!-- Dashbord -->
<%- include('../../components/_sidebarItem', { link: '#', iconPath: 'M12.5 0c-.157 0-.311.01-.565.027A1 1 0 0 0 11 1.02V10h8.975a1 1 0 0 0 1-.935c.013-.188.028-.374.028-.565A8.51 8.51 0 0 0 12.5 0Z',
<%- include('../../components/_sidebarItem', { link: '/admin/inbox', iconPath: 'M12.5 0c-.157 0-.311.01-.565.027A1 1 0 0 0 11 1.02V10h8.975a1 1 0 0 0 1-.935c.013-.188.028-.374.028-.565A8.51 8.51 0 0 0 12.5 0Z',
itemName: 'Dashboard', badge: '' }) %>
<!-- Inbox -->
<%- include('../../components/_sidebarItem', { link: '#', iconPath: 'm17.418 3.623-.018-.008a6.713 6.713 0 0 0-2.4-.569V2h1a1 1 0 1 0 0-2h-2a1 1 0 0 0-1 1v2H9.89A6.977 6.977 0 0 1 12 8v5h-2V8A5 5 0 1 0 0 8v6a1 1 0 0 0 1 1h8v4a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-4h6a1 1 0 0 0 1-1V8a5 5 0 0 0-2.582-4.377ZM6 12H4a1 1 0 0 1 0-2h2a1 1 0 0 1 0 2Z',
<%- include('../../components/_sidebarItem', { link: '/admin/inbox', iconPath: 'm17.418 3.623-.018-.008a6.713 6.713 0 0 0-2.4-.569V2h1a1 1 0 1 0 0-2h-2a1 1 0 0 0-1 1v2H9.89A6.977 6.977 0 0 1 12 8v5h-2V8A5 5 0 1 0 0 8v6a1 1 0 0 0 1 1h8v4a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-4h6a1 1 0 0 0 1-1V8a5 5 0 0 0-2.582-4.377ZM6 12H4a1 1 0 0 1 0-2h2a1 1 0 0 1 0 2Z',
itemName: 'Inbox', badge: '1' }) %>
<!-- Archived -->
<%- include('../../components/_sidebarItem', { link: '#', iconPath: 'm17.418 3.623-.018-.008a6.713 6.713 0 0 0-2.4-.569V2h1a1 1 0 1 0 0-2h-2a1 1 0 0 0-1 1v2H9.89A6.977 6.977 0 0 1 12 8v5h-2V8A5 5 0 1 0 0 8v6a1 1 0 0 0 1 1h8v4a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-4h6a1 1 0 0 0 1-1V8a5 5 0 0 0-2.582-4.377ZM6 12H4a1 1 0 0 1 0-2h2a1 1 0 0 1 0 2Z',
<%- include('../../components/_sidebarItem', { link: '/admin/inbox', iconPath: 'm17.418 3.623-.018-.008a6.713 6.713 0 0 0-2.4-.569V2h1a1 1 0 1 0 0-2h-2a1 1 0 0 0-1 1v2H9.89A6.977 6.977 0 0 1 12 8v5h-2V8A5 5 0 1 0 0 8v6a1 1 0 0 0 1 1h8v4a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-4h6a1 1 0 0 0 1-1V8a5 5 0 0 0-2.582-4.377ZM6 12H4a1 1 0 0 1 0-2h2a1 1 0 0 1 0 2Z',
itemName: 'Archived', badge: '' }) %>
</ul>
</div>
</aside>

<div class="p-4 sm:ml-64">

<p class="text-black text-xl mt-8">New Customers (Unreads)</p>
<p class="text-black text-xl mt-8">Archived Customers</p>

<% result.forEach(function(item) { %>
<%- include('../../components/customercard.ejs', { "phone": item.phone, "email": item.email, "date": item.date, "msg":item.msg, "label": "new"}) %>
<%- include('../../components/customercard.ejs', { "phone": item.phone, "email": item.email, "date": item.date, "msg":item.msg, "label": "inbox"}) %>
<% }); %>

</div>
Expand Down
8 changes: 4 additions & 4 deletions views/pages/admin/dashboard.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@

<aside id="cta-button-sidebar" class="fixed top-0 left-0 z-40 w-64 h-screen transition-transform -translate-x-full sm:translate-x-0" aria-label="Sidebar">
<div class="h-full px-3 py-4 overflow-y-auto bg-gray-50 dark:bg-gray-800">
<ul class="space-y-2 font-medium">
<ul class="space-y-2 font-medium">

<!-- Dashbord -->
<%- include('../../components/_sidebarItem', { link: 'inbox', iconPath: 'M12.5 0c-.157 0-.311.01-.565.027A1 1 0 0 0 11 1.02V10h8.975a1 1 0 0 0 1-.935c.013-.188.028-.374.028-.565A8.51 8.51 0 0 0 12.5 0Z',
<%- include('../../components/_sidebarItem', { link: '/admin/inbox', iconPath: 'M12.5 0c-.157 0-.311.01-.565.027A1 1 0 0 0 11 1.02V10h8.975a1 1 0 0 0 1-.935c.013-.188.028-.374.028-.565A8.51 8.51 0 0 0 12.5 0Z',
itemName: 'Dashboard', badge: '' }) %>
<!-- Inbox -->
<%- include('../../components/_sidebarItem', { link: '#', iconPath: 'm17.418 3.623-.018-.008a6.713 6.713 0 0 0-2.4-.569V2h1a1 1 0 1 0 0-2h-2a1 1 0 0 0-1 1v2H9.89A6.977 6.977 0 0 1 12 8v5h-2V8A5 5 0 1 0 0 8v6a1 1 0 0 0 1 1h8v4a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-4h6a1 1 0 0 0 1-1V8a5 5 0 0 0-2.582-4.377ZM6 12H4a1 1 0 0 1 0-2h2a1 1 0 0 1 0 2Z',
<%- include('../../components/_sidebarItem', { link: '/admin/inbox', iconPath: 'm17.418 3.623-.018-.008a6.713 6.713 0 0 0-2.4-.569V2h1a1 1 0 1 0 0-2h-2a1 1 0 0 0-1 1v2H9.89A6.977 6.977 0 0 1 12 8v5h-2V8A5 5 0 1 0 0 8v6a1 1 0 0 0 1 1h8v4a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-4h6a1 1 0 0 0 1-1V8a5 5 0 0 0-2.582-4.377ZM6 12H4a1 1 0 0 1 0-2h2a1 1 0 0 1 0 2Z',
itemName: 'Inbox', badge: '1' }) %>
<!-- Archived -->
<%- include('../../components/_sidebarItem', { link: '#', iconPath: 'm17.418 3.623-.018-.008a6.713 6.713 0 0 0-2.4-.569V2h1a1 1 0 1 0 0-2h-2a1 1 0 0 0-1 1v2H9.89A6.977 6.977 0 0 1 12 8v5h-2V8A5 5 0 1 0 0 8v6a1 1 0 0 0 1 1h8v4a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-4h6a1 1 0 0 0 1-1V8a5 5 0 0 0-2.582-4.377ZM6 12H4a1 1 0 0 1 0-2h2a1 1 0 0 1 0 2Z',
<%- include('../../components/_sidebarItem', { link: '/admin/inbox', iconPath: 'm17.418 3.623-.018-.008a6.713 6.713 0 0 0-2.4-.569V2h1a1 1 0 1 0 0-2h-2a1 1 0 0 0-1 1v2H9.89A6.977 6.977 0 0 1 12 8v5h-2V8A5 5 0 1 0 0 8v6a1 1 0 0 0 1 1h8v4a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-4h6a1 1 0 0 0 1-1V8a5 5 0 0 0-2.582-4.377ZM6 12H4a1 1 0 0 1 0-2h2a1 1 0 0 1 0 2Z',
itemName: 'Archived', badge: '' }) %>
</ul>
</div>
Expand Down
10 changes: 5 additions & 5 deletions views/pages/admin/inbox.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@

<aside id="cta-button-sidebar" class="fixed top-0 left-0 z-40 w-64 h-screen transition-transform -translate-x-full sm:translate-x-0" aria-label="Sidebar">
<div class="h-full px-3 py-4 overflow-y-auto bg-gray-50 dark:bg-gray-800">
<ul class="space-y-2 font-medium">
<ul class="space-y-2 font-medium">

<!-- Dashbord -->
<%- include('../../components/_sidebarItem', { link: '#', iconPath: 'M12.5 0c-.157 0-.311.01-.565.027A1 1 0 0 0 11 1.02V10h8.975a1 1 0 0 0 1-.935c.013-.188.028-.374.028-.565A8.51 8.51 0 0 0 12.5 0Z',
<%- include('../../components/_sidebarItem', { link: '/admin/inbox', iconPath: 'M12.5 0c-.157 0-.311.01-.565.027A1 1 0 0 0 11 1.02V10h8.975a1 1 0 0 0 1-.935c.013-.188.028-.374.028-.565A8.51 8.51 0 0 0 12.5 0Z',
itemName: 'Dashboard', badge: '' }) %>
<!-- Inbox -->
<%- include('../../components/_sidebarItem', { link: '#', iconPath: 'm17.418 3.623-.018-.008a6.713 6.713 0 0 0-2.4-.569V2h1a1 1 0 1 0 0-2h-2a1 1 0 0 0-1 1v2H9.89A6.977 6.977 0 0 1 12 8v5h-2V8A5 5 0 1 0 0 8v6a1 1 0 0 0 1 1h8v4a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-4h6a1 1 0 0 0 1-1V8a5 5 0 0 0-2.582-4.377ZM6 12H4a1 1 0 0 1 0-2h2a1 1 0 0 1 0 2Z',
<%- include('../../components/_sidebarItem', { link: '/admin/inbox', iconPath: 'm17.418 3.623-.018-.008a6.713 6.713 0 0 0-2.4-.569V2h1a1 1 0 1 0 0-2h-2a1 1 0 0 0-1 1v2H9.89A6.977 6.977 0 0 1 12 8v5h-2V8A5 5 0 1 0 0 8v6a1 1 0 0 0 1 1h8v4a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-4h6a1 1 0 0 0 1-1V8a5 5 0 0 0-2.582-4.377ZM6 12H4a1 1 0 0 1 0-2h2a1 1 0 0 1 0 2Z',
itemName: 'Inbox', badge: '1' }) %>
<!-- Archived -->
<%- include('../../components/_sidebarItem', { link: '#', iconPath: 'm17.418 3.623-.018-.008a6.713 6.713 0 0 0-2.4-.569V2h1a1 1 0 1 0 0-2h-2a1 1 0 0 0-1 1v2H9.89A6.977 6.977 0 0 1 12 8v5h-2V8A5 5 0 1 0 0 8v6a1 1 0 0 0 1 1h8v4a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-4h6a1 1 0 0 0 1-1V8a5 5 0 0 0-2.582-4.377ZM6 12H4a1 1 0 0 1 0-2h2a1 1 0 0 1 0 2Z',
<%- include('../../components/_sidebarItem', { link: '/admin/archived', iconPath: 'm17.418 3.623-.018-.008a6.713 6.713 0 0 0-2.4-.569V2h1a1 1 0 1 0 0-2h-2a1 1 0 0 0-1 1v2H9.89A6.977 6.977 0 0 1 12 8v5h-2V8A5 5 0 1 0 0 8v6a1 1 0 0 0 1 1h8v4a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-4h6a1 1 0 0 0 1-1V8a5 5 0 0 0-2.582-4.377ZM6 12H4a1 1 0 0 1 0-2h2a1 1 0 0 1 0 2Z',
itemName: 'Archived', badge: '' }) %>
</ul>
</div>
Expand All @@ -40,7 +40,7 @@
<p class="text-black text-xl mt-8">New Customers (Unreads)</p>

<% result.forEach(function(item) { %>
<%- include('../../components/customercard.ejs', { "phone": item.phone, "email": item.email, "date": item.date, "msg":item.msg, "label": "archive"}) %>
<%- include('../../components/customercard.ejs', { "phone": item.phone, "email": item.email, "date": item.date, "msg":item.msg, "label": "archived"}) %>
<% }); %>

</div>
Expand Down

0 comments on commit e964aed

Please sign in to comment.