Skip to content

Commit 8a93bef

Browse files
committed
Supply a customizable themed version.
1 parent 055ed9b commit 8a93bef

4 files changed

Lines changed: 143 additions & 0 deletions

File tree

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<ng-container *ngIf="fileData">
2+
<div class="row">
3+
<div class="col-md-2">
4+
<!--ds-themed-thumbnail [thumbnail]="bitstreamsList[bitstreamKey].url | async"></ds-themed-thumbnail-->
5+
<ds-themed-thumbnail [thumbnail]="fileData?.thumbnail"></ds-themed-thumbnail>
6+
</div>
7+
<div class="col-md-10">
8+
<div class="float-left w-75">
9+
<h3>{{fileName}} <span class="text-muted">({{fileData?.sizeBytes | dsFileSize}})</span></h3>
10+
</div>
11+
<div class="float-right w-15">
12+
<ng-container>
13+
<ds-themed-file-download-link [cssClasses]="'btn btn-link-focus'" [isBlank]="true" [bitstream]="getBitstream()" [enableRequestACopy]="false">
14+
<i class="fa fa-download fa-2x text-normal" aria-hidden="true"></i>
15+
</ds-themed-file-download-link>
16+
<button class="btn btn-link-focus"
17+
[attr.aria-label]="'submission.sections.upload.edit.title' | translate"
18+
title="{{ 'submission.sections.upload.edit.title' | translate }}"
19+
(click)="$event.preventDefault();editBitstreamData();">
20+
<i class="fa fa-edit fa-2x text-normal"></i>
21+
</button>
22+
<button class="btn btn-link-focus"
23+
[attr.aria-label]="'submission.sections.upload.delete.confirm.title' | translate"
24+
title="{{ 'submission.sections.upload.delete.confirm.title' | translate }}"
25+
[disabled]="(processingDelete$ | async)"
26+
(click)="$event.preventDefault();confirmDelete(content);">
27+
<i *ngIf="(processingDelete$ | async)" class="fas fa-circle-notch fa-spin fa-2x text-danger"></i>
28+
<i *ngIf="!(processingDelete$ | async)" class="fa fa-trash fa-2x text-danger"></i>
29+
</button>
30+
</ng-container>
31+
</div>
32+
<div class="clearfix"></div>
33+
<ds-submission-section-upload-file-view [fileData]="fileData"></ds-submission-section-upload-file-view>
34+
</div>
35+
</div>
36+
</ng-container>
37+
38+
<ng-template #content let-c="close" let-d="dismiss">
39+
<div class="modal-header">
40+
<h4 class="modal-title text-danger">{{ 'submission.sections.upload.delete.confirm.title' | translate }}</h4>
41+
<button type="button" class="close" aria-label="Close" (click)="d('cancel')">
42+
<span aria-hidden="true">&times;</span>
43+
</button>
44+
</div>
45+
<div class="modal-body">
46+
<p>{{ 'submission.sections.upload.delete.confirm.info' | translate }}</p>
47+
</div>
48+
<div class="modal-footer">
49+
<button type="button" class="btn btn-secondary" (click)="c('cancel')">{{ 'submission.sections.upload.delete.confirm.cancel' | translate }}</button>
50+
<button type="button" class="btn btn-danger" (click)="c('ok')">{{ 'submission.sections.upload.delete.confirm.submit' | translate }}</button>
51+
</div>
52+
</ng-template>

src/themes/custom/app/submission/sections/upload/file/section-upload-file.component.scss

Whitespace-only changes.
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
import {
2+
Component, Input, ViewChild
3+
} from '@angular/core';
4+
5+
import {
6+
SubmissionFormsModel
7+
} from 'src/app/core/config/models/config-submission-forms.model';
8+
import {
9+
SubmissionSectionUploadFileEditComponent
10+
} from 'src/app/submission/sections/upload/file/edit/section-upload-file-edit.component';
11+
import {
12+
SubmissionSectionUploadFileComponent as BaseComponent
13+
} from 'src/app/submission/sections/upload/file/section-upload-file.component';
14+
15+
/**
16+
* This component represents a single bitstream contained in the submission
17+
*/
18+
@Component({
19+
selector: 'ds-submission-upload-section-file',
20+
// styleUrls: ['./section-upload-file.component.scss'],
21+
styleUrls: ['../../../../../../../app/submission/sections/upload/file/section-upload-file.component.scss'],
22+
// templateUrl: './section-upload-file.component.html'
23+
templateUrl: '../../../../../../../app/submission/sections/upload/file/section-upload-file.component.html'
24+
})
25+
export class SubmissionSectionUploadFileComponent
26+
extends BaseComponent {
27+
28+
/**
29+
* The list of available access condition
30+
* @type {Array}
31+
*/
32+
@Input() availableAccessConditionOptions: any[];
33+
34+
/**
35+
* The submission id
36+
* @type {string}
37+
*/
38+
@Input() collectionId: string;
39+
40+
/**
41+
* Define if collection access conditions policy type :
42+
* POLICY_DEFAULT_NO_LIST : is not possible to define additional access group/s for the single file
43+
* POLICY_DEFAULT_WITH_LIST : is possible to define additional access group/s for the single file
44+
* @type {number}
45+
*/
46+
@Input() collectionPolicyType: number;
47+
48+
/**
49+
* The configuration for the bitstream's metadata form
50+
* @type {SubmissionFormsModel}
51+
*/
52+
@Input() configMetadataForm: SubmissionFormsModel;
53+
54+
/**
55+
* The bitstream id
56+
* @type {string}
57+
*/
58+
@Input() fileId: string;
59+
60+
/**
61+
* The bitstream array key
62+
* @type {string}
63+
*/
64+
@Input() fileIndex: string;
65+
66+
/**
67+
* The bitstream id
68+
* @type {string}
69+
*/
70+
@Input() fileName: string;
71+
72+
/**
73+
* The section id
74+
* @type {string}
75+
*/
76+
@Input() sectionId: string;
77+
78+
/**
79+
* The submission id
80+
* @type {string}
81+
*/
82+
@Input() submissionId: string;
83+
84+
/**
85+
* The [[SubmissionSectionUploadFileEditComponent]] reference
86+
* @type {SubmissionSectionUploadFileEditComponent}
87+
*/
88+
@ViewChild(SubmissionSectionUploadFileEditComponent) fileEditComp: SubmissionSectionUploadFileEditComponent;
89+
}

src/themes/custom/lazy-theme.module.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ import {
141141
import { NgxGalleryModule } from '@kolkov/ngx-gallery';
142142
import { WorkspaceItemsDeletePageComponent } from './app/workspace-items-delete-page/workspace-items-delete/workspace-items-delete.component';
143143
import { ThumbnailComponent } from './app/thumbnail/thumbnail.component';
144+
import { SubmissionSectionUploadFileComponent } from './app/submission/sections/upload/file/section-upload-file.component';
144145

145146
const DECLARATIONS = [
146147
FileSectionComponent,
@@ -217,6 +218,7 @@ const DECLARATIONS = [
217218
MediaViewerVideoComponent,
218219
WorkspaceItemsDeletePageComponent,
219220
ThumbnailComponent,
221+
SubmissionSectionUploadFileComponent,
220222
];
221223

222224
@NgModule({

0 commit comments

Comments
 (0)