Merge pull request #3231 from crazyserver/MOBILE-3833

Mobile 3833
main
Dani Palou 2022-04-05 16:16:54 +02:00 committed by GitHub
commit 8ca0325571
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
96 changed files with 101 additions and 22 deletions

View File

@ -1,21 +1,42 @@
:host .core-block-content ::ng-deep {
ul.badges {
list-style: none;
margin-left: 0;
margin-right: 0;
-webkit-padding-start: 0;
:host {
--badge-size: 100px;
--badge-container-size: 150px;
li {
position: relative;
display: inline-block;
padding-top: 1em;
text-align: center;
vertical-align: top;
width: 150px;
.core-block-content ::ng-deep {
.badge-name {
display: block;
padding: 5px;
ul.badges {
list-style: none;
margin: 0;
li {
position: relative;
display: inline-block;
text-align: center;
margin-top: 1em;
vertical-align: top;
width: var(--badge-container-size);
.badge-name {
display: block;
padding: 5px;
}
.badge-image {
width: var(--badge-size);
}
.expireimage {
content: 'expired';
background-image: url('/assets/img/expired.svg');
background-repeat: no-repeat;
background-size: var(--badge-size) var(--badge-size);
width: var(--badge-size);
height: var(--badge-size);
left: calc((var(--badge-container-size) - var(--badge-size)) /2);
top: 0;
position: absolute;
z-index: 2;
opacity: .85;
}
}
}
}

View File

@ -154,6 +154,10 @@ export class AddonModH5PActivityPrefetchHandlerService extends CoreCourseActivit
};
if (!accessInfo.canreviewattempts) {
if (!h5pActivity.enabletracking) {
return;
}
// Not a teacher, prefetch user attempts and the current user profile.
const site = await CoreSites.getSite(siteId);

View File

@ -20,7 +20,8 @@
padding: 0;
}
.core-course-storage-activity ion-label {
.core-course-storage-activity ion-label h3 {
position: relative;
max-height: var(--course-storage-max-activity-height);
&:before {

View File

@ -0,0 +1 @@
<svg width="150" height="150" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMinYMid meet"><title>Layer 1</title><path stroke="#fff" stroke-linecap="null" stroke-linejoin="null" stroke-dasharray="null" stroke-width="8" fill="none" d="M6.773 112.162L113.546 5.39l29.7 29.698L36.47 141.86z"/><path stroke-width="5" stroke="#bf3b08" fill="none" d="M7 112.066L113.066 6l29.34 29.34L36.342 141.408z"/><text stroke="#fff" fill="#bf3b08" stroke-dasharray="null" stroke-linejoin="null" stroke-linecap="null" x="72.605" y="79.727" font-size="20" font-family="Sans-serif" text-anchor="middle" font-weight="bold" transform="rotate(-45 74.918 71.252) scale(1.00967 1)">E X P I R E D</text></svg>

After

Width:  |  Height:  |  Size: 693 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 539 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 543 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 888 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 888 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -299,11 +299,17 @@ export class CoreCourseModuleDelegateService extends CoreDelegate<CoreCourseModu
sectionId?: number,
forCoursePage?: boolean,
): Promise<CoreCourseModuleHandlerData | undefined> {
return await this.executeFunctionOnEnabled<CoreCourseModuleHandlerData>(
const data = await this.executeFunctionOnEnabled<CoreCourseModuleHandlerData>(
modname,
'getData',
[module, courseId, sectionId, forCoursePage],
);
if (data) {
data.showDownloadButton = data.showDownloadButton ?? true;
}
return data;
}
/**

View File

@ -6,7 +6,7 @@
position: relative;
width: 100%;
height: 230px;
background: url('../../../../../assets/img/icons/h5p.svg') center top 25px / 100px auto no-repeat var(--core-h5p-placeholder-bg-color);
background: url('/assets/img/icons/h5p.svg') center top 25px / 100px auto no-repeat var(--core-h5p-placeholder-bg-color);
color: var(--core-h5p-placeholder-text-color);
.icon:not([color="success"]) {

View File

@ -45,6 +45,14 @@
</ion-label>
<ion-toggle [(ngModel)]="pluginStyles" (ionChange)="pluginStylesChanged()"></ion-toggle>
</ion-item>
<ion-item class="ion-text-wrap" *ngIf="userToursEnabled">
<ion-label>
<h2>Reset user tours</h2>
</ion-label>
<ion-button (click)="resetUserTours()" aria-label="Reset user tours" fill="clear" slot="end">
<ion-icon slot="icon-only" aria-hidden="true" name="fas-broom"></ion-icon>
</ion-button>
</ion-item>
<ion-item-divider>
<ion-label>

View File

@ -14,7 +14,9 @@
import { Component, OnInit } from '@angular/core';
import { CoreSitePlugins } from '@features/siteplugins/services/siteplugins';
import { CoreUserTours } from '@features/usertours/services/user-tours';
import { CoreSites } from '@services/sites';
import { CoreDomUtils } from '@services/utils/dom';
import { CoreUtils } from '@services/utils/utils';
import { Platform } from '@singletons';
@ -36,6 +38,7 @@ export class CoreSettingsDevPage implements OnInit {
pluginStyles = true;
pluginStylesCount = 0;
sitePlugins: CoreSitePluginsBasicInfo[] = [];
userToursEnabled = true;
disabledFeatures: string[] = [];
@ -60,6 +63,8 @@ export class CoreSettingsDevPage implements OnInit {
this.pluginStyles = false;
this.pluginStylesCount = 0;
this.userToursEnabled = !CoreUserTours.isDisabled();
document.head.querySelectorAll('style').forEach((style) => {
if (this.siteId && style.id.endsWith(this.siteId)) {
if (style.innerHTML.length > 0) {
@ -139,6 +144,14 @@ export class CoreSettingsDevPage implements OnInit {
CoreUtils.copyToClipboard(JSON.stringify({ disabledFeatures: this.disabledFeatures, sitePlugins: this.sitePlugins }));
}
/**
* Reset all user tours.
*/
async resetUserTours(): Promise<void> {
await CoreUserTours.resetTours();
CoreDomUtils.showToast('User tours have been reseted');
}
}
// Basic site plugin info.

View File

@ -63,7 +63,7 @@ export class CoreUserToursService {
* @returns Whether the User Tour is pending or not.
*/
async isPending(id: string): Promise<boolean> {
if (CoreConstants.CONFIG.disableUserTours || CoreConstants.CONFIG.disabledUserTours?.includes(id)) {
if (this.isDisabled(id)) {
return false;
}
@ -252,6 +252,31 @@ export class CoreUserToursService {
}
}
/**
* Is user Tour disabled?
*
* @param tourId Tour Id or undefined to check all user tours.
* @return Wether a particular or all user tours are disabled.
*/
isDisabled(tourId?: string): boolean {
if (CoreConstants.CONFIG.disableUserTours) {
return true;
}
return !!tourId && !!CoreConstants.CONFIG.disabledUserTours?.includes(tourId);
}
/**
* It will reset all user tours.
*/
async resetTours(): Promise<void> {
if (this.isDisabled()) {
return;
}
await this.table.delete();
}
}
export const CoreUserTours = makeSingleton(CoreUserToursService);

View File

@ -280,7 +280,7 @@ export class CoreMimetypeUtilsProvider {
* @return The path to a folder icon.
*/
getFolderIcon(): string {
return 'assets/img/files/folder.png';
return 'assets/img/files/folder-64.png';
}
/**
@ -290,7 +290,7 @@ export class CoreMimetypeUtilsProvider {
* @return The icon path.
*/
getFileIconForType(type: string): string {
return `assets/img/files/${type}.png`;
return 'assets/img/files/' + type + '-64.png';
}
/**