commit
578c40f3d1
|
@ -53,6 +53,7 @@
|
||||||
"ro": "Română",
|
"ro": "Română",
|
||||||
"ru": "Русский",
|
"ru": "Русский",
|
||||||
"sl": "Slovenščina",
|
"sl": "Slovenščina",
|
||||||
|
"sq": "Shqip",
|
||||||
"sr-cr": "Српски",
|
"sr-cr": "Српски",
|
||||||
"sr-lt": "Srpski",
|
"sr-lt": "Srpski",
|
||||||
"sv": "Svenska",
|
"sv": "Svenska",
|
||||||
|
|
|
@ -617,7 +617,7 @@ export class AddonCalendarHelperProvider {
|
||||||
const eventCourse = (event.course && event.course.id) || event.courseid;
|
const eventCourse = (event.course && event.course.id) || event.courseid;
|
||||||
|
|
||||||
// Show the event if it is from site home or if it matches the selected course.
|
// Show the event if it is from site home or if it matches the selected course.
|
||||||
return !!eventCourse && (eventCourse == CoreSites.getCurrentSiteHomeId() || eventCourse == courseId);
|
return !eventCourse || (eventCourse === CoreSites.getCurrentSiteHomeId() || eventCourse === courseId);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -166,7 +166,7 @@
|
||||||
|
|
||||||
<!-- Add or edit submission. -->
|
<!-- Add or edit submission. -->
|
||||||
<div collapsible-footer *ngIf="loaded && !isSubmittedForGrading" [hidden]="selectedTab !== 'submission'" slot="fixed">
|
<div collapsible-footer *ngIf="loaded && !isSubmittedForGrading" [hidden]="selectedTab !== 'submission'" slot="fixed">
|
||||||
<div class="list-item-limited-width adaptable-buttons-row" *ngIf="canEdit || canSubmit">
|
<div class="list-item-limited-width" *ngIf="canEdit || canSubmit">
|
||||||
<ng-container *ngIf="canEdit">
|
<ng-container *ngIf="canEdit">
|
||||||
<ng-container *ngIf=" !unsupportedEditPlugins.length && !showErrorStatementEdit">
|
<ng-container *ngIf=" !unsupportedEditPlugins.length && !showErrorStatementEdit">
|
||||||
<!-- If has offline data, show edit. -->
|
<!-- If has offline data, show edit. -->
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
|
|
||||||
import { CoreSites } from '@services/sites';
|
import { CoreSites } from '@services/sites';
|
||||||
|
import { CoreUtils } from '@services/utils/utils';
|
||||||
import { makeSingleton } from '@singletons';
|
import { makeSingleton } from '@singletons';
|
||||||
import { PREFERENCES_TABLE_NAME, CoreUserPreferenceDBRecord } from './database/user';
|
import { PREFERENCES_TABLE_NAME, CoreUserPreferenceDBRecord } from './database/user';
|
||||||
|
|
||||||
|
@ -33,7 +34,10 @@ export class CoreUserOfflineProvider {
|
||||||
async getChangedPreferences(siteId?: string): Promise<CoreUserPreferenceDBRecord[]> {
|
async getChangedPreferences(siteId?: string): Promise<CoreUserPreferenceDBRecord[]> {
|
||||||
const site = await CoreSites.getSite(siteId);
|
const site = await CoreSites.getSite(siteId);
|
||||||
|
|
||||||
return site.getDb().getRecordsSelect(PREFERENCES_TABLE_NAME, 'value != onlineValue');
|
return site.getDb().getRecordsSelect(
|
||||||
|
PREFERENCES_TABLE_NAME,
|
||||||
|
'value != onlinevalue OR onlinevalue IS NULL',
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -64,8 +68,19 @@ export class CoreUserOfflineProvider {
|
||||||
const record: Partial<CoreUserPreferenceDBRecord> = {
|
const record: Partial<CoreUserPreferenceDBRecord> = {
|
||||||
name,
|
name,
|
||||||
value,
|
value,
|
||||||
|
onlinevalue: onlineValue,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (onlineValue === undefined) {
|
||||||
|
// Keep online value already stored (if any).
|
||||||
|
const entry = await CoreUtils.ignoreErrors(
|
||||||
|
site.getDb().getRecord<CoreUserPreferenceDBRecord>(PREFERENCES_TABLE_NAME, { name }),
|
||||||
|
null,
|
||||||
|
);
|
||||||
|
|
||||||
|
record.onlinevalue = entry?.onlinevalue;
|
||||||
|
}
|
||||||
|
|
||||||
await site.getDb().insertRecord(PREFERENCES_TABLE_NAME, record);
|
await site.getDb().insertRecord(PREFERENCES_TABLE_NAME, record);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue