-
Notifications
You must be signed in to change notification settings - Fork 0
/
unit-create.xhtml
79 lines (79 loc) · 3.84 KB
/
unit-create.xhtml
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
<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="/callimachus/template.xsl"?>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
xmlns:owl="http://www.w3.org/2002/07/owl#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:calli="http://callimachusproject.org/rdf/2009/framework#"
xmlns:foaf="http://xmlns.com/foaf/0.1/"
xmlns:skos="http://www.w3.org/2004/02/skos/core#"
xmlns:vcard="http://www.w3.org/2006/vcard/ns#"
xmlns:gr="http://purl.org/goodrelations/v1#"
xmlns:directory="http://dir.w3.org/rdf/2012/directory/">
<head>
<title>New Organization</title>
<script type="text/javascript">
// <![CDATA[
jQuery(function($) {
var legal = parent.document.getElementById('legal').value;
$('#legal').val(legal);
var orgtype = parent.document.getElementById('orgtype');
var about = orgtype.options[orgtype.selectedIndex].getAttribute('about');
if (about) {
$('#orgtype').append('<span about="' + about + '" />');
}
});
function updateLabel() {
var legal = $('#legal').val();
var unit = $('#unit').val();
var label = legal + ' ' + unit;
$('#label').val(label);
$('#fn').val(label);
$('#name').val(legal);
}
// ]]>
</script>
</head>
<body>
<div class="container">
<div class="page-header">
<h1>New Organization</h1>
</div>
<form id="form" typeof="vcard:Organization vcard:VCard gr:BusinessEntity" method="POST" action="" enctype="application/rdf+xml" onsubmit="updateLabel();return calli.saveResourceAs(event, calli.slugify($('#unit').val()))">
<div class="row">
<div class="col-sm-4">
<div class="form-group">
<h4>Business Unit</h4>
<input id="unit" type="text" autofocus="autofocus" value="{vcard:organization-unit}" required="required" title="The name of a unit, division, department, or group within an organization" class="form-control" />
<input id="legal" type="hidden" value="{gr:legalName}" />
<input id="label" type="hidden" value="{rdfs:label}" />
<input id="fn" type="hidden" value="{vcard:fn}" />
<input id="name" type="hidden" value="{vcard:organization-name}" />
<span id="orgtype" rel="directory:isOrganizationType">
<span about="?orgtype" rev="calli:hasComponent" resource="type-of-organization/" />
</span>
</div>
<div class="form-group">
<label for="url">Web site URL</label>
<input id="url" type="url" required="required" value="{vcard:url}" class="form-control" />
</div>
<div class="form-group">
<label for="email" class="control-label">Email</label>
<input id="email" type="email" value="{vcard:workEmail}" title="Preferred e-mail address for contact" class="form-control" />
</div>
<div class="form-group">
<label for="tel" class="control-label">Telephone</label>
<input type="text" id="tel" placeholder="+country code-area-number" value="{vcard:workTel}" class="form-control" />
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<button id="submit" type="submit" class="btn btn-primary">Create</button>
</div>
</div>
</form>
</div>
</body>
</html>