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_myoverview.all": "block_myoverview",
"addon.block_myoverview.allincludinghidden": "block_myoverview",
"addon.block_myoverview.browseallcourses": "local_moodlemobileapp",
"addon.block_myoverview.card": "block_myoverview",
"addon.block_myoverview.favourites": "block_myoverview",
"addon.block_myoverview.future": "block_myoverview",
@ -47,7 +48,10 @@
"addon.block_myoverview.inprogress": "block_myoverview",
"addon.block_myoverview.lastaccessed": "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.pluginname": "block_myoverview",
"addon.block_myoverview.shortname": "block_myoverview",

View File

@ -99,13 +99,26 @@
</ion-col>
</ion-row>
<core-empty-box *ngIf="filteredCourses.length == 0" image="assets/img/icons/courses.svg"
[message]="'addon.block_myoverview.nocourses' | translate">
<ion-button *ngIf="searchEnabled" (click)="openSearch()" fill="outline">
<ion-icon name="fas-search" slot="start" aria-hidden="true">
</ion-icon>
{{'core.courses.searchcourses' | translate}}
</ion-button>
<core-empty-box *ngIf="filteredCourses.length == 0" image="assets/img/icons/courses.svg">
<p *ngIf="hasCourses" class="item-heading">
{{'addon.block_myoverview.noresult' | translate}}
</p>
<p *ngIf="!hasCourses" class="item-heading">
{{'addon.block_myoverview.nocoursesenrolled' | translate}}
</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>
<!-- 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",
"allincludinghidden": "All (including archived)",
"browseallcourses": "Browse all courses",
"card": "Card",
"favourites": "Starred",
"future": "Future",
@ -8,7 +9,10 @@
"inprogress": "In progress",
"lastaccessed": "Last accessed",
"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",
"pluginname": "Course overview",
"shortname": "Short name",

View File

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

View File

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