-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreateproduct.html
More file actions
82 lines (72 loc) · 2.6 KB
/
Copy pathcreateproduct.html
File metadata and controls
82 lines (72 loc) · 2.6 KB
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
<html>
<head>
{% include "styles.html" %}
<title>BeneTag</title>
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
</head>
<script type="text/javascript">
function initialize() {
var factory_names = new Array();
{% for factory in factories %}
{% if factory.unique %}
factory_names.push('{{factory.name}} ({{factory.unique}})');
{% else %}
factory_names.push('{{factory.name}}');
{% endif %}
{% endfor %}
$('#factoryName').autocomplete({
source: factory_names
});
}
</script>
<script type="text/javascript">
function onsubmitform()
{
if(document.pressed == 'more')
{
document.createprod.action ="/storeproduct?more=True";
}
else
if(document.pressed == 'exit')
{
document.createprod.action ="/storeproduct";
}
return true;
}
</script>
<body onload="initialize()">
{% include "navbar.html" %}
<p>
{% if added %}
<p>Product added successfully</p>
{% endif %}
{% if repeat %}
<p>Product already exists</p>
{% endif %}
<form name="createprod" onsubmit="return onsubmitform();" enctype="multipart/form-data" method="post">
<div>Name: <input name="name" id="name"></input></div><br />
<div>Factories:
{% for factory in factories %}
<input type="radio" name="factory" value ="{{factory.key}}">{{factory.name}} {% if factory.unique %} ({{factory.unique}}) {% endif %} </input><br/>
{% endfor %}
</div><br />
<div>Workers:
{% for worker in workers %}
<input type="checkbox" name="workers" value ="{{worker.key}}">{{worker.name}} {% if worker.unique %} ({{worker.unique}}) {% endif %} </input><br/>
{% endfor %}
</div><br />
<div>Badges:
{% for badge in badges %}
<input type="checkbox" name="badges" value ="{{badge.key}}">{{badge.name}}</input><br/>
{%endfor%}
</div><br />
<div>Picture:<input type="file" name="picture"/></div><br />
<div>Unique ID (optional): <input name="unique"></input></div><br />
<div><input type="submit" name="more" value="Save and create another" onclick="document.pressed=this.name" a class='span4 btn medium'></div>
<div><input type="submit" name="exit" value="Save and view product" onclick="document.pressed=this.name" a class='span4 btn medium'></div>
</form></p>
{% include "footer.html" %}
</body>
</html>