Skip to content

Commit

Permalink
Merge pull request #4046 from crazyserver/MOBILE-4470
Browse files Browse the repository at this point in the history
Mobile 4470
  • Loading branch information
dpalou authored May 14, 2024
2 parents 2b9c431 + 8f461ad commit 691ad40
Show file tree
Hide file tree
Showing 30 changed files with 246 additions and 191 deletions.
4 changes: 1 addition & 3 deletions scripts/langindex.json
Original file line number Diff line number Diff line change
Expand Up @@ -524,15 +524,13 @@
"addon.mod_choice.cannotsubmit": "choice",
"addon.mod_choice.choiceoptions": "choice",
"addon.mod_choice.errorgetchoice": "local_moodlemobileapp",
"addon.mod_choice.expired": "choice",
"addon.mod_choice.full": "choice",
"addon.mod_choice.limita": "choice",
"addon.mod_choice.modulenameplural": "choice",
"addon.mod_choice.noresultsviewable": "choice",
"addon.mod_choice.notopenyet": "choice",
"addon.mod_choice.numberofuser": "choice",
"addon.mod_choice.numberofuserinpercentage": "choice",
"addon.mod_choice.previewonly": "choice",
"addon.mod_choice.previewing": "choice",
"addon.mod_choice.publishinfoanonafter": "choice",
"addon.mod_choice.publishinfoanonclose": "choice",
"addon.mod_choice.publishinfofullafter": "choice",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@

.ion-text-wrap ion-label {
.item-heading, h2, p {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
@include ellipsis();
}
}
}
Expand Down
3 changes: 1 addition & 2 deletions src/addons/block/timeline/components/events/events.scss
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ h4.core-bold {
flex-wrap: wrap;

& > span {
overflow: hidden;
text-overflow: ellipsis;
@include ellipsis();
}

}
Expand Down
4 changes: 1 addition & 3 deletions src/addons/messages/messages-common.scss
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,7 @@
}

.addon-message-last-message-text {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
@include ellipsis();
flex-shrink: 1;
}
}
Expand Down
4 changes: 1 addition & 3 deletions src/addons/messages/pages/discussion/discussion.scss
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,7 @@
}

core-format-text {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
@include ellipsis();
flex-shrink: 1;
display: block;
}
Expand Down
4 changes: 2 additions & 2 deletions src/addons/mod/choice/choice.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ import { CoreCourseModulePrefetchDelegate } from '@features/course/services/modu
import { CoreMainMenuTabRoutingModule } from '@features/mainmenu/mainmenu-tab-routing.module';
import { CoreCronDelegate } from '@services/cron';
import { CORE_SITE_SCHEMAS } from '@services/sites';
import { AddonModChoiceProvider } from './services/choice';
import { OFFLINE_SITE_SCHEMA } from './services/database/choice';
import { AddonModChoiceIndexLinkHandler } from './services/handlers/index-link';
import { AddonModChoiceListLinkHandler } from './services/handlers/list-link';
import { AddonModChoiceModuleHandler, AddonModChoiceModuleHandlerService } from './services/handlers/module';
import { AddonModChoicePrefetchHandler } from './services/handlers/prefetch';
import { AddonModChoiceSyncCronHandler } from './services/handlers/sync-cron';
import { ADDON_MOD_CHOICE_COMPONENT } from './constants';

const routes: Routes = [
{
Expand Down Expand Up @@ -57,7 +57,7 @@ const routes: Routes = [
CoreContentLinksDelegate.registerHandler(AddonModChoiceIndexLinkHandler.instance);
CoreContentLinksDelegate.registerHandler(AddonModChoiceListLinkHandler.instance);

CoreCourseHelper.registerModuleReminderClick(AddonModChoiceProvider.COMPONENT);
CoreCourseHelper.registerModuleReminderClick(ADDON_MOD_CHOICE_COMPONENT);
},
},
],
Expand Down
49 changes: 25 additions & 24 deletions src/addons/mod/choice/components/index/addon-mod-choice-index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,57 +12,58 @@
[courseId]="courseId" [hasDataToSync]="hasOffline" (completionChanged)="onCompletionChange()" />

<!-- Activity availability messages -->
<ion-card class="core-info-card" *ngIf="choiceNotOpenYet">
<ion-card class="core-info-card" *ngIf="showPreview && options.length">
<ion-item>
<ion-icon name="fas-circle-info" slot="start" aria-hidden="true" />
<ion-label>
<p *ngIf="options.length">{{ 'addon.mod_choice.previewonly' | translate:{$a: openTimeReadable} }}</p>
<p *ngIf="!options.length">{{ 'addon.mod_choice.notopenyet' | translate:{$a: openTimeReadable} }}</p>
</ion-label>
</ion-item>
</ion-card>

<ion-card class="core-info-card" *ngIf="choiceClosed">
<ion-item>
<ion-icon name="fas-circle-info" slot="start" aria-hidden="true" />
<ion-label>
<p *ngIf="options.length">
{{ 'addon.mod_choice.yourselection' | translate }}
<core-format-text [text]="options[0].text" contextLevel="module" [contextInstanceId]="module.id"
[courseId]="courseId" />
</p>
<p>{{ 'addon.mod_choice.expired' | translate:{$a: closeTimeReadable} }}</p>
<p>{{ 'addon.mod_choice.previewing' | translate }}</p>
</ion-label>
</ion-item>
</ion-card>

<!-- Inform what will happen with the choices. -->
<ion-card class="core-info-card" *ngIf="canEdit && publishInfo && options.length">
<ion-card class="core-info-card" *ngIf="publishInfo && options.length">
<ion-item>
<ion-icon name="fas-circle-info" slot="start" aria-hidden="true" />
<ion-label>{{ publishInfo | translate }}</ion-label>
</ion-item>
</ion-card>

<!-- Choice options -->
<ion-card *ngIf="options.length && choice">
<ion-card *ngIf="options.length && choice && (canEdit || showPreview)">
<ng-container *ngIf="choice.allowmultiple">
<ion-item class="ion-text-wrap" *ngFor="let option of options">
<ion-checkbox [(ngModel)]="option.checked" [disabled]="option.disabled || !canEdit">
<ion-checkbox [(ngModel)]="option.checked" [disabled]="option.disabled || showPreview">
<ng-container *ngTemplateOutlet="optionLabelTemplate; context: {option: option}" />
</ion-checkbox>
</ion-item>
</ng-container>
<ion-radio-group *ngIf="!choice.allowmultiple" [(ngModel)]="selectedOption.id">
<ion-item class="ion-text-wrap" *ngFor="let option of options">
<ion-radio [value]="option.id" [disabled]="option.disabled || !canEdit">
<ion-radio [value]="option.id" [disabled]="option.disabled || showPreview">
<ng-container *ngTemplateOutlet="optionLabelTemplate; context: {option: option}" />
</ion-radio>
</ion-item>
</ion-radio-group>
</ion-card>

<ion-card *ngIf="options.length && choice && !canEdit && !showPreview">
<ion-item-divider>
<ion-label>
<h2>{{ 'addon.mod_choice.yourselection' | translate }}</h2>
</ion-label>
</ion-item-divider>
<ng-container *ngFor="let option of options">
<ion-item class="ion-text-wrap" *ngIf="option.checked">
<ion-label>
<core-format-text [text]="option.text" contextLevel="module" [contextInstanceId]="module.id" [courseId]="courseId" />
</ion-label>
</ion-item>
</ng-container>
</ion-card>

<!-- Choice results -->
<div *ngIf="canSeeResults && choice">
<ng-container *ngIf="canSeeResults && choice">
<ion-item-divider>
<ion-label>
<h2>{{ 'addon.mod_choice.responses' | translate }}</h2>
Expand Down Expand Up @@ -115,9 +116,9 @@ <h3 class="item-heading">
</ion-col>
</ion-row>
</ion-grid>
</div>
</ng-container>

<ion-card class="core-info-card" *ngIf="!canSeeResults && !choiceNotOpenYet">
<ion-card class="core-info-card" *ngIf="!canSeeResults && showResultsMessage">
<ion-item>
<ion-icon name="fas-circle-info" slot="start" aria-hidden="true" />
<ion-label>
Expand Down
Loading

0 comments on commit 691ad40

Please sign in to comment.