Merge pull request #3239 from crazyserver/MOBILE-3833

Mobile 3833
main
Dani Palou 2022-04-07 07:57:38 +02:00 committed by GitHub
commit a4bb6caad2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 44 additions and 12 deletions

View File

@ -40,6 +40,7 @@
"addon.block_learningplans.pluginname": "block_lp", "addon.block_learningplans.pluginname": "block_lp",
"addon.block_myoverview.all": "block_myoverview", "addon.block_myoverview.all": "block_myoverview",
"addon.block_myoverview.allincludinghidden": "block_myoverview", "addon.block_myoverview.allincludinghidden": "block_myoverview",
"addon.block_myoverview.browseallcourses": "local_moodlemobileapp",
"addon.block_myoverview.card": "block_myoverview", "addon.block_myoverview.card": "block_myoverview",
"addon.block_myoverview.favourites": "block_myoverview", "addon.block_myoverview.favourites": "block_myoverview",
"addon.block_myoverview.future": "block_myoverview", "addon.block_myoverview.future": "block_myoverview",
@ -47,7 +48,10 @@
"addon.block_myoverview.inprogress": "block_myoverview", "addon.block_myoverview.inprogress": "block_myoverview",
"addon.block_myoverview.lastaccessed": "block_myoverview", "addon.block_myoverview.lastaccessed": "block_myoverview",
"addon.block_myoverview.list": "block_myoverview", "addon.block_myoverview.list": "block_myoverview",
"addon.block_myoverview.nocourses": "moodle", "addon.block_myoverview.nocoursesenrolled": "local_moodlemobileapp",
"addon.block_myoverview.nocoursesenrolleddescription": "local_moodlemobileapp",
"addon.block_myoverview.noresult": "local_moodlemobileapp",
"addon.block_myoverview.noresultdescription": "local_moodlemobileapp",
"addon.block_myoverview.past": "block_myoverview", "addon.block_myoverview.past": "block_myoverview",
"addon.block_myoverview.pluginname": "block_myoverview", "addon.block_myoverview.pluginname": "block_myoverview",
"addon.block_myoverview.shortname": "block_myoverview", "addon.block_myoverview.shortname": "block_myoverview",

View File

@ -99,13 +99,26 @@
</ion-col> </ion-col>
</ion-row> </ion-row>
<core-empty-box *ngIf="filteredCourses.length == 0" image="assets/img/icons/courses.svg" <core-empty-box *ngIf="filteredCourses.length == 0" image="assets/img/icons/courses.svg">
[message]="'addon.block_myoverview.nocourses' | translate"> <p *ngIf="hasCourses" class="item-heading">
<ion-button *ngIf="searchEnabled" (click)="openSearch()" fill="outline"> {{'addon.block_myoverview.noresult' | translate}}
<ion-icon name="fas-search" slot="start" aria-hidden="true"> </p>
</ion-icon> <p *ngIf="!hasCourses" class="item-heading">
{{'core.courses.searchcourses' | translate}} {{'addon.block_myoverview.nocoursesenrolled' | translate}}
</ion-button> </p>
<ng-container *ngIf="searchEnabled">
<p *ngIf="hasCourses" class="subdued">
{{'addon.block_myoverview.noresultdescription' | translate}}
</p>
<p *ngIf="!hasCourses" class="subdued">
{{'addon.block_myoverview.nocoursesenrolleddescription' | translate}}
</p>
<ion-button (click)="openSearch()" fill="outline">
<ion-icon name="fas-search" slot="start" aria-hidden="true">
</ion-icon>
{{'addon.block_myoverview.browseallcourses' | translate}}
</ion-button>
</ng-container>
</core-empty-box> </core-empty-box>
<!-- List of courses. --> <!-- List of courses. -->

View File

@ -34,4 +34,15 @@
} }
} }
core-empty-box {
.item-heading {
font-weight: bold;
margin-bottom: 0;
font-size: 16px;
}
.subdued {
color: var(--subdued-text-color);
}
}
} }

View File

@ -1,6 +1,7 @@
{ {
"all": "All", "all": "All",
"allincludinghidden": "All (including archived)", "allincludinghidden": "All (including archived)",
"browseallcourses": "Browse all courses",
"card": "Card", "card": "Card",
"favourites": "Starred", "favourites": "Starred",
"future": "Future", "future": "Future",
@ -8,7 +9,10 @@
"inprogress": "In progress", "inprogress": "In progress",
"lastaccessed": "Last accessed", "lastaccessed": "Last accessed",
"list": "List", "list": "List",
"nocourses": "No courses", "nocoursesenrolled": "You're not enrolled in any courses yet.",
"nocoursesenrolleddescription": "Browse all available courses below and start learning.",
"noresult": "Your search didn't match any courses.",
"noresultdescription": "Try adjusting your filters or browse all courses below.",
"past": "Past", "past": "Past",
"pluginname": "Course overview", "pluginname": "Course overview",
"shortname": "Short name", "shortname": "Short name",

View File

@ -92,7 +92,7 @@
</addon-mod-forum-post> </addon-mod-forum-post>
</div> </div>
<ion-card *ngIf="sort != 'nested'"> <ion-card *ngIf="sort != 'nested' && posts.length">
<ng-container *ngFor="let post of posts; first as first"> <ng-container *ngFor="let post of posts; first as first">
<core-spacer *ngIf="!first"></core-spacer> <core-spacer *ngIf="!first"></core-spacer>
<addon-mod-forum-post [post]="post" [courseId]="courseId" [discussionId]="discussionId" [component]="component" <addon-mod-forum-post [post]="post" [courseId]="courseId" [discussionId]="discussionId" [component]="component"
@ -103,7 +103,7 @@
</ng-container> </ng-container>
</ion-card> </ion-card>
<ng-container *ngIf="sort == 'nested'"> <ng-container *ngIf="sort == 'nested' && posts.length">
<ng-container *ngFor="let post of posts"> <ng-container *ngFor="let post of posts">
<ng-container *ngTemplateOutlet="nestedPosts; context: {post: post}"></ng-container> <ng-container *ngTemplateOutlet="nestedPosts; context: {post: post}"></ng-container>
</ng-container> </ng-container>

View File

@ -75,7 +75,7 @@ export class AddonModForumDiscussionPage implements OnInit, AfterViewInit, OnDes
discussion?: AddonModForumDiscussion; discussion?: AddonModForumDiscussion;
discussions?: AddonModForumDiscussionDiscussionsSwipeManager; discussions?: AddonModForumDiscussionDiscussionsSwipeManager;
startingPost?: Post; startingPost?: Post;
posts!: Post[]; posts: Post[] = [];
discussionLoaded = false; discussionLoaded = false;
postSubjects!: { [id: string]: string }; postSubjects!: { [id: string]: string };
isOnline!: boolean; isOnline!: boolean;