aboutsummaryrefslogtreecommitdiffstats
path: root/webapp/src/app/projects/projectsListAccordion.component.ts
blob: 210be5c33e6976a5dc2e58b5a9d8909bb754d617 (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
32
33
34
35
36
37
38
39
import { Component, Input } from "@angular/core";

import { IProject } from "../services/project.service";

@Component({
    selector: 'projects-list-accordion',
    template: `
        <style>
            .fa.fa-exclamation-triangle {
                margin-right: 2em;
                color: red;
            }
            .fa.fa-refresh {
                margin-right: 10px;
                color: darkviolet;
            }
        </style>
        <accordion>
            <accordion-group #group *ngFor="let prj of projects">
                <div accordion-heading>
                    {{ prj.label }}
                    <div class="pull-right">
                        <i *ngIf="prj.status == 'Syncing'" class="fa fa-refresh faa-spin animated"></i>
                        <i *ngIf="!prj.isInSync && prj.status != 'Syncing'" class="fa fa-exclamation-triangle"></i>
                        <i class="fa" [ngClass]="{'fa-chevron-down': group.isOpen, 'fa-chevron-right': !group.isOpen}"></i>
                    </div>
                </div>
                <project-card [project]="prj"></project-card>
            </accordion-group>
        </accordion>
    `
})
export class ProjectsListAccordionComponent {

    @Input() projects: IProject[];

}