-
Notifications
You must be signed in to change notification settings - Fork 3
/
project-input-edition.html
143 lines (129 loc) · 5.64 KB
/
project-input-edition.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
<div>
<form class="form-horizontal" name="$ctrl.inputForm">
<div class="form-section">
<legend translate="project.general_informations"></legend>
<div class="form-group">
<label class="col-sm-2 control-label" translate="project.collection_form"></label>
<div class="col-sm-10 metadata">
<div class="input-group" style="width: 100%;">
<select
class="form-control"
ng-options="ds.id as ds.name for ds in $ctrl.project.forms"
ng-model="$ctrl.dataSourceId"
ng-disabled="!$ctrl.dataSourceEditable"
></select>
<span class="input-group-btn">
<button
ng-disabled="!$ctrl.dataSourceId || !$ctrl.dataSourceEditable"
ng-click="$ctrl.onDataSourceSet()"
class="btn btn-default"
>
Valider la source
</button>
</span>
</div>
</div>
</div>
<div class="form-group" ng-if="!$ctrl.dataSourceEditable">
<label class="col-sm-2 control-label" translate="project.collection_site"></label>
<div class="col-sm-10 metadata">
<image-scroll
ng-if="$ctrl.upload.reprojected.regions.site"
upload="$ctrl.upload"
region="site"
></image-scroll>
<select
class="form-control"
ng-options="site.id as site.name for site in $ctrl.sites"
ng-model="$ctrl.siteId"
ng-disabled="!$ctrl.metadataEditable"
></select>
</div>
</div>
<div class="form-group" ng-if="!$ctrl.dataSourceEditable">
<label class="col-sm-2 control-label" translate="project.covered_period"></label>
<div class="col-sm-10 metadata">
<image-scroll
ng-if="$ctrl.upload.reprojected.regions.period"
upload="$ctrl.upload"
region="period"
></image-scroll>
<select
class="form-control"
ng-options="slot as slot|formatSlot for slot in $ctrl.periods"
ng-model="$ctrl.period"
ng-disabled="!$ctrl.metadataEditable"
></select>
</div>
</div>
<div class="form-group" ng-if="$ctrl.upload">
<label class="col-sm-2 control-label" translate="project.original_file"></label>
<div class="col-sm-10 metadata">
<a
target="_blank"
href="/api/project/{{$ctrl.upload.projectId}}/upload/{{$ctrl.upload._id}}/original"
>
<img
class="img-thumbnail"
ng-src="/api/project/{{$ctrl.upload.projectId}}/upload/{{$ctrl.upload._id}}/thumbnail"
/>
</a>
</div>
</div>
</div>
<div class="form-section data-section">
<legend>
<div class="btn-group pull-right" ng-if="!$ctrl.metadataEditable">
<a ng-click="$ctrl.fillWithZeros()" class="btn btn-default btn-xs">
<i class="fa fa-pencil"></i>
{{'project.fill_with_zeros'|translate}}
</a>
<a
ng-if="$ctrl.previousInput"
ng-click="$ctrl.copy()"
class="btn btn-default btn-xs"
>
<i class="fa fa-clipboard"></i>
{{'project.fill_with_last_input'|translate}}
</a>
</div>
{{'project.data'|translate}}
</legend>
<button
ng-if="$ctrl.metadataEditable"
ng-disabled="!$ctrl.siteId || !$ctrl.period"
ng-click="$ctrl.onMetadataSet()"
class="btn btn-default"
>
Charger les données
</button>
<div
class="form-group"
ng-if="$ctrl.contentByVariableId"
ng-repeat="variable in $ctrl.variables"
>
<label class="col-sm-2 control-label">{{variable.name}}</label>
<div class="col-sm-10">
<image-scroll
ng-if="$ctrl.upload && $ctrl.upload.reprojected.regions[variable.id]"
class="img-thumbnail"
upload="$ctrl.upload"
region="{{variable.id}}"
></image-scroll>
<input-grid
variable="variable"
ng-model="$ctrl.contentByVariableId[variable.id].data"
></input-grid>
</div>
</div>
</div>
</form>
</div>
<save-block
is-valid="$ctrl.inputForm.$valid"
is-changed="!$ctrl.isUnchanged"
is-persisted="false"
is-saving="$ctrl.inputSaving"
on-save-clicked="$ctrl.save()"
on-reset-clicked="$ctrl.reset()"
></save-block>