X-Git-Url: https://code.grnet.gr/git/flowspy/blobdiff_plain/138e4e37498cdf38eccea80a7052fa535ab435f6..a9afab2127aa96676092131be4eb8b20967491e8:/templates/apply.html diff --git a/templates/apply.html b/templates/apply.html index 7cd84ed..d889d04 100644 --- a/templates/apply.html +++ b/templates/apply.html @@ -25,13 +25,14 @@ $("#id_destinationport").css('width', '100px').attr('size', '5'); $('#id_then').attr("multiple", ""); $( "#id_expires" ).datepicker({ dateFormat: 'yy-mm-dd' , maxDate: '+10d', minDate: '+1d', changeMonth: false, changeYear: false }).datepicker( $.datepicker.regional[ "el" ] ); + {% comment %} $('#then_diag').dialog({ height: 220, width: 340, modal: true, autoOpen: false, buttons: { - 'Add': function() { + '{% trans "Add" %}': function() { console.log($("#add_rl_form").serialize()); $.ajax({ url:"{% url add-rate-limit %}", @@ -51,20 +52,19 @@ } }); }, - Cancel: function() { + '{% trans "Cancel" %}': function() { $('#then_diag').dialog('close'); } } }); - + {% endcomment %} $('#port_diag').dialog({ height: 220, width: 340, modal: true, autoOpen: false, buttons: { - 'Add': function() { - console.log($("#add_port_form").serialize()); + '{% trans "Add" %}': function() { $.ajax({ url:"{% url add-port %}", data:$("#add_port_form").serialize(), @@ -85,7 +85,7 @@ } }); }, - Cancel: function() { + '{% trans "Cancel" %}': function() { $('#port_diag').dialog('close'); } } @@ -155,202 +155,282 @@ th { font-style: italic; } +div.roundbox, #portsacc, #id_comments{ + -moz-border-radius: 5px; border-radius:5px; -webkit-border-radius: 5px; + -moz-box-shadow: 0 0 3px #AAAAAA; box-shadow: 0 0 3px #AAAAAA; -webkit-box-shadow: 0 0 3px #AAAAAA; + background-color: #F4F4F4; + border: 1px solid #FFFFFF; + clear: both; + float: left; + margin: 5px 0 5px 100px; + padding: 10px; + width: 620px; +} +#rule_form_wrapper{ + margin: 15px auto; + position: relative; + text-align: center; + width: 800px; +} + +#rule_form_container input:not([type="submit"]), #rule_form_container select { + background: none repeat scroll 0 0 #FFFFFF; + border: 1px solid #DDDDDD; + -moz-border-radius: 3px; border-radius:3px; -webkit-border-radius: 3px; + float: left; + font-family: "Century Gothic",Helvetica,sans-serif; + font-size: 13px; + outline: medium none; + padding: 5px; + width: 180px; +} + +#id_comments { + background: none repeat scroll 0 0 #FFFFFF; + border: 1px solid #DDDDDD; + border-radius: 3px 3px 3px 3px; + float: left; + font-family: "Century Gothic",Helvetica,sans-serif; + font-size: 13px; + outline: medium none; + padding: 5px; + width: 622px; +} + +#rule_form_container{ + -moz-border-radius: 10px 10px 10px 10px; border-radius:10px; -webkit-border-radius: 10px; + -moz-box-shadow: 0 0 3px #AAAAAA; box-shadow: 0 0 3px #AAAAAA; -webkit-box-shadow: 0 0 3px #AAAAAA; + background-color: #F9F9F9; + border: 2px solid #FFFFFF; + overflow: hidden; + width: 800px; + } +#rule_form_container div label { + color: #666666; + float: left; + font-family: "Century Gothic",Helvetica,sans-serif; + font-size: 15px; + font-weight: bold; + line-height: 26px; + margin-right: 15px; + text-align: right; + text-shadow: 1px 1px 1px #FFFFFF; + width: 180px; +} +#rule_form_container p.submit { + background: none repeat scroll 0 0 transparent; + border: medium none; + box-shadow: none; +} + -
+
{% if edit %}

{% trans "Edit rule" %}: {{form.data.name}}

{% else %}

{% trans "Apply for a new rule" %}

{% endif %}
- {% csrf_token %} - {% load unescape %} - {% if form.non_field_errors %} -

- {{ form.non_field_errors|unescape}} -

- {% endif %} -
- - {% trans "Rule Basic Info" %} - - - - - - - - - - -
- {{ form.name.label_tag }} - - {{ form.name }}{{ form.name.errors|join:", " }} -
- +
+ {% csrf_token %} + {% load unescape %} + {% if form.non_field_errors %} +

+ {{ form.non_field_errors|unescape}} +

+ {% endif %} +
+ + {% trans "Rule Basic Info" %} + +
+ {{ form.name.label_tag }}{{ form.name }} +
+ {% if form.name.errors %} +
+

+ {{ form.name.errors|join:", " }} +

+ {% endif %} +
+

A unique identifier will be added as a name_suffix -

-
-
- - {% trans "Rule Match Conditions" %} - - - - - - - - - - - - - - - - - - - -
- {{ form.source.label_tag }} - - {{ form.source }}{{ form.source.errors|join:", " }} -
- +

+ + + {% if user.is_superuser %} +
+ + {% trans "Admin Options" %} + +
+ {{ form.applier.label_tag }}{{ form.applier }} +
+ {% if form.applier.errors %} +
+

+ {{ form.applier.errors|join:", " }} +

+ {% endif %} +
+
+ {% else %} + + {% endif %} +
+ + {% trans "Rule Match Conditions" %} + +
+ {{ form.source.label_tag }}{{ form.source }} {% if form.source.errors %} +
+

+ {{ form.source.errors|join:", " }} +

+ {% endif %} +
+

{{ form.source.help_text }} -

- {{ form.destination.label_tag }} - - {{ form.destination }}{{ form.destination.errors|join:", " }} -
- +

+ +
+ {{ form.destination.label_tag }}{{ form.destination }} {% if form.destination.errors %} +
+

+ {{ form.destination.errors|join:", " }} +

+ {% endif %} +
+

{{ form.destination.help_text }} -

-
-

Advanced Settings (Ports)

-
- Select source/destination port(s), or select common port(s) for both source/destination - - - - - - - - - - - - - - - - - - - - - - - - - +

+ +
+ {{ form.protocol.label_tag }}{{ form.protocol }}{% if form.protocol.errors %} +
+

+ {{ form.protocol.errors|join:", " }} +

+ {% endif %} +
+
+

{% trans "Advanced Settings (Ports)" %}

+
+ {% trans "Select source/destination port(s), or select common port(s) for both source/destination" %} +
- {{ form.sourceport.label_tag }} - - {{ form.sourceport }}   - - {{ form.sourceport.errors|join:", " }} -
- - {{ form.sourceport.help_text }} -
- {{ form.destinationport.label_tag }} - - {{ form.destinationport }}   - - {{ form.destinationport.errors|join:", " }} -
- - {{ form.destinationport.help_text }} -
- {{ form.port.label_tag }} - - {{ form.port }}   - - {{ form.port.errors|join:", " }} -
- - {{ form.port.help_text }} -
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ {{ form.sourceport.label_tag }} + + {{ form.sourceport }}   + + {{ form.sourceport.errors|join:", " }} +
+ + {{ form.sourceport.help_text }} +
+ {{ form.destinationport.label_tag }} + + {{ form.destinationport }}   + + {{ form.destinationport.errors|join:", " }} +
+ + {{ form.destinationport.help_text }} +
+ {{ form.port.label_tag }} + + {{ form.port }}   + + {{ form.port.errors|join:", " }} +
+ + {{ form.port.help_text }} +
- -
-
-
- - {% trans "Rule Actions" %} - - - - - - -
- {{ form.then.label_tag }} - - {{ form.then }}{% comment %}   - {% endcomment %} - {{ form.then.errors|join:", " }} -
-
-
- - {% trans "Expiration" %} - - - - - - -
- {{ form.expires.label_tag }} - - {{ form.expires }}{{ form.expires.errors|join:", " }} -
-
-
- - {% trans "Use/Comments" %} - - {% blocktrans %} -

- Give a short description of the intended use of this rule, that justifies the parameter selection above. Feel free to include any additional comments. -

- {% endblocktrans %} +
+
+ + {% trans "Rule Actions" %} + +
+ {{ form.then.label_tag }}{{ form.then }}{% comment %}   + {% endcomment %} + {% if form.then.errors %} +

+ {{ form.then.errors|join:", " }} +

+ {% endif %} +
+
+
+ + {% trans "Expiration" %} + +
+ {{ form.expires.label_tag }}{{ form.expires }} + {% if form.expires.errors %} +
+

+ {{ form.expires.errors|join:", " }} +

+ {% endif %} +
+
+
+ + {% trans "Use/Comments" %} + +

+ {% blocktrans %}Give a short description of the intended use of this rule, that justifies the parameter selection above. Feel free to include any additional comments.{% endblocktrans %} +

+ +

+ {{ form.comments }} + {% if form.errors %} +
+ {{ form.comments.errors|join:", " }}{% endif %} +

+

- {{ form.comments }} - {% if form.errors %} -
- {{ form.comments.errors|join:", " }}{% endif %} +

- -

- -

+
-
+
{% endblock %}