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 @@ ...@@ -55,7 +55,7 @@
<label class="custom-control-label" for="public">Public</label> <label class="custom-control-label" for="public">Public</label>
</div> </div>
</accordion-group> </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"> <button (click)="newImageOpenModal(templateAddImage); $event.stopPropagation()" class="btn btn-outline-primary" type="button">
<i class="far fa-image"></i> Add new image <i class="far fa-image"></i> Add new image
</button> </button>
...@@ -63,7 +63,7 @@ ...@@ -63,7 +63,7 @@
<table class="table table-striped"> <table class="table table-striped">
<thead> <thead>
<tr> <tr>
<th scope="col">Name</th> <th scope="col">Path</th>
<th scope="col">Size</th> <th scope="col">Size</th>
<th scope="col">RA min/max</th> <th scope="col">RA min/max</th>
<th scope="col">DEC min/max</th> <th scope="col">DEC min/max</th>
...@@ -138,7 +138,7 @@ ...@@ -138,7 +138,7 @@
</td> </td>
</tr> </tr>
<tr *ngFor="let image of datasetImages"> <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"> <td class="align-middle">
<div class="custom-control custom-switch"> <div class="custom-control custom-switch">
<input class="custom-control-input" type="checkbox" id="{{ image.id }}_enabled" name="{{ image.id }}_enabled" [ngModel]="getBackgroundEnabled(image)"> <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 { ...@@ -141,10 +141,14 @@ export class FormDatasetComponent implements OnChanges {
if (m) { if (m) {
return m.display; return m.display;
} else { } else {
return image.id * 10; return (image.id + 1) * 10;
} }
} }
getImageFilename(path: string) {
return path.replace(/^.*[\\\/]/, '');
}
onChange(surveyName: string): void { onChange(surveyName: string): void {
this.changeSurvey.emit(this.surveyList.find(survey => survey.name === surveyName).id_database); 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