<ion-header>
  <ion-toolbar mode="ios" class="sant">
    <ion-buttons slot="start">
      <ion-back-button mode="md"></ion-back-button>
    </ion-buttons>
    <ion-title class="back-btn">Chaturmas information</ion-title>
  </ion-toolbar>
</ion-header>
<ion-content class="sant">
  <div class="bottom-bg-location">
    <h3 *ngIf="noDataFlag && chaturmasList?.length === 0" class="ion-text-center">
      <img src="/assets/images/welcome-sant.svg">
      <p>No Chaturmas details found. If you know, please add and admin will verify.</p>
    </h3>
    <ion-card *ngFor="let chaturmas of chaturmasList;let i = index">
      <ion-card-header>
        <ion-card-title>
          <ion-icon name="calendar"></ion-icon>
          <div>
            <h5>{{chaturmas.chaturmas_info.year}}</h5>
            <p *ngIf="!chaturmas.is_approved" class="in-review">In Review</p>
          </div>
        </ion-card-title>
        <ion-card-title *ngIf="chaturmas?.place" (click)="address(chaturmas)">
          <ion-icon name="location"></ion-icon>
          <div>
            <h5>{{ chaturmas.place }}</h5>
            <p>{{ chaturmas.place }}</p>
          </div>
        </ion-card-title>
        <ion-card-title *ngIf="chaturmas?.sangh_id" (click)="goToSanghProfile(chaturmas.sangh_id)">
          <img src="/assets/images/sangh-fill-icon.svg">
          <div>
            <h5>{{ chaturmas?.sangh?.name }}</h5>
            <p>{{ chaturmas?.sangh?.address }}</p>
          </div>
        </ion-card-title>
      </ion-card-header>
      <ion-card-content>
        <div>
          <p>Added by: <span>{{ chaturmas?.created_by ? chaturmas?.created_by?.name : 'Global Jain Member' }}</span></p>
          <p>{{ chaturmas?.created_ago}}</p>
        </div>
        <div *ngIf="chaturmas.updated_by">
          <p>Edit by: <span>{{ chaturmas?.updated_by?.name }}</span></p>
          <p>{{ chaturmas?.updated_ago}}</p>
        </div>
      </ion-card-content>
      <p (click)="chaturmasReport(chaturmas.id)">Chaturmas incorrect ? Please write to us <span>Here</span></p>
      <p *ngIf="chaturmas.is_approved"><span>(Approved)</span></p>
    </ion-card>
    <ion-infinite-scroll threshold="250px" (ionInfinite)="loadData($event)" *ngIf="pageNumber <= totalPage">
      <ion-infinite-scroll-content loadingSpinner="bubbles" loadingText="Loading more data...">
      </ion-infinite-scroll-content>
    </ion-infinite-scroll>
  </div>
  <ion-fab horizontal="end" vertical="bottom" slot="fixed">
    <ion-fab-button (click)="addChaturmas()">
      <ion-icon name="add"></ion-icon>
    </ion-fab-button>
  </ion-fab>
</ion-content>