Merge pull request #4224 from crazyserver/MOBILE-4616

MOBILE-4616 course: Show availability section info in collapsed content
main
Albert Gasset 2024-10-23 13:34:45 +02:00 committed by GitHub
commit 67bcfc5420
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 24 additions and 9 deletions

View File

@ -22,9 +22,11 @@
<ion-label class="ion-text-wrap"> <ion-label class="ion-text-wrap">
<h2 *ngIf="section.name" class="big" [id]="'core-section-name-' + section.id"> <h2 *ngIf="section.name" class="big" [id]="'core-section-name-' + section.id">
<core-format-text [text]="section.name" contextLevel="course" [contextInstanceId]="course.id" /> <core-format-text [text]="section.name" contextLevel="course" [contextInstanceId]="course.id" />
<ion-icon *ngIf="section.availabilityinfo" name="fas-lock" [attr.aria-label]="'core.restricted' | translate" />
</h2> </h2>
<div *ngIf="section.visible === 0 && section.uservisible !== false"> <div *ngIf="section.visible === 0 && section.uservisible !== false">
<ion-badge color="warning"> <ion-badge color="secondary" class="ion-text-wrap">
<ion-icon name="far-eye-slash" aria-hidden="true" />
{{ 'core.course.hiddenfromstudents' | translate }} {{ 'core.course.hiddenfromstudents' | translate }}
</ion-badge> </ion-badge>
</div> </div>
@ -33,20 +35,22 @@
{{ 'core.notavailable' | translate }} {{ 'core.notavailable' | translate }}
</ion-badge> </ion-badge>
</div> </div>
<div *ngIf="section.availabilityinfo">
<ion-chip class="clickable">
<ion-icon name="fas-lock" [attr.aria-label]="'core.restricted' | translate" />
<ion-label>
<core-format-text [text]=" section.availabilityinfo" contextLevel="course" [contextInstanceId]="course.id" />
</ion-label>
</ion-chip>
</div>
</ion-label> </ion-label>
<ion-badge *ngIf="section.highlighted && highlightedName" slot="end">{{highlightedName}}</ion-badge> <ion-badge *ngIf="section.highlighted && highlightedName" slot="end">{{highlightedName}}</ion-badge>
</ion-item> </ion-item>
</ng-template> </ng-template>
<ng-template #sectionContent> <ng-template #sectionContent>
<ion-item class="ion-text-wrap section-summary" *ngIf="section.availabilityinfo">
<ion-label>
<ion-chip>
<ion-icon name="fas-lock" [attr.aria-label]="'core.restricted' | translate" />
<ion-label>
<core-format-text [text]="section.availabilityinfo" contextLevel="course" [contextInstanceId]="course.id" />
</ion-label>
</ion-chip>
</ion-label>
</ion-item>
<ion-item class="ion-text-wrap section-summary" *ngIf="section.summary"> <ion-item class="ion-text-wrap section-summary" *ngIf="section.summary">
<ion-label> <ion-label>
<core-format-text [text]="section.summary" contextLevel="course" [contextInstanceId]="course.id" /> <core-format-text [text]="section.summary" contextLevel="course" [contextInstanceId]="course.id" />

View File

@ -1,6 +1,17 @@
@use "theme/globals" as *;
:host { :host {
.course-section { .course-section {
--inner-padding-end: var(--mdl-spacing-3); --inner-padding-end: var(--mdl-spacing-3);
ion-badge {
@include margin-horizontal(null, 4px);
font: var(--mdl-typography-body-font-sm);
}
h2 ion-icon {
@include margin-horizontal(4px, null);
}
} }
&.collapsible { &.collapsible {