Skip to content

Commit

Permalink
Merge pull request #4062 from crazyserver/MOBILE-4600
Browse files Browse the repository at this point in the history
Mobile 4600
  • Loading branch information
dpalou authored May 27, 2024
2 parents e8f65b4 + ffe3029 commit 0e599a5
Show file tree
Hide file tree
Showing 73 changed files with 3,120 additions and 459 deletions.
2 changes: 2 additions & 0 deletions scripts/langindex.json
Original file line number Diff line number Diff line change
Expand Up @@ -555,6 +555,7 @@
"addon.mod_data.authorfirstname": "data",
"addon.mod_data.authorlastname": "data",
"addon.mod_data.confirmdeleterecord": "data",
"addon.mod_data.datemodified": "data",
"addon.mod_data.descending": "data",
"addon.mod_data.disapprove": "data",
"addon.mod_data.edittagsnotsupported": "local_moodlemobileapp",
Expand Down Expand Up @@ -2548,6 +2549,7 @@
"core.storingfiles": "local_moodlemobileapp",
"core.strftimedate": "langconfig",
"core.strftimedatefullshort": "langconfig",
"core.strftimedatemonthabbr": "langconfig",
"core.strftimedateshort": "langconfig",
"core.strftimedatetime": "langconfig",
"core.strftimedatetimeshort": "langconfig",
Expand Down
2 changes: 1 addition & 1 deletion src/addons/mod/data/classes/base-field-plugin-component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export abstract class AddonModDataFieldPluginBaseComponent implements OnInit, On
}

/**
* Component being changed.
* @inheritdoc
*/
ngOnChanges(changes: { [name: string]: SimpleChange }): void {
if ((this.showMode || this.listMode) && changes.value) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,12 @@
<core-comments *ngIf="action === 'comments' && mode === 'list'" contextLevel="module" [instanceId]="database.coursemodule"
component="mod_data" [itemId]="entry.id" area="database_entry" [courseId]="database.course" />

<span *ngIf="action === 'timeadded'">{{ entry.timecreated * 1000 | coreFormatDate }}</span>
<span *ngIf="action === 'timemodified'">{{ entry.timemodified * 1000 | coreFormatDate }}</span>
<span *ngIf="action === 'timeadded'" [title]="entry.timecreated * 1000 | coreFormatDate">
{{ entry.timecreated * 1000 | coreFormatDate: 'strftimedatemonthabbr' }}
</span>
<span *ngIf="action === 'timemodified'" [title]="entry.timemodified * 1000 | coreFormatDate">
{{ entry.timemodified * 1000 | coreFormatDate: 'strftimedatemonthabbr' }}
</span>

<core-user-avatar *ngIf="action === 'userpicture'" [user]="entry" slot="start" [courseId]="database.course" [userId]="entry.userid"
[profileUrl]="userPicture" />
Expand Down
38 changes: 21 additions & 17 deletions src/addons/mod/data/components/index/addon-mod-data-index.html
Original file line number Diff line number Diff line change
Expand Up @@ -80,22 +80,7 @@
<core-compile-html [text]="entriesRendered" [jsData]="jsData" [extraImports]="extraImports" />
</div>

<ion-grid *ngIf="search.page > 0 || hasNextPage">
<ion-row class="ion-align-items-center">
<ion-col *ngIf="search.page > 0">
<ion-button expand="block" fill="outline" (click)="searchEntries(search.page - 1)">
<ion-icon name="fas-chevron-left" slot="start" aria-hidden="true" />
{{ 'core.previous' | translate }}
</ion-button>
</ion-col>
<ion-col *ngIf="hasNextPage">
<ion-button expand="block" (click)="searchEntries(search.page + 1)">
{{ 'core.next' | translate }}
<ion-icon name="fas-chevron-right" slot="end" aria-hidden="true" />
</ion-button>
</ion-col>
</ion-row>
</ion-grid>


<core-empty-box *ngIf="isEmpty && !search.searching" icon="fas-database" [message]="'addon.mod_data.norecords' | translate" />

Expand All @@ -104,9 +89,28 @@
<button class="as-link" (click)="searchReset($event)">{{ 'addon.mod_data.resetsettings' | translate}}</button>
</core-empty-box>

<div collapsible-footer appearOnBottom *ngIf="!showLoading" slot="fixed">
<ion-grid *ngIf="search.page > 0 || hasNextPage">
<ion-row class="ion-align-items-center">
<ion-col *ngIf="search.page > 0">
<ion-button expand="block" fill="outline" (click)="searchEntries(search.page - 1)">
<ion-icon name="fas-chevron-left" slot="start" aria-hidden="true" />
{{ 'core.previous' | translate }}
</ion-button>
</ion-col>
<ion-col *ngIf="hasNextPage">
<ion-button expand="block" (click)="searchEntries(search.page + 1)">
{{ 'core.next' | translate }}
<ion-icon name="fas-chevron-right" slot="end" aria-hidden="true" />
</ion-button>
</ion-col>
</ion-row>
</ion-grid>

<core-course-module-navigation [courseId]="courseId" [currentModuleId]="module.id" />
</div>
</core-loading>

<core-course-module-navigation collapsible-footer [hidden]="showLoading" [courseId]="courseId" [currentModuleId]="module.id" />

<ion-fab slot="fixed" core-fab vertical="bottom" horizontal="end" *ngIf="canAdd">
<ion-fab-button (click)="gotoAddEntries()" [attr.aria-label]="'addon.mod_data.addentries' | translate">
Expand Down
27 changes: 17 additions & 10 deletions src/addons/mod/data/data-forms.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,32 @@
// Edit and search modal.
:host {

::ng-deep {
table {
width: 100%;
}
td {
vertical-align: top;
}
}

.addon-data-advanced-search {
padding: 16px;
width: 100%;
}

.addon-data-contents form,
.addon-data-edit-entry form,
form .addon-data-advanced-search {
background-color: var(--ion-item-background);

::ng-deep {
table {
width: 100%;
tbody {
display: block;
}

td {
vertical-align: top;
}
}

.edit-field,
.search-field {
border-bottom: 1px solid var(--stroke);
}

.has-errors {
.input-highlight,
.select-highlight,
Expand Down
11 changes: 6 additions & 5 deletions src/addons/mod/data/data.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,18 @@ $grid-column-paddings: (
--border-color: var(--stroke);
}

.addon-data-edit-entry {
.addon-data-contents {
overflow: visible;
white-space: normal;
word-break: break-word;
padding: 16px;

background-color: var(--ion-item-background);
border-bottom: 1px solid var(--border-color);

::ng-deep {
table, tbody {

@import "theme/components/moodle.scss";
@import "theme/components/bootstrap/bootstrap_database.scss";

table {
display: block;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
<span *ngIf="inputMode && form && searchFields" [formGroup]="form">
<span *ngIf="inputMode && form" [formGroup]="form">
<span *ngIf="editMode" [core-mark-required]="field.required" class="core-mark-required"></span>

<ion-datetime-button datetime="datetime" />
<ion-modal [keepContentsMounted]="true">
<ng-template>
<ion-datetime id="datetime" [formControlName]="'f_'+field.id" [max]="maxDate" [min]="minDate"
[disabled]="searchMode && !searchFields['f_'+field.id+'_z']" presentation="date" [showDefaultButtons]="true" />
[disabled]="searchMode && searchFields && !searchFields['f_'+field.id+'_z']" presentation="date"
[showDefaultButtons]="true" />
</ng-template>
</ion-modal>
<core-input-errors *ngIf="error && editMode" [control]="form.controls['f_'+field.id]" [errorText]="error" />

<ion-item *ngIf="searchMode" class="ion-text-wrap">
<ion-item *ngIf="searchMode && searchFields" class="ion-text-wrap">
<ion-checkbox [formControlName]="'f_'+field.id+'_z'" [(ngModel)]="searchFields['f_'+field.id+'_z']">
{{ 'addon.mod_data.usedate' | translate }}
</ion-checkbox>
Expand Down
1 change: 1 addition & 0 deletions src/addons/mod/data/lang.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"authorfirstname": "First name",
"authorlastname": "Last name",
"confirmdeleterecord": "Are you sure you want to delete this entry?",
"datemodified": "Last edited:",
"descending": "Descending",
"disapprove": "Undo approval",
"edittagsnotsupported": "Sorry, editing tags is not supported by the app.",
Expand Down
Loading

0 comments on commit 0e599a5

Please sign in to comment.