You are here

add.component.html in Opigno group manager 8

File

ng/src/app/activities/add/add.component.html
View source
<div class="activity-add lateral-panel" [class.add]="!entityForm" [class.create]="entityForm">
  <div class="info d-flex">
    <div class="flex-1 text-uppercase">
      <div>
        <h2 *ngIf="step==1">1/2 <span>{{ text_choose_an_activity_type }}</span></h2>
        <h2 *ngIf="step==2">2/2 <span>{{ text_choose_an_activity }}</span></h2>
      </div>
    </div>
    <button mat-icon-button color="basic" class="close" (click)="close()">
      <mat-icon class="mat-24" aria-label="Close">close</mat-icon>
    </button>
  </div>
  <div [hidden]="entityForm" class="mt-4">
    <div class="step-1" *ngIf="step==1">
      <div class="activity-types">
        <div class="bg-faded mb-2" *ngFor="let type of types; index as i">
          <div class="d-flex" *ngIf="!type.help">
            <button class="type-name flex-1 text-left" (click)="form.type=i;updateAvailableEntities($event);step=2">
              {{type.name}}
            </button>
            <button class="type-help-open" (click)="type.help=1"><i class="icon-help-circle"></i>{{ text_help }}</button>
          </div>
          <div *ngIf="type.help">
            <div class="d-flex">
              <div class="type-name btn flex-1 text-left">{{type.name}}</div>
              <button class="type-help-close" (click)="type.help=0"><i class="icon-close"></i>{{ text_close }}</button>
            </div>
            <div class="type-info" [innerHtml]="type.description"></div>
            <button class="type-add w-100 btn btn-success text-uppercase" (click)="form.type=i;updateAvailableEntities($event);step=2">
              {{ text_add_activity }}
            </button>
          </div>
        </div>
      </div>
    </div>

    <div class="step-2" *ngIf="(form.type || form.type===0) && step == 2">
      <div>
        <button (click)="getAddForm()"><i class="icon-document-new"></i>{{ text_create_a_new_activity }}</button>
      </div>
      <div class="mt-3">{{ text_or_add_from_existing_catalogue }}</div>
      <input type="text" placeholder="{{ text_search_for_an_activity }}"
             [(ngModel)]="filterEntity"
             (paste)="updateResults()"
             (keyup)="updateResults()">

      <mat-radio-group class="w-100 d-flex flex-column" [(ngModel)]="form.existingEntity">
        <mat-radio-button *ngFor="let result of results" [value]="result" (click)="addActivityToModule(result)">
          {{result.entity.name}}
        </mat-radio-button>
      </mat-radio-group>
    </div>

    <div class="step-pager mt-4 text-center">
      <button type="button" (click)="step=1" [class.active]="step==1">1</button>
      <button type="button" (click)="step=2" [class.active]="step==2" [disabled]="!form.type&&form.type!==0">2</button>
    </div>
  </div>
  <iframe *ngIf="entityForm" width="100%" height="100%" [src]="entityForm"></iframe>
</div>