MOBILE-4470 attachments: Improve Attachments look and feel
parent
f42ab61f59
commit
f9ed1e8153
|
@ -597,6 +597,8 @@
|
||||||
"addon.mod_data.timeadded": "data",
|
"addon.mod_data.timeadded": "data",
|
||||||
"addon.mod_data.timemodified": "data",
|
"addon.mod_data.timemodified": "data",
|
||||||
"addon.mod_data.usedate": "data",
|
"addon.mod_data.usedate": "data",
|
||||||
|
"addon.mod_data_fields_file.fieldtypelabel": "datafield_file",
|
||||||
|
"addon.mod_data_fields_picture.fieldtypelabel": "datafield_picture",
|
||||||
"addon.mod_feedback.analysis": "feedback",
|
"addon.mod_feedback.analysis": "feedback",
|
||||||
"addon.mod_feedback.anonymous": "feedback",
|
"addon.mod_feedback.anonymous": "feedback",
|
||||||
"addon.mod_feedback.anonymous_entries": "feedback",
|
"addon.mod_feedback.anonymous_entries": "feedback",
|
||||||
|
@ -1812,6 +1814,7 @@
|
||||||
"core.filenameexist": "local_moodlemobileapp",
|
"core.filenameexist": "local_moodlemobileapp",
|
||||||
"core.filenotfound": "resource",
|
"core.filenotfound": "resource",
|
||||||
"core.fileuploader.addfiletext": "repository",
|
"core.fileuploader.addfiletext": "repository",
|
||||||
|
"core.fileuploader.attachedfiles": "repository",
|
||||||
"core.fileuploader.audio": "local_moodlemobileapp",
|
"core.fileuploader.audio": "local_moodlemobileapp",
|
||||||
"core.fileuploader.audiotitle": "tiny_recordrtc",
|
"core.fileuploader.audiotitle": "tiny_recordrtc",
|
||||||
"core.fileuploader.camera": "local_moodlemobileapp",
|
"core.fileuploader.camera": "local_moodlemobileapp",
|
||||||
|
@ -1834,6 +1837,7 @@
|
||||||
"core.fileuploader.microphonepermissiondenied": "local_moodlemobileapp",
|
"core.fileuploader.microphonepermissiondenied": "local_moodlemobileapp",
|
||||||
"core.fileuploader.microphonepermissionrestricted": "local_moodlemobileapp",
|
"core.fileuploader.microphonepermissionrestricted": "local_moodlemobileapp",
|
||||||
"core.fileuploader.more": "data",
|
"core.fileuploader.more": "data",
|
||||||
|
"core.fileuploader.nofilesattached": "repository",
|
||||||
"core.fileuploader.pauserecording": "local_moodlemobileapp",
|
"core.fileuploader.pauserecording": "local_moodlemobileapp",
|
||||||
"core.fileuploader.photoalbums": "local_moodlemobileapp",
|
"core.fileuploader.photoalbums": "local_moodlemobileapp",
|
||||||
"core.fileuploader.readingfile": "local_moodlemobileapp",
|
"core.fileuploader.readingfile": "local_moodlemobileapp",
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
<ng-container *ngIf="editMode && form">
|
<ng-container *ngIf="editMode && form">
|
||||||
<core-attachments [files]="files" [maxSize]="maxSizeBytes" maxSubmissions="1" [component]="component" [componentId]="componentId"
|
<core-attachments [files]="files" [maxSize]="maxSizeBytes" maxSubmissions="1" [component]="component" [componentId]="componentId"
|
||||||
[allowOffline]="true" [courseId]="database?.course" [required]="field.required" />
|
[allowOffline]="true" [courseId]="database?.course" [required]="field.required"
|
||||||
|
[title]="'addon.mod_data_fields_file.fieldtypelabel' | translate" />
|
||||||
<core-input-errors *ngIf="error" [errorText]="error" />
|
<core-input-errors *ngIf="error" [errorText]="error" />
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
{
|
||||||
|
"fieldtypelabel": "File"
|
||||||
|
}
|
|
@ -1,6 +1,7 @@
|
||||||
<ng-container *ngIf="editMode && form" [formGroup]="form">
|
<ng-container *ngIf="editMode && form" [formGroup]="form">
|
||||||
<core-attachments [files]="files" [maxSize]="maxSizeBytes" maxSubmissions="1" [component]="component" [componentId]="componentId"
|
<core-attachments [files]="files" [maxSize]="maxSizeBytes" maxSubmissions="1" [component]="component" [componentId]="componentId"
|
||||||
[allowOffline]="true" acceptedTypes="image" [courseId]="database?.course" [required]="field.required" />
|
[allowOffline]="true" acceptedTypes="image" [courseId]="database?.course" [required]="field.required"
|
||||||
|
[title]="'addon.mod_data_fields_picture.fieldtypelabel' | translate" />
|
||||||
<core-input-errors *ngIf="error" [errorText]="error" />
|
<core-input-errors *ngIf="error" [errorText]="error" />
|
||||||
|
|
||||||
<ion-input [label]="'addon.mod_data.alttext' | translate" labelPlacement="stacked" type="text"
|
<ion-input [label]="'addon.mod_data.alttext' | translate" labelPlacement="stacked" type="text"
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
{
|
||||||
|
"fieldtypelabel": "Image"
|
||||||
|
}
|
|
@ -17,6 +17,7 @@
|
||||||
<ion-input labelPlacement="stacked" type="text" [placeholder]="'addon.mod_glossary.concept' | translate"
|
<ion-input labelPlacement="stacked" type="text" [placeholder]="'addon.mod_glossary.concept' | translate"
|
||||||
[(ngModel)]="data.concept" name="concept" [label]="'addon.mod_glossary.concept' | translate" />
|
[(ngModel)]="data.concept" name="concept" [label]="'addon.mod_glossary.concept' | translate" />
|
||||||
</ion-item>
|
</ion-item>
|
||||||
|
|
||||||
<ion-item>
|
<ion-item>
|
||||||
<ion-label position="stacked">{{ 'addon.mod_glossary.definition' | translate }}</ion-label>
|
<ion-label position="stacked">{{ 'addon.mod_glossary.definition' | translate }}</ion-label>
|
||||||
<core-rich-text-editor [control]="definitionControl" (contentChanged)="onDefinitionChange($event)"
|
<core-rich-text-editor [control]="definitionControl" (contentChanged)="onDefinitionChange($event)"
|
||||||
|
@ -24,8 +25,8 @@
|
||||||
[componentId]="cmId" [autoSave]="true" contextLevel="module" [contextInstanceId]="cmId" elementId="definition_editor"
|
[componentId]="cmId" [autoSave]="true" contextLevel="module" [contextInstanceId]="cmId" elementId="definition_editor"
|
||||||
[draftExtraParams]="editorExtraParams" />
|
[draftExtraParams]="editorExtraParams" />
|
||||||
</ion-item>
|
</ion-item>
|
||||||
<ion-item *ngIf="categories.length > 0">
|
|
||||||
|
|
||||||
|
<ion-item *ngIf="categories.length > 0">
|
||||||
<ion-select labelPlacement="stacked" [(ngModel)]="data.categories" multiple="true" interface="action-sheet"
|
<ion-select labelPlacement="stacked" [(ngModel)]="data.categories" multiple="true" interface="action-sheet"
|
||||||
[placeholder]="'addon.mod_glossary.categories' | translate" name="categories" [cancelText]="'core.cancel' | translate"
|
[placeholder]="'addon.mod_glossary.categories' | translate" name="categories" [cancelText]="'core.cancel' | translate"
|
||||||
[interfaceOptions]="{header: 'addon.mod_glossary.categories' | translate}"
|
[interfaceOptions]="{header: 'addon.mod_glossary.categories' | translate}"
|
||||||
|
@ -35,18 +36,15 @@
|
||||||
</ion-select-option>
|
</ion-select-option>
|
||||||
</ion-select>
|
</ion-select>
|
||||||
</ion-item>
|
</ion-item>
|
||||||
<ion-item *ngIf="showAliases">
|
|
||||||
|
|
||||||
|
<ion-item *ngIf="showAliases">
|
||||||
<ion-textarea labelPlacement="stacked" [(ngModel)]="data.aliases" rows="1" [core-auto-rows]="data.aliases" name="aliases"
|
<ion-textarea labelPlacement="stacked" [(ngModel)]="data.aliases" rows="1" [core-auto-rows]="data.aliases" name="aliases"
|
||||||
[label]="'addon.mod_glossary.aliases' | translate" />
|
[label]="'addon.mod_glossary.aliases' | translate" />
|
||||||
</ion-item>
|
</ion-item>
|
||||||
<ion-item-divider>
|
|
||||||
<ion-label>
|
|
||||||
<h2>{{ 'addon.mod_glossary.attachment' | translate }}</h2>
|
|
||||||
</ion-label>
|
|
||||||
</ion-item-divider>
|
|
||||||
<core-attachments [files]="data.attachments" [component]="component" [componentId]="glossary.coursemodule" [allowOffline]="true"
|
<core-attachments [files]="data.attachments" [component]="component" [componentId]="glossary.coursemodule" [allowOffline]="true"
|
||||||
[courseId]="courseId" />
|
[courseId]="courseId" [title]="'addon.mod_glossary.attachment' | translate" />
|
||||||
|
|
||||||
<ng-container *ngIf="glossary.usedynalink">
|
<ng-container *ngIf="glossary.usedynalink">
|
||||||
<ion-item-divider>
|
<ion-item-divider>
|
||||||
<ion-label>
|
<ion-label>
|
||||||
|
@ -69,6 +67,7 @@
|
||||||
</ion-toggle>
|
</ion-toggle>
|
||||||
</ion-item>
|
</ion-item>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
<ion-button class="ion-margin" expand="block" [disabled]="!data.concept || !data.definition" (click)="save()">
|
<ion-button class="ion-margin" expand="block" [disabled]="!data.concept || !data.definition" (click)="save()">
|
||||||
{{ 'core.save' | translate }}
|
{{ 'core.save' | translate }}
|
||||||
</ion-button>
|
</ion-button>
|
||||||
|
|
|
@ -55,6 +55,7 @@ export class CoreAttachmentsComponent implements OnInit {
|
||||||
@Input() acceptedTypes?: string; // List of supported filetypes. If undefined, all types supported.
|
@Input() acceptedTypes?: string; // List of supported filetypes. If undefined, all types supported.
|
||||||
@Input() required?: boolean; // Whether to display the required mark.
|
@Input() required?: boolean; // Whether to display the required mark.
|
||||||
@Input() courseId?: number; // Course ID.
|
@Input() courseId?: number; // Course ID.
|
||||||
|
@Input() title = Translate.instant('core.fileuploader.attachedfiles'); // Title to display.
|
||||||
|
|
||||||
maxSizeReadable?: string;
|
maxSizeReadable?: string;
|
||||||
maxSubmissionsReadable?: string;
|
maxSubmissionsReadable?: string;
|
||||||
|
|
|
@ -1,12 +1,17 @@
|
||||||
<core-loading [hideUntil]="loaded" [fullscreen]="false">
|
<core-loading [hideUntil]="loaded" [fullscreen]="false">
|
||||||
|
<ion-card>
|
||||||
<ion-item class="ion-text-wrap">
|
<ion-item class="ion-text-wrap">
|
||||||
<ion-label>
|
<ion-label>
|
||||||
|
<p class="item-heading">{{ title }} <span [core-mark-required]="required" class="core-mark-required"></span></p>
|
||||||
<span *ngIf="maxSubmissionsReadable">
|
<span *ngIf="maxSubmissionsReadable">
|
||||||
{{ 'core.maxsizeandattachments' | translate:{$a: {size: maxSizeReadable, attachments: maxSubmissionsReadable} } }}
|
{{ 'core.maxsizeandattachments' | translate:{$a: {size: maxSizeReadable, attachments: maxSubmissionsReadable} } }}
|
||||||
</span>
|
</span>
|
||||||
<span *ngIf="!maxSubmissionsReadable">{{ 'core.maxfilesize' | translate:{$a: maxSizeReadable} }}</span>
|
<span *ngIf="!maxSubmissionsReadable">{{ 'core.maxfilesize' | translate:{$a: maxSizeReadable} }}</span>
|
||||||
<span [core-mark-required]="required" class="core-mark-required"></span>
|
|
||||||
</ion-label>
|
</ion-label>
|
||||||
|
<ion-button slot="end" (click)="add()" [attr.aria-label]="'core.fileuploader.addfiletext' | translate"
|
||||||
|
*ngIf="unlimitedFiles || (maxSubmissions !== undefined && maxSubmissions >= 0 && files && files.length < maxSubmissions)">
|
||||||
|
<ion-icon name="fas-plus" slot="icon-only" aria-hidden="true" />
|
||||||
|
</ion-button>
|
||||||
</ion-item>
|
</ion-item>
|
||||||
<ion-item class="ion-text-wrap" *ngIf="fileTypes && fileTypes.mimetypes && fileTypes.mimetypes.length">
|
<ion-item class="ion-text-wrap" *ngIf="fileTypes && fileTypes.mimetypes && fileTypes.mimetypes.length">
|
||||||
<ion-label>
|
<ion-label>
|
||||||
|
@ -18,7 +23,7 @@
|
||||||
</ul>
|
</ul>
|
||||||
</ion-label>
|
</ion-label>
|
||||||
</ion-item>
|
</ion-item>
|
||||||
<div *ngFor="let file of files; let index=index">
|
<ng-container *ngFor="let file of files; let index=index">
|
||||||
<!-- Files already attached to the submission, either in online or in offline. -->
|
<!-- Files already attached to the submission, either in online or in offline. -->
|
||||||
<core-file *ngIf="!file.name" [file]="file" [component]="component" [componentId]="componentId" [canDelete]="true"
|
<core-file *ngIf="!file.name" [file]="file" [component]="component" [componentId]="componentId" [canDelete]="true"
|
||||||
(onDelete)="delete(index, true)" [canDownload]="!file.offline" />
|
(onDelete)="delete(index, true)" [canDownload]="!file.offline" />
|
||||||
|
@ -26,13 +31,12 @@
|
||||||
<!-- Files added to draft but not attached to submission yet. -->
|
<!-- Files added to draft but not attached to submission yet. -->
|
||||||
<core-local-file *ngIf="file.name" [file]="file" [manage]="true" (onDelete)="delete(index, false)"
|
<core-local-file *ngIf="file.name" [file]="file" [manage]="true" (onDelete)="delete(index, false)"
|
||||||
(onRename)="renamed(index, $event)" />
|
(onRename)="renamed(index, $event)" />
|
||||||
</div>
|
</ng-container>
|
||||||
|
|
||||||
<!-- Button to add more files. -->
|
<ion-item class="ion-text-wrap" *ngIf="!files || !files.length">
|
||||||
<ion-button expand="block"
|
<ion-label>
|
||||||
*ngIf="unlimitedFiles || (maxSubmissions !== undefined && maxSubmissions >= 0 && files && files.length < maxSubmissions)"
|
<p>{{ 'core.fileuploader.nofilesattached' | translate }}</p>
|
||||||
class="ion-text-wrap ion-margin" (click)="add()">
|
</ion-label>
|
||||||
<ion-icon name="fas-plus" slot="start" aria-hidden="true" />
|
</ion-item>
|
||||||
{{ 'core.fileuploader.addfiletext' | translate }}
|
</ion-card>
|
||||||
</ion-button>
|
|
||||||
</core-loading>
|
</core-loading>
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
{
|
{
|
||||||
"addfiletext": "Add file",
|
"addfiletext": "Add file",
|
||||||
|
"attachedfiles": "Attached files",
|
||||||
"audio": "Audio",
|
"audio": "Audio",
|
||||||
"audiotitle": "Record audio",
|
"audiotitle": "Record audio",
|
||||||
"camera": "Camera",
|
"camera": "Camera",
|
||||||
|
@ -22,6 +23,7 @@
|
||||||
"microphonepermissiondenied": "Permission to access the microphone has been denied.",
|
"microphonepermissiondenied": "Permission to access the microphone has been denied.",
|
||||||
"microphonepermissionrestricted": "Microphone access is restricted.",
|
"microphonepermissionrestricted": "Microphone access is restricted.",
|
||||||
"more": "More",
|
"more": "More",
|
||||||
|
"nofilesattached": "No files attached",
|
||||||
"pauserecording": "Pause recording",
|
"pauserecording": "Pause recording",
|
||||||
"photoalbums": "Photo albums",
|
"photoalbums": "Photo albums",
|
||||||
"readingfile": "Reading file",
|
"readingfile": "Reading file",
|
||||||
|
|
Loading…
Reference in New Issue