Revision 57334
Added by Michele Artini over 4 years ago
modules/dnet-orgs-database-application/trunk/src/main/resources/static/resources/html/similarities.html | ||
---|---|---|
6 | 6 |
<div class="card-header"> |
7 | 7 |
<ul class="nav nav-tabs card-header-tabs"> |
8 | 8 |
<li class="nav-item"> |
9 |
<a href="#!/metadata/{{orgId}}" class="nav-link">Metadata</a> |
|
9 |
<a href="#!/metadata/0/{{orgId}}" class="nav-link">Metadata</a>
|
|
10 | 10 |
</li> |
11 | 11 |
<li class="nav-item"> |
12 | 12 |
<a href="#!/relations/{{orgId}}" class="nav-link" href="#">Relations</a> |
modules/dnet-orgs-database-application/trunk/src/main/resources/static/resources/html/relations.html | ||
---|---|---|
6 | 6 |
<div class="card-header"> |
7 | 7 |
<ul class="nav nav-tabs card-header-tabs"> |
8 | 8 |
<li class="nav-item"> |
9 |
<a href="#!/metadata/{{orgId}}" class="nav-link">Metadata</a> |
|
9 |
<a href="#!/metadata/0/{{orgId}}" class="nav-link">Metadata</a>
|
|
10 | 10 |
</li> |
11 | 11 |
<li class="nav-item"> |
12 | 12 |
<a href="javascript:void(0)" class="nav-link active" href="#">Relations</a> |
... | ... | |
30 | 30 |
<td class="text-center text-muted" colspan="3">No relations</td> |
31 | 31 |
</tr> |
32 | 32 |
<tr ng-repeat="r in rels"> |
33 |
<td class="pl-3"><a href="#!/metadata/{{r.relatedOrgId}}" title="{{r.relatedOrgId}}">{{r.relatedOrgName}}</a></td> |
|
33 |
<td class="pl-3"><a href="#!/metadata/0/{{r.relatedOrgId}}" title="{{r.relatedOrgId}}">{{r.relatedOrgName}}</a></td>
|
|
34 | 34 |
<td>{{r.type}}</td> |
35 | 35 |
<td class="text-right"> |
36 | 36 |
<button type="button" class="btn btn-sm btn-outline-danger" ng-click="deleteRelation(r.relatedOrgId, r.type)"><i class="fa fa-trash"></i></button> |
modules/dnet-orgs-database-application/trunk/src/main/resources/static/resources/html/edit.html | ||
---|---|---|
1 |
<p class="text-muted" ng-if="orgId"> |
|
2 |
<b>ID: </b>{{orgId}}<br /> |
|
3 |
<b>Created at</b> {{org.creationDate | date:'MMMM d, y HH:mm:ss'}} <b>by</b> {{org.createdBy}}<br /> |
|
4 |
<b>Modified at</b> {{org.modificationDate | date:'MMMM d, y HH:mm:ss'}} <b>by</b> {{org.modifiedBy}} |
|
5 |
</p> |
|
1 |
<div class="row" style="height: 5em"> |
|
2 |
<div class="col-xl-8 col-lg-10"> |
|
3 |
<div class="alert alert-success" ng-if="message">{{message}}</div> |
|
4 |
<p class="text-muted" ng-if="orgId && !message"> |
|
5 |
<b>ID: </b>{{orgId}}<br /> |
|
6 |
<b>Created at</b> {{org.creationDate | date:'MMMM d, y HH:mm:ss'}} <b>by</b> {{org.createdBy}}<br /> |
|
7 |
<b>Modified at</b> {{org.modificationDate | date:'MMMM d, y HH:mm:ss'}} <b>by</b> {{org.modifiedBy}} |
|
8 |
</p> |
|
9 |
</div> |
|
10 |
</div> |
|
6 | 11 |
|
7 | 12 |
<div class="row"> |
8 | 13 |
<div class="col-xl-8 col-lg-10"> |
... | ... | |
213 | 218 |
</div> |
214 | 219 |
</fieldset> |
215 | 220 |
|
216 |
<button type="submit" class="btn btn-sm btn-primary" ng-click="save()" ng-disabled="organizationForm.$invalid">save</button>
|
|
221 |
<button type="submit" class="btn btn-primary" ng-click="save()" ng-disabled="organizationForm.$invalid">save</button> |
|
217 | 222 |
</form> |
218 | 223 |
</div> |
219 | 224 |
</div> |
modules/dnet-orgs-database-application/trunk/src/main/resources/static/resources/html/list.html | ||
---|---|---|
1 |
Page: {{orgs.number + 1}} / {{orgs.totalPages}}<br /> |
|
2 |
Total elements: {{orgs.totalElements}}<br /> |
|
3 |
Searching for: {{fieldValue}} |
|
1 |
<p ng-if="orgs.number">Page: {{orgs.number + 1}} / {{orgs.totalPages}}<br />Total elements: {{orgs.totalElements}}<br />Searching for: {{fieldValue}}</p> |
|
2 |
<p ng-if="!orgs.number">Page:<br />Total elements:<br />Searching for: {{fieldValue}}</p> |
|
4 | 3 |
|
5 | 4 |
<nav> |
6 | 5 |
<ul class="pagination justify-content-center"> |
... | ... | |
25 | 24 |
</thead> |
26 | 25 |
<tbody> |
27 | 26 |
<tr ng-repeat="o in orgs.content" class="d-flex"> |
28 |
<td class="col-6"><a href="#!/metadata/{{o.id}}" title="{{o.id}}">{{o.name}}</a></td> |
|
27 |
<td class="col-6"><a href="#!/metadata/0/{{o.id}}" title="{{o.id}}">{{o.name}}</a></td>
|
|
29 | 28 |
<td class="col-4"><img ng-src="resources/images/flags/{{o.country}}.gif" /> {{o.city}}, {{o.country}}</td> |
30 | 29 |
<td class="col-1 text-center">{{o.acronyms.join()}}</td> |
31 | 30 |
<td class="col-1 text-right">{{o.type}}</td> |
modules/dnet-orgs-database-application/trunk/src/main/resources/static/resources/js/organizations.js | ||
---|---|---|
9 | 9 |
.when('/byCountry/:page/:size/:code*', { templateUrl: 'resources/html/list.html', controller: 'byCountryCtrl' }) |
10 | 10 |
.when('/types', { templateUrl: 'resources/html/browse.html', controller: 'typesCtrl' }) |
11 | 11 |
.when('/byType/:page/:size/:type*', { templateUrl: 'resources/html/list.html', controller: 'byTypeCtrl' }) |
12 |
.when('/metadata/:id', { templateUrl: 'resources/html/edit.html', controller: 'showMetadataCtrl' })
|
|
12 |
.when('/metadata/:msg/:id', { templateUrl: 'resources/html/edit.html', controller: 'showMetadataCtrl' })
|
|
13 | 13 |
.when('/relations/:id', { templateUrl: 'resources/html/relations.html', controller: 'showRelationsCtrl' }) |
14 | 14 |
.when('/similarities/:id', { templateUrl: 'resources/html/similarities.html', controller: 'showSimilaritiesCtrl' }) |
15 | 15 |
.otherwise({ redirectTo: '/search' }); |
... | ... | |
68 | 68 |
$http.defaults.headers.post["Content-Type"] = "application/json;charset=UTF-8"; |
69 | 69 |
$http.post('/api/organizations/save', $scope.org).then(function successCallback(res) { |
70 | 70 |
// alert('Organization saved !!!'); |
71 |
$location.url('/metadata/' + res.data[0]); |
|
71 |
$location.url('/metadata/1/' + res.data[0]);
|
|
72 | 72 |
}, function errorCallback(res) { |
73 | 73 |
alert('ERROR: ' + res.data.error + ' (' + res.data.message + ')'); |
74 | 74 |
}); |
... | ... | |
85 | 85 |
$scope.basepath = '/searchResults'; |
86 | 86 |
$scope.fieldValue = decodeURIComponent($routeParams.text); |
87 | 87 |
|
88 |
$scope.orgs = [];
|
|
88 |
$scope.orgs = {};
|
|
89 | 89 |
|
90 | 90 |
$http.get('/api/organizations/search/' + $routeParams.page + '/' + $routeParams.size + '?q=' + $scope.fieldValue).then(function successCallback(res) { |
91 | 91 |
$scope.orgs = res.data; |
... | ... | |
147 | 147 |
}); |
148 | 148 |
|
149 | 149 |
|
150 |
orgsModule.controller('showMetadataCtrl', function ($scope, $http, $routeParams, $route) { |
|
150 |
orgsModule.controller('showMetadataCtrl', function ($scope, $http, $routeParams, $route, $location, $timeout) {
|
|
151 | 151 |
$scope.orgId = $routeParams.id; |
152 | 152 |
$scope.org = {}; |
153 | 153 |
$scope.vocabularies = {}; |
154 | 154 |
|
155 |
if ($routeParams.msg == 1) { |
|
156 |
$scope.message = 'New organization registered !!!'; |
|
157 |
} else if ($routeParams.msg == 2) { |
|
158 |
$scope.message = 'Organization updated !!!'; |
|
159 |
} else { |
|
160 |
$scope.message = ''; |
|
161 |
} |
|
162 |
|
|
163 |
$timeout(function() { $scope.message = ''; }, 3000) |
|
164 |
|
|
155 | 165 |
$http.get('/api/vocabularies').then(function successCallback(res) { |
156 | 166 |
$scope.vocabularies = res.data; |
157 | 167 |
|
... | ... | |
167 | 177 |
$scope.save = function() { |
168 | 178 |
$http.defaults.headers.post["Content-Type"] = "application/json;charset=UTF-8"; |
169 | 179 |
$http.post('/api/organizations/save', $scope.org).then(function successCallback(res) { |
170 |
// alert('Organization updated !!!');
|
|
171 |
$route.reload();
|
|
180 |
if ($routeParams.msg == 2) { $route.reload(); }
|
|
181 |
else { $location.url('/metadata/2/' + res.data[0]); }
|
|
172 | 182 |
}, function errorCallback(res) { |
173 | 183 |
alert('ERROR: ' + res.data.error + ' (' + res.data.message + ')'); |
174 | 184 |
}); |
Also available in: Unified diff