Vmeda.Online/src/addons/mod/glossary/components/index/addon-mod-glossary-index.html
2024-04-25 09:46:43 +02:00

83 lines
4.6 KiB
HTML

<!-- Buttons to add to the header. -->
<core-navbar-buttons slot="end">
<ion-button *ngIf="!showLoading && glossary && glossary.browsemodes && glossary.browsemodes.length > 1" (click)="openModePicker($event)"
[attr.aria-label]="'addon.mod_glossary.browsemode' | translate">
<ion-icon name="fas-sort" slot="icon-only" aria-hidden="true" />
</ion-button>
<ion-button *ngIf="!showLoading && glossary" (click)="toggleSearch()" [attr.aria-label]="'addon.mod_glossary.bysearch' | translate">
<ion-icon name="fas-magnifying-glass" slot="icon-only" aria-hidden="true" />
</ion-button>
<ion-button *ngIf="!showLoading" fill="clear" (click)="openModuleSummary()" aria-haspopup="true"
[attr.aria-label]="'core.info' | translate">
<ion-icon name="fas-circle-info" slot="icon-only" aria-hidden="true" />
</ion-button>
</core-navbar-buttons>
<!-- Content. -->
<core-split-view>
<ion-refresher slot="fixed" [disabled]="showLoading" (ionRefresh)="doRefresh($event.target)">
<ion-refresher-content pullingText="{{ 'core.pulltorefresh' | translate }}" />
</ion-refresher>
<core-search-box *ngIf="isSearch" (onSubmit)="search($event)" [placeholder]="'addon.mod_glossary.searchquery' | translate"
[autoFocus]="true" [lengthCheck]="2" (onClear)="toggleSearch()" searchArea="AddonModGlossary-{{module.id}}" />
<core-loading [hideUntil]="!showLoading" [message]="loadingMessage">
<!-- Activity info. -->
<core-course-module-info *ngIf="!isSearch" [module]="module" [description]="description" [component]="component"
[componentId]="componentId" [courseId]="courseId" [hasDataToSync]="hasOffline" (completionChanged)="onCompletionChange()" />
<ion-list *ngIf="!isSearch && entries && entries.offlineEntries.length > 0" class="addon-mod-glossary-index--offline-entries">
<ion-item-divider>
<ion-label>
<h2 class="big">{{ 'addon.mod_glossary.entriestobesynced' | translate }}</h2>
</ion-label>
</ion-item-divider>
<ion-item *ngFor="let entry of entries.offlineEntries" (click)="entries.select(entry)" button [detail]="false"
[attr.aria-current]="entries.getItemAriaCurrent(entry)">
<ion-label>
<div class="addon-mod-glossary-index--offline-entry">
<ion-icon name="fas-clock" class="ion-margin-end" [attr.aria-label]="'core.notsent' | translate" />
<core-format-text [text]="entry.concept" contextLevel="module" [contextInstanceId]="glossary!.coursemodule"
[courseId]="courseId" />
</div>
</ion-label>
</ion-item>
</ion-list>
<ion-list *ngIf="entries && entries.onlineEntries.length > 0">
<ng-container *ngFor="let entry of entries.onlineEntries; let index = index">
<ion-item-divider *ngIf="getDivider && showDivider(entry, entries.onlineEntries[index - 1])">
<ion-label>
<h2 class="big">{{ getDivider!(entry) }}</h2>
</ion-label>
</ion-item-divider>
<ion-item button (click)="entries.select(entry)" [attr.aria-current]="entries.getItemAriaCurrent(entry)" [detail]="false">
<ion-label>
<core-format-text [text]="entry.concept" contextLevel="module" [contextInstanceId]="glossary!.coursemodule"
[courseId]="courseId" />
</ion-label>
</ion-item>
</ng-container>
</ion-list>
<core-empty-box *ngIf="(!entries || !entries.hasEntries) && (!isSearch || hasSearched)" icon="fas-list"
[message]="'addon.mod_glossary.noentriesfound' | translate" [attr.role]="hasSearched ? 'alert' : null" />
<core-infinite-loading [enabled]="entries && !entries.completed && (!isSearch || hasSearched)" [error]="loadMoreError"
(action)="loadMoreEntries($event)" />
</core-loading>
<core-course-module-navigation collapsible-footer [hidden]="showLoading" [courseId]="courseId" [currentModuleId]="module.id" />
<ion-fab slot="fixed" core-fab vertical="bottom" horizontal="end" *ngIf="canAdd && !showLoading">
<ion-fab-button (click)="openNewEntry()" [attr.aria-label]="'addon.mod_glossary.addentry' | translate">
<ion-icon name="fas-plus" aria-hidden="true" />
<span class="sr-only">{{ 'addon.mod_glossary.addentry' | translate }}</span>
</ion-fab-button>
</ion-fab>
</core-split-view>