1 {% extends "base.html" %}
6 {% trans "Edit Rule" %} {{form.data.name}}
8 {% trans "Create new Rule" %}
12 {% block breadcrumbs %}::
14 {% trans "Edit rule" %} {{form.data.name}}
16 {% trans "Create rule" %}
21 $(document).ready( function(){
23 $("#id_sourceport").css('width', '100px').attr('size', '5');
24 $("#id_port").css('width', '100px').attr('size', '5');
25 $("#id_destinationport").css('width', '100px').attr('size', '5');
26 $('#id_then').attr("multiple", "");
27 $( "#id_expires" ).datepicker({ dateFormat: 'yy-mm-dd' , maxDate: '+10d', minDate: '+1d', changeMonth: false, changeYear: false }).datepicker( $.datepicker.regional[ "el" ] );
29 $('#then_diag').dialog({
36 console.log($("#add_rl_form").serialize());
38 url:"{% url add-rate-limit %}",
39 data:$("#add_rl_form").serialize(),
42 success:function(data){
46 $('#id_then').append($("<option></option>").attr("value",value).text(text));
47 $('#then_diag').dialog('close');
50 $('#then_diag').html(data);
56 $('#then_diag').dialog('close');
61 $('#port_diag').dialog({
68 console.log($("#add_port_form").serialize());
70 url:"{% url add-port %}",
71 data:$("#add_port_form").serialize(),
74 success:function(data){
78 $('#id_port').append($("<option></option>").attr("value",value).text(text));
79 $('#id_destinationport').append($("<option></option>").attr("value",value).text(text));
80 $('#id_sourceport').append($("<option></option>").attr("value",value).text(text));
81 $('#port_diag').dialog('close');
84 $('#port_diag').html(data);
90 $('#port_diag').dialog('close');
96 $("#new_then_actions").button({
98 primary: "ui-icon-plusthick"
103 url: "{% url add-rate-limit %}",
105 success: function(data){
106 $("#then_diag").html(data);
109 $('#then_diag').dialog('open');
114 $(".new_port").button({
116 primary: "ui-icon-plusthick"
121 url: "{% url add-port %}",
123 success: function(data){
124 $("#port_diag").html(data);
127 $('#port_diag').dialog('open');
131 $("#portsacc").accordion({
137 $("#applybutton").button();
144 <style type="text/css">
147 padding-right: 0.5em;
152 height: 452px !important;
161 {% if edit %}<h3>{% trans "Edit rule" %}: {{form.data.name}}</h3>
162 {% else %}<h3>{% trans "Apply for a new rule" %}</h3>
167 {% if form.non_field_errors %}
169 {{ form.non_field_errors|unescape}}
172 <fieldset {% if edit %} style="display:none;" {% endif %}>
174 {% trans "Rule Basic Info" %}
179 {{ form.name.label_tag }}
182 {{ form.name }}<span class="error">{{ form.name.errors|join:", " }}</span>
189 A unique identifier will be added as a name_suffix
196 {% trans "Rule Match Conditions" %}
199 <input type="hidden" id="id_applier" name="applier" value="{{applier}}"/>
202 {{ form.source.label_tag }}
205 {{ form.source }}<span class="error">{{ form.source.errors|join:", " }}</span>
212 {{ form.source.help_text }}
217 {{ form.destination.label_tag }}
220 {{ form.destination }}<span class="error">{{ form.destination.errors|join:", " }}</span>
227 {{ form.destination.help_text }}
231 <div id='portsacc' style="width: 500px;">
232 <h3 style="padding: 0.5em 0.5em 0.5em 0.7em;">Advanced Settings (Ports)</h3>
233 <div class='accord_wrapper' style="height: 452px !important;">
234 Select source/destination port(s), or select common port(s) for both source/destination
238 {{ form.sourceport.label_tag }}
241 {{ form.sourceport }}
242 <button class="new_port">
245 <span class="error">{{ form.sourceport.errors|join:", " }}</span>
252 {{ form.sourceport.help_text }}
257 {{ form.destinationport.label_tag }}
260 {{ form.destinationport }}
261 <button class="new_port">
264 <span class="error">{{ form.destinationport.errors|join:", " }}</span>
271 {{ form.destinationport.help_text }}
276 {{ form.port.label_tag }}
279 {{ form.port }}
280 <button class="new_port">
283 <span class="error">{{ form.port.errors|join:", " }}</span>
290 {{ form.port.help_text }}
299 {% trans "Rule Actions" %}
304 {{ form.then.label_tag }}
307 {{ form.then }}{% comment %}
308 <button id="new_then_actions">
310 </button>{% endcomment %}
311 <span class="error">{{ form.then.errors|join:", " }}</span>
318 {% trans "Expiration" %}
323 {{ form.expires.label_tag }}
326 {{ form.expires }}<span class="error">{{ form.expires.errors|join:", " }}</span>
333 {% trans "Use/Comments" %}
337 Give a short description of the intended use of this rule, that justifies the parameter selection above. Feel free to include any additional comments.
344 <span class="error">{{ form.comments.errors|join:", " }}</span>{% endif %}
348 <input type="submit" id="applybutton" value="{% trans "Apply" %}" />
352 <div id="then_diag" title="Add new rate-limit value">
354 <div id="port_diag" title="Add new port">