Project

General

Profile

« Previous | Next » 

Revision 56484

View differences:

modules/dnet-orgs-database-application/trunk/src/main/resources/static/html/show.html
1
<p class="muted"><b>ID: </b>{{org.id}} - <b>source:</b> {{org.source}}</p>
2

  
3
<form>
4
	<fieldset class="mb-4">
5
		<legend>Organization name</legend>
6

  
7
		<div class="form-group row">
8
			<div class="input-group input-group-sm col-xl-8 col-lg-10">
9
				<div class="input-group-prepend">
10
					<div class="input-group-text">name</div>
11
				</div>
12
				<input type="text" class="form-control" placeholder="name" ng-model="org.name" />
13
			</div>
14
		</div>
15
	</fieldset>
16
	<fieldset class="mb-4">
17
		<legend>Geographical location</legend>
18
	
19
		<div class="form-group row">
20
			<div class="input-group input-group-sm col-xl-8 col-lg-10">
21
				<div class="input-group-prepend">
22
					<div class="input-group-text">city</div>
23
				</div>
24
				<input type="text" class="form-control" placeholder="" ng-model="org.city" />
25
				<div class="input-group-append input-group-prepend">
26
					<div class="input-group-text">country</div>
27
				</div>
28
				<select class="custom-select" ng-model="org.country">
29
					<option disabled="disabled" value=''>country...</option>
30
					<option ng-repeat="c in vocabularies.countries">{{c}}</option>
31
				</select>
32
				<div class="input-group-append input-group-prepend">
33
					<div class="input-group-text">lat</div>
34
				</div>
35
				<input type="text" class="form-control" placeholder="0.0" ng-model="org.lat" />
36
				<div class="input-group-append input-group-prepend">
37
					<div class="input-group-text">lng</div>
38
				</div>
39
				<input type="text" class="form-control" placeholder="0.0" ng-model="org.lng" />
40
			</div>
41
		</div>
42
	</fieldset>
43
	
44
	<fieldset class="mb-4">
45
		<legend>Organization type</legend>
46
		<div class="form-group row">
47
			<div class="col-xl-4 col-lg-8">
48
				<div class="card">
49
					<table class="table table-sm">
50
						<tbody>
51
							<tr ng-repeat="t in org.types">
52
								<td>{{t}}</td>
53
								<td class="text-right">
54
									<button type="button" class="btn btn-sm  btn-outline-danger" ng-click="org.types.splice($index, 1)">delete</button>
55
								</td>
56
							</tr>
57
						</tbody>
58
					</table>
59
					<div class="card-footer">
60
						<div class="input-group input-group-sm" ng-init="newType=''">
61
							<select class="custom-select" ng-model="newType">
62
								<option disabled="disabled" value=''>new type...</option>
63
								<option ng-repeat="t in vocabularies.orgTypes" ng-disabled="org.types.indexOf(t) !== -1">{{t}}</option>
64
							</select>
65
							<div class="input-group-append">
66
								<button type="button" class="btn btn-outline-success" ng-click="org.types.push(newType); newType=''" ng-disabled="!newType">add</button>
67
							</div>
68
						</div>
69
					</div>
70
				</div>
71
			</div>
72
		</div>
73
	</fieldset>
74

  
75

  
76
	<fieldset class="mb-4">
77
		<legend>Other names and identifiers</legend>
78
		
79
		<div class="form-group row">
80
			<div class="col-xl-4 col-lg-8 mb-2">
81
				<div class="card">
82
					<div class="card-header text-center">Identifiers</div>
83
					<table class="table table-sm">
84
						<thead class="thead-light">
85
							<tr>
86
								<th>id</th>
87
								<th>type</th>
88
								<th></th>
89
							</tr>
90
						</thead>
91
						<tbody>
92
							<tr ng-repeat="id in org.otherIdentifiers">
93
								<td>{{id.id}}</td>
94
								<td>{{id.type}}</td>
95
								<td class="text-right">
96
									<button type="button" class="btn btn-sm  btn-outline-danger" ng-click="org.otherIdentifiers.splice($index, 1)">delete</button>
97
								</td>
98
							</tr>
99
						</tbody>
100
					</table>
101
					<div class="card-footer">
102
						<div class="input-group input-group-sm" ng-init="newId=newIdType=''">
103
							<input type="text" class="form-control" placeholder="new id..." ng-model="newId" />
104
							<select class="custom-select" ng-model="newIdType">
105
								<option disabled="disabled" value=''>new type...</option>
106
								<option ng-repeat="t in vocabularies.idTypes">{{t}}</option>
107
							</select>
108
							<div class="input-group-append">
109
								<button type="button" class="btn btn-outline-success" ng-click="org.otherIdentifiers.push({'id': newId, 'type': newIdType}); newId=newIdType=''" ng-disabled="!newId || !newIdType">add</button>
110
							</div>
111
						</div>
112
					</div>
113
				</div>
114
			</div>
115
		
116
			<div class="col-xl-4 col-lg-8 mb-2">
117
				<div class="card">
118
					<div class="card-header text-center">Aliases</div>
119
					<table class="table table-sm">
120
						<thead class="thead-light">
121
							<tr>
122
								<th>name</th>
123
								<th>lang</th>
124
								<th></th>
125
							</tr>
126
						</thead>
127
						<tbody>
128
							<tr ng-repeat="n in org.otherNames">
129
								<td>{{n.name}}</td>
130
								<td>{{n.lang}}</td>
131
								<td class="text-right">
132
									<button type="button" class="btn btn-sm  btn-outline-danger" ng-click="org.otherNames.splice($index, 1)">delete</button>
133
								</td>
134
							</tr>
135
						</tbody>
136
					</table>	
137
					<div class="card-footer">
138
						<div class="input-group input-group-sm" ng-init="newOtherName=newLang=''">
139
							<input type="text" class="form-control" placeholder="new alias..." ng-model="newOtherName" />
140
							<select class="custom-select" ng-model="newLang">
141
								<option disabled="disabled" value=''>language...</option>
142
								<option ng-repeat="l in vocabularies.languages">{{l}}</option>
143
							</select>
144
							<div class="input-group-append">
145
								<button type="button" class="btn btn-outline-success" ng-click="org.otherNames.push({'name': newOtherName, 'lang': newLang}); newOtherName=newLang=''" ng-disabled="!newOtherName || !newLang">add</button>
146
							</div>
147
						</div>
148
					</div>
149
				</div>
150
			</div>
151
		</div>
152
		<div class="form-group row">
153
			<div class="col-xl-4 col-lg-8 mb-2">
154
				<div class="card">
155
					<div class="card-header text-center">Acronyms</div>
156
					<table class="table table-sm">
157
						<tbody>
158
							<tr ng-repeat="a in org.acronyms">
159
								<td>{{a}}</td>
160
								<td class="text-right">
161
									<button type="button" class="btn btn-sm  btn-outline-danger" ng-click="org.acronyms.splice($index, 1)">delete</button>
162
								</td>
163
							</tr>
164
						</tbody>
165
					</table>
166
					<div class="card-footer">
167
						<div class="input-group input-group-sm" ng-init="newAcronym=''">
168
							<input type="text" class="form-control" placeholder="new acronym..." ng-model='newAcronym'/>
169
							<div class="input-group-append">
170
								<button type="button" class="btn btn-outline-success" ng-click="org.acronyms.push(newAcronym); newAcronym=''" ng-disabled="!newAcronym || org.acronyms.indexOf(newAcronym) !== -1" >add</button>
171
							</div>
172
						</div>
173
					</div>
174
				</div>
175
			</div>
176
			<div class="col-xl-4 col-lg-8 mb-2">
177
				<div class="card">
178
					<div class="card-header text-center">Urls</div>
179
					<table class="table table-sm">
180
						<tbody>
181
							<tr ng-repeat="u in org.urls">
182
								<td><a href="{{u}}" target="_blank">{{u}}</a></td>
183
								<td class="text-right">
184
									<button type="button" class="btn btn-sm  btn-outline-danger" ng-click="org.urls.splice($index, 1)">delete</button>
185
								</td>
186
							</tr>
187
						</tbody>
188
					</table>
189
					<div class="card-footer">
190
						<div class="input-group input-group-sm" ng-init="newUrl=''">
191
							<input type="text" class="form-control" placeholder="http://..." ng-model="newUrl" />
192
							<div class="input-group-append">
193
								<button type="button" class="btn btn-outline-success" ng-click="org.urls.push(newUrl); newUrl=''" ng-disabled="!newUrl || org.urls.indexOf(newUrl) !== -1" >add</button>
194
							</div>
195
						</div>
196
					</div>	
197
				</div>
198
			</div>
199
		</div>
200
	</fieldset>
201

  
202
	<fieldset class="mb-4">
203
		<legend>Relations</legend>
204
		
205
		<div class="form-group row">
206
			<div class="col-xl-8 col-lg-10">
207
				<div class="card">
208
					<table class="table table-sm">
209
						<thead class="thead-light">
210
							<tr>
211
								<th>related org</th>
212
								<th>type</th>
213
								<th></th>
214
							</tr>
215
						</thead>
216
						<tbody>
217
							<tr ng-repeat="r in org.relations">
218
								<td><a href="#!/show/{{r.relatedOrgId}}" title="{{r.relatedOrgId}}">{{r.relatedOrgName}}</a></td>
219
								<td>{{r.type}}</td>
220
								<td class="text-right">
221
									<button type="button" class="btn btn-sm  btn-outline-danger" ng-click="org.relations.splice($index, 1)">delete</button>
222
								</td>
223
							</tr>
224
						</tbody>
225
					</table>
226
					<div class="card-footer">
227
						<div class="input-group input-group-sm" ng-init="newRelId=newRelType=''">
228
							<input type="text" class="form-control" placeholder="new relation (organization id)..." ng-model="newRelId" />
229
							<select class="custom-select" ng-model="newRelType">
230
								<option disabled="disabled" value=''>relation type...</option>
231
								<option ng-repeat="t in vocabularies.relTypes">{{t}}</option>
232
							</select>
233
							<div class="input-group-append">
234
								<button type="button" class="btn btn-outline-success" ng-click="org.relations.push({'relatedOrgId': newRelId, 'relatedOrgName': 'New organization (ID: ' + newRelId + ')', 'type': newRelType}); newRelId=newRelType=''" ng-disabled="!newRelId || !newRelType">add</button>
235
							</div>
236
						</div>
237
					</div>	
238
				</div>
239
			</div>
240
		</div>
241
	</fieldset>
242
</form>
243

  
modules/dnet-orgs-database-application/trunk/src/main/resources/static/html/new.html
1
NEW
modules/dnet-orgs-database-application/trunk/src/main/resources/static/html/edit.html
1
<p class="muted"><b>ID: </b>{{org.id}} - <b>source:</b> {{org.source}}</p>
2

  
3
<form>
4
	<fieldset class="mb-4">
5
		<legend>Organization name</legend>
6

  
7
		<div class="form-group row">
8
			<div class="input-group input-group-sm col-xl-8 col-lg-10">
9
				<div class="input-group-prepend">
10
					<div class="input-group-text">name</div>
11
				</div>
12
				<input type="text" class="form-control" placeholder="name" ng-model="org.name" />
13
			</div>
14
		</div>
15
	</fieldset>
16
	<fieldset class="mb-4">
17
		<legend>Geographical location</legend>
18
	
19
		<div class="form-group row">
20
			<div class="input-group input-group-sm col-xl-8 col-lg-10">
21
				<div class="input-group-prepend">
22
					<div class="input-group-text">city</div>
23
				</div>
24
				<input type="text" class="form-control" placeholder="" ng-model="org.city" />
25
				<div class="input-group-append input-group-prepend">
26
					<div class="input-group-text">country</div>
27
				</div>
28
				<select class="custom-select" ng-model="org.country">
29
					<option disabled="disabled" value=''>country...</option>
30
					<option ng-repeat="c in vocabularies.countries">{{c}}</option>
31
				</select>
32
				<div class="input-group-append input-group-prepend">
33
					<div class="input-group-text">lat</div>
34
				</div>
35
				<input type="text" class="form-control" placeholder="0.0" ng-model="org.lat" />
36
				<div class="input-group-append input-group-prepend">
37
					<div class="input-group-text">lng</div>
38
				</div>
39
				<input type="text" class="form-control" placeholder="0.0" ng-model="org.lng" />
40
			</div>
41
		</div>
42
	</fieldset>
43
	
44
	<fieldset class="mb-4">
45
		<legend>Organization type</legend>
46
		<div class="form-group row">
47
			<div class="col-xl-4 col-lg-8">
48
				<div class="card">
49
					<table class="table table-sm">
50
						<tbody>
51
							<tr ng-repeat="t in org.types">
52
								<td>{{t}}</td>
53
								<td class="text-right">
54
									<button type="button" class="btn btn-sm  btn-outline-danger" ng-click="org.types.splice($index, 1)">delete</button>
55
								</td>
56
							</tr>
57
						</tbody>
58
					</table>
59
					<div class="card-footer">
60
						<div class="input-group input-group-sm" ng-init="newType=''">
61
							<select class="custom-select" ng-model="newType">
62
								<option disabled="disabled" value=''>new type...</option>
63
								<option ng-repeat="t in vocabularies.orgTypes" ng-disabled="org.types.indexOf(t) !== -1">{{t}}</option>
64
							</select>
65
							<div class="input-group-append">
66
								<button type="button" class="btn btn-outline-success" ng-click="org.types.push(newType); newType=''" ng-disabled="!newType">add</button>
67
							</div>
68
						</div>
69
					</div>
70
				</div>
71
			</div>
72
		</div>
73
	</fieldset>
74

  
75

  
76
	<fieldset class="mb-4">
77
		<legend>Other names and identifiers</legend>
78
		
79
		<div class="form-group row">
80
			<div class="col-xl-4 col-lg-8 mb-2">
81
				<div class="card">
82
					<div class="card-header text-center">Identifiers</div>
83
					<table class="table table-sm">
84
						<thead class="thead-light">
85
							<tr>
86
								<th>id</th>
87
								<th>type</th>
88
								<th></th>
89
							</tr>
90
						</thead>
91
						<tbody>
92
							<tr ng-repeat="id in org.otherIdentifiers">
93
								<td>{{id.id}}</td>
94
								<td>{{id.type}}</td>
95
								<td class="text-right">
96
									<button type="button" class="btn btn-sm  btn-outline-danger" ng-click="org.otherIdentifiers.splice($index, 1)">delete</button>
97
								</td>
98
							</tr>
99
						</tbody>
100
					</table>
101
					<div class="card-footer">
102
						<div class="input-group input-group-sm" ng-init="newId=newIdType=''">
103
							<input type="text" class="form-control" placeholder="new id..." ng-model="newId" />
104
							<select class="custom-select" ng-model="newIdType">
105
								<option disabled="disabled" value=''>new type...</option>
106
								<option ng-repeat="t in vocabularies.idTypes">{{t}}</option>
107
							</select>
108
							<div class="input-group-append">
109
								<button type="button" class="btn btn-outline-success" ng-click="org.otherIdentifiers.push({'id': newId, 'type': newIdType}); newId=newIdType=''" ng-disabled="!newId || !newIdType">add</button>
110
							</div>
111
						</div>
112
					</div>
113
				</div>
114
			</div>
115
		
116
			<div class="col-xl-4 col-lg-8 mb-2">
117
				<div class="card">
118
					<div class="card-header text-center">Aliases</div>
119
					<table class="table table-sm">
120
						<thead class="thead-light">
121
							<tr>
122
								<th>name</th>
123
								<th>lang</th>
124
								<th></th>
125
							</tr>
126
						</thead>
127
						<tbody>
128
							<tr ng-repeat="n in org.otherNames">
129
								<td>{{n.name}}</td>
130
								<td>{{n.lang}}</td>
131
								<td class="text-right">
132
									<button type="button" class="btn btn-sm  btn-outline-danger" ng-click="org.otherNames.splice($index, 1)">delete</button>
133
								</td>
134
							</tr>
135
						</tbody>
136
					</table>	
137
					<div class="card-footer">
138
						<div class="input-group input-group-sm" ng-init="newOtherName=newLang=''">
139
							<input type="text" class="form-control" placeholder="new alias..." ng-model="newOtherName" />
140
							<select class="custom-select" ng-model="newLang">
141
								<option disabled="disabled" value=''>language...</option>
142
								<option ng-repeat="l in vocabularies.languages">{{l}}</option>
143
							</select>
144
							<div class="input-group-append">
145
								<button type="button" class="btn btn-outline-success" ng-click="org.otherNames.push({'name': newOtherName, 'lang': newLang}); newOtherName=newLang=''" ng-disabled="!newOtherName || !newLang">add</button>
146
							</div>
147
						</div>
148
					</div>
149
				</div>
150
			</div>
151
		</div>
152
		<div class="form-group row">
153
			<div class="col-xl-4 col-lg-8 mb-2">
154
				<div class="card">
155
					<div class="card-header text-center">Acronyms</div>
156
					<table class="table table-sm">
157
						<tbody>
158
							<tr ng-repeat="a in org.acronyms">
159
								<td>{{a}}</td>
160
								<td class="text-right">
161
									<button type="button" class="btn btn-sm  btn-outline-danger" ng-click="org.acronyms.splice($index, 1)">delete</button>
162
								</td>
163
							</tr>
164
						</tbody>
165
					</table>
166
					<div class="card-footer">
167
						<div class="input-group input-group-sm" ng-init="newAcronym=''">
168
							<input type="text" class="form-control" placeholder="new acronym..." ng-model='newAcronym'/>
169
							<div class="input-group-append">
170
								<button type="button" class="btn btn-outline-success" ng-click="org.acronyms.push(newAcronym); newAcronym=''" ng-disabled="!newAcronym || org.acronyms.indexOf(newAcronym) !== -1" >add</button>
171
							</div>
172
						</div>
173
					</div>
174
				</div>
175
			</div>
176
			<div class="col-xl-4 col-lg-8 mb-2">
177
				<div class="card">
178
					<div class="card-header text-center">Urls</div>
179
					<table class="table table-sm">
180
						<tbody>
181
							<tr ng-repeat="u in org.urls">
182
								<td><a href="{{u}}" target="_blank">{{u}}</a></td>
183
								<td class="text-right">
184
									<button type="button" class="btn btn-sm  btn-outline-danger" ng-click="org.urls.splice($index, 1)">delete</button>
185
								</td>
186
							</tr>
187
						</tbody>
188
					</table>
189
					<div class="card-footer">
190
						<div class="input-group input-group-sm" ng-init="newUrl=''">
191
							<input type="text" class="form-control" placeholder="http://..." ng-model="newUrl" />
192
							<div class="input-group-append">
193
								<button type="button" class="btn btn-outline-success" ng-click="org.urls.push(newUrl); newUrl=''" ng-disabled="!newUrl || org.urls.indexOf(newUrl) !== -1" >add</button>
194
							</div>
195
						</div>
196
					</div>	
197
				</div>
198
			</div>
199
		</div>
200
	</fieldset>
201

  
202
	<fieldset class="mb-4">
203
		<legend>Relations</legend>
204
		
205
		<div class="form-group row">
206
			<div class="col-xl-8 col-lg-10">
207
				<div class="card">
208
					<table class="table table-sm">
209
						<thead class="thead-light">
210
							<tr>
211
								<th>related org</th>
212
								<th>type</th>
213
								<th></th>
214
							</tr>
215
						</thead>
216
						<tbody>
217
							<tr ng-repeat="r in org.relations">
218
								<td><a href="#!/show/{{r.relatedOrgId}}" title="{{r.relatedOrgId}}">{{r.relatedOrgName}}</a></td>
219
								<td>{{r.type}}</td>
220
								<td class="text-right">
221
									<button type="button" class="btn btn-sm  btn-outline-danger" ng-click="org.relations.splice($index, 1)">delete</button>
222
								</td>
223
							</tr>
224
						</tbody>
225
					</table>
226
					<div class="card-footer">
227
						<div class="input-group input-group-sm" ng-init="newRelId=newRelType=''">
228
							<input type="text" class="form-control" placeholder="new relation (organization id)..." ng-model="newRelId" />
229
							<select class="custom-select" ng-model="newRelType">
230
								<option disabled="disabled" value=''>relation type...</option>
231
								<option ng-repeat="t in vocabularies.relTypes">{{t}}</option>
232
							</select>
233
							<div class="input-group-append">
234
								<button type="button" class="btn btn-outline-success" ng-click="org.relations.push({'relatedOrgId': newRelId, 'relatedOrgName': 'New organization (ID: ' + newRelId + ')', 'type': newRelType}); newRelId=newRelType=''" ng-disabled="!newRelId || !newRelType">add</button>
235
							</div>
236
						</div>
237
					</div>	
238
				</div>
239
			</div>
240
		</div>
241
	</fieldset>
242
</form>
243

  
modules/dnet-orgs-database-application/trunk/src/main/resources/static/js/datasources.js
2 2

  
3 3
orgsModule.config(function($routeProvider) {
4 4
	$routeProvider
5
		.when('/new',                              { templateUrl: 'html/new.html',    controller: 'newOrgCtrl' })
5
		.when('/new',                              { templateUrl: 'html/edit.html',   controller: 'newOrgCtrl' })
6 6
		.when('/search',                           { templateUrl: 'html/search.html', controller: 'searchCtrl' })
7 7
		.when('/searchResults/:page/:size/:text*', { templateUrl: 'html/list.html',   controller: 'searchResultsCtrl' })
8 8
		.when('/countries',                        { templateUrl: 'html/browse.html', controller: 'countriesCtrl' })
9 9
		.when('/byCountry/:page/:size/:code*',     { templateUrl: 'html/list.html',   controller: 'byCountryCtrl' })
10 10
		.when('/types',                            { templateUrl: 'html/browse.html', controller: 'typesCtrl' })
11 11
		.when('/byType/:page/:size/:type*',        { templateUrl: 'html/list.html',   controller: 'byTypeCtrl' })
12
		.when('/show/:id',                         { templateUrl: 'html/show.html',   controller: 'showCtrl' })
12
		.when('/show/:id',                         { templateUrl: 'html/edit.html',   controller: 'showCtrl' })
13 13
		.otherwise({ redirectTo: '/search' });
14 14
});
15 15

  
......
26 26
});
27 27

  
28 28
orgsModule.controller('newOrgCtrl', function ($scope, $http, $routeParams) {
29
	$scope.org = {
30
			"id": "",
31
			"name": "",
32
			"lat": 0.0,
33
			"lng": 0.0,
34
			"city": "",
35
			"country": "",
36
			"source": "user",
37
			"otherIdentifiers": [],
38
			"otherNames": [],
39
			"relations": [],
40
			"acronyms": [],
41
			"types": [],
42
			"urls": []
43
		};
44
	$scope.vocabularies = {};
29 45
	
46
	$http.get('/api/vocabularies').then(function successCallback(res) {
47
		$scope.vocabularies = res.data;
48
	}, function errorCallback(res) {
49
		alert("Error");
50
	});
51
	
30 52
});
31 53

  
32 54
orgsModule.controller('searchCtrl', function ($scope, $http, $routeParams) {});
modules/dnet-orgs-database-application/trunk/src/main/resources/application.properties
13 13
spring.jpa.properties.hibernate.jdbc.lob.non_contextual_creation=true
14 14
spring.jpa.open-in-view=true
15 15

  
16
spring.jpa.properties.hibernate.show_sql=true
17
spring.jpa.properties.hibernate.use_sql_comments=true
18
spring.jpa.properties.hibernate.format_sql=true
16
#spring.jpa.properties.hibernate.show_sql=true
17
#spring.jpa.properties.hibernate.use_sql_comments=true
18
#spring.jpa.properties.hibernate.format_sql=true

Also available in: Unified diff