summaryrefslogtreecommitdiff
path: root/templates/apps/name/edit.html
blob: d18cbecf4aa604e55c6c0e1c1d4b5c937b2bd861 (plain)
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
{% extends "base.html" %}
{% block js %}
<script type="text/javascript">
$(function() {
   	$("#members").accordion({
   		header: 'h3'
   	});
   	$('#tree').jstree({
   		'json_data': {
   			'ajax': {
   				'url': function(n) {
   					if (n == -1) {
   						return {% if name %}"/rtree/"+{{name.id}}+".json"{% else %}"/rtree.json"{% endif %};
   					} else {
   						return "/ctree/"+n.attr('id')+".json";
   					}
   				}
   			},
   			"progressive_render"  : true,
   			'animation': 0,
   		},
   		'plugins': ['themeroller','json_data']
   	});
});
</script>
{% endblock %}
{% block headline %}{% if name %}{{name.shortname}}{% else %}(){% endif %}{% endblock %}
{% block title %}COIP{% if name %} - {{name.shortname}}{% endif %}{% endblock %}
{% block main %}
<div style="float: left; width: 30%;">
	{% if name %}
	{% if name.parent %}
	<a href="/name/id/{{name.parent.id}}">.. (up one level)</a>
	{% else %}
	<a href="/name">.. (up one level)</a>
	{% endif %}
	{% endif %}
	<div style="height: 100%;" id="tree"></div>
</div>
<div style="float: right; width: 60%; padding-left: 20px;">
	<form method="POST">
		<div class="ui-widget-content ui-corner-all infopanel">
		    <h3>{{formtitle}}</h3>
			<table>
		      {% for field in form %}
		        <tr>
		          {% if field.errors %}
		            <td colspan="2">{{ field.errors }}</td>
		          {% endif %}
		        </tr>
		        <tr>
		          <td>{{ field.label_tag }}</td>
		          <td><div class="ui-widget">{{ field }}</div></td>
		        </tr>
		      {% endfor %}
		    </table>
		</div>
		<br/>
		<div class="button">
		    <input type="submit" value="{{submitname}}" />
		    <input type="button" onClick="document.location='/name/id/{{name.id}}'" value="Cancel"/>
	    </div>
	</form>
</div>
{% endblock %}