servers_edit.html 5.75 KB
Newer Older
1
{% extends "edumanage/welcome.html"%}
Kroustouris Stauros's avatar
Kroustouris Stauros committed
2
{% load staticfiles %}
3
{% load i18n %}
Kroustouris Stauros's avatar
Kroustouris Stauros committed
4 5


6 7
{% block homeactive %}{% endblock %}
{% block serversactive %}class="active"{% endblock %}
Kroustouris Stauros's avatar
Kroustouris Stauros committed
8 9
{% block management_content %}
<h4>{% if edit %}{{form.instance.get_name}} ({% trans "edit" %}){% else %}{% trans "Add Server" %}{% endif %}</h4>
10 11 12
<hr>
<form method="POST" class="form-horizontal">
	{% if form.non_field_errors %}
13 14 15
		{% for error in form.non_field_errors %}
	        <li class="alert-danger"><strong>{{ error }}</strong></li>
	    {% endfor %}
16
	{% endif %}
17
	{% csrf_token %}
18 19 20
	<div style="display: none">
		{{form.instid}}
	</div>
Kroustouris Stauros's avatar
Kroustouris Stauros committed
21 22 23 24 25
	<div class="col-md-6">
		<div class="form-group {% if form.ertype.errors %} error {% endif %}">
			<label class="control-label" for="id_ertype"><b>{% trans "Type" %}</b></label>
			<div class="controls">
				{{ form.ertype }}
26
				{% if form.ertype.errors %} <div class="alert-danger"> {{ form.ertype.errors|join:", " }} </div>
Kroustouris Stauros's avatar
Kroustouris Stauros committed
27 28
				{% endif %} <span class="help-block">{{ form.ertype.help_text }}</span>
			</div>
29 30
		</div>
	</div>
Kroustouris Stauros's avatar
Kroustouris Stauros committed
31 32 33 34 35
	<div class="col-md-6">
		<div class="form-group {% if form.addr_type.errors %} error {% endif %}">
			<label class="control-label" for="id_addr_type"><b>{% trans "Address Family" %}</b></label>
			<div class="controls">
				{{ form.addr_type }}
36
				{% if form.addr_type.errors %} <div class="alert-danger"> {{ form.addr_type.errors|join:", " }} </div>
Kroustouris Stauros's avatar
Kroustouris Stauros committed
37 38
				{% endif %} <span class="help-block">{{ form.addr_type.help_text }}</span>
			</div>
39 40
		</div>
	</div>
Kroustouris Stauros's avatar
Kroustouris Stauros committed
41 42 43 44 45
	<div class="col-md-6">
		<div class="form-group {% if form.host.errors %} error {% endif %}">
			<label class="control-label" for="id_host"><b>{% trans "Hostname" %}</b></label>
			<div class="controls">
				{{ form.host }}
46
				{% if form.host.errors %} <div class="alert-danger"> {{ form.host.errors|join:", " }} </div>
Kroustouris Stauros's avatar
Kroustouris Stauros committed
47 48
				{% endif %} <span class="help-block">{{ form.host.help_text }}</span>
			</div>
49 50
		</div>
	</div>
Kroustouris Stauros's avatar
Kroustouris Stauros committed
51 52 53 54 55
	<div class="col-md-6">
		<div class="form-group {% if form.name.errors %} error {% endif %}">
			<label class="control-label" for="id_name">{% trans "Label" %}</label>
			<div class="controls">
				{{ form.name }}
56
				{% if form.name.errors %} <div class="alert-danger"> {{ form.name.errors|join:", " }} </div>
Kroustouris Stauros's avatar
Kroustouris Stauros committed
57 58
				{% endif %} <span class="help-block">{{ form.name.help_text }}</span>
			</div>
59 60 61
		</div>
	</div>
	{% if institution.ertype == 1 or institution.ertype == 3 %}
Kroustouris Stauros's avatar
Kroustouris Stauros committed
62 63 64 65 66
	<div class="col-md-6">
		<div class="form-group {% if form.rad_pkt_type.errors %} error {% endif %}">
			<label class="control-label" for="id_rad_pkt_type"><b>{% trans "RADIUS Packet Types" %}</b></label>
			<div class="controls">
				{{ form.rad_pkt_type }}
67
				{% if form.rad_pkt_type.errors %} <div class="alert-danger"> {{ form.rad_pkt_type.errors|join:", " }} </div>
Kroustouris Stauros's avatar
Kroustouris Stauros committed
68 69
				{% endif %} <span class="help-block">{{ form.rad_pkt_type.help_text }}</span>
			</div>
70 71
		</div>
	</div>
Kroustouris Stauros's avatar
Kroustouris Stauros committed
72 73 74 75 76
	<div class="col-md-6">
		<div class="form-group {% if form.auth_port.errors %} error {% endif %}">
			<label class="control-label" for="id_auth_port"><b>{% trans "Authentication Port" %}</b></label>
			<div class="controls">
				{{ form.auth_port }}
77
				{% if form.auth_port.errors %} <div class="alert-danger"> {{ form.auth_port.errors|join:", " }} </div>
Kroustouris Stauros's avatar
Kroustouris Stauros committed
78 79
				{% endif %} <span class="help-block">{{ form.auth_port.help_text }}</span>
			</div>
80 81
		</div>
	</div>
Kroustouris Stauros's avatar
Kroustouris Stauros committed
82 83 84 85 86
	<div class="col-md-6">
		<div class="form-group {% if form.acct_port.errors %} error {% endif %}">
			<label class="control-label" for="id_acct_port"><b>{% trans "Accounting Port" %}</b></label>
			<div class="controls">
				{{ form.acct_port }}
87
				{% if form.acct_port.errors %} <div class="alert-danger"> {{ form.acct_port.errors|join:", " }} </div>
Kroustouris Stauros's avatar
Kroustouris Stauros committed
88 89
				{% endif %} <span class="help-block">{{ form.acct_port.help_text }}</span>
			</div>
90 91 92
		</div>
	</div>
	{% endif %}
Kroustouris Stauros's avatar
Kroustouris Stauros committed
93 94 95 96 97
	<div class="col-md-6">
		<div class="form-group {% if form.status_server.errors %} error {% endif %}">
			<label class="control-label" for="id_status_server">{% trans "Status-Server" %}</label>
			<div class="controls">
				{{ form.status_server }}
98
				{% if form.status_server.errors %} <div class="alert-danger"> {{ form.status_server.errors|join:", " }} </div>
Kroustouris Stauros's avatar
Kroustouris Stauros committed
99 100
				{% endif %} <span class="help-block">{{ form.status_server.help_text }}</span>
			</div>
101 102
		</div>
	</div>
Kroustouris Stauros's avatar
Kroustouris Stauros committed
103 104 105 106 107
	<div class="col-md-6">
		<div class="form-group {% if form.secret.errors %} error {% endif %}">
			<label class="control-label" for="id_secret"><b>{% trans "Secret" %}</b></label>
			<div class="controls">
				<input type="password" maxlength="80" name="secret" id="id_secret" {% if edit %}value='{{form.instance.secret}}'{% endif %} {% if form.data.secret %}value='{{form.data.secret}}'{% endif %}>
108
				{% if form.secret.errors %} <div class="alert-danger"> {{ form.secret.errors|join:", " }} </div>
Kroustouris Stauros's avatar
Kroustouris Stauros committed
109 110
				{% endif %} <span class="help-block">{{ form.secret.help_text }}</span>
			</div>
111 112
		</div>
	</div>
Kroustouris Stauros's avatar
Kroustouris Stauros committed
113 114 115 116 117
	<div class="col-md-6">
		<div class="form-group {% if form.proto.errors %} error {% endif %}">
			<label class="control-label" for="id_proto"><b>{% trans "Protocol" %}</b></label>
			<div class="controls">
				{{ form.proto }}
118
				{% if form.proto.errors %} <div class="alert-danger"> {{ form.proto.errors|join:", " }} </div>
Kroustouris Stauros's avatar
Kroustouris Stauros committed
119 120
				{% endif %} <span class="help-block">{{ form.proto.help_text }}</span>
			</div>
121 122
		</div>
	</div>
Kroustouris Stauros's avatar
Kroustouris Stauros committed
123 124 125 126 127 128
	<div class="col-md-12">
		<div class="form-group">
			<div class="controls">
				<button type="submit" id="applybutton" value="Apply" class="btn btn-primary"/>
				{% trans "Apply" %}</button>
			</div>
129
		</div>
Kroustouris Stauros's avatar
Kroustouris Stauros committed
130 131
	</form>
	{% endblock %}
132
	</div>
Kroustouris Stauros's avatar
Kroustouris Stauros committed
133

Kroustouris Stauros's avatar
Kroustouris Stauros committed
134 135 136 137 138 139 140 141 142 143

{% block extrajs %}
<script type="text/javascript" src="{% static 'js/showpass.js' %}"></script>
<script type="text/javascript" src="//maps.googleapis.com/maps/api/js?sensor=false"></script>
<script type="text/javascript">
$(document).ready(function() {
	$('#id_secret').showPassword();
});
</script>
{% endblock %}