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


<ion-content padding>
    <ion-grid>
23

24
        <ion-row>
25
            <h2>{{'TEXT_RANGE' | translate}}</h2>
26
27
28
        </ion-row>
        <ion-row>
            <ion-col>
29
                {{ 'START_OF_TEXT' | translate }}
30
31
32
            </ion-col>
            <ion-col>
                <input [(ngModel)]="corpusService.currentTextRange.start[0]" id="input1"
33
34
35
                    (ngModelChange)="showFurtherReferences(true).then()"
                    placeholder="{{ corpusService.currentCorpus?.citation_level_1 }}" (focus)="currentInputId = 1"
                    (blur)="resetCurrentInputId()" />
36
37
            </ion-col>
            <ion-col>
38
                <input *ngIf="corpusService.currentCorpus?.citation_level_2 !== CitationLevel[CitationLevel.default]"
39
40
41
42
43
                    [(ngModel)]="corpusService.currentTextRange.start[1]" id="input2"
                    (ngModelChange)="showFurtherReferences(true).then()"
                    placeholder="{{ corpusService.currentCorpus?.citation_level_2 }}" (focus)="currentInputId = 2"
                    (blur)="resetCurrentInputId()"
                    disabled="{{!corpusService.currentCorpus?.citations.hasOwnProperty(corpusService.currentTextRange.start[0])}}" />
44
45
            </ion-col>
            <ion-col>
46
                <input *ngIf="corpusService.currentCorpus?.citation_level_3 !== CitationLevel[CitationLevel.default]"
47
48
49
50
                    [(ngModel)]="corpusService.currentTextRange.start[2]" id="input3"
                    (ngModelChange)="showFurtherReferences(true).then()"
                    placeholder="{{ corpusService.currentCorpus?.citation_level_3 }}" (focus)="currentInputId = 3"
                    (blur)="resetCurrentInputId()" disabled="{{isInputDisabled(true)}}" />
51
52
53
            </ion-col>
        </ion-row>
        <ion-row>
54
55
56
            <ion-col>

            </ion-col>
57
58
59
60
            <ion-col>
                <ion-list *ngIf="currentInputId === 1">
                    <ion-item *ngFor="let key of ObjectKeys(corpusService.currentCorpus.citations)">
                        <button class="autocomplete"
61
                            (click)="corpusService.currentTextRange.start[0] = key; applyAutoComplete(true)">
62
63
64
65
66
67
68
69
                            {{ key }}
                        </button>
                    </ion-item>
                </ion-list>
            </ion-col>
            <ion-col>
                <ion-list *ngIf="currentInputId === 2">
                    <ion-item
70
                        *ngFor="let key of ObjectKeys(corpusService.currentCorpus.citations[corpusService.currentTextRange.start[0]].subcitations)">
71
                        <button class="autocomplete"
72
                            (click)="corpusService.currentTextRange.start[1] = key; applyAutoComplete(true)">
73
74
75
76
77
78
79
80
                            {{ key }}
                        </button>
                    </ion-item>
                </ion-list>
            </ion-col>
            <ion-col>
                <ion-list *ngIf="currentInputId === 3">
                    <ion-item
81
                        *ngFor="let key of ObjectKeys(corpusService.currentCorpus.citations[corpusService.currentTextRange.start[0]].subcitations[corpusService.currentTextRange.start[1]].subcitations)">
82
                        <button class="autocomplete"
83
                            (click)="corpusService.currentTextRange.start[2] = key; applyAutoComplete(true)">
84
85
86
87
88
89
90
91
92
                            {{ key }}
                        </button>
                    </ion-item>
                </ion-list>
            </ion-col>
        </ion-row>
        <ion-row>
        </ion-row>
        <ion-row>
93
94
95
            <ion-col>
                {{ 'END_OF_TEXT' | translate }}
            </ion-col>
96
97
            <ion-col>
                <input [(ngModel)]="corpusService.currentTextRange.end[0]" id="input4"
98
99
100
                    (ngModelChange)="showFurtherReferences(false).then()"
                    placeholder="{{ corpusService.currentCorpus?.citation_level_1 }}" (focus)="currentInputId = 4"
                    (blur)="resetCurrentInputId()" />
101
102
            </ion-col>
            <ion-col>
103
                <input *ngIf="corpusService.currentCorpus?.citation_level_2 !== CitationLevel[CitationLevel.default]"
104
105
106
107
108
                    [(ngModel)]="corpusService.currentTextRange.end[1]" id="input5"
                    (ngModelChange)="showFurtherReferences(false).then()"
                    placeholder="{{ corpusService.currentCorpus?.citation_level_2 }}" (focus)="currentInputId = 5"
                    (blur)="resetCurrentInputId()"
                    disabled="{{!corpusService.currentCorpus?.citations.hasOwnProperty(corpusService.currentTextRange.start[0])}}" />
109
110
            </ion-col>
            <ion-col>
111
                <input *ngIf="corpusService.currentCorpus?.citation_level_3 !== CitationLevel[CitationLevel.default]"
112
113
114
115
                    [(ngModel)]="corpusService.currentTextRange.end[2]" id="input6"
                    (ngModelChange)="showFurtherReferences(false).then()"
                    placeholder="{{ corpusService.currentCorpus?.citation_level_3 }}" (focus)="currentInputId = 6"
                    (blur)="resetCurrentInputId()" disabled="{{isInputDisabled(false)}}" />
116
117
118
            </ion-col>
        </ion-row>
        <ion-row>
119
120
121
            <ion-col>
                
            </ion-col>
122
123
124
125
            <ion-col>
                <ion-list *ngIf="currentInputId === 4">
                    <ion-item *ngFor="let key of ObjectKeys(corpusService.currentCorpus.citations)">
                        <button class="autocomplete"
126
                            (click)="corpusService.currentTextRange.end[0] = key; applyAutoComplete(false)">
127
128
129
130
131
132
133
134
                            {{ key }}
                        </button>
                    </ion-item>
                </ion-list>
            </ion-col>
            <ion-col>
                <ion-list *ngIf="currentInputId === 5">
                    <ion-item
135
                        *ngFor="let key of ObjectKeys(corpusService.currentCorpus.citations[corpusService.currentTextRange.end[0]].subcitations)">
136
                        <button class="autocomplete"
137
                            (click)="corpusService.currentTextRange.end[1] = key; applyAutoComplete(false)">
138
139
140
141
142
143
144
145
                            {{ key }}
                        </button>
                    </ion-item>
                </ion-list>
            </ion-col>
            <ion-col>
                <ion-list *ngIf="currentInputId === 6">
                    <ion-item
146
                        *ngFor="let key of ObjectKeys(corpusService.currentCorpus.citations[corpusService.currentTextRange.end[0]].subcitations[corpusService.currentTextRange.end[1]].subcitations)">
147
                        <button class="autocomplete"
148
                            (click)="corpusService.currentTextRange.end[2] = key; applyAutoComplete(false)">
149
150
151
152
153
154
                            {{ key }}
                        </button>
                    </ion-item>
                </ion-list>
            </ion-col>
        </ion-row>
155
156
157
158
159
160
161
162
163
164
165
        <ion-row>
            <ion-col>
                <ion-button (click)="HelperService.goToAuthorDetailPage(navCtrl)">{{ 'BACK' | translate }}</ion-button>
            </ion-col>
            <ion-col>
                <ion-button (click)="confirmSelection()">{{ "SHOW_TEXT" | translate }}</ion-button>
            </ion-col>
            <ion-col>
                <ion-button (click)="confirmSelection(true)">{{ "EXERCISE_SET_PARAMETERS" | translate }}</ion-button>
            </ion-col>
        </ion-row>
166
    </ion-grid>
167
</ion-content>