aboutsummaryrefslogtreecommitdiff
path: root/app/components/plan-list/plan-list.html
blob: 9a75ed9081965d6d5b28acf58c4e77a3a3ee7e16 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<div class="page">
   <div class="hero-container" *ngIf="plans.length === 0">
      Welcome to PEV! Please <a [routerLink]="['/PlanNew']">submit</a> a plan for visualization
   </div>

  <table class="table">
    <tr *ngFor="#plan of plans">
      <td><a [routerLink]="['/PlanView', {id: plan.id}]">{{plan.name}}</a></td>
      <td>created on {{plan.createdOn | momentDate }}</td>
      <td class="align-right"><button class="btn btn-danger" (click)="requestDelete()">
        <i class="fa fa-trash"></i>delete</button>
        <!-- this is a hack that should be converted to a proper dialog once that is available in angular 2-->
        <div *ngIf="openDialog">
           <div class="modal-backdrop"></div>

           <div class="modal">
              <div class="modal-dialog">
                 <div class="modal-content">
                    <div class="modal-body">You're about to delete this plan. Are you sure?</div>
                    <div class="modal-footer">
                       <button class="btn btn-primary" (click)="deletePlan(plan)">Yes</button>
                       <button class="btn btn-default" (click)="cancelDelete()">No</button>
                    </div>
                </div>
              </div>
           </div>
        </div>
     </td>
    </tr>
  </table>
</div>