diff --git a/apps/commudle-admin/src/app/feature-modules/community-control-panel/community-control-panel-routing.module.ts b/apps/commudle-admin/src/app/feature-modules/community-control-panel/community-control-panel-routing.module.ts index 861f5c68d7..9dae6205b9 100644 --- a/apps/commudle-admin/src/app/feature-modules/community-control-panel/community-control-panel-routing.module.ts +++ b/apps/commudle-admin/src/app/feature-modules/community-control-panel/community-control-panel-routing.module.ts @@ -50,17 +50,11 @@ const routes = [ }, { path: 'forms', - component: CommunityFormsAndSurveysComponent, - children: [ - { - path: '', - component: CommunityFormsListComponent, - }, - { - path: 'surveys', - component: CommunitySurveysComponent, - }, - ], + component: CommunityFormsListComponent, + }, + { + path: 'surveys', + component: CommunitySurveysComponent, }, { path: 'edit', diff --git a/apps/commudle-admin/src/app/feature-modules/community-control-panel/community-control-panel.module.ts b/apps/commudle-admin/src/app/feature-modules/community-control-panel/community-control-panel.module.ts index 265e2ccc5c..0a5b1db2f1 100644 --- a/apps/commudle-admin/src/app/feature-modules/community-control-panel/community-control-panel.module.ts +++ b/apps/commudle-admin/src/app/feature-modules/community-control-panel/community-control-panel.module.ts @@ -58,6 +58,7 @@ import { CommunityChannelsModule } from 'apps/commudle-admin/src/app/feature-mod import { AdminCommunityHackathonComponent } from './components/admin-community-hackathon/admin-community-hackathon.component'; import { CommunityPaymentLogsComponent } from 'apps/commudle-admin/src/app/feature-modules/community-control-panel/components/community-payments/community-payment-logs/community-payment-logs.component'; import { CommunityBankDetailsComponent } from 'apps/commudle-admin/src/app/feature-modules/community-control-panel/components/community-payments/community-bank-details/community-bank-details.component'; +import { SidebarComponent } from 'apps/shared-components/sidebar/sidebar.component'; @NgModule({ declarations: [ @@ -103,6 +104,9 @@ import { CommunityBankDetailsComponent } from 'apps/commudle-admin/src/app/featu AppSharedComponentsModule, CommunityChannelsModule, + //standalone + SidebarComponent, + // Nebular NbCardModule, NbInputModule, diff --git a/apps/commudle-admin/src/app/feature-modules/community-control-panel/components/admin-community-hackathon/admin-community-hackathon.component.scss b/apps/commudle-admin/src/app/feature-modules/community-control-panel/components/admin-community-hackathon/admin-community-hackathon.component.scss index ad65ef93a7..ba8bd2d48c 100644 --- a/apps/commudle-admin/src/app/feature-modules/community-control-panel/components/admin-community-hackathon/admin-community-hackathon.component.scss +++ b/apps/commudle-admin/src/app/feature-modules/community-control-panel/components/admin-community-hackathon/admin-community-hackathon.component.scss @@ -1,3 +1,3 @@ .hackathons { - @apply com-m-4; + @apply com-m-6; } diff --git a/apps/commudle-admin/src/app/feature-modules/community-control-panel/components/community-control-panel/community-control-panel.component.html b/apps/commudle-admin/src/app/feature-modules/community-control-panel/components/community-control-panel/community-control-panel.component.html index 164118a5e4..f262b1556d 100644 --- a/apps/commudle-admin/src/app/feature-modules/community-control-panel/components/community-control-panel/community-control-panel.component.html +++ b/apps/commudle-admin/src/app/feature-modules/community-control-panel/components/community-control-panel/community-control-panel.component.html @@ -1,198 +1,322 @@ -
-
-
- - -
-
- {{ community.name }} -
-

{{ community.name }}

-
+
+
+
+ {{ community.name }} +
+

{{ community.name }}

+
-
-
- - {{ community.members_count }} Members + +
+
+
- - - +
+
+ Content +
+ +
+ +
+ Newsletters +
+ +
+ +
+ Page Builder +
+
+
+ Members +
+ +
+ +
+ Members +
+ +
+
+ Stats & Data +
+ +
+ +
+ Form Data +
+ +
+ +
+ Stats +
+ +
+
+
+
+
Admin
+
+ +
+ +
+ Bank Details +
+ +
+ +
+ Manage Team +
+ +
+ +
+ Community Profile +
+
+ +
+ + -
+ diff --git a/apps/commudle-admin/src/app/feature-modules/community-control-panel/components/community-control-panel/community-control-panel.component.scss b/apps/commudle-admin/src/app/feature-modules/community-control-panel/components/community-control-panel/community-control-panel.component.scss index c710378920..b2c8ce6ff7 100644 --- a/apps/commudle-admin/src/app/feature-modules/community-control-panel/components/community-control-panel/community-control-panel.component.scss +++ b/apps/commudle-admin/src/app/feature-modules/community-control-panel/components/community-control-panel/community-control-panel.component.scss @@ -37,7 +37,7 @@ } } -section { +.header-links { div { @apply com-mb-4; } @@ -96,3 +96,119 @@ section { @apply com-text-gray-400 #{!important}; } } + +.header { + @apply com-bg-white com-px-10 com-pb-4; +} + +.sidebar { + @apply com-sticky com-top-16 com-h-[calc(100vh-70px)]; + + a { + @apply com-text-inherit com-no-underline; + } + .action-buttons { + @apply com-flex com-flex-col com-p-4; + .back-admin, + .sidebar-expand-icon { + .icon { + @apply com-text-Cadet-Grey; + } + .heading { + @apply com-text-xs com-text-Cadet-Grey; + } + } + + .category-heading { + @apply com-text-sm com-font-semibold com-my-2; + } + .divided-line { + @apply com-border com-border-solid com-border-Bright-Gray com-w-full; + } + .action-button { + @apply com-p-1 com-flex com-items-center com-w-full com-cursor-pointer; + &.active { + @apply com-bg-Bright-Gray-Light com-text-tYankees-Blue; + } + .icon { + @apply com-h-8 com-w-8 com-text-Cadet-Grey com-flex com-items-center com-justify-center com-mr-2 com-flex-shrink-0; + + fa-icon, + nb-icon, + img { + @apply com-text-xl com-flex; + } + } + .heading { + @apply com-text-sm com-font-light; + } + &.public-event-page { + @apply com-text-Azure; + .icon { + @apply com-text-Azure; + } + } + &.stats { + @apply com-text-Caribbean-Green; + .icon { + @apply com-text-Caribbean-Green; + } + } + } + + .action-button:hover { + @apply com-bg-Bright-Gray-Light com-text-tYankees-Blue; + } + } +} +a { + @apply com-flex com-items-center; +} +.right-column { + @apply com-w-full com-bg-white com-rounded-lg md:com-mt-4 com-max-w-screen-xl com-mx-auto; +} + +.event-dashboard-menu { + @apply com-sticky com-top-16 com-z-10 com-my-4; + nb-card { + @apply com-mx-0; + nb-card-body { + @apply com-p-0; + + div { + @apply com-flex; + .action-button { + @apply com-p-2 com-flex com-gap-2 com-items-center com-text-inherit com-no-underline com-w-max; + &.active { + @apply com-border-0 com-border-b-3 com-border-solid com-border-primary-500; + .heading { + @apply com-text-primary-500; + } + } + .icon { + @apply com-text-lg com-text-Cadet-Grey; + } + .heading { + @apply com-text-base com-font-medium com-w-max; + } + } + } + } + } +} + +.router { + @apply com-max-w-screen-xl com-mx-auto; +} + +.header-icons { + @apply com-flex com-w-full; +} + +.header-icons-non-expanded { + @apply com-mb-4 com-justify-center; +} + +.header-icons-expanded { + @apply com-justify-between; +} diff --git a/apps/commudle-admin/src/app/feature-modules/community-control-panel/components/community-control-panel/community-control-panel.component.ts b/apps/commudle-admin/src/app/feature-modules/community-control-panel/components/community-control-panel/community-control-panel.component.ts index b93647993e..22ebdd4b09 100644 --- a/apps/commudle-admin/src/app/feature-modules/community-control-panel/components/community-control-panel/community-control-panel.component.ts +++ b/apps/commudle-admin/src/app/feature-modules/community-control-panel/components/community-control-panel/community-control-panel.component.ts @@ -7,13 +7,15 @@ import { ICommunity } from 'apps/shared-models/community.model'; import { EemailTypes } from 'apps/shared-models/enums/email_types.enum'; import { SeoService } from 'apps/shared-services/seo.service'; import { Subscription } from 'rxjs'; -import { faScroll } from '@fortawesome/free-solid-svg-icons'; +import { faBars, faScroll } from '@fortawesome/free-solid-svg-icons'; import { NotificationsStore } from 'apps/commudle-admin/src/app/feature-modules/notifications/store/notifications.store'; import { GoogleTagManagerService } from 'apps/commudle-admin/src/app/services/google-tag-manager.service'; import { ENotificationSenderTypes } from 'apps/shared-models/enums/notification_sender_types.enum'; import { faBuildingColumns, faFileLines, faNewspaper, faMessage } from '@fortawesome/free-solid-svg-icons'; import { environment } from '@commudle/shared-environments'; import { DarkModeService } from 'apps/commudle-admin/src/app/services/dark-mode.service'; +import { SidebarService } from 'apps/shared-components/sidebar/service/sidebar.service'; +import { ESidebarWidth } from 'apps/shared-components/sidebar/enum/sidebar.enum'; @Component({ selector: 'app-community-control-panel', @@ -35,10 +37,14 @@ export class CommunityControlPanelComponent implements OnInit, OnDestroy { faFileLines, faNewspaper, faMessage, + faBars, }; environment = environment; darkMode: boolean; isHackathonActive = false; + sidebarExpanded = true; + ESidebarWidth = ESidebarWidth; + sidebarEventName = 'community'; constructor( private communitiesService: CommunitiesService, @@ -49,6 +55,7 @@ export class CommunityControlPanelComponent implements OnInit, OnDestroy { private gtm: GoogleTagManagerService, private darkModeService: DarkModeService, private router: Router, + public sidebarService: SidebarService, ) {} ngOnInit() { @@ -63,6 +70,14 @@ export class CommunityControlPanelComponent implements OnInit, OnDestroy { this.isHackathonActive = this.router.url.toString().includes('/hackathons'); } }); + this.sidebarService.setSidebarVisibility(this.sidebarEventName, true); + + // eslint-disable-next-line no-prototype-builtins + if (this.sidebarService.setSidebar$.hasOwnProperty(this.sidebarEventName)) { + this.sidebarService.setSidebar$[this.sidebarEventName].subscribe((data) => { + this.sidebarExpanded = data; + }); + } } ngOnDestroy() { @@ -70,6 +85,10 @@ export class CommunityControlPanelComponent implements OnInit, OnDestroy { this.subscriptions.forEach((subscription) => subscription.unsubscribe()); } + toggleSidebar() { + this.sidebarService.toggleSidebarVisibility(this.sidebarEventName); + } + setCommunity() { this.activatedRoute.params.subscribe(() => { const communityId = this.activatedRoute.snapshot.params['community_id']; diff --git a/apps/commudle-admin/src/app/feature-modules/community-control-panel/components/community-forms-and-surveys/community-forms-and-surveys.component.html b/apps/commudle-admin/src/app/feature-modules/community-control-panel/components/community-forms-and-surveys/community-forms-and-surveys.component.html index 04f5e9a812..372249430f 100644 --- a/apps/commudle-admin/src/app/feature-modules/community-control-panel/components/community-forms-and-surveys/community-forms-and-surveys.component.html +++ b/apps/commudle-admin/src/app/feature-modules/community-control-panel/components/community-forms-and-surveys/community-forms-and-surveys.component.html @@ -1,3 +1,4 @@ +
diff --git a/apps/commudle-admin/src/app/feature-modules/community-control-panel/components/community-forms-and-surveys/community-forms-and-surveys.component.ts b/apps/commudle-admin/src/app/feature-modules/community-control-panel/components/community-forms-and-surveys/community-forms-and-surveys.component.ts index f523fc51c6..bfbed5244d 100644 --- a/apps/commudle-admin/src/app/feature-modules/community-control-panel/components/community-forms-and-surveys/community-forms-and-surveys.component.ts +++ b/apps/commudle-admin/src/app/feature-modules/community-control-panel/components/community-forms-and-surveys/community-forms-and-surveys.component.ts @@ -1,3 +1,5 @@ +// DEPRECATED + import { Component, OnInit } from '@angular/core'; import { NbRouteTab } from '@commudle/theme'; diff --git a/apps/commudle-admin/src/app/feature-modules/community-control-panel/components/community-forms-and-surveys/community-forms-list/community-forms-list.component.scss b/apps/commudle-admin/src/app/feature-modules/community-control-panel/components/community-forms-and-surveys/community-forms-list/community-forms-list.component.scss index 0c9f5d5ba4..015e5ec148 100644 --- a/apps/commudle-admin/src/app/feature-modules/community-control-panel/components/community-forms-and-surveys/community-forms-list/community-forms-list.component.scss +++ b/apps/commudle-admin/src/app/feature-modules/community-control-panel/components/community-forms-and-surveys/community-forms-list/community-forms-list.component.scss @@ -5,5 +5,5 @@ } .forms-list { - @apply md:com-px-0 com-py-6 com-px-4; + @apply md:com-p-6 com-py-6 com-px-4; } diff --git a/apps/commudle-admin/src/app/feature-modules/community-control-panel/components/community-forms-and-surveys/community-forms-list/community-forms-list.component.ts b/apps/commudle-admin/src/app/feature-modules/community-control-panel/components/community-forms-and-surveys/community-forms-list/community-forms-list.component.ts index 5a5df5e1c9..3bce7e670e 100644 --- a/apps/commudle-admin/src/app/feature-modules/community-control-panel/components/community-forms-and-surveys/community-forms-list/community-forms-list.component.ts +++ b/apps/commudle-admin/src/app/feature-modules/community-control-panel/components/community-forms-and-surveys/community-forms-list/community-forms-list.component.ts @@ -54,7 +54,7 @@ export class CommunityFormsListComponent implements OnInit { constructor(private dataFormsService: DataFormsService, private activatedRoute: ActivatedRoute) {} ngOnInit() { - this.newFormParentId = this.activatedRoute.parent.parent.snapshot.params.community_id; + this.newFormParentId = this.activatedRoute.parent.snapshot.params.community_id; if (this.newFormParentId) { this.getDataForms(); } diff --git a/apps/commudle-admin/src/app/feature-modules/community-control-panel/components/community-forms-and-surveys/community-surveys/community-surveys.component.html b/apps/commudle-admin/src/app/feature-modules/community-control-panel/components/community-forms-and-surveys/community-surveys/community-surveys.component.html index 3d7a5fc917..dc59cfac02 100644 --- a/apps/commudle-admin/src/app/feature-modules/community-control-panel/components/community-forms-and-surveys/community-surveys/community-surveys.component.html +++ b/apps/commudle-admin/src/app/feature-modules/community-control-panel/components/community-forms-and-surveys/community-surveys/community-surveys.component.html @@ -1 +1,3 @@ - +
+ +
diff --git a/apps/commudle-admin/src/app/feature-modules/community-control-panel/components/community-forms-and-surveys/community-surveys/community-surveys.component.scss b/apps/commudle-admin/src/app/feature-modules/community-control-panel/components/community-forms-and-surveys/community-surveys/community-surveys.component.scss index e69de29bb2..ea6162631c 100644 --- a/apps/commudle-admin/src/app/feature-modules/community-control-panel/components/community-forms-and-surveys/community-surveys/community-surveys.component.scss +++ b/apps/commudle-admin/src/app/feature-modules/community-control-panel/components/community-forms-and-surveys/community-surveys/community-surveys.component.scss @@ -0,0 +1,3 @@ +.commudle-surveys { + @apply com-p-6; +} diff --git a/apps/commudle-admin/src/app/feature-modules/community-control-panel/components/community-forms-and-surveys/community-surveys/community-surveys.component.ts b/apps/commudle-admin/src/app/feature-modules/community-control-panel/components/community-forms-and-surveys/community-surveys/community-surveys.component.ts index 628af9f26b..4ab4633a74 100644 --- a/apps/commudle-admin/src/app/feature-modules/community-control-panel/components/community-forms-and-surveys/community-surveys/community-surveys.component.ts +++ b/apps/commudle-admin/src/app/feature-modules/community-control-panel/components/community-forms-and-surveys/community-surveys/community-surveys.component.ts @@ -12,6 +12,6 @@ export class CommunitySurveysComponent implements OnInit { constructor(private activatedRoute: ActivatedRoute) {} ngOnInit(): void { - this.parentId = this.activatedRoute.parent.parent.snapshot.params.community_id; + this.parentId = this.activatedRoute.parent.snapshot.params.community_id; } }