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({
69 url:"{% url add-port %}",
70 data:$("#add_port_form").serialize(),
73 success:function(data){
77 $('#id_port').append($("<option></option>").attr("value",value).text(text));
78 $('#id_destinationport').append($("<option></option>").attr("value",value).text(text));
79 $('#id_sourceport').append($("<option></option>").attr("value",value).text(text));
80 $('#port_diag').dialog('close');
83 $('#port_diag').html(data);
89 $('#port_diag').dialog('close');
95 $("#new_then_actions").button({
97 primary: "ui-icon-plusthick"
102 url: "{% url add-rate-limit %}",
104 success: function(data){
105 $("#then_diag").html(data);
108 $('#then_diag').dialog('open');
113 $(".new_port").button({
115 primary: "ui-icon-plusthick"
120 url: "{% url add-port %}",
122 success: function(data){
123 $("#port_diag").html(data);
126 $('#port_diag').dialog('open');
130 $("#portsacc").accordion({
136 $("#applybutton").button();
143 <style type="text/css">
146 padding-right: 0.5em;
151 height: 452px !important;
158 div.roundbox, #portsacc, #id_comments{
159 -moz-border-radius: 5px; border-radius:5px; -webkit-border-radius: 5px;
160 -moz-box-shadow: 0 0 3px #AAAAAA; box-shadow: 0 0 3px #AAAAAA; -webkit-box-shadow: 0 0 3px #AAAAAA;
161 background-color: #F4F4F4;
162 border: 1px solid #FFFFFF;
165 margin: 5px 0 5px 100px;
176 #rule_form_container input:not([type="submit"]), #rule_form_container select {
177 background: none repeat scroll 0 0 #FFFFFF;
178 border: 1px solid #DDDDDD;
179 -moz-border-radius: 3px; border-radius:3px; -webkit-border-radius: 3px;
181 font-family: "Century Gothic",Helvetica,sans-serif;
183 outline: medium none;
189 background: none repeat scroll 0 0 #FFFFFF;
190 border: 1px solid #DDDDDD;
191 border-radius: 3px 3px 3px 3px;
193 font-family: "Century Gothic",Helvetica,sans-serif;
195 outline: medium none;
200 #rule_form_container{
201 -moz-border-radius: 10px 10px 10px 10px; border-radius:10px; -webkit-border-radius: 10px;
202 -moz-box-shadow: 0 0 3px #AAAAAA; box-shadow: 0 0 3px #AAAAAA; -webkit-box-shadow: 0 0 3px #AAAAAA;
203 background-color: #F9F9F9;
204 border: 2px solid #FFFFFF;
208 #rule_form_container div label {
211 font-family: "Century Gothic",Helvetica,sans-serif;
217 text-shadow: 1px 1px 1px #FFFFFF;
220 #rule_form_container p.submit {
221 background: none repeat scroll 0 0 transparent;
227 <div align="center" id="rule_form_wrapper">
228 {% if edit %}<h3>{% trans "Edit rule" %}: {{form.data.name}}</h3>
229 {% else %}<h3>{% trans "Apply for a new rule" %}</h3>
232 <div id="rule_form_container">
235 {% if form.non_field_errors %}
237 {{ form.non_field_errors|unescape}}
240 <fieldset {% if edit %} style="display:none;" {% endif %}>
242 {% trans "Rule Basic Info" %}
244 <div class="roundbox">
245 {{ form.name.label_tag }}{{ form.name }}
247 {% if form.name.errors %}
249 <p class="error" style="clear:both;">
250 {{ form.name.errors|join:", " }}
254 <p style="clear:both;">
255 A unique identifier will be added as a name_suffix
261 {% trans "Rule Match Conditions" %}
263 <input type="hidden" id="id_applier" name="applier" value="{{applier}}"/>
264 <div class="roundbox">
265 {{ form.source.label_tag }}{{ form.source }}<img src="/static/threat_source.png"/> {% if form.source.errors %}
267 <p class="error" style="clear:both;">
268 {{ form.source.errors|join:", " }}
272 <p style="clear:both;">
273 {{ form.source.help_text }}
276 <div class="roundbox">
277 {{ form.destination.label_tag }}{{ form.destination }}<img src="/static/secure_destination.png"/> {% if form.destination.errors %}
279 <p class="error" style="clear:both;">
280 {{ form.destination.errors|join:", " }}
284 <p style="clear:both;">
285 {{ form.destination.help_text }}
289 <h3 style="padding: 0.5em 0.5em 0.5em 0.7em;">Advanced Settings (Ports)</h3>
290 <div class='accord_wrapper' style="height: 452px !important;">
291 Select source/destination port(s), or select common port(s) for both source/destination
295 {{ form.sourceport.label_tag }}
298 {{ form.sourceport }}
299 <button class="new_port">
302 <span class="error">{{ form.sourceport.errors|join:", " }}</span>
309 {{ form.sourceport.help_text }}
314 {{ form.destinationport.label_tag }}
317 {{ form.destinationport }}
318 <button class="new_port">
321 <span class="error">{{ form.destinationport.errors|join:", " }}</span>
328 {{ form.destinationport.help_text }}
333 {{ form.port.label_tag }}
336 {{ form.port }}
337 <button class="new_port">
340 <span class="error">{{ form.port.errors|join:", " }}</span>
347 {{ form.port.help_text }}
356 {% trans "Rule Actions" %}
358 <div class="roundbox">
359 {{ form.then.label_tag }}{{ form.then }}{% comment %}
360 <button id="new_then_actions">
362 </button>{% endcomment %}
363 {% if form.then.errors %}
365 {{ form.then.errors|join:", " }}
372 {% trans "Expiration" %}
374 <div class="roundbox">
375 {{ form.expires.label_tag }}{{ form.expires }}
376 {% if form.expires.errors %}
379 {{ form.expires.errors|join:", " }}
386 {% trans "Use/Comments" %}
390 Give a short description of the intended use of this rule, that justifies the parameter selection above. Feel free to include any additional comments.
397 <span class="error">{{ form.comments.errors|join:", " }}</span>{% endif %}
401 <input type="submit" id="applybutton" value="{% trans "Apply" %}" />
406 <div id="then_diag" title="Add new rate-limit value">
408 <div id="port_diag" title="Add new port">