<div class="container">

    <div class="row">
      <div class="col-12">
        <ul class="list-unstyled titileLi-w">
          <li class="headingText-w">خدمه إداره المحتوي </li>
          <li class="headingText-w activeLi-w" style="margin-right:5px"> شريط الأحداث والتفاعلات الداخليه</li>
        </ul>
      </div>
    </div>

    <div class="containerContent-w">

    <div class="row">
      <div class="col-12 col-sm-12 col-md-6 col-lg-6">
          <button type="button" class="btn btn-outline-success butttonCreate dashButton-w" (click)="onAdd()" *ngIf="authSer.showAddBtn"><i class="fas fa-plus marginFontAowsome-w"></i>إنشاء جديد</button>
          <button type="button" class="btn btn-outline-danger butttonDelete dashButton-w" (click)="onDelete()" *ngIf="authSer.showDeleteBtn"><i class="fas fa-times marginFontAowsome-w"></i>حذف</button>
      </div>
      <div class="col-12 col-sm-12 col-md-6 col-lg-6">
        <div class="form-group">
          <input type="text" placeholder="البحث" class="form-control inputSearchTable-w" style="margin-top:13px;" (input)="filtterFunc($event)"/>
          <hr>
        </div>
      </div>
    </div>

    <div class="row">
        <div class="col-12 col-sm-12 col-md-12 col-lg-6">
          <div class="form-group">
            <span class="spanSelect-w">
              <select [ngModel]="dataTableNumber" class="form-control selectButton-w" (input)="onGetValue($event)">
                <option value="5">5</option>
                <option value="10">10</option>
                <option value="15">15</option>
                <option value="20">20</option>
              </select>
              من العناصر يتم عرضها
            </span>
          </div>
        </div>
        <div class="col-12 col-sm-12 col-md-12 col-lg-6">

        </div>
    </div>

    <table class="table table-bordered">
      <thead class="headBackground-w">
        <tr>
          <th>
            <div class="custom-control custom-checkbox">
                <input type="checkbox" class="custom-control-input" [(ngModel)]="selectedAll" (change)="selectAll();" id="customCheck" name="example1">
                <!-- <label class="custom-control-label fixedWidthLabel-w checkAll-w" for="customCheck" style="margin-bottom:20px; cursor: pointer;"></label> -->
            </div>
          </th>
          <th>عنوان الحدث</th>
          <th>الحاله</th>
          <th>الترتيب</th>
          <th>تاريخ الإنشاء</th>
          <th>الناشر</th>
          <th> موقع العرض</th>
          <th *ngIf="authSer.showEditBtn">تعديل</th>
        </tr>
      </thead>
      <tbody>
        <tr *ngFor="let lecture of lecturesList | paginate: { itemsPerPage: perPagePagenation, currentPage: currentPage, totalItems: count }; let i = index ">
          <td>
            <div class="custom-control custom-checkbox centerIneerItem">
              <input type="checkbox" class="custom-control-input" id="{{lecture.id}}" [(ngModel)]="lecture.selected" [value]='lecture' (change)="checkIfAllSelected();">
              <!-- <label class="custom-control-label disblayBlock-w" for="{{lecture.id}}" style="color:#2a2a2a;cursor: pointer;"></label> -->
            </div>
          </td>
          <td>{{lecture.name}}</td>
          <td>{{lecture.status == '0' ? 'مسوده' : lecture.status == '1' ? 'نشر' : 'not found'}}</td>
          <td>
            {{lecture.ranking == '10000' ? 'المزيد' : lecture.ranking }}
          </td>
          <td>{{lecture.created_at}}</td>
          <td>{{lecture.created_by_name}}</td>
          <td>{{lecture.display_location == 'both' ? 'كلاهما' : lecture.display_location == 'internal' ? 'الصفحه الداخليه' : lecture.display_location == 'external' ? 'الصفحه الخارجيه' : 'غير موجود'}}</td>
          <td *ngIf="authSer.showEditBtn"><button type="button" class="btn btn-outline-secondary" (click)="onEdit(lecture.id)"><i class="fas fa-edit"></i></button></td>
        </tr>
      </tbody>
    </table>
    <pagination-controls nextLabel="التالي" previousLabel="السابق" (pageChange)="onPageChange($event)"></pagination-controls>
  </div>
  </div>
