aboutsummaryrefslogtreecommitdiff
path: root/sandbox/testAppSonja/frontend/front/src/app/main-page/main-page.component.html
blob: d731a5bd453517f96e06b6b85299feb5526a8631 (plain) (blame)
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<h2>Spisak studenata</h2>

<table *ngIf="students && students.length > 0">
    <thead>
        <tr>
            <th>Ime i prezime</th>
            <th>Broj indeksa</th>
            <th>Prosecna ocena</th>
            <th>Adresa</th>
            <th>Broj telefona</th>
            <th></th>
            <th></th>
        </tr>
    </thead>
    <tbody>
        <tr *ngFor="let student of students">
            <td>{{student.firstName}} {{student.lastName}}</td>
            <td>{{student.regNum}}</td>
            <td>{{student.gpa}}</td>
            <td>{{student.address}}</td>
            <td>{{student.phoneNum}}</td>
            <td>
                <button><a routerLink="../edit/{{student.id}}" type="button" class="btn btn-primary">Izmeni podatke</a></button>
            </td>
            <td>
                <button type="button" class="btn btn-primary" (click)="pickStudentForDelete(student.id)">Obrisi studenta</button>
            </td>
        </tr>
    </tbody>
</table>

<div>
    <button id="btnDodaj" type="button" class="btn btn-primary"><a routerLink="../add">Dodaj novog studenta</a></button>
</div>

<!--
<p *ngIf="!students || !students.length">
    Nema studenata!
</p>
-->

<style>

    h2 {
        text-align: center;
        margin-bottom: 50px;
    }
    
    table {
    border-collapse: collapse;
    width: 60%;
    margin: auto;
    }

    th, td {
    text-align: left;
    padding: 8px;
    }

    tr:nth-child(even){background-color: #f2f2f2}

    th {
    background-color: #04AA6D;
    color: white;
    }

    div {
        text-align: center;
        padding-top: 70px;
    }

</style>