Merge pull request #3720 from alfonso-salces/MOBILE-4267
MOBILE-4267 about: Add idnumber, department and institutionmain
commit
b60fd49cec
|
@ -2492,6 +2492,7 @@
|
||||||
"core.user.completeyourprofile": "local_moodlemobileapp",
|
"core.user.completeyourprofile": "local_moodlemobileapp",
|
||||||
"core.user.contact": "local_moodlemobileapp",
|
"core.user.contact": "local_moodlemobileapp",
|
||||||
"core.user.country": "moodle",
|
"core.user.country": "moodle",
|
||||||
|
"core.user.department": "moodle",
|
||||||
"core.user.description": "moodle",
|
"core.user.description": "moodle",
|
||||||
"core.user.details": "report_security",
|
"core.user.details": "report_security",
|
||||||
"core.user.detailsnotavailable": "local_moodlemobileapp",
|
"core.user.detailsnotavailable": "local_moodlemobileapp",
|
||||||
|
@ -2500,6 +2501,8 @@
|
||||||
"core.user.emailagain": "moodle",
|
"core.user.emailagain": "moodle",
|
||||||
"core.user.errorloaduser": "local_moodlemobileapp",
|
"core.user.errorloaduser": "local_moodlemobileapp",
|
||||||
"core.user.firstname": "moodle",
|
"core.user.firstname": "moodle",
|
||||||
|
"core.user.idnumber": "moodle",
|
||||||
|
"core.user.institution": "moodle",
|
||||||
"core.user.interests": "moodle",
|
"core.user.interests": "moodle",
|
||||||
"core.user.lastcourseaccess": "moodle",
|
"core.user.lastcourseaccess": "moodle",
|
||||||
"core.user.lastname": "moodle",
|
"core.user.lastname": "moodle",
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
"completeyourprofile": "Complete your profile",
|
"completeyourprofile": "Complete your profile",
|
||||||
"contact": "Contact",
|
"contact": "Contact",
|
||||||
"country": "Country",
|
"country": "Country",
|
||||||
|
"department": "Department",
|
||||||
"description": "Description",
|
"description": "Description",
|
||||||
"details": "Details",
|
"details": "Details",
|
||||||
"detailsnotavailable": "The details of this user are not available to you.",
|
"detailsnotavailable": "The details of this user are not available to you.",
|
||||||
|
@ -17,6 +18,8 @@
|
||||||
"emailagain": "Email (again)",
|
"emailagain": "Email (again)",
|
||||||
"errorloaduser": "Error loading user.",
|
"errorloaduser": "Error loading user.",
|
||||||
"firstname": "First name",
|
"firstname": "First name",
|
||||||
|
"idnumber": "ID number",
|
||||||
|
"institution": "Institution",
|
||||||
"interests": "Interests",
|
"interests": "Interests",
|
||||||
"lastcourseaccess": "Last access to course",
|
"lastcourseaccess": "Last access to course",
|
||||||
"lastname": "Last name",
|
"lastname": "Last name",
|
||||||
|
|
|
@ -59,21 +59,13 @@
|
||||||
</a></p>
|
</a></p>
|
||||||
</ion-label>
|
</ion-label>
|
||||||
</ion-item>
|
</ion-item>
|
||||||
<ion-item class="ion-text-wrap" *ngIf="formattedAddress">
|
<ion-item class="ion-text-wrap" *ngIf="user.city">
|
||||||
<ion-label>
|
|
||||||
<p class="item-heading">{{ 'core.user.address' | translate}}</p>
|
|
||||||
<p><a class="core-anchor" [href]="encodedAddress" core-link auto-login="no" [showBrowserWarning]="false">
|
|
||||||
{{ formattedAddress }}
|
|
||||||
</a></p>
|
|
||||||
</ion-label>
|
|
||||||
</ion-item>
|
|
||||||
<ion-item class="ion-text-wrap" *ngIf="user.city && !formattedAddress">
|
|
||||||
<ion-label>
|
<ion-label>
|
||||||
<p class="item-heading">{{ 'core.user.city' | translate}}</p>
|
<p class="item-heading">{{ 'core.user.city' | translate}}</p>
|
||||||
<p>{{ user.city }}</p>
|
<p>{{ user.city }}</p>
|
||||||
</ion-label>
|
</ion-label>
|
||||||
</ion-item>
|
</ion-item>
|
||||||
<ion-item class="ion-text-wrap" *ngIf="user.country && !formattedAddress">
|
<ion-item class="ion-text-wrap" *ngIf="user.country">
|
||||||
<ion-label>
|
<ion-label>
|
||||||
<p class="item-heading">{{ 'core.user.country' | translate}}</p>
|
<p class="item-heading">{{ 'core.user.country' | translate}}</p>
|
||||||
<p>{{ user.country }}</p>
|
<p>{{ user.country }}</p>
|
||||||
|
@ -85,6 +77,26 @@
|
||||||
<p>{{ user.timezone }}</p>
|
<p>{{ user.timezone }}</p>
|
||||||
</ion-label>
|
</ion-label>
|
||||||
</ion-item>
|
</ion-item>
|
||||||
|
<ng-container *ngIf="canShowDepartment">
|
||||||
|
<ion-item class="ion-text-wrap" *ngIf="user.idnumber">
|
||||||
|
<ion-label>
|
||||||
|
<p class="item-heading">{{ 'core.user.idnumber' | translate }}</p>
|
||||||
|
<p>{{ user.idnumber }}</p>
|
||||||
|
</ion-label>
|
||||||
|
</ion-item>
|
||||||
|
<ion-item class="ion-text-wrap" *ngIf="user.institution">
|
||||||
|
<ion-label>
|
||||||
|
<p class="item-heading">{{ 'core.user.institution' | translate }}</p>
|
||||||
|
<p>{{ user.institution }}</p>
|
||||||
|
</ion-label>
|
||||||
|
</ion-item>
|
||||||
|
<ion-item class="ion-text-wrap" *ngIf="user.department">
|
||||||
|
<ion-label>
|
||||||
|
<p class="item-heading">{{ 'core.user.department' | translate }}</p>
|
||||||
|
<p>{{ user.department }}</p>
|
||||||
|
</ion-label>
|
||||||
|
</ion-item>
|
||||||
|
</ng-container>
|
||||||
</ion-item-group>
|
</ion-item-group>
|
||||||
<ion-item-group *ngIf="hasDetails">
|
<ion-item-group *ngIf="hasDetails">
|
||||||
<ion-item-divider>
|
<ion-item-divider>
|
||||||
|
|
|
@ -13,12 +13,10 @@
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
import { Component, OnDestroy, OnInit } from '@angular/core';
|
import { Component, OnDestroy, OnInit } from '@angular/core';
|
||||||
import { SafeUrl } from '@angular/platform-browser';
|
|
||||||
import { IonRefresher } from '@ionic/angular';
|
import { IonRefresher } from '@ionic/angular';
|
||||||
|
|
||||||
import { CoreSites } from '@services/sites';
|
import { CoreSites } from '@services/sites';
|
||||||
import { CoreDomUtils } from '@services/utils/dom';
|
import { CoreDomUtils } from '@services/utils/dom';
|
||||||
import { CoreTextUtils } from '@services/utils/text';
|
|
||||||
import { CoreUtils } from '@services/utils/utils';
|
import { CoreUtils } from '@services/utils/utils';
|
||||||
import { CoreEventObserver, CoreEvents } from '@singletons/events';
|
import { CoreEventObserver, CoreEvents } from '@singletons/events';
|
||||||
import {
|
import {
|
||||||
|
@ -52,11 +50,10 @@ export class CoreUserAboutPage implements OnInit, OnDestroy {
|
||||||
hasDetails = false;
|
hasDetails = false;
|
||||||
user?: CoreUserProfile;
|
user?: CoreUserProfile;
|
||||||
title?: string;
|
title?: string;
|
||||||
formattedAddress?: string;
|
|
||||||
encodedAddress?: SafeUrl;
|
|
||||||
canChangeProfilePicture = false;
|
canChangeProfilePicture = false;
|
||||||
interests?: string[];
|
interests?: string[];
|
||||||
displayTimezone = false;
|
displayTimezone = false;
|
||||||
|
canShowDepartment = false;
|
||||||
|
|
||||||
protected userId!: number;
|
protected userId!: number;
|
||||||
protected site!: CoreSite;
|
protected site!: CoreSite;
|
||||||
|
@ -88,6 +85,7 @@ export class CoreUserAboutPage implements OnInit, OnDestroy {
|
||||||
async ngOnInit(): Promise<void> {
|
async ngOnInit(): Promise<void> {
|
||||||
this.userId = CoreNavigator.getRouteNumberParam('userId') || 0;
|
this.userId = CoreNavigator.getRouteNumberParam('userId') || 0;
|
||||||
this.courseId = CoreNavigator.getRouteNumberParam('courseId') || 0;
|
this.courseId = CoreNavigator.getRouteNumberParam('courseId') || 0;
|
||||||
|
this.canShowDepartment = this.userId != this.site.getUserId();
|
||||||
|
|
||||||
// Allow to change the profile image only in the app profile page.
|
// Allow to change the profile image only in the app profile page.
|
||||||
this.canChangeProfilePicture =
|
this.canChangeProfilePicture =
|
||||||
|
@ -110,11 +108,6 @@ export class CoreUserAboutPage implements OnInit, OnDestroy {
|
||||||
try {
|
try {
|
||||||
const user = await CoreUser.getProfile(this.userId, this.courseId);
|
const user = await CoreUser.getProfile(this.userId, this.courseId);
|
||||||
|
|
||||||
if (user.address) {
|
|
||||||
this.formattedAddress = CoreUserHelper.formatAddress(user.address, user.city, user.country);
|
|
||||||
this.encodedAddress = CoreTextUtils.buildAddressURL(this.formattedAddress);
|
|
||||||
}
|
|
||||||
|
|
||||||
this.interests = user.interests ?
|
this.interests = user.interests ?
|
||||||
user.interests.split(',').map(interest => interest.trim()) :
|
user.interests.split(',').map(interest => interest.trim()) :
|
||||||
undefined;
|
undefined;
|
||||||
|
|
Loading…
Reference in New Issue