team-menu.component.html 3.01 KB
Newer Older
1
2
3
<section *ngIf="loggedIn">
    <div class="container py-3" *ngIf="team!=null">
        <div class="card" *ngFor="let pokemon of team; let i=index">
Manish Kumar's avatar
Manish Kumar committed
4
5
6
7
8
9
10
            <div class="row ">
                <div class="col-md-4">
                    <img src="https://pokeres.bastionbot.org/images/pokemon/{{pokemon.id_pokemon}}.png" alt="" onerror="this.src='https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/0.png';" class="w-100">
                </div>
                <div class="col-md-8 px-3">
                    <div class="card-block px-3">
                        <h4 class="card-title">{{pokemon.pokeName}}</h4>
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
                        <p class="card-text">Attacks : {{showAttacks(pokemon)}}</p>
                    </div>
                    <nav>
                        <div class="nav nav-tabs" id="nav-tab" role="tablist">
                          <a [ngClass]="first ? 'nav-item nav-link active' : 'nav-item nav-link'" id="nav-{{pokemon.pokeName}}-attack{{nb}}-tab" data-toggle="tab" href="#nav-{{pokemon.pokeName}}-attack{{nb}}" role="tab" aria-selected="false" *ngFor="let nb of nbAttacks;let first = first;">attack {{nb}}</a>
                        </div>
                      </nav>
                      <div class="tab-content" id="nav-tabContent">
                        <div [ngClass]="first ? 'tab-pane fade show active' : 'tab-pane fade show'" id="nav-{{pokemon.pokeName}}-attack{{item}}" role="tabpanel" *ngFor="let item of nbAttacks; let first = first; let j = index">
                            <a>{{chosenAttacks.get(pokemon.pokeName)[j]}}</a>
                            <div class="row">
                                <div class="col text-right">
                                  <div ngbDropdown class="d-inline-block">
                                    <button class="btn btn-outline-primary" id="dropdownBasic1" ngbDropdownToggle>Change attack {{item}}</button>
                                    <div ngbDropdownMenu aria-labelledby="dropdownBasic1" class="dropydown">
                                      <button ngbDropdownItem *ngFor="let move of pokemon.movesUtil; let k=index" (click)="updateAttacks(pokemon, move, j, k)">{{move.identifier}}</button>
                                    </div>
                                  </div>
                                </div>
                            </div>
                        </div>
                        
Manish Kumar's avatar
Manish Kumar committed
33
34
35
                    </div>
                </div>
                <div class="col-md-4">
36
                    <button  type="button" class="btn btn-danger" (click)="removePokemon(pokemon)">Remove</button >
Manish Kumar's avatar
Manish Kumar committed
37
38
39
40
41
                </div>
            </div>
        </div>
    </div>
</section>
42
<div class="alert alert-warning alert-dismissible fade show" role="alert" *ngIf="!loggedIn">
Manish Kumar's avatar
Manish Kumar committed
43
44
45
46
     You need to <strong>create an account</strong> to use this feature.
    <button type="button" class="close" data-dismiss="alert" aria-label="Close">
      <span aria-hidden="true">&times;</span>
    </button>
47
</div>
48
<p *ngIf="team==null">You don't have any Pokemon :(</p>