show-text.page.html 5.1 KB
Newer Older
1
2
<ion-header>
    <ion-toolbar>
3
4
        <ion-buttons slot="start">
            <div class="home-logo">
5
                <a (click)="HelperService.goToHomePage(navCtrl)">
6
7
8
9
                    <img src="assets/imgs/logo.png" width="32px" height="32px" alt="CALLIDUS Logo">
                </a>
            </div>
        </ion-buttons>
10
11
12
13
        <ion-spinner *ngIf="HelperService.isLoading"></ion-spinner>
        <ion-title>
            {{corpusService.currentCorpus?.title}} {{corpusService.currentUrn?.split(":")[corpusService.currentUrn?.split(":").length - 1]}}
        </ion-title>
14
15
16
        <ion-buttons slot="end">
            <ion-menu-button autoHide="false"></ion-menu-button>
        </ion-buttons>
17
18
19
20
21
    </ion-toolbar>
</ion-header>


<ion-content padding>
22
23
24
    <h2 padding>
        {{'SHOW_TEXT_TITLE' | translate}}
    </h2>
25
    <ion-grid *ngIf="corpusService.currentText.length > 0; else loading">
26
        <ion-row *ngIf="HelperService.isVocabularyCheck">
27
            <ion-col style="text-align:left; padding-left:10px;">
28
                <label>
29
                    <input type="checkbox" [(ngModel)]="highlightOOV"/>
30
                    <span class="checkbox">{{ "TEXT_SHOW_OOV" | translate}}</span>
31
32
33
34
                </label>
                <br>
            </ion-col>
        </ion-row>
35
        <ion-row>
36
37
38
39
            <ion-col class="text" size="8">
                <div *ngIf="highlightOOV; else noOOV">
                    <!-- do not add whitespace/newline etc. between the span elements!                   -->
                    <span *ngFor="let node of corpusService.annisResponse.nodes; index as i"><span class="tok"
40
                                                                                                   [class.oov]="node.is_oov">{{node.annis_tok}}</span>{{ getWhiteSpace(i) }}</span>
41
42
43
44
                </div>
                <ng-template #noOOV>
                    <span class="tok">{{corpusService.currentText}}</span>
                </ng-template>
45
            </ion-col>
46
            <ion-col class="toggle-menu" style="text-align:left" padding>
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
                <ion-grid>
                    <ion-row>
                        <button *ngIf="showTextComplexity; else dropright"
                                (click)="showTextComplexity = !showTextComplexity">
                            <ion-icon name="arrow-dropdown"></ion-icon>
                        </button>
                        <ng-template #dropright>
                            <button (click)="showTextComplexity = !showTextComplexity">
                                <ion-icon name="arrow-dropright"></ion-icon>
                            </button>
                        </ng-template>
                        <div>
                            <h2 (click)="showTextComplexity = !showTextComplexity">{{ 'TEXT_COMPLEXITY' | translate }}</h2>
                        </div>
                    </ion-row>
                    <ion-row>
                        <div *ngIf="showTextComplexity" style="text-align:left">
                            <label *ngFor="let key of ObjectKeys(textComplexityMap)">
                                {{ textComplexityMap[key] | translate }}:
                                {{corpusService.annisResponse.text_complexity[key]}}<br>
                            </label>
                            <br>
                        </div>
                    </ion-row>
                    <ion-row>
                        <a (click)="generateDownloadLink(FileType[FileType.docx])">
                            {{ 'GENERATE_FILE_DOCX' | translate }}
                        </a>
                    </ion-row>
                    <ion-row>
                        <a (click)="generateDownloadLink(FileType[FileType.pdf])">
                            {{ 'GENERATE_FILE_PDF' | translate }}
                        </a>
                    </ion-row>
                    <ion-row>
                        <a (click)="HelperService.goToVocabularyCheckPage(navCtrl)">
                            {{ 'VOCABULARY_CHECK' | translate }}</a>
                    </ion-row>
                    <ion-row>
                        <a (click)="HelperService.goToExerciseParametersPage(navCtrl).then()">
                            {{ "EXERCISE_SET_PARAMETERS" | translate}}</a>
                    </ion-row>
                </ion-grid>
90
91
92
93
94
95
96
97
98
99
100
            </ion-col>
        </ion-row>
        <ion-row>
            <ion-col>
                <ion-spinner *ngIf="isDownloading"></ion-spinner>
                <!--  hidden download link, do not delete this!
                This is preferable compared to a button click event, because the browser knows from the beginning that
                it is going to be a download (instead of an ordinary link or click).         -->
                <a style="display: none" id="download" href="" download>Download</a>
            </ion-col>
        </ion-row>
101
102
        <ion-row>
        </ion-row>
103
        <ion-row>
104
105
            <ion-col>
                <ion-button (click)="navCtrl.pop()">{{ 'BACK' | translate }}</ion-button>
106
107
108
109
110
111
            </ion-col>
        </ion-row>
    </ion-grid>
    <ng-template #loading>
        <ion-spinner></ion-spinner>
    </ng-template>
112
</ion-content>