Ignore:
Timestamp:
11/16/20 03:55:10 (4 years ago)
Author:
DimitarSlezenkovski <dslezenkovski@…>
Branches:
master
Children:
db484c9
Parents:
8b13eb2
Message:

Fix bugs, add some more.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Farmatiko/ClientApp/src/app/dashboard/dashboard.component.html

    r8b13eb2 r8e74e2f  
    1313          <ul class="navbar-nav flex-grow">
    1414            <li>Logged as <p *ngIf="head">{{head.Name}}</p> </li>
    15             <li (click)="logout()" class="btn btn-link"><a>Logout</a></li>
    1615          </ul>
    1716        </div>
     
    2019        <mat-menu #menu="matMenu">
    2120          <button mat-menu-item [routerLink]="['/']"><mat-icon>directions</mat-icon>Почетна</button>
     21          <button mat-menu-item (click)="logout()"><mat-icon>exit_to_app</mat-icon>Одјави се</button>
    2222        </mat-menu>
    2323      </div>
     
    2525</header>
    2626
    27 <mat-tab-group mat-stretch-tabs>
     27<mat-tab-group dynamicHeight mat-stretch-tabs>
    2828  <mat-tab class="tab" label="Мои аптеки">
    2929  <div class="wrapper">
     
    8888    <div class="header">
    8989    <h2>Достапни лекови</h2>
    90     <mat-form-field>
     90    <div class="btns">
     91      <button mat-raised-button color="primary" (click)="saveDeletedMedicines()" [disabled]="editedMedicine==false">Зачувај ги промените</button>
     92      <button mat-raised-button color="accent" aria-label="Add medicine" (click)="addMedicine()">Додај нов лек</button>
     93      <button mat-raised-button color="accent" aria-label="Add medicine" (click)="addMedicinesFromList()">Додај постоечки лекови</button>
     94    </div><br/>
     95    <mat-slide-toggle (click)="switchEditMedicineMode()">Edit mode</mat-slide-toggle>
     96   
     97    <mat-form-field *ngIf="!medicinesEditMode">
    9198      <input matInput (keyup)="applyFilterMedicines($event.target.value)" placeholder="Пронајди лек">
    9299    </mat-form-field>
    93       </div>
     100    </div>
    94101      <table class='table table-striped table-bordered table-sm' cellspacing="0" width="100%" aria-labelledby="tableLabel" *ngIf="head">
    95102        <thead>
     
    102109            <th>Цена</th>
    103110            <th>Пакување</th>
     111            <th>Контроли</th>
    104112          </tr>
    105113        </thead>
    106114        <tbody>
    107           <tr *ngFor="let medicine of head.PharmacyMedicines">
    108             <td><a (click)="openMedicineDialog(medicine)">{{ medicine.name }}</a></td>
    109             <td>{{ medicine.strength }}</td>
    110             <td>{{ medicine.form }}</td>
    111             <td>{{ medicine.wayOfIssuing }}</td>
    112             <td>{{ medicine.manufacturer }}</td>
    113             <td>{{ medicine.price }}</td>
    114             <td>{{ medicine.packaging }}</td>
    115             <td><a (click)="deleteMedicine(medicine)">Delete</a></td>
     115          <tr *ngFor="let medicine of filteredMedicines">
     116            <td *ngIf="!medicinesEditMode"><a (click)="openMedicineDialog(medicine)">{{ medicine.name }}</a></td>
     117            <td *ngIf="medicinesEditMode"><mat-form-field appearance="fill"><input matInput [(ngModel)]="medicine.name" name="medname"></mat-form-field></td>
     118            <td *ngIf="!medicinesEditMode">{{ medicine.strength }}</td>
     119            <td *ngIf="medicinesEditMode"><mat-form-field appearance="fill"><input matInput [(ngModel)]="medicine.strength" name="medstr"></mat-form-field></td>
     120            <td *ngIf="!medicinesEditMode">{{ medicine.form }}</td>
     121            <td *ngIf="medicinesEditMode"><mat-form-field appearance="fill"><input matInput [(ngModel)]="medicine.form" name="medform"></mat-form-field></td>
     122            <td *ngIf="!medicinesEditMode">{{ medicine.wayOfIssuing }}</td>
     123            <td *ngIf="medicinesEditMode"><mat-form-field appearance="fill"><input matInput [(ngModel)]="medicine.wayOfIssuing" name="medwayOfIssuing"></mat-form-field></td>
     124            <td *ngIf="!medicinesEditMode">{{ medicine.manufacturer }}</td>
     125            <td *ngIf="medicinesEditMode"><mat-form-field appearance="fill"><input matInput [(ngModel)]="medicine.manufacturer" name="medmanufacturer"></mat-form-field></td>
     126            <td *ngIf="!medicinesEditMode">{{ medicine.price }}</td>
     127            <td *ngIf="medicinesEditMode"><mat-form-field appearance="fill"><input matInput [(ngModel)]="medicine.price" name="medprice"></mat-form-field></td>
     128            <td *ngIf="!medicinesEditMode">{{ medicine.packaging }}</td>
     129            <td *ngIf="medicinesEditMode"><mat-form-field appearance="fill"><input matInput [(ngModel)]="medicine.packaging" name="medpackaging"></mat-form-field></td>
     130            <td>
     131              <button mat-mini-fab color="warn" aria-label="Delete medicine" (click)="deleteMedicine(medicine)">
     132                <mat-icon>delete</mat-icon>
     133              </button>
     134            </td>
    116135          </tr>
    117136      </tbody>
Note: See TracChangeset for help on using the changeset viewer.