dnet-applications/apps/dnet-orgs-database-application/src/main/resources/static/resources/html/forms/org_metadata.html

298 lines
12 KiB
HTML

<div class="card-body">
<form name="organizationForm">
<div ng-if="mode == 'approve'" class="alert alert-warning">
This is a pending organization. Please evaluate it before approving.
</div>
<div ng-if="mode == 'readonly'" class="alert alert-secondary">
This organization is managed by the system. You can not edit.
</div>
<fieldset ng-disabled="mode == 'readonly'">
<legend>Official name and type</legend>
<div class="form-group">
<div class="input-group input-group-sm">
<div class="input-group-prepend">
<div class="input-group-text text-white" ng-class="{'bg-primary' : mode != 'approve', 'bg-warning' : mode == 'approve'}">name</div>
</div>
<input name="org_nm" type="text" class="form-control"
placeholder="organization name..." ng-model="org.name"
required="required"
ng-class="{'is-invalid' : organizationForm.org_nm.$error.required}" />
<div class="input-group-append input-group-prepend">
<div class="input-group-text text-white" ng-class="{'bg-primary' : mode != 'approve', 'bg-warning' : mode == 'approve'}">type</div>
</div>
<select name="org_tp" class="custom-select" ng-model="org.type"
required="required"
ng-class="{'is-invalid' : organizationForm.org_tp.$error.required}">
<option disabled="disabled" value='' ng-if="!org.type">type...</option>
<option ng-repeat="t in vocabularies.orgTypes" value="{{t.value}}">{{t.name}}</option>
</select>
</div>
</div>
</fieldset>
<fieldset class="mt-4" ng-disabled="mode == 'readonly'">
<legend>Geographical location</legend>
<div class="form-group">
<div class="input-group input-group-sm">
<div class="input-group-prepend">
<div class="input-group-text text-white" ng-class="{'bg-primary' : mode != 'approve', 'bg-warning' : mode == 'approve'}">city</div>
</div>
<input name="org_ct" type="text" class="form-control" placeholder=""
ng-model="org.city" />
<div class="input-group-append input-group-prepend">
<div class="input-group-text text-white" ng-class="{'bg-primary' : mode != 'approve', 'bg-warning' : mode == 'approve'}">country</div>
</div>
<select name="org_cntr" class="custom-select" ng-model="org.country"
required="required"
ng-class="{'is-invalid' : organizationForm.org_cntr.$error.required}">
<option disabled="disabled" value='' ng-if="!org.country">country...</option>
<option ng-repeat="c in vocabularies.countries"value="{{c.value}}">{{c.name}}</option>
</select>
<div class="input-group-append input-group-prepend">
<div class="input-group-text text-white" ng-class="{'bg-primary' : mode != 'approve', 'bg-warning' : mode == 'approve'}">lat</div>
</div>
<input name="org_lat" type="text" class="form-control"
placeholder="0.0" ng-model="org.lat" />
<div class="input-group-append input-group-prepend">
<div class="input-group-text text-white" ng-class="{'bg-primary' : mode != 'approve', 'bg-warning' : mode == 'approve'}">lng</div>
</div>
<input name="org_lng" type="text" class="form-control"
placeholder="0.0" ng-model="org.lng" />
</div>
</div>
</fieldset>
<fieldset class="mt-4" ng-disabled="mode == 'readonly'">
<legend>Other names and identifiers</legend>
<div class="form-group row">
<div class="col-lg-8 mb-2">
<div class="card">
<div class="card-header text-white text-center py-1" ng-class="{'bg-primary' : mode != 'approve', 'bg-warning' : mode == 'approve'}">Acronyms</div>
<table class="table table-sm">
<tbody>
<tr ng-repeat="a in org.acronyms">
<td>{{a}}</td>
<td class="text-right" style="width: 44px">
<button type="button" class="btn btn-sm btn-outline-danger"
ng-click="org.acronyms.splice($index, 1)">
<i class="fa fa-trash"></i>
</button>
</td>
</tr>
</tbody>
<tfoot>
<tr ng-init="newAcronym=''">
<td><input type="text" class="form-control form-control-sm"
placeholder="new acronym..." ng-model='newAcronym' /></td>
<td class="text-right" style="width: 44px">
<button type="button" class="btn btn-sm btn-outline-success"
ng-click="org.acronyms.push(newAcronym); newAcronym=''"
ng-disabled="!newAcronym || org.acronyms.indexOf(newAcronym) !== -1">
<i class="fa fa-plus"></i>
</button>
</td>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
<div class="form-group row">
<div class="col-lg-8 mb-2">
<div class="card">
<div class="card-header text-white text-center py-1" ng-class="{'bg-primary' : mode != 'approve', 'bg-warning' : mode == 'approve'}">Aliases</div>
<table class="table table-sm">
<thead class="thead-light">
<tr>
<th>name</th>
<th style="width: 156px">language</th>
<th style="width: 44px"></th>
</tr>
</thead>
<tbody>
<tr ng-repeat="n in org.otherNames">
<td>{{n.name}}</td>
<td>{{n.lang}}</td>
<td class="text-right">
<button type="button" class="btn btn-sm btn-outline-danger"
ng-click="org.otherNames.splice($index, 1)">
<i class="fa fa-trash"></i>
</button>
</td>
</tr>
</tbody>
<tfoot>
<tr ng-init="newOtherName=newLang=''">
<td><input type="text" class="form-control form-control-sm"
placeholder="new alias..." ng-model="newOtherName" /></td>
<td><select class="custom-select custom-select-sm"
ng-model="newLang">
<option disabled="disabled" value=''>language...</option>
<option ng-repeat="l in vocabularies.languages" value="{{l.value}}">{{l.name}}</option>
</select></td>
<td class="text-right" style="width: 44px">
<button type="button" class="btn btn-sm btn-outline-success"
ng-click="org.otherNames.push({'name': newOtherName, 'lang': newLang}); newOtherName=newLang=''"
ng-disabled="!newOtherName || !newLang">
<i class="fa fa-plus"></i>
</button>
</td>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
<div class="form-group row">
<div class="col-lg-8 mb-2">
<div class="card">
<div class="card-header text-white text-center py-1" ng-class="{'bg-primary' : mode != 'approve', 'bg-warning' : mode == 'approve'}">Identifiers</div>
<table class="table table-sm">
<thead class="thead-light">
<tr>
<th>id</th>
<th style="width: 156px">type</th>
<th style="width: 44px"></th>
</tr>
</thead>
<tbody>
<tr ng-repeat="id in org.otherIdentifiers">
<td>{{id.id}}</td>
<td>{{id.type}}</td>
<td class="text-right" style="width: 44px">
<button type="button" class="btn btn-sm btn-outline-danger"
ng-click="org.otherIdentifiers.splice($index, 1)">
<i class="fa fa-trash"></i>
</button>
</td>
</tr>
</tbody>
<tfoot>
<tr ng-init="newId=newIdType=''">
<td><input type="text" class="form-control form-control-sm"
placeholder="new id..." ng-model="newId" /></td>
<td><select class="custom-select custom-select-sm"
ng-model="newIdType">
<option disabled="disabled" value=''>type...</option>
<option ng-repeat="t in vocabularies.idTypes" value="{{t.value}}">{{t.name}}</option>
</select></td>
<td class="text-right" style="width: 44px">
<button type="button" class="btn btn-sm btn-outline-success"
ng-click="org.otherIdentifiers.push({'id': newId, 'type': newIdType}); newId=newIdType=''"
ng-disabled="!newId || !newIdType">
<i class="fa fa-plus"></i>
</button>
</td>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
<div class="form-group row">
<div class="col-lg-8 mb-2">
<div class="card">
<div class="card-header text-white text-center py-1" ng-class="{'bg-primary' : mode != 'approve', 'bg-warning' : mode == 'approve'}">Urls</div>
<table class="table table-sm">
<tbody>
<tr ng-repeat="u in org.urls">
<td><a href="{{u}}" target="_blank">{{u}}</a></td>
<td class="text-right" style="width: 44px">
<button type="button" class="btn btn-sm btn-outline-danger"
ng-click="org.urls.splice($index, 1)">
<i class="fa fa-trash"></i>
</button>
</td>
</tr>
</tbody>
<tfoot>
<tr ng-init="newUrl=''">
<td><input type="text" class="form-control form-control-sm"
placeholder="http://..." ng-model="newUrl" /></td>
<td class="text-right" style="width: 44px">
<button type="button" class="btn btn-sm btn-outline-success"
ng-click="org.urls.push(newUrl); newUrl=''"
ng-disabled="!newUrl || org.urls.indexOf(newUrl) !== -1">
<i class="fa fa-plus"></i>
</button>
</td>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
</fieldset>
<fieldset class="mt-4" ng-disabled="mode == 'readonly'">
<legend>Relations</legend>
<div class="form-group row">
<div class="col-lg-8 mb-2">
<div class="card">
<div class="card-header text-white text-center py-1" ng-class="{'bg-primary' : mode != 'approve', 'bg-warning' : mode == 'approve'}">Relations</div>
<table class="table table-sm">
<thead class="thead-light">
<tr>
<th class="pl-3" style="border-top: none;">Related organization</th>
<th style="border-top: none; width: 156px">Type</th>
<th style="border-top: none; width: 44px"></th>
</tr>
</thead>
<tbody>
<tr ng-if="org.relations.length == 0">
<td class="text-center text-muted" colspan="3">No relations</td>
</tr>
<tr ng-repeat="r in org.relations">
<td class="pl-3"><a href="#!/edit/0/{{r.relatedOrgId}}" title="{{r.relatedOrgId}}">{{r.relatedOrgName}}</a></td>
<td>{{r.type}}</td>
<td class="text-right">
<button type="button" class="btn btn-sm btn-outline-danger" ng-click="org.relations.splice($index, 1)"><i class="fa fa-trash"></i></button>
</td>
</tr>
</tbody>
<tfoot>
<tr>
<td>
<input type="text" placeholder="add a related organization..." readonly="readonly"
class="form-control form-control-sm" style="background-color: white; color: #007bff;"
ng-model="newRelation.name" ng-click="resetSelectedRelation()"
data-toggle="modal" data-target="#selectRelatedOrgModal" ng-hide="mode == 'readonly'"/>
<input type="text" placeholder="add a related organization..." disabled="disabled"
class="form-control form-control-sm" ng-model="newRelation.name" ng-show="mode == 'readonly'"/>
</td>
<td>
<select class="custom-select custom-select-sm" ng-model="newRelType">
<option disabled="disabled" value=''>rel type...</option>
<option ng-repeat="t in vocabularies.relTypes" value="{{t.value}}">{{t.name}}</option>
</select>
</td>
<td class="text-right">
<button type="button" class="btn btn-sm btn-outline-success" ng-disabled="!newRelType || !newRelation.id" ng-click="addNewRelation()"><i class="fa fa-plus"></i></button>
</td>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
</fieldset>
<button type="submit" class="btn" ng-class="{'btn-primary' : mode != 'approve', 'btn-warning' : mode == 'approve'}" ng-click="save()" ng-disabled="organizationForm.$invalid" ng-hide="mode == 'readonly'">
<span ng-if="mode != 'approve'">Save</span>
<span ng-if="mode == 'approve'">Register as new Organization</span>
</button>
</form>
</div>
<select-org-modal modal-id="selectRelatedOrgModal" selected-org="newRelation"></select-org-modal>