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 %}
Zenon Mousmoulas's avatar
Zenon Mousmoulas committed
13 14 15 16 17
	<ul>
	{% for error in form.non_field_errors %}
		<li class="alert-danger"><strong>{{ error }}</strong></li>
	{% endfor %}
	</ul>
18
	{% endif %}
19
	{% csrf_token %}
20 21 22
	<div style="display: none">
		{{form.instid}}
	</div>
Kroustouris Stauros's avatar
Kroustouris Stauros committed
23 24 25 26 27
	<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 }}
28
				{% if form.ertype.errors %} <div class="alert-danger"> {{ form.ertype.errors|join:", " }} </div>
Kroustouris Stauros's avatar
Kroustouris Stauros committed
29 30
				{% endif %} <span class="help-block">{{ form.ertype.help_text }}</span>
			</div>
31 32
		</div>
	</div>
Kroustouris Stauros's avatar
Kroustouris Stauros committed
33 34 35 36 37
	<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 }}
38
				{% if form.addr_type.errors %} <div class="alert-danger"> {{ form.addr_type.errors|join:", " }} </div>
Kroustouris Stauros's avatar
Kroustouris Stauros committed
39 40
				{% endif %} <span class="help-block">{{ form.addr_type.help_text }}</span>
			</div>
41 42
		</div>
	</div>
Kroustouris Stauros's avatar
Kroustouris Stauros committed
43 44 45 46 47
	<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 }}
48
				{% if form.host.errors %} <div class="alert-danger"> {{ form.host.errors|join:", " }} </div>
Kroustouris Stauros's avatar
Kroustouris Stauros committed
49 50
				{% endif %} <span class="help-block">{{ form.host.help_text }}</span>
			</div>
51 52
		</div>
	</div>
Kroustouris Stauros's avatar
Kroustouris Stauros committed
53 54 55 56 57
	<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 }}
58
				{% if form.name.errors %} <div class="alert-danger"> {{ form.name.errors|join:", " }} </div>
Kroustouris Stauros's avatar
Kroustouris Stauros committed
59 60
				{% endif %} <span class="help-block">{{ form.name.help_text }}</span>
			</div>
61 62 63
		</div>
	</div>
	{% if institution.ertype == 1 or institution.ertype == 3 %}
Kroustouris Stauros's avatar
Kroustouris Stauros committed
64 65 66 67 68
	<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 }}
69
				{% if form.rad_pkt_type.errors %} <div class="alert-danger"> {{ form.rad_pkt_type.errors|join:", " }} </div>
Kroustouris Stauros's avatar
Kroustouris Stauros committed
70 71
				{% endif %} <span class="help-block">{{ form.rad_pkt_type.help_text }}</span>
			</div>
72 73
		</div>
	</div>
Kroustouris Stauros's avatar
Kroustouris Stauros committed
74 75 76 77 78
	<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 }}
79
				{% if form.auth_port.errors %} <div class="alert-danger"> {{ form.auth_port.errors|join:", " }} </div>
Kroustouris Stauros's avatar
Kroustouris Stauros committed
80 81
				{% endif %} <span class="help-block">{{ form.auth_port.help_text }}</span>
			</div>
82 83
		</div>
	</div>
Kroustouris Stauros's avatar
Kroustouris Stauros committed
84 85 86 87 88
	<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 }}
89
				{% if form.acct_port.errors %} <div class="alert-danger"> {{ form.acct_port.errors|join:", " }} </div>
Kroustouris Stauros's avatar
Kroustouris Stauros committed
90 91
				{% endif %} <span class="help-block">{{ form.acct_port.help_text }}</span>
			</div>
92 93 94
		</div>
	</div>
	{% endif %}
Kroustouris Stauros's avatar
Kroustouris Stauros committed
95 96 97 98 99
	<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 }}
100
				{% if form.status_server.errors %} <div class="alert-danger"> {{ form.status_server.errors|join:", " }} </div>
Kroustouris Stauros's avatar
Kroustouris Stauros committed
101 102
				{% endif %} <span class="help-block">{{ form.status_server.help_text }}</span>
			</div>
103 104
		</div>
	</div>
Kroustouris Stauros's avatar
Kroustouris Stauros committed
105 106 107 108 109
	<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 %}>
110
				{% if form.secret.errors %} <div class="alert-danger"> {{ form.secret.errors|join:", " }} </div>
Kroustouris Stauros's avatar
Kroustouris Stauros committed
111 112
				{% endif %} <span class="help-block">{{ form.secret.help_text }}</span>
			</div>
113 114
		</div>
	</div>
Kroustouris Stauros's avatar
Kroustouris Stauros committed
115 116 117 118 119
	<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 }}
120
				{% if form.proto.errors %} <div class="alert-danger"> {{ form.proto.errors|join:", " }} </div>
Kroustouris Stauros's avatar
Kroustouris Stauros committed
121 122
				{% endif %} <span class="help-block">{{ form.proto.help_text }}</span>
			</div>
123 124
		</div>
	</div>
Kroustouris Stauros's avatar
Kroustouris Stauros committed
125 126 127 128 129 130
	<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>
131
		</div>
Kroustouris Stauros's avatar
Kroustouris Stauros committed
132 133
	</form>
	{% endblock %}
134
	</div>
Kroustouris Stauros's avatar
Kroustouris Stauros committed
135

Kroustouris Stauros's avatar
Kroustouris Stauros committed
136 137 138 139 140 141 142 143 144 145

{% 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 %}