Merge pull request #2764 from crazyserver/MOBILE-3752

Mobile 3752
main
Dani Palou 2021-05-14 08:30:40 +02:00 committed by GitHub
commit 7a2c27fe57
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
177 changed files with 364 additions and 436 deletions

View File

@ -310,7 +310,7 @@ function array_contains {
print_title 'Generating language from code...'
gulp lang
npx gulp lang
print_title 'Getting languages'

View File

@ -10,8 +10,9 @@ DEFAULT_LASTVERSION='4.0'
# Checks if AWS is available and configured.
function check_aws {
aws --version &> /dev/null
AWS_SERVICE=1
aws --version &> /dev/null
if [ $? -ne 0 ]; then
AWS_SERVICE=0
echo 'AWS not installed. Check https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html for more info.'
@ -19,7 +20,7 @@ function check_aws {
fi
# In order to login to AWS, use credentials file or AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY vars.
if [ ! -f ~/.aws/credentials ] && [ [ -z $AWS_ACCESS_KEY_ID ] || [ -z $AWS_SECRET_ACCESS_KEY ] ]; then
if [ ! -f ~/.aws/credentials ] && ([ -z "$AWS_ACCESS_KEY_ID" ] || [ -z "$AWS_SECRET_ACCESS_KEY" ]); then
AWS_SERVICE=0
lastversion=$DEFAULT_LASTVERSION
echo 'AWS Cannot authenticate. Use aws configure or set the proper env vars.'
@ -63,6 +64,13 @@ function get_last_version {
lastversion=$DEFAULT_LASTVERSION
}
# Create langfolder
function create_langfolder {
if [ ! -d $LANGPACKSFOLDER ]; then
mkdir $LANGPACKSFOLDER
fi
}
# Get all language list from AWS.
function get_all_languages_aws {
langsfiles=`aws s3 ls s3://$BUCKET/$lastversion/`
@ -87,6 +95,8 @@ function get_language {
get_last_version
create_langfolder
echo "Getting $lang language"
pushd $LANGPACKSFOLDER > /dev/null
@ -115,7 +125,7 @@ function get_languages {
return
fi
else
mkdir $LANGPACKSFOLDER
create_langfolder
fi

View File

@ -34,8 +34,6 @@ export class AddonBlockLearningPlansHandlerService extends CoreBlockBaseHandler
* @return Data or promise resolved with the data.
*/
getDisplayData(): CoreBlockHandlerData {
// @todo
return {
title: 'addon.block_learningplans.pluginname',
class: 'addon-block-learning-plans',

View File

@ -65,7 +65,7 @@
</ion-card>
<ion-card *ngIf="plan">
<ion-card-header class="ion-text-wrap">
<h2>{{ 'addon.competency.learningplancompetencies' | translate }}</h2>
<ion-card-title>{{ 'addon.competency.learningplancompetencies' | translate }}</ion-card-title>
</ion-card-header>
<ion-list>
<ion-item class="ion-text-wrap" *ngIf="plan.competencycount == 0">

View File

@ -3377,7 +3377,7 @@ export type AddonMessagesMarkMessageReadResult = {
* Result of WS core_message_send_instant_messages.
*/
export type AddonMessagesSendInstantMessagesMessage = {
msgid: number; // Test this to know if it succeeds: id of the created message if it succeeded, -1 when failed.
msgid: number; // Test this to know if it succeeds: i of the created message if it succeeded, -1 when failed.
clientmsgid?: string; // Your own id for the message.
errormessage?: string; // Error message - if it failed.
text?: string; // @since 3.6. The text of the message.

View File

@ -22,8 +22,6 @@
.addon-data-advanced-search {
padding: 16px;
width: 100%;
// @todo check if needed
// @include safe-area-padding-horizontal(16px !important, 16px !important);
}
.addon-data-contents form,

View File

@ -17,8 +17,6 @@ $grid-column-paddings: (
white-space: normal;
word-break: break-word;
padding: 16px;
// @todo check if needed
// @include safe-area-padding-horizontal(16px !important, 16px !important);
background-color: var(--ion-item-background);
border-width: 1px 0;

View File

@ -49,8 +49,6 @@ declare module '@singletons/events' {
/**
* Service that provides some features for forums.
*
* @todo Add all content.
*/
@Injectable({ providedIn: 'root' })
export class AddonModForumProvider {

View File

@ -61,51 +61,62 @@
<!-- List of user attempts. -->
<ion-card class="addon-mod_quiz-table" *ngIf="quiz && attempts.length">
<ion-card-header class="ion-text-wrap">
<ion-card-header>
<ion-card-title>{{ 'addon.mod_quiz.summaryofattempts' | translate }}</ion-card-title>
</ion-card-header>
</ion-card-header>
<ion-card-content>
<ion-card-content role="table">
<!-- "Header" of the table -->
<ion-item class="ion-text-wrap addon-mod_quiz-table-header" detail="true">
<ion-label>
<ion-row class="ion-align-items-center">
<ion-col class="ion-text-center ion-hide-md-down" *ngIf="quiz.showAttemptColumn">
<strong>{{ 'addon.mod_quiz.attemptnumber' | translate }}</strong>
<ion-item class="ion-text-wrap addon-mod_quiz-table-header">
<ion-label role="rowgroup">
<ion-row class="ion-align-items-center" role="row">
<ion-col class="ion-text-center" *ngIf="quiz.showAttemptColumn" role="columnheader">
<strong class="ion-hide-md-up" aria-hidden="true">#</strong>
<span class="sr-only ion-hide-md-up">{{ 'addon.mod_quiz.attemptnumber' | translate }}</span>
<strong class="ion-hide-md-down">{{ 'addon.mod_quiz.attemptnumber' | translate }}</strong>
</ion-col>
<ion-col class="ion-text-center ion-hide-md-up" *ngIf="quiz.showAttemptColumn"><strong>#</strong></ion-col>
<ion-col size="7"><strong>{{ 'addon.mod_quiz.attemptstate' | translate }}</strong></ion-col>
<ion-col class="ion-text-center ion-hide-md-down" *ngIf="quiz.showMarkColumn">
<ion-col size="7" role="columnheader">
<strong>{{ 'addon.mod_quiz.attemptstate' | translate }}</strong>
</ion-col>
<ion-col class="ion-text-center ion-hide-md-down" *ngIf="quiz.showMarkColumn" role="columnheader">
<strong>{{ 'addon.mod_quiz.marks' | translate }} / {{ quiz.sumGradesFormatted }}</strong>
</ion-col>
<ion-col class="ion-text-center" *ngIf="quiz.showGradeColumn">
<ion-col class="ion-text-center" *ngIf="quiz.showGradeColumn" role="columnheader">
<strong>{{ 'addon.mod_quiz.grade' | translate }} / {{ quiz.gradeFormatted }}</strong>
</ion-col>
</ion-row>
</ion-label>
</ion-item>
<div role="rowgroup">
<!-- List of attempts. -->
<ion-item class="ion-text-wrap" *ngFor="let attempt of attempts" button detail="true"
<ion-item
button
detail="true"
*ngFor="let attempt of attempts"
class="ion-text-wrap"
[ngClass]='{"addon-mod_quiz-highlighted": attempt.highlightGrade}'
[attr.aria-label]="'core.seemoredetail' | translate" (click)="viewAttempt(attempt.id)">
[attr.aria-label]="'core.seemoredetail' | translate"
(click)="viewAttempt(attempt.id)"
>
<ion-label>
<ion-row class="ion-align-items-center">
<ion-col class="ion-text-center" *ngIf="quiz.showAttemptColumn && attempt.preview">
<ion-row class="ion-align-items-center" role="row">
<ion-col class="ion-text-center" *ngIf="quiz.showAttemptColumn && attempt.preview" role="cell">
{{ 'addon.mod_quiz.preview' | translate }}
</ion-col>
<ion-col class="ion-text-center" *ngIf="quiz.showAttemptColumn && !attempt.preview">
<ion-col class="ion-text-center" *ngIf="quiz.showAttemptColumn && !attempt.preview" role="cell">
{{ attempt.attempt }}
</ion-col>
<ion-col size="7">
<ion-col size="7" role="cell">
<p *ngFor="let sentence of attempt.readableState">{{ sentence }}</p>
</ion-col>
<ion-col class="ion-text-center ion-hide-md-down" *ngIf="quiz.showMarkColumn">
<ion-col class="ion-text-center ion-hide-md-down" *ngIf="quiz.showMarkColumn" role="cell">
<p>{{ attempt.readableMark }}</p>
</ion-col>
<ion-col class="ion-text-center" *ngIf="quiz.showGradeColumn"><p>{{ attempt.readableGrade }}</p></ion-col>
<ion-col class="ion-text-center" *ngIf="quiz.showGradeColumn" role="cell">
<p>{{ attempt.readableGrade }}</p>
</ion-col>
</ion-row>
</ion-label>
</ion-item>
</div>
</ion-card-content>
</ion-card>

View File

@ -23,8 +23,8 @@
<ion-card *ngIf="attempt">
<ion-card-header class="ion-text-wrap">
<ion-card-title>
<span *ngIf="attempt.preview">{{ 'addon.mod_quiz.reviewofpreview' | translate }}</span>
<span *ngIf="!attempt.preview">{{ 'addon.mod_quiz.reviewofattempt' | translate:{$a: attempt.attempt} }}</span>
<ng-container *ngIf="attempt.preview">{{ 'addon.mod_quiz.reviewofpreview' | translate }}</ng-container>
<ng-container *ngIf="!attempt.preview">{{ 'addon.mod_quiz.reviewofattempt' | translate:{$a: attempt.attempt} }}</ng-container>
</ion-card-title>
</ion-card-header>
<ion-list lines="none">

View File

@ -35,7 +35,7 @@ const routes: Routes = [
canDeactivate: [CanLeaveGuard],
},
{
path: ':courseId/:cmId/:submissionId/edit', // @todo
path: ':courseId/:cmId/:submissionId/edit',
component: AddonModWorkshopEditSubmissionPage,
canDeactivate: [CanLeaveGuard],
},

View File

@ -1,31 +0,0 @@
:host {
// @todo
// .card-md core-file + core-file > .item-md.item-block > .item-inner,
// core-file + core-file > .item-md.item-block > .item-inner {
// border-top: 1px solid $list-md-border-color;
// }
// .card-ios core-file + core-file > .item-ios.item-block > .item-inner,
// core-file + core-file > .item-ios.item-block > .item-inner {
// border-top: $hairlines-width solid $list-ios-border-color;
// .buttons {
// min-height: 53px;
// min-width: 58px;
// }
// }
// core-file > .item.item-block > .item-inner {
// border-bottom: 0;
// @include safe-area-padding(null, 0px, null, null);
// .buttons {
// display: flex;
// flex-flow: row;
// align-items: center;
// z-index: 1;
// justify-content: space-around;
// align-content: center;
// min-height: 52px;
// min-width: 53px;
// }
// }
}

View File

@ -34,7 +34,6 @@ import { CoreWSFile } from '@services/ws';
@Component({
selector: 'core-file',
templateUrl: 'core-file.html',
styleUrls: ['file.scss'],
})
export class CoreFileComponent implements OnInit, OnDestroy {

View File

@ -1,5 +1,7 @@
:host {
position: relative;
width: var(--core-avatar-size);
height: var(--core-avatar-size);
.clickable {
cursor: pointer;

View File

@ -4,9 +4,6 @@
background: var(--background);
ion-item-divider {
min-height: 60px;
.core-button-spinner {
margin: 0;
}
min-height: var(--item-divider-min-height);
}
}

View File

@ -16,7 +16,6 @@
box-shadow: none !important;
flex-grow: 1;
max-width: 100%;
// @todo @include core-split-area-start();
}
div.core-course-blocks-side {
@ -24,7 +23,6 @@
min-width: var(--side-blocks-min-width);
box-shadow: var(--side-blocks-box-shadow);
z-index: 2;
// @todo @include core-split-area-end();
}
.core-course-blocks-content,

View File

@ -52,31 +52,4 @@
}
}
// @todo
// .item-divider {
// .label {
// margin-top: 0;
// margin-bottom: 0;
// }
// core-format-text {
// line-height: 44px;
// }
// ion-badge core-format-text {
// line-height: normal;
// margin-bottom: 9px;
// }
// &.core-section-download .label{
// @include margin(null, 0, null, null);
// }
// }
// div.core-section-download {
// @include padding(null, 0, null, null);
// }
//
}

View File

@ -1,17 +0,0 @@
// @todo Review commented styles.
// ion-app.app-root {
// .safe-area-page,
// .safe-padding-horizontal {
// core-course-module-description {
// padding-left: 0 !important;
// padding-right: 0 !important;
// .item-ios.item-block {
// @include safe-area-padding-horizontal($item-ios-padding-end / 2, null);
// .item-inner {
// @include safe-area-padding-horizontal(null, $item-ios-padding-end / 2);
// }
// }
// }
// }
// }

View File

@ -28,7 +28,10 @@
</p>
</ion-label>
<ng-container *ngIf="!isEnrolled">
<ion-icon *ngFor="let icon of icons" color="dark" size="small"
[name]="icon.icon" [attr.aria-label]="icon.label | translate" slot="end"></ion-icon>
<ion-icon *ngFor="let icon of icons" color="dark" size="small" [name]="icon.icon"
[title]="icon.label | translate"
[attr.aria-label]="icon.label | translate"
slot="end">
</ion-icon>
</ng-container>
</ion-item>

View File

@ -1,7 +1,18 @@
@import "~theme/globals";
// @todo darkmode
// @todo RTL layout
:host {
--header-background: var(--white);
--odd-cell-background: var(--gray-lighter);
--even-cell-background: var(--white);
--icon-color: #999999;
}
:host-context(body.dark) {
--header-background: var(--black);
--odd-cell-background: var(--gray-darker);
--even-cell-background: var(--black);
--icon-color: #eeeeee;
}
:host-context(ion-app.md) {
--border-color: var(--ion-item-border-color, var(--ion-border-color, var(--ion-color-step-150, rgba(0, 0, 0, .13))));
@ -18,16 +29,12 @@
font-size: 16px;
color: var(--ion-text-color);
// @include darkmode() {
// color: $core-dark-text-color;
// }
tr {
border-bottom: 1px solid var(--border-color);
}
th, td {
padding: 10px 0 10px 10px;
@include padding(10px, 10px, 10px, null);
vertical-align: top;
white-space: normal;
text-align: start;
@ -36,11 +43,7 @@
thead th {
vertical-align: bottom;
font-weight: bold;
background-color: var(--white);
// @include darkmode() {
// background-color: $black;
// }
background-color: var(--header-background);
}
tbody th {
@ -48,15 +51,15 @@
}
#gradeitem {
padding-left: 5px;
@include padding(null, null, null, 5px);
}
.core-grades-table-gradeitem {
padding-left: 5px;
@include padding(null, null, null, 5px);
font-weight: bold;
&.column-itemname {
padding-left: 0;
@include padding(null, null, null, 0);
}
img {
@ -65,17 +68,17 @@
}
ion-icon {
color: #999999;
color: var(--icon-color);
}
span {
margin-left: 5px;
@include margin(null, null, null, 5px);
}
}
.core-grades-table-feedback {
padding-left: 5px;
@include padding(null, null, null, 5px);
.no-overflow {
overflow: auto;
@ -89,27 +92,16 @@
}
.odd {
td, th, th[aria-current="page"] {
background-color: var(--gray-lighter);
// @include darkmode() {
// background-color: $gray-darker;
// }
background-color: var(--odd-cell-background);
}
}
.even {
td, th, th[aria-current="page"] {
background-color: var(--white);
// @include darkmode() {
// background-color: $black;
// }
background-color: var(--even-cell-background);
}
}
.core-grades-grade-clickable {

View File

@ -93,7 +93,7 @@
(ionCancel)="filterChanged()" [placeholder]="'core.login.findyoursite' | translate">
</ion-searchbar>
<ng-container *ngFor="let site of filteredSites">
<ng-container *ngTemplateOutlet="site"></ng-container>
<ng-container *ngTemplateOutlet="sitelisting; context: {site: site}"></ng-container>
</ng-container>
</ion-list>
</ng-container>

View File

@ -2,14 +2,6 @@
margin-bottom: 20px;
}
.searchbar-ios {
background: transparent;
.searchbar-input {
background-color: white; // @todo $searchbar-ios-toolbar-input-background;
}
}
.item {
&.core-login-need-help {
margin-top: 16px;

View File

@ -17,10 +17,3 @@ $core-dashboard-logo: false !default;
display: none;
}
}
ion-badge.core-course-download-courses-progress {
display: block;
// @include float(start);
// @include margin(12px, 12px, null, 12px);
}

View File

@ -6,11 +6,11 @@
[autocorrect]="autocorrect" [spellcheck]="spellcheck" [core-auto-focus]="autoFocus"
[disabled]="disabled" role="searchbox" (ionFocus)="focus($event)">
</ion-input>
<ion-button slot="end" fill="clear" type="submit" size="small" [attr.aria-label]="searchLabel"
<ion-button slot="end" fill="clear" type="submit" [attr.aria-label]="searchLabel"
[disabled]="disabled || !searchText || (searchText.length < lengthCheck)">
<ion-icon name="fas-search" slot="icon-only" aria-hidden="true"></ion-icon>
</ion-button>
<ion-button *ngIf="showClear" slot="end" fill="clear" size="small"
<ion-button *ngIf="showClear" slot="end" fill="clear"
[attr.aria-label]="'core.clearsearch' | translate" [disabled]="searched == '' || disabled"
(click)="clearForm()">
<ion-icon name="fas-backspace" slot="icon-only" aria-hidden="true"></ion-icon>

View File

@ -228,7 +228,7 @@ $core-login-text-color-dark: $white !default;
$core-star-color: $brand-color !default;
$core-large-avatar-size: 90px !default;
$core-avatar-size: 40px !default;
$core-avatar-size: 44px !default;
$core-send-message-input-background: $gray !default;
$core-send-message-input-color: $black !default;
@ -252,7 +252,7 @@ $addon-messages-avatar-size: 30px !default;
$addon-messages-discussion-badge: $primary !default;
$addon-messages-discussion-badge-text: $white !default;
$addon-forum-avatar-size: 28px !default;
$addon-forum-avatar-size: 44px !default;
$addon-forum-border-color: $gray !default;
$addon-forum-highlight-color: $gray-lighter !default;

View File

@ -1,4 +1,4 @@
@import "./globals.mixins.ionic.scss";
@import "./globals.scss";
// Common styles.
.text-left { text-align: left; }
@ -126,12 +126,17 @@ ion-button.button-small ion-icon.faicon[slot] {
font-size: 1.5em !important;
}
[dir=rtl] ion-icon.icon-flip-rtl {
[dir=rtl] ion-icon.icon-flip-rtl,
[dir=rtl] ion-item::part(detail-icon),
[dir=rtl] ion-icon.item-detail-icon {
transform: scaleX(-1);
}
// Buttons.
ion-button, button, [role="button"] {
ion-button,
ion-fab-button,
button,
[role="button"] {
min-height: var(--a11y-min-target-size);
min-width: var(--a11y-min-target-size);
}
@ -203,7 +208,7 @@ ion-toolbar {
// Modals.
.core-modal-fullscreen .modal-wrapper {
position: absolute;
// @todo @include position(0 !important, null, null, 0 !important);
@include position(0 !important, null, null, 0 !important);
display: block;
width: 100% !important;
height: 100% !important;
@ -215,11 +220,10 @@ ion-toolbar {
@media only screen and (min-height: 400px) and (min-width: 300px) {
.core-modal-lateral {
// @todo @include core-split-area-end();
.modal-wrapper {
position: absolute;
@include position(0 !important, 0 !important, 0 !important, auto);
@include position(0 !important, 0 !important, 0 !important, unset !important);
display: block;
height: 100% !important;
width: auto;
@ -422,6 +426,16 @@ ion-select::part(text) {
text-decoration: underline;
}
core-block ion-item-divider .core-button-spinner {
display: flex;
align-items: center;
@include margin-horizontal(10px);
ion-badge.core-course-download-courses-progress {
@include margin(null, 12px, null, null);
}
}
// Horizontal scrolling elements
.core-horizontal-scroll {
display: flex;