aboutsummaryrefslogtreecommitdiff
path: root/frontend/src/app/_elements/folder/folder.component.html
blob: bff066be50e5cd4700127d09f51e92974ff899d8 (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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
<div id="folder">
    <div id="tabs">
        <div id="new-file-tab" *ngIf="newFile" class="folder-tab p-1 rounded-top" [style]="'z-index:' + (selectedTab == TabType.NewFile ? 11 : 10) + ' ;'" [ngClass]="{'selected-tab' : selectedTab == TabType.NewFile, 'hover-tab' : hoverTab == TabType.NewFile}">
            <mat-icon class="text-offwhite">add</mat-icon>
            <a class="stretched-link tab-link" (click)="selectTab(TabType.NewFile)" (mouseenter)="hoverOverTab(TabType.NewFile)" (mouseleave)="hoverOverTab(TabType.None)">
                {{newFile.name}}
            </a>
        </div>
        <!--<div class="folder-tab p-1 rounded-top" *ngFor="let file of filteredFiles; let i = index" [style]="'z-index:' + calcZIndex(i) + ' ;'" [ngClass]="{'selected-tab' : selectedFileIndex == i, 'hover-tab' : hoveringOverFileIndex == i}">
            <a class="m-1 stretched-link tab-link" (click)="selectFile(i)" (mouseenter)="hoverOverFile(i)" (mouseleave)="hoverOverFile(-1)">{{file.name}}</a>
        </div>-->
        <div class="folder-tab p-1 rounded-top" *ngFor="let tab of tabsToShow; let i = index" [style]="'z-index:' + (selectedTab == tab ? 11 : (tabsToShow.length - i)) + ' ;'" [ngClass]="{'selected-tab' : selectedTab == tab, 'hover-tab' : hoverTab == tab}">
            <a class="m-1 stretched-link tab-link" (click)="selectTab(tab)" (mouseenter)="hoverOverTab(tab)" (mouseleave)="hoverOverTab(TabType.None)">{{tabTitles[tab]}}</a>
        </div>

        <div class="folder-tab p-1 rounded-top" *ngIf="selectedFile" [style]="'z-index:' + (selectedTab == TabType.File ? 11 : (tabsToShow.length)) + ' ;'" [ngClass]="{'selected-tab' : selectedTab == TabType.File, 'hover-tab' : hoverTab == TabType.File}">
            <a class="m-1 stretched-link tab-link" (click)="selectTab(TabType.File)" (mouseenter)="hoverOverTab(TabType.File)" (mouseleave)="hoverOverTab(TabType.None)">{{selectedFile.name}}</a>
        </div>
    </div>
    <div id="selected-content" class="rounded-bottom text-offwhite">
        <div id="searchbar" *ngIf="listView">
            <!-- <div id="path" class="ps-2">{{folderName}}
            </div>
            <mat-icon>keyboard_arrow_right</mat-icon> -->
            <div id="search" class="text-offwhite mx-1">
                <mat-form-field>
                    <button matPrefix class="btn-clear input-icon"><mat-icon>search</mat-icon></button>
                    <input type="search" matInput name="search" [(ngModel)]="searchTerm" (input)="searchTermsChanged()">
                    <button matSuffix class="btn-clear input-icon" (click)="clearSearchTerm()"><mat-icon>clear</mat-icon></button>
                </mat-form-field>
            </div>
            <div id="search-options">
                <!-- <div id="collapseFilters" class="collapse collapse-horizontal">
                    <mat-icon class="text-offwhite ">timeline</mat-icon>
                    Regresioni
                    <mat-icon class="text-offwhite ">looks_two</mat-icon>
                    Binarni klasifikacioni
                    <mat-icon class="text-offwhite ">auto_awesome_motion</mat-icon>
                    Multiklasifikacioni
                </div> -->
                <button class="btn-clear icon-toggle" data-bs-toggle="collapse" data-bs-target="#collapseFilters" aria-expanded="false" aria-controls="collapseFilters">
                    <mat-icon>filter_alt</mat-icon>
                </button>
                <!-- <div id="collapseSort" class="collapse collapse-horizontal">
                    [sort options here TODO]
                </div> -->
                <button class="btn-clear icon-toggle" data-bs-toggle="collapse" data-bs-target="#collapseSort" aria-expanded="false" aria-controls="collapseSort">
                    <mat-icon>sort</mat-icon>
                </button>
                <!-- <button class="btn-clear icon-toggle separator" [ngClass]="{'icon-toggle-on': listView}" (click)="toggleListView()">
                    <mat-icon>view_list</mat-icon>
                </button> -->
            </div>
        </div>
        <!--{{fileToDisplay ? fileToDisplay.name : 'No file selected.'}} {{selectedFileIndex}} {{hoveringOverFileIndex}}-->
        <div class="folder-inside bg-blur">
            <div class="file-content" [ngClass]="{'form-hidden' : listView}">
                <div class="file-bottom-buttons" *ngIf="selectedTab != TabType.NewFile">
                    <button *ngIf="this.selectedFile && selectedTab == TabType.File" class="btn-clear file-button" (click)="deleteFile(this.selectedFile, $event)">
                        <mat-icon>delete</mat-icon>
                    </button>
                    <!-- <button class="btn-clear file-button">
                        <mat-icon>zoom_out_map</mat-icon>
                    </button> -->
                </div>
                <app-form-model [ngClass]="{'form-hidden': type != FolderType.Model}" [forExperiment]="forExperiment"></app-form-model>
                <app-form-dataset [ngClass]="{'form-hidden': type != FolderType.Dataset}" [forExperiment]="forExperiment"></app-form-dataset>
            </div>
            <div [ngClass]="{'form-hidden' : !listView}" class="list-view">
                <div *ngFor="let file of filteredFiles; let i = index" class="list-item force-link" (click)="selectFile(file)">
                    <div class="mx-2">
                        {{file.name}}
                    </div>
                    <div class="mx-2 hover-hide">
                        {{file.lastUpdated | date}}
                    </div>
                    <div class="mx-2 hover-show" *ngIf="selectedTab !== TabType.PublicDatasets && selectedTab !== TabType.PublicModels">
                        <button class="btn-clear file-button" (click)="deleteFile(file, $event)">
                            <mat-icon>delete</mat-icon>
                        </button>
                    </div>

                </div>
                <div class="list-add" [ngSwitch]="type">
                    <button mat-raised-button *ngSwitchCase="FolderType.Dataset" (click)="selectNewFile()">Dodaj {{privacy == Privacy.Public ? 'javni ' : ' '}}izvor podataka</button>
                    <button mat-raised-button *ngSwitchCase="FolderType.Model" (click)="selectNewFile()">Dodaj {{privacy == Privacy.Public ? 'javnu ' : ' '}}konfiguraciju neuronske mreže</button>
                    <button mat-raised-button *ngSwitchCase="FolderType.Experiment" routerLink="/experiment">Dodaj eksperiment</button>
                </div>
            </div>
        </div>
    </div>
    <div id="footer" [ngSwitch]="newFileSelected" *ngIf="!listView">
        <button mat-button (click)="saveNewFile()" class="bottom-button text-offwhite rounded-bottom" *ngSwitchCase="true">
            <div  class="f-row">
                <div>Sačuvaj</div>
                <div class="pt-1">
                    <mat-icon>check</mat-icon>
                </div>
            </div>
        </button>
        <button mat-button (click)="ok()" class="bottom-button text-offwhite rounded-bottom" *ngSwitchCase="false">
            <div class="f-row">
                <div>Ok</div>
                <div class="icon-double pt-1">
                    <mat-icon>check</mat-icon>
                    <mat-icon>check</mat-icon>
                </div>
            </div>
        </button>
    </div>
</div>