Merge pull request #1797 from crazyserver/MOBILE-2910

Mobile 2910
main
Juan Leyva 2019-03-11 13:08:18 +01:00 committed by GitHub
commit a0698c7eea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 23 additions and 51 deletions

View File

@ -27,7 +27,7 @@
<ion-avatar core-user-avatar [user]="member" [linkProfile]="false" [checkOnline]="member.showonlinestatus" item-start></ion-avatar> <ion-avatar core-user-avatar [user]="member" [linkProfile]="false" [checkOnline]="member.showonlinestatus" item-start></ion-avatar>
<h2> <h2>
<core-format-text [text]="member.fullname"></core-format-text> <core-format-text [text]="member.fullname"></core-format-text>
<core-icon name="fa-ban" *ngIf="member.isblocked" [attr.aria-label]="'addon.messages.contactblocked' | translate"></core-icon> <core-icon name="fa-ban" *ngIf="member.isblocked" [label]="'addon.messages.contactblocked' | translate"></core-icon>
</h2> </h2>
</a> </a>

View File

@ -100,7 +100,7 @@
<h2> <h2>
<core-format-text [text]="conversation.name"></core-format-text> <core-format-text [text]="conversation.name"></core-format-text>
<core-icon name="fa-ban" *ngIf="conversation.isblocked" [attr.aria-label]="'addon.messages.contactblocked' | translate"></core-icon> <core-icon name="fa-ban" *ngIf="conversation.isblocked" [label]="'addon.messages.contactblocked' | translate"></core-icon>
</h2> </h2>
<ion-note *ngIf="conversation.lastmessagedate > 0 || conversation.unreadcount"> <ion-note *ngIf="conversation.lastmessagedate > 0 || conversation.unreadcount">
<ion-badge *ngIf="conversation.unreadcount > 0">{{ conversation.unreadcount }}</ion-badge> <ion-badge *ngIf="conversation.unreadcount > 0">{{ conversation.unreadcount }}</ion-badge>

View File

@ -34,7 +34,7 @@
<ion-avatar item-start core-user-avatar [user]="result" [checkOnline]="true" [linkProfile]="false"></ion-avatar> <ion-avatar item-start core-user-avatar [user]="result" [checkOnline]="true" [linkProfile]="false"></ion-avatar>
<h2> <h2>
<core-format-text [text]="result.fullname"></core-format-text> <core-format-text [text]="result.fullname"></core-format-text>
<core-icon name="fa-ban" *ngIf="result.isblocked" [attr.aria-label]="'addon.messages.contactblocked' | translate"></core-icon> <core-icon name="fa-ban" *ngIf="result.isblocked" [label]="'addon.messages.contactblocked' | translate"></core-icon>
</h2> </h2>
<ion-note *ngIf="result.lastmessagedate > 0"> <ion-note *ngIf="result.lastmessagedate > 0">
{{result.lastmessagedate | coreDateDayOrTime}} {{result.lastmessagedate | coreDateDayOrTime}}

View File

@ -25,9 +25,10 @@
<span *ngIf="question.number">{{ 'core.question.questionno' | translate:{$a: question.number} }}</span> <span *ngIf="question.number">{{ 'core.question.questionno' | translate:{$a: question.number} }}</span>
<span *ngIf="!question.number">{{ 'core.question.information' | translate }}</span> <span *ngIf="!question.number">{{ 'core.question.information' | translate }}</span>
<core-icon item-content *ngIf="!question.number" name="information-circle" color="info"></core-icon> <core-icon item-content *ngIf="!question.number" name="information-circle" color="info"></core-icon>
<core-icon item-content *ngIf="question.stateClass == 'core-question-correct'" name="fa-check" color="success"></core-icon> <core-icon item-content *ngIf="question.stateClass == 'core-question-requiresgrading'" name="fa-question-circle" color="gray" [label]="question.status"></core-icon>
<core-icon item-content *ngIf="question.stateClass == 'core-question-partiallycorrect'" name="fa-check-square" color="warning"></core-icon> <core-icon item-content *ngIf="question.stateClass == 'core-question-correct'" name="fa-check" color="success" [label]="question.status"></core-icon>
<core-icon item-content *ngIf="question.stateClass == 'core-question-incorrect' || question.stateClass == 'core-question-notanswered'" name="fa-remove" color="danger"></core-icon> <core-icon item-content *ngIf="question.stateClass == 'core-question-partiallycorrect'" name="fa-check-square" color="warning" [label]="question.status"></core-icon>
<core-icon item-content *ngIf="question.stateClass == 'core-question-incorrect' || question.stateClass == 'core-question-notanswered'" name="fa-remove" color="danger" [label]="question.status"></core-icon>
</a> </a>
<!-- In player, show button to finish attempt. --> <!-- In player, show button to finish attempt. -->

View File

@ -14,49 +14,16 @@ ion-app.app-root page-addon-mod-quiz-navigation-modal {
} }
} }
.item.core-question-correct { .item.core-question-correct,
&.addon-mod_quiz-selected {
@include border-start(5px, solid, $core-question-correct-color);
}
.item-inner {
@include push-arrow-color($core-question-correct-color);
border-bottom-color: $core-question-correct-color;
}
}
.item.core-question-incorrect, .item.core-question-incorrect,
.item.core-question-notanswered { .item.core-question-notanswered,
&.addon-mod_quiz-selected { .item.core-question-partiallycorrect,
@include border-start(5px, solid, $core-question-incorrect-color);
}
.item-inner {
@include push-arrow-color($core-question-incorrect-color);
border-bottom-color: $core-question-incorrect-color;
}
}
.item.core-question-partiallycorrect {
&.addon-mod_quiz-selected {
@include border-start(5px, solid, $core-question-state-partial-text);
}
.item-inner {
@include push-arrow-color($core-question-state-partial-text);
border-bottom-color: $core-question-state-partial-text;
}
}
.item.core-question-requiresgrading, .item.core-question-requiresgrading,
.item.core-question-answersaved { .item.core-question-answersaved {
&.addon-mod_quiz-selected { ion-label.label {
@include border-start(5px, solid, $text-color); color: $text-color;
}
.item-inner {
@include push-arrow-color($text-color);
border-bottom-color: $text-color;
} }
color: $text-color;
background-color: $white;
} }
} }

View File

@ -69,7 +69,7 @@ export class AddonModQuizReviewPage implements OnInit {
this.navigationModal = modalCtrl.create('AddonModQuizNavigationModalPage', { this.navigationModal = modalCtrl.create('AddonModQuizNavigationModalPage', {
isReview: true, isReview: true,
page: this page: this
}); }, { cssClass: 'core-modal-lateral' });
} }
/** /**

View File

@ -1,7 +1,7 @@
<ion-list [id]="uniqueId" role="menu"> <ion-list [id]="uniqueId" role="menu">
<ion-list-header *ngIf="title">{{title}}</ion-list-header> <ion-list-header *ngIf="title">{{title}}</ion-list-header>
<a ion-item text-wrap *ngFor="let item of items" core-link [capture]="item.captureLink" [autoLogin]="item.autoLogin" [href]="item.href" (click)="itemClicked($event, item)" [attr.aria-label]="item.ariaAction" [hidden]="item.hidden" [attr.detail-none]="!item.href || item.iconAction" role="menuitem" [attr.aria-controls]="uniqueId"> <a ion-item text-wrap *ngFor="let item of items" core-link [capture]="item.captureLink" [autoLogin]="item.autoLogin" [href]="item.href" (click)="itemClicked($event, item)" [attr.aria-label]="item.ariaAction" [hidden]="item.hidden" [attr.detail-none]="!item.href || item.iconAction" role="menuitem" [attr.aria-controls]="uniqueId">
<core-icon *ngIf="item.iconDescription" [name]="item.iconDescription" [attr.aria-label]="item.ariaDescription" item-start></core-icon> <core-icon *ngIf="item.iconDescription" [name]="item.iconDescription" [label]="item.ariaDescription" item-start></core-icon>
<core-format-text [clean]="true" [text]="item.content"></core-format-text> <core-format-text [clean]="true" [text]="item.content"></core-format-text>
<core-icon *ngIf="(item.href || item.action) && item.iconAction && item.iconAction != 'spinner'" [name]="item.iconAction" item-end></core-icon> <core-icon *ngIf="(item.href || item.action) && item.iconAction && item.iconAction != 'spinner'" [name]="item.iconAction" item-end></core-icon>
<ion-spinner *ngIf="(item.href || item.action) && item.iconAction == 'spinner'" item-end></ion-spinner> <ion-spinner *ngIf="(item.href || item.action) && item.iconAction == 'spinner'" item-end></ion-spinner>

View File

@ -1 +1 @@
<ion-icon [name]="name" [isActive]="isActive" [md]="md" [ios]="ios" [color]="color" aria-hidden="true" role="presentation"></ion-icon> <ion-icon [name]="name" [isActive]="isActive" [md]="md" [ios]="ios" [color]="color"></ion-icon>

View File

@ -37,6 +37,8 @@ export class CoreIconComponent implements OnInit, OnDestroy {
// FontAwesome params. // FontAwesome params.
@Input('fixed-width') fixedWidth: string; @Input('fixed-width') fixedWidth: string;
@Input('label') ariaLabel?: string;
protected element: HTMLElement; protected element: HTMLElement;
protected newElement: HTMLElement; protected newElement: HTMLElement;
@ -54,8 +56,6 @@ export class CoreIconComponent implements OnInit, OnDestroy {
this.newElement.classList.add('icon'); this.newElement.classList.add('icon');
this.newElement.classList.add('fa'); this.newElement.classList.add('fa');
this.newElement.classList.add(this.name); this.newElement.classList.add(this.name);
this.newElement.setAttribute('aria-hidden', 'true');
this.newElement.setAttribute('role', 'img');
if (this.isTrueProperty(this.fixedWidth)) { if (this.isTrueProperty(this.fixedWidth)) {
this.newElement.classList.add('fa-fw'); this.newElement.classList.add('fa-fw');
} }
@ -66,6 +66,10 @@ export class CoreIconComponent implements OnInit, OnDestroy {
this.newElement = <HTMLElement> this.element.firstElementChild; this.newElement = <HTMLElement> this.element.firstElementChild;
} }
!this.ariaLabel && this.newElement.setAttribute('aria-hidden', 'true');
!this.ariaLabel && this.newElement.setAttribute('role', 'presentation');
this.ariaLabel && this.newElement.setAttribute('aria-label', this.ariaLabel);
const attrs = this.element.attributes; const attrs = this.element.attributes;
for (let i = attrs.length - 1; i >= 0; i--) { for (let i = attrs.length - 1; i >= 0; i--) {
if (attrs[i].name == 'class') { if (attrs[i].name == 'class') {