Hima 5 rokov pred
rodič
commit
5e122fa0f1

+ 3 - 3
src/app/External-Page/external-page-content/external-page-content.component.html

@@ -12,7 +12,7 @@
                     </ul>
                     <div class="carousel-inner">
                         <div class="carousel-item" *ngFor="let report of reports; let i = index" [ngClass]="i == 0 ? 'active' : ''">
-                          <img src="{{authSer.pathImg + report['photo'].photo}}" />
+                          <img src="{{ report.photo ? authSer.pathImg + report.photo.photo : '' }}" />
                           <div class="carousel-caption d-md-block">
                               <h5>{{report.title}}</h5>
                               <p [innerHtml] = "report.description"></p>
@@ -28,7 +28,7 @@
               <div class="col-12">
                 <div class="eventPart-w">
                   <div id="demo1" class="carousel slide" data-ride="carousel">
-                      <div class="carousel-inner">
+                      <div class="carousel-inner"> 
                           <div class="carousel-item" *ngFor="let event of events; let i = index" [ngClass]="i == 0 ? 'active' : ''">
                               <div class="carousel-caption">
                                   <p><img src="../../../assets/image/eventX.png" /> <span> حدث :</span> {{event.name}}</p>
@@ -232,7 +232,7 @@
                       </ul>
                       <div class="carousel-inner">
                           <div class="carousel-item" *ngFor="let report of reports; let i = index" [ngClass]="i == 0 ? 'active' : ''">
-                            <img src="{{authSer.pathImg + report['photo'].photo}}" />
+                            <img src="{{ report.photo ? authSer.pathImg + report.photo.photo : '' }}" />
                             <div class="carousel-caption d-none d-md-block">
                                 <h5>{{report.title_en}}</h5>
                                 <p [innerHtml] = "report.description_en"></p>

+ 1 - 0
src/app/External-Page/external-page-content/external-page-content.component.ts

@@ -76,6 +76,7 @@ export class ExternalPageContentComponent implements OnInit, OnDestroy {
       (responce) => {
         console.log(responce);
         this.reports = responce['data'].reports;
+        console.log(this.reports);
         for(let i = 0; i < this.reports.length; i++) {
           if(this.reports[i].description.length > 100) {
             this.reports[i].description = this.reports[i].description.substring(0,300) + '.......';

+ 4 - 4
src/app/Internal-Page/internal-page-content/internal-page-content.component.html

@@ -2,7 +2,7 @@
     <div class="container">
         <div class="contentPage-w">
             <div class="advertisiment">
-                <img src="{{ authSer.pathImg + advertisiment.photo }}" />
+                <img *ngIf="advertisiment.photo" src="{{ advertisiment.photo ? authSer.pathImg + advertisiment.photo : ''}}" />
             </div>
 
             <div class="servicesContent-w">
@@ -13,7 +13,7 @@
                                 <div class="col-lg-6 col-md-12 col-sm-4 col-xs-12 editRowPadding-w" *ngFor="let service of externalServices">
                                     <a class="hyperLink" (click)="onGetService(service)">
                                         <div class="serviceItem-w">
-                                            <img src="{{authSer.pathImg + service.photo}}" title="TITLE NEED SHOW ON HOVER"/>
+                                            <img src="{{service.photo ? authSer.pathImg + service.photo : ''}}" title="TITLE NEED SHOW ON HOVER"/>
                                             <p>{{service.name}}</p>
                                         </div>
                                     </a>
@@ -26,7 +26,7 @@
                                 <div *ngIf="reportsData.length > 1"> 
                                     <ngb-carousel #myCarousel="ngbCarousel">
                                         <ng-template ngbSlide *ngFor="let report of reportsData; let i = index" id={{i}} >
-                                            <img [src]="authSer.pathImg + report.photo.photo" alt="Random first slide">
+                                            <img [src]="report.photo ? authSer.pathImg + report.photo.photo : ''" alt="Random first slide">
                                             <div class="carousel-caption">
                                             <h4>{{report.title}}</h4>
                                             <p class="paragraphTemplate-w" [innerHTML] = "report.description"> </p>
@@ -272,7 +272,7 @@
                 <div class="slider" *ngIf="reportsData.length > 1">
                 <ngb-carousel>
                     <ng-template *ngFor="let report of reportsData" ngbSlide>
-                    <img src="{{authSer.pathImg + report.photo.photo}}" alt="Random first slide">
+                    <img src="{{report.photo ? authSer.pathImg + report.photo.photo : ''}}" alt="Random first slide">
                     <div class="carousel-caption">
                         <h4>{{report.title_en}}</h4>
                         <p class="paragraphTemplate-w" [innerHTML] = "report.description_en"></p>

+ 2 - 0
src/app/dashboard/dasboard-content.html

@@ -1,3 +1,5 @@
+<!-- <app-header></app-header> -->
+
 <div class="routerLinkContainer-w" [style.min-height.px]="screenHeight">
     <router-outlet></router-outlet>
 </div>

+ 4 - 0
src/app/dashboard/dashboard-content.ts

@@ -15,8 +15,10 @@ export class DashboardContent implements OnInit {
   }
 
 
+
   ngOnInit() {
     this.authSer.arabicTemplate = true; //to make footer arabic all time 
+    
   }
 
 
@@ -28,6 +30,8 @@ export class DashboardContent implements OnInit {
         console.log(this.screenHeight);
   }
 
+ 
+
 
 
 }

+ 4 - 3
src/app/dashboard/header/header.component.ts

@@ -25,15 +25,16 @@ export class HeaderComponent implements OnInit {
 
   ngOnInit() {
 
-    this.authSer.showHeaderLogin = true;
-    this.authSer.showHeaderDashBoard = false;
-
+    this.authSer.showHeaderLogin = false;
+    this.authSer.showHeaderDashBoard = true;
+    this.authSer.showDashboardHeader = true;
 
     this.authSer.checkExternalFooter = false;
 
     if(!this.authSer.isAuthenticated()) {
       console.log('user data ', this.authSer.returnUserData());
       this.dataLoginUser = JSON.parse(localStorage.getItem('userData'));
+      console.log('data loginnnnn', this.dataLoginUser);
     }
 
 

+ 4 - 0
src/app/shared/internal-page.service.ts

@@ -10,11 +10,15 @@ export class InternalPageService {
   constructor(private http: HttpClient, public authSer: AuthServiceService) { }
 
 
+
   //get internl page data 
   getInternalPageData() {
+
     if(this.authSer.isAuthenticated()) {
+      console.log(this.authSer.isAuthenticated());
       return this.http.get(this.authSer.pathApi + '/internal_page');
     } else {
+      console.log(this.authSer.isAuthenticated());
       return this.http.get(this.authSer.pathApi + '/internal_page/1');
     }
   }