Commit 405514bc authored by François Agneray's avatar François Agneray
Browse files

Improvement of images config for dataset form

parent bab26f9e
......@@ -55,7 +55,7 @@
<label class="custom-control-label" for="public">Public</label>
</div>
</accordion-group>
<accordion-group heading="Images configuration">
<accordion-group [isDisabled]="!model.data_path" heading="Images configuration">
<button (click)="newImageOpenModal(templateAddImage); $event.stopPropagation()" class="btn btn-outline-primary" type="button">
<i class="far fa-image"></i> Add new image
</button>
......@@ -63,7 +63,7 @@
<table class="table table-striped">
<thead>
<tr>
<th scope="col">Name</th>
<th scope="col">Path</th>
<th scope="col">Size</th>
<th scope="col">RA min/max</th>
<th scope="col">DEC min/max</th>
......@@ -138,7 +138,7 @@
</td>
</tr>
<tr *ngFor="let image of datasetImages">
<td class="align-middle">{{ image.name }}</td>
<td class="align-middle">{{ getImageFilename(image.name) }}</td>
<td class="align-middle">
<div class="custom-control custom-switch">
<input class="custom-control-input" type="checkbox" id="{{ image.id }}_enabled" name="{{ image.id }}_enabled" [ngModel]="getBackgroundEnabled(image)">
......
......@@ -141,10 +141,14 @@ export class FormDatasetComponent implements OnChanges {
if (m) {
return m.display;
} else {
return image.id * 10;
return (image.id + 1) * 10;
}
}
getImageFilename(path: string) {
return path.replace(/^.*[\\\/]/, '');
}
onChange(surveyName: string): void {
this.changeSurvey.emit(this.surveyList.find(survey => survey.name === surveyName).id_database);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment