Commit d0ce822c by Konstantin Schulz

### display of exercises in the exercise list is now more mobile friendly

parent 75584031
 { "name": "mc_frontend", "version": "1.4.3", "version": "1.4.5", "author": "Ionic Framework", "homepage": , "scripts": { ... ...
 ... ... @@ -64,4 +64,4 @@ \ No newline at end of file
 ... ... @@ -23,8 +23,8 @@ ... ... @@ -40,140 +40,101 @@

{{ 'VOCABULARY_CHECK' | translate }}

{{ 'VOCABULARY_CHECK' | translate }}

{{ 'APPLY' | translate }} {{'EXERCISE_TYPE' | translate}} {{'DATE' | translate}} {{'AUTHOR' | translate}} {{'TEXT_SELECTION' | translate}} {{'TEXT_COMPLEXITY' | translate}} {{'VOCABULARY_MATCHING_DEGREE' | translate}}
{{exercise.exercise_type_translation}} {{ getDateString(exercise.last_access_time) }} {{exercise.exercise_type_translation}} {{ getDateString(exercise.last_access_time) }} {{Math.round(exercise.text_complexity)}} {{getMatchingDegree(exercise)}} {{exercise.work_author}} {{exercise.work_title}} {{Math.round(exercise.text_complexity)}} {{getMatchingDegree(exercise)}}

{{ 'NO_EXERCISES_FOUND' | translate }}

... ...
 ion-list { .exercises { cursor: pointer; padding: 0; border: 2px solid black; } .exercises { padding: 0; .exercises ion-col { padding: 0 2em 0 0; } .item-nested-top { ... ...
 ... ... @@ -29,7 +29,7 @@ export class ExerciseListPage implements OnInit { public currentSortingCategory: SortingCategory = SortingCategory.dateDesc; public exercises: ExerciseMC[]; public ExerciseTypeTranslation = ExerciseTypeTranslation; public hasChanges = false; public hasVocChanged = false; public HelperService = HelperService; public Math = Math; public metadata: { [eid: string]: string } = {}; ... ... @@ -37,7 +37,8 @@ export class ExerciseListPage implements OnInit { public showVocabularyCorpus = false; public SortingCategory = SortingCategory; public sortingCategoriesAsc: Set = new Set([ SortingCategory.vocAsc, SortingCategory.authorAsc, SortingCategory.dateAsc, SortingCategory.typeAsc]); SortingCategory.vocAsc, SortingCategory.authorAsc, SortingCategory.dateAsc, SortingCategory.typeAsc, SortingCategory.complexityAsc]); public sortingCategoriesMap: { [sc: string]: string } = { [SortingCategory.authorAsc]: 'work_author', [SortingCategory.authorDesc]: 'work_author', ... ... @@ -70,7 +71,7 @@ export class ExerciseListPage implements OnInit { const searchValueLower: string = searchValue.toLowerCase(); const metadata = this.metadata; this.exercises = this.availableExercises.filter((exercise: ExerciseMC) => { return metadata[exercise.eid].includes(searchValueLower); return metadata[exercise.eid].toLowerCase().includes(searchValueLower); }); } this.sortExercises(); ... ... @@ -82,7 +83,7 @@ export class ExerciseListPage implements OnInit { getExerciseList(): void { const url: string = HelperService.config['backendBaseUrl'] + HelperService.config['backendApiExerciseListPath']; this.hasChanges = false; this.hasVocChanged = false; let params: HttpParams = new HttpParams().set('lang', this.translateService.currentLang); if (this.vocService.currentReferenceVocabulary) { params = params.set('vocabulary', VocabularyCorpus[this.vocService.currentReferenceVocabulary]); ... ... @@ -97,7 +98,7 @@ export class ExerciseListPage implements OnInit { this.metadata[exercise.eid] = [exercise.work_author, exercise.exercise_type_translation, exercise.work_title] .join(' ').toLowerCase(); }); this.sortExercises(); this.filterExercises(this.currentSearchValue); }, () => { }); } ... ... @@ -141,4 +142,14 @@ export class ExerciseListPage implements OnInit { }); } } toggleVocCorpus() { this.showVocabularyCorpus = !this.showVocabularyCorpus; if (this.showVocabularyCorpus && !this.vocService.currentReferenceVocabulary) { this.vocService.currentReferenceVocabulary = VocabularyCorpus.bws; this.hasVocChanged = true; } const iRowElement: HTMLElement = document.querySelector('#vocCorpus'); iRowElement.style.display = this.showVocabularyCorpus ? 'block' : 'none'; } }
 ... ... @@ -223,10 +223,16 @@ export class HelperService { static makeGetRequest(http: HttpClient, toastCtrl: ToastController, url: string, params: HttpParams): Promise { HelperService.currentError = null; HelperService.isLoading = true; // dirty hack to avoid ExpressionChangedAfterItHasBeenCheckedError setTimeout(() => { HelperService.isLoading = true; }, 0); return new Promise(((resolve, reject) => { http.get(url, {params}).subscribe((result: any) => { HelperService.isLoading = false; // dirty hack to avoid ExpressionChangedAfterItHasBeenCheckedError setTimeout(() => { HelperService.isLoading = false; }, 0); return resolve(result); }, async (error: HttpErrorResponse) => { HelperService.isLoading = false; ... ...
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!