Commit 08e83ca6 by Őry Máté

network-gui: merge from network-gui

parent 43391a3d
...@@ -218,8 +218,9 @@ DJANGO_APPS = ( ...@@ -218,8 +218,9 @@ DJANGO_APPS = (
) )
THIRD_PARTY_APPS = ( THIRD_PARTY_APPS = (
# Database migration helpers:
'south', 'south',
'django_tables2',
'crispy_forms',
) )
# Apps specific for this project go here. # Apps specific for this project go here.
...@@ -227,6 +228,7 @@ LOCAL_APPS = ( ...@@ -227,6 +228,7 @@ LOCAL_APPS = (
'vm', 'vm',
'storage', 'storage',
'firewall', 'firewall',
'network',
) )
# See: https://docs.djangoproject.com/en/dev/ref/settings/#installed-apps # See: https://docs.djangoproject.com/en/dev/ref/settings/#installed-apps
...@@ -287,3 +289,5 @@ WSGI_APPLICATION = '%s.wsgi.application' % SITE_NAME ...@@ -287,3 +289,5 @@ WSGI_APPLICATION = '%s.wsgi.application' % SITE_NAME
########## END WSGI CONFIGURATION ########## END WSGI CONFIGURATION
FIREWALL_SETTINGS = loads(get_env_variable('DJANGO_FIREWALL_SETTINGS')) FIREWALL_SETTINGS = loads(get_env_variable('DJANGO_FIREWALL_SETTINGS'))
CRISPY_TEMPLATE_PACK = 'bootstrap3'
...@@ -14,4 +14,5 @@ urlpatterns = patterns('', ...@@ -14,4 +14,5 @@ urlpatterns = patterns('',
# url(r'^admin/doc/', include('django.contrib.admindocs.urls')), # url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
url(r'^admin/', include(admin.site.urls)), url(r'^admin/', include(admin.site.urls)),
url(r'^network/', include('network.urls')),
) )
from django.forms import ModelForm
from django.core.urlresolvers import reverse_lazy
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Layout, Fieldset, Div, Submit, BaseInput
from crispy_forms.bootstrap import FormActions
from firewall.models import (Host, Vlan, Domain, Group, Record, Blacklist,
Rule, VlanGroup)
class LinkButton(BaseInput):
"""
Used to create a link button descriptor for the {% crispy %} template tag::
back = LinkButton('back', 'Back', reverse_lazy('index'))
.. note:: The first argument is also slugified and turned into the id for
the submit button.
"""
template = "bootstrap/layout/linkbutton.html"
field_classes = 'btn btn-default'
def __init__(self, name, text, url, *args, **kwargs):
self.href = url
super(LinkButton, self).__init__(name, text, *args, **kwargs)
class BlacklistForm(ModelForm):
helper = FormHelper()
helper.layout = Layout(
Div(
Fieldset(
'',
'ipv4',
'host',
'reason',
'type',
)
),
FormActions(
Submit('submit', 'Save changes'),
LinkButton('back', 'Back', reverse_lazy('network.blacklist_list'))
)
)
class Meta:
model = Blacklist
class DomainForm(ModelForm):
helper = FormHelper()
helper.layout = Layout(
Div(
Fieldset(
'',
'name',
'owner',
'ttl',
),
),
FormActions(
Submit('submit', 'Save'),
LinkButton('back', 'Back', reverse_lazy('network.domain_list'))
)
)
class Meta:
model = Domain
class GroupForm(ModelForm):
helper = FormHelper()
helper.layout = Layout(
Div(
Fieldset(
'Identity',
'name',
'description',
'owner',
),
),
FormActions(
Submit('submit', 'Save'),
LinkButton('back', 'Back', reverse_lazy('network.group_list'))
)
)
class Meta:
model = Group
class HostForm(ModelForm):
helper = FormHelper()
helper.layout = Layout(
Div(
Fieldset(
'Identity',
'hostname',
'reverse',
'mac',
),
Fieldset(
'Network',
'vlan',
'ipv4',
'ipv6',
'shared_ip',
'pub_ipv4',
),
Fieldset(
'Information',
'description',
'location',
'comment',
'owner',
),
),
FormActions(
Submit('submit', 'Save'),
LinkButton('back', 'Back', reverse_lazy('network.host_list')))
)
class Meta:
model = Host
class RecordForm(ModelForm):
helper = FormHelper()
helper.layout = Layout(
Div(
Fieldset(
'',
'type',
'host',
'name',
'domain',
'address',
'ttl',
'description',
'owner',
)
),
FormActions(
Submit('submit', 'Save'),
LinkButton('back', 'Back', reverse_lazy('network.record_list'))
)
)
class Meta:
model = Record
class RuleForm(ModelForm):
helper = FormHelper()
helper.layout = Layout(
Div(
Fieldset(
'Identity',
'direction',
'description',
'foreign_network',
'dport',
'sport',
'proto',
'extra',
'accept',
'owner',
'r_type',
'nat',
'nat_dport',
),
Fieldset(
'External',
'vlan',
'vlangroup',
'host',
'hostgroup',
'firewall'
)
),
FormActions(
Submit('submit', 'Save'),
LinkButton('back', 'Back', reverse_lazy('network.rule_list'))
)
)
class Meta:
model = Rule
class VlanForm(ModelForm):
helper = FormHelper()
helper.layout = Layout(
Div(
Fieldset(
'Identity',
'name',
'vid',
'interface',
),
Fieldset(
'IPv4',
'net4',
'prefix4',
'ipv4',
'snat_to',
'snat_ip',
'dhcp_pool',
),
Fieldset(
'IPv6',
'net6',
'prefix6',
'ipv6',
),
Fieldset(
'Domain name service',
'domain',
'reverse_domain',
),
Fieldset(
'Info',
'description',
'comment',
# 'created_at',
# 'modified_at',
),
),
FormActions(
Submit('submit', 'Save'),
LinkButton('back', 'Back', reverse_lazy('network.vlan_list'))
)
)
class Meta:
model = Vlan
class VlanGroupForm(ModelForm):
helper = FormHelper()
helper.layout = Layout(
Div(
Fieldset(
'',
'name',
'vlans',
'description',
'owner',
)
),
FormActions(
Submit('submit', 'Save'),
LinkButton('back', 'Back', reverse_lazy(
'network.vlan_group_list'))
)
)
class Meta:
model = VlanGroup
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-08-21 12:29+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1)\n"
#: static/js/record-create.js:108
msgid "Address must be specified!"
msgstr ""
#: static/js/record-create.js:118
#, c-format
msgid "%s - not an IPv4 address"
msgstr "%s - nem egy IPv4 cím"
#: static/js/record-create.js:128
#, c-format
msgid "%s - not an IPv6 address"
msgstr ""
#: static/js/record-create.js:139
msgid "Bad MX address format. "
msgstr ""
#: static/js/record-create.js:150 static/js/record-create.js.c:178
#, c-format
msgid "%s - invalid domain name"
msgstr ""
#: static/js/record-create.js:160
msgid "Unknown record type."
msgstr ""
#: static/js/record-create.js:168 static/js/record-create.js.c:287
msgid "You must choose a type"
msgstr ""
#: static/js/record-create.js:188
msgid "You must choose a domain"
msgstr ""
#: static/js/record-create.js:195
msgid "You must specify an owner!"
msgstr ""
#: static/js/record-create.js:271
msgid "Specify a type!"
msgstr ""
from django.db import models
# Create your models here.
/**
* bootbox.js v3.3.0
*
* http://bootboxjs.com/license.txt
*/
var bootbox=window.bootbox||function(a,b){function c(a,b){return"undefined"==typeof b&&(b=d),"string"==typeof m[b][a]?m[b][a]:b!=e?c(a,e):a}var d="en",e="en",f=!0,g="static",h="javascript:;",i="",j={},k={},l={};l.setLocale=function(a){for(var b in m)if(b==a)return d=a,void 0;throw new Error("Invalid locale: "+a)},l.addLocale=function(a,b){"undefined"==typeof m[a]&&(m[a]={});for(var c in b)m[a][c]=b[c]},l.setIcons=function(a){k=a,("object"!=typeof k||null===k)&&(k={})},l.setBtnClasses=function(a){j=a,("object"!=typeof j||null===j)&&(j={})},l.alert=function(){var a="",b=c("OK"),d=null;switch(arguments.length){case 1:a=arguments[0];break;case 2:a=arguments[0],"function"==typeof arguments[1]?d=arguments[1]:b=arguments[1];break;case 3:a=arguments[0],b=arguments[1],d=arguments[2];break;default:throw new Error("Incorrect number of arguments: expected 1-3")}return l.dialog(a,{label:b,icon:k.OK,"class":j.OK,callback:d},{onEscape:d||!0})},l.confirm=function(){var a="",b=c("CANCEL"),d=c("CONFIRM"),e=null;switch(arguments.length){case 1:a=arguments[0];break;case 2:a=arguments[0],"function"==typeof arguments[1]?e=arguments[1]:b=arguments[1];break;case 3:a=arguments[0],b=arguments[1],"function"==typeof arguments[2]?e=arguments[2]:d=arguments[2];break;case 4:a=arguments[0],b=arguments[1],d=arguments[2],e=arguments[3];break;default:throw new Error("Incorrect number of arguments: expected 1-4")}var f=function(){return"function"==typeof e?e(!1):void 0},g=function(){return"function"==typeof e?e(!0):void 0};return l.dialog(a,[{label:b,icon:k.CANCEL,"class":j.CANCEL,callback:f},{label:d,icon:k.CONFIRM,"class":j.CONFIRM,callback:g}],{onEscape:f})},l.prompt=function(){var a="",d=c("CANCEL"),e=c("CONFIRM"),f=null,g="";switch(arguments.length){case 1:a=arguments[0];break;case 2:a=arguments[0],"function"==typeof arguments[1]?f=arguments[1]:d=arguments[1];break;case 3:a=arguments[0],d=arguments[1],"function"==typeof arguments[2]?f=arguments[2]:e=arguments[2];break;case 4:a=arguments[0],d=arguments[1],e=arguments[2],f=arguments[3];break;case 5:a=arguments[0],d=arguments[1],e=arguments[2],f=arguments[3],g=arguments[4];break;default:throw new Error("Incorrect number of arguments: expected 1-5")}var h=a,i=b("<form></form>");i.append("<input class='input-block-level' autocomplete=off type=text value='"+g+"' />");var m=function(){return"function"==typeof f?f(null):void 0},n=function(){return"function"==typeof f?f(i.find("input[type=text]").val()):void 0},o=l.dialog(i,[{label:d,icon:k.CANCEL,"class":j.CANCEL,callback:m},{label:e,icon:k.CONFIRM,"class":j.CONFIRM,callback:n}],{header:h,show:!1,onEscape:m});return o.on("shown",function(){i.find("input[type=text]").focus(),i.on("submit",function(a){a.preventDefault(),o.find(".btn-primary").click()})}),o.modal("show"),o},l.dialog=function(c,d,e){function j(){var a=null;"function"==typeof e.onEscape&&(a=e.onEscape()),a!==!1&&x.modal("hide")}var k="",l=[];e||(e={}),"undefined"==typeof d?d=[]:"undefined"==typeof d.length&&(d=[d]);for(var m=d.length;m--;){var n=null,o=null,p=null,q="",r=null;if("undefined"==typeof d[m].label&&"undefined"==typeof d[m]["class"]&&"undefined"==typeof d[m].callback){var s=0,t=null;for(var u in d[m])if(t=u,++s>1)break;1==s&&"function"==typeof d[m][u]&&(d[m].label=t,d[m].callback=d[m][u])}"function"==typeof d[m].callback&&(r=d[m].callback),d[m]["class"]?p=d[m]["class"]:m==d.length-1&&d.length<=2&&(p="btn-primary"),d[m].link!==!0&&(p="btn "+p),n=d[m].label?d[m].label:"Option "+(m+1),d[m].icon&&(q="<i class='"+d[m].icon+"'></i> "),o=d[m].href?d[m].href:h,k="<a data-handler='"+m+"' class='"+p+"' href='"+o+"'>"+q+n+"</a>"+k,l[m]=r}var v=["<div class='bootbox modal' tabindex='-1' style='overflow:hidden;'>"];if(e.header){var w="";("undefined"==typeof e.headerCloseButton||e.headerCloseButton)&&(w="<a href='"+h+"' class='close'>&times;</a>"),v.push("<div class='modal-header'>"+w+"<h3>"+e.header+"</h3></div>")}v.push("<div class='modal-body'></div>"),k&&v.push("<div class='modal-footer'>"+k+"</div>"),v.push("</div>");var x=b(v.join("\n")),y="undefined"==typeof e.animate?f:e.animate;y&&x.addClass("fade");var z="undefined"==typeof e.classes?i:e.classes;return z&&x.addClass(z),x.find(".modal-body").html(c),x.on("keyup.dismiss.modal",function(a){27===a.which&&e.onEscape&&j("escape")}),x.on("click","a.close",function(a){a.preventDefault(),j("close")}),x.on("shown",function(){x.find("a.btn-primary:first").focus()}),x.on("hidden",function(a){a.target===this&&x.remove()}),x.on("click",".modal-footer a",function(a){var c=b(this).data("handler"),e=l[c],f=null;("undefined"==typeof c||"undefined"==typeof d[c].href)&&(a.preventDefault(),"function"==typeof e&&(f=e(a)),f!==!1&&x.modal("hide"))}),b("body").append(x),x.modal({backdrop:"undefined"==typeof e.backdrop?g:e.backdrop,keyboard:!1,show:!1}),x.on("show",function(){b(a).off("focusin.modal")}),("undefined"==typeof e.show||e.show===!0)&&x.modal("show"),x},l.modal=function(){var a,c,d,e={onEscape:null,keyboard:!0,backdrop:g};switch(arguments.length){case 1:a=arguments[0];break;case 2:a=arguments[0],"object"==typeof arguments[1]?d=arguments[1]:c=arguments[1];break;case 3:a=arguments[0],c=arguments[1],d=arguments[2];break;default:throw new Error("Incorrect number of arguments: expected 1-3")}return e.header=c,d="object"==typeof d?b.extend(e,d):e,l.dialog(a,[],d)},l.hideAll=function(){b(".bootbox").modal("hide")},l.animate=function(a){f=a},l.backdrop=function(a){g=a},l.classes=function(a){i=a};var m={br:{OK:"OK",CANCEL:"Cancelar",CONFIRM:"Sim"},da:{OK:"OK",CANCEL:"Annuller",CONFIRM:"Accepter"},de:{OK:"OK",CANCEL:"Abbrechen",CONFIRM:"Akzeptieren"},en:{OK:"OK",CANCEL:"Cancel",CONFIRM:"OK"},es:{OK:"OK",CANCEL:"Cancelar",CONFIRM:"Aceptar"},fr:{OK:"OK",CANCEL:"Annuler",CONFIRM:"D'accord"},it:{OK:"OK",CANCEL:"Annulla",CONFIRM:"Conferma"},nl:{OK:"OK",CANCEL:"Annuleren",CONFIRM:"Accepteren"},pl:{OK:"OK",CANCEL:"Anuluj",CONFIRM:"Potwierdź"},ru:{OK:"OK",CANCEL:"Отмена",CONFIRM:"Применить"},zh_CN:{OK:"OK",CANCEL:"取消",CONFIRM:"确认"},zh_TW:{OK:"OK",CANCEL:"取消",CONFIRM:"確認"}};return l}(document,window.jQuery);window.bootbox=bootbox;
\ No newline at end of file
$('i[class="icon-remove"]').click(function() {
href = $(this).parent('a').attr('href');
csrf = getCookie('csrftoken');
var click_this = this;
bootbox.dialog("Are you sure?", [
{
"label": "Cancel",
"class": "btn-info",
"callback": function () {}
},
{
"label": "Remove",
"class": "btn-danger",
"callback": function() {
delete_rule_or_group(click_this);
}
}
]);
return false;
});
function delete_rule_or_group(click_this) {
ajax = $.ajax({
type: 'POST',
url: href,
headers: {"X-CSRFToken": csrf},
context: click_this,
success: function(data, textStatus, xhr) {
if(xhr.status == 200) {
// we delete a row in a table
if(href.indexOf("rules") != -1) {
$(this).closest('tr').fadeOut(500, function() {
$(this).remove();
});
}
// we delete the whole div around the table
else {
// we need to readd the deleted group to the select
group_pk = parseInt($(this).closest('h4').attr('id'));
group_name = $(this).closest('h4').text();
$(this).closest('div').fadeOut(500, function() {
$(this).remove();
$('#add_group')
.append($("<option></option>")
.attr('value', group_pk)
.text(group_name));
});
}
}
}
});
return false;
}
/**
* Getter for user cookies
* @param {String} name Cookie name
* @return {String} Cookie value
*/
function getCookie(name) {
var cookieValue = null;
if (document.cookie && document.cookie != '') {
var cookies = document.cookie.split(';');
for (var i = 0; i < cookies.length; i++) {
var cookie = jQuery.trim(cookies[i]);
if (cookie.substring(0, name.length + 1) == (name + '=')) {
cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
break;
}
}
}
return cookieValue;
}
Copyright 2012 Igor Vaynberg
Version: @@ver@@ Timestamp: @@timestamp@@
This software is licensed under the Apache License, Version 2.0 (the "Apache License") or the GNU
General Public License version 2 (the "GPL License"). You may choose either license to govern your
use of this software only upon the condition that you accept all of the terms of either the Apache
License or the GPL License.
You may obtain a copy of the Apache License and the GPL License at:
http://www.apache.org/licenses/LICENSE-2.0
http://www.gnu.org/licenses/gpl-2.0.html
Unless required by applicable law or agreed to in writing, software distributed under the Apache License
or the GPL Licesnse is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
either express or implied. See the Apache License and the GPL License for the specific language governing
permissions and limitations under the Apache License and the GPL License.
\ No newline at end of file
Select2
=================
Select2 is a jQuery based replacement for select boxes. It supports searching, remote data sets, and infinite scrolling of results.
To get started checkout examples and documentation at http://ivaynberg.github.com/select2
What Usecases Does Select2 Support
-------------------------------------------------
* Enhances native selects with search
* Enhances native selects with a better multi-select interface
* Loading data from javascript: easily load items via ajax and have them searchable
* Nested optgroups: native selects only support one level of nested, Select2 does not have this restriction
* Tagging: ability to add new items on the fly
* Working with large remote datesets: ability to partially load a dataset based on the search term
* Paging of large datasets: easy support for loading more pages when the results are scrolled to the end
* Templating: support for custom rendering of results and selections
Browser Compatibility
--------------------
* IE 8+ (7 mostly works except for [issue with z-index](https://github.com/ivaynberg/select2/issues/37))
* Chrome 8+
* Firefox 3.5+
* Safari 3+
* Opera 10.6+
Integrations
------------
* [Wicket-Select2](https://github.com/ivaynberg/wicket-select2) (Java / [Apache Wicket](http://wicket.apache.org))
* [select2-rails](https://github.com/argerim/select2-rails) (Ruby on Rails)
* [AngularUI](http://angular-ui.github.com/#directives-select2) ([AngularJS](angularjs.org))
* [Django](https://github.com/applegrew/django-select2)
* [Symfony](https://github.com/19Gerhard85/sfSelect2WidgetsPlugin)
* [Bootstrap](https://github.com/t0m/select2-bootstrap-css) (CSS skin)
* [Yii](https://github.com/tonybolzan/yii-select2)
Internationalization (i18n)
---------------------------
Select2 supports multiple languages by simply including the right
language JS file (`select2_locale_it.js`, `select2_locale_nl.js` etc.).
Missing a language? Just copy `select2_locale_en.js.template`, translate
it and make a pull request back to Select2 here on Github.
Bug tracker
-----------
Have a bug? Please create an issue here on GitHub!
https://github.com/ivaynberg/select2/issues
Mailing list
------------
Have a question? Ask on our mailing list!
select2@googlegroups.com
https://groups.google.com/d/forum/select2
Copyright and License
---------------------
Copyright 2012 Igor Vaynberg
This software is licensed under the Apache License, Version 2.0 (the "Apache License") or the GNU
General Public License version 2 (the "GPL License"). You may choose either license to govern your
use of this software only upon the condition that you accept all of the terms of either the Apache
License or the GPL License.
You may obtain a copy of the Apache License and the GPL License in the LICENSE file, or at:
http://www.apache.org/licenses/LICENSE-2.0
http://www.gnu.org/licenses/gpl-2.0.html
Unless required by applicable law or agreed to in writing, software distributed under the Apache License
or the GPL Licesnse is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
either express or implied. See the Apache License and the GPL License for the specific language governing
permissions and limitations under the Apache License and the GPL License.
{
"name": "select2",
"version": "3.4.0",
"main": ["select2.js", "select2.css", "select2.png", "select2x2.png", "select2-spinner.gif"],
"dependencies": {
"jquery": ">= 1.7.1"
}
}
#!/bin/bash
set -e
echo -n "Enter the version for this release: "
read ver
if [ ! $ver ]; then
echo "Invalid version."
exit
fi
name="select2"
js="$name.js"
mini="$name.min.js"
css="$name.css"
release="$name-$ver"
tag="$ver"
branch="build-$ver"
curbranch=`git branch | grep "*" | sed "s/* //"`
timestamp=$(date)
tokens="s/@@ver@@/$ver/g;s/\@@timestamp@@/$timestamp/g"
remote="github"
echo "Updating Version Identifiers"
sed -E -e "s/\"version\": \"([0-9\.]+)\",/\"version\": \"$ver\",/g" -i "" component.json select2.jquery.json
git add component.json
git add select2.jquery.json
git commit -m "modified version identifiers in descriptors for release $ver"
git push
git branch "$branch"
git checkout "$branch"
echo "Tokenizing..."
find . -name "$js" | xargs -I{} sed -e "$tokens" -i "" {}
find . -name "$css" | xargs -I{} sed -e "$tokens" -i "" {}
sed -e "s/latest/$ver/g" -i "" component.json
git add "$js"
git add "$css"
echo "Minifying..."
echo "/*" > "$mini"
cat LICENSE | sed "$tokens" >> "$mini"
echo "*/" >> "$mini"
curl -s \
--data-urlencode "js_code@$js" \
http://marijnhaverbeke.nl/uglifyjs \
>> "$mini"
git add "$mini"
git commit -m "release $ver"
echo "Tagging..."
git tag -a "$tag" -m "tagged version $ver"
git push "$remote" --tags
echo "Cleaning Up..."
git checkout "$curbranch"
git branch -D "$branch"
echo "Done"
{
"name": "select2",
"title": "Select2",
"description": "Select2 is a jQuery based replacement for select boxes. It supports searching, remote data sets, and infinite scrolling of results.",
"keywords": [
"select",
"autocomplete",
"typeahead",
"dropdown",
"multiselect",
"tag",
"tagging"
],
"version": "3.4.0",
"author": {
"name": "Igor Vaynberg",
"url": "https://github.com/ivaynberg"
},
"licenses": [
{
"type": "Apache",
"url": "http://www.apache.org/licenses/LICENSE-2.0"
},
{
"type": "GPL v2",
"url": "http://www.gnu.org/licenses/gpl-2.0.html"
}
],
"bugs": "https://github.com/ivaynberg/select2/issues",
"homepage": "http://ivaynberg.github.com/select2",
"docs": "http://ivaynberg.github.com/select2/",
"download": "https://github.com/ivaynberg/select2/tags",
"dependencies": {
"jquery": ">=1.7.1"
}
}
This source diff could not be displayed because it is too large. You can view the blob instead.
/**
* Select2 Catalan translation.
*
* Author: David Planella <david.planella@gmail.com>
*/
(function ($) {
"use strict";
$.extend($.fn.select2.defaults, {
formatNoMatches: function () { return "No s'ha trobat cap coincidència"; },
formatInputTooShort: function (input, min) { var n = min - input.length; return "Introduïu " + n + " caràcter" + (n == 1 ? "" : "s") + " més"; },
formatInputTooLong: function (input, max) { var n = input.length - max; return "Introduïu " + n + " caràcter" + (n == 1? "" : "s") + "menys"; },
formatSelectionTooBig: function (limit) { return "Només podeu seleccionar " + limit + " element" + (limit == 1 ? "" : "s"); },
formatLoadMore: function (pageNumber) { return "S'estan carregant més resultats..."; },
formatSearching: function () { return "S'està cercant..."; }
});
})(jQuery);
/**
* Select2 Czech translation.
*
* Author: Michal Marek <ahoj@michal-marek.cz>
* Author - sklonovani: David Vallner <david@vallner.net>
*/
(function ($) {
"use strict";
// use text for the numbers 2 through 4
var smallNumbers = {
2: function(masc) { return (masc ? "dva" : "dvě"); },
3: function() { return "tři"; },
4: function() { return "čtyři"; }
}
$.extend($.fn.select2.defaults, {
formatNoMatches: function () { return "Nenalezeny žádné položky"; },
formatInputTooShort: function (input, min) {
var n = min - input.length;
if (n == 1) {
return "Prosím zadejte ještě jeden znak";
} else if (n <= 4) {
return "Prosím zadejte ještě další "+smallNumbers[n](true)+" znaky";
} else {
return "Prosím zadejte ještě dalších "+n+" znaků";
}
},
formatInputTooLong: function (input, max) {
var n = input.length - max;
if (n == 1) {
return "Prosím zadejte o jeden znak méně";
} else if (n <= 4) {
return "Prosím zadejte o "+smallNumbers[n](true)+" znaky méně";
} else {
return "Prosím zadejte o "+n+" znaků méně";
}
},
formatSelectionTooBig: function (limit) {
if (limit == 1) {
return "Můžete zvolit jen jednu položku";
} else if (limit <= 4) {
return "Můžete zvolit maximálně "+smallNumbers[limit](false)+" položky";
} else {
return "Můžete zvolit maximálně "+limit+" položek";
}
},
formatLoadMore: function (pageNumber) { return "Načítavají se další výsledky..."; },
formatSearching: function () { return "Vyhledávání..."; }
});
})(jQuery);
/**
* Select2 Danish translation.
*
* Author: Anders Jenbo <anders@jenbo.dk>
*/
(function ($) {
"use strict";
$.extend($.fn.select2.defaults, {
formatNoMatches: function () { return "Ingen resultater fundet"; },
formatInputTooShort: function (input, min) { var n = min - input.length; return "Angiv venligst " + n + " tegn mere"; },
formatInputTooLong: function (input, max) { var n = input.length - max; return "Angiv venligst " + n + " tegn mindre"; },
formatSelectionTooBig: function (limit) { return "Du kan kun vælge " + limit + " emne" + (limit === 1 ? "" : "r"); },
formatLoadMore: function (pageNumber) { return "Indlæser flere resultater…"; },
formatSearching: function () { return "Søger…"; }
});
})(jQuery);
/**
* Select2 German translation
*/
(function ($) {
"use strict";
$.extend($.fn.select2.defaults, {
formatNoMatches: function () { return "Keine Übereinstimmungen gefunden"; },
formatInputTooShort: function (input, min) { var n = min - input.length; return "Bitte " + n + " Zeichen mehr eingeben"; },
formatInputTooLong: function (input, max) { var n = input.length - max; return "Bitte " + n + " Zeichen weniger eingeben"; },
formatSelectionTooBig: function (limit) { return "Sie können nur " + limit + " Eintr" + (limit === 1 ? "ag" : "äge") + " auswählen"; },
formatLoadMore: function (pageNumber) { return "Lade mehr Ergebnisse..."; },
formatSearching: function () { return "Suche..."; }
});
})(jQuery);
\ No newline at end of file
/**
* Select2 <Language> translation.
*
* Author: Your Name <your@email>
*/
(function ($) {
"use strict";
$.extend($.fn.select2.defaults, {
formatNoMatches: function () { return "No matches found"; },
formatInputTooShort: function (input, min) { var n = min - input.length; return "Please enter " + n + " more character" + (n == 1 ? "" : "s"); },
formatInputTooLong: function (input, max) { var n = input.length - max; return "Please enter " + n + " less character" + (n == 1? "" : "s"); },
formatSelectionTooBig: function (limit) { return "You can only select " + limit + " item" + (limit == 1 ? "" : "s"); },
formatLoadMore: function (pageNumber) { return "Loading more results..."; },
formatSearching: function () { return "Searching..."; }
});
})(jQuery);
/**
* Select2 Spanish translation
*/
(function ($) {
"use strict";
$.extend($.fn.select2.defaults, {
formatNoMatches: function () { return "No se encontraron resultados"; },
formatInputTooShort: function (input, min) { var n = min - input.length; return "Por favor adicione " + n + " caracter" + (n == 1? "" : "es"); },
formatInputTooLong: function (input, max) { var n = input.length - max; return "Por favor elimine " + n + " caracter" + (n == 1? "" : "es"); },
formatSelectionTooBig: function (limit) { return "Solo puede seleccionar " + limit + " elemento" + (limit == 1 ? "" : "s"); },
formatLoadMore: function (pageNumber) { return "Cargando más resultados..."; },
formatSearching: function () { return "Buscando..."; }
});
})(jQuery);
\ No newline at end of file
/**
* Select2 Estonian translation.
*
* Author: Kuldar Kalvik <kuldar@kalvik.ee>
*/
(function ($) {
"use strict";
$.extend($.fn.select2.defaults, {
formatNoMatches: function () { return "Tulemused puuduvad"; },
formatInputTooShort: function (input, min) { var n = min - input.length; return "Sisesta " + n + " täht" + (n == 1 ? "" : "e") + " rohkem"; },
formatInputTooLong: function (input, max) { var n = input.length - max; return "Sisesta " + n + " täht" + (n == 1? "" : "e") + " vähem"; },
formatSelectionTooBig: function (limit) { return "Saad vaid " + limit + " tulemus" + (limit == 1 ? "e" : "t") + " valida"; },
formatLoadMore: function (pageNumber) { return "Laen tulemusi.."; },
formatSearching: function () { return "Otsin.."; }
});
})(jQuery);
/**
* Select2 Basque translation.
*
* Author: Julen Ruiz Aizpuru <julenx at gmail dot com>
*/
(function ($) {
"use strict";
$.extend($.fn.select2.defaults, {
formatNoMatches: function () {
return "Ez da bat datorrenik aurkitu";
},
formatInputTooShort: function (input, min) {
var n = min - input.length;
if (n === 1) {
return "Idatzi karaktere bat gehiago";
} else {
return "Idatzi " + n + " karaktere gehiago";
}
},
formatInputTooLong: function (input, max) {
var n = input.length - max;
if (n === 1) {
return "Idatzi karaktere bat gutxiago";
} else {
return "Idatzi " + n + " karaktere gutxiago";
}
},
formatSelectionTooBig: function (limit) {
if (limit === 1 ) {
return "Elementu bakarra hauta dezakezu";
} else {
return limit + " elementu hauta ditzakezu soilik";
}
},
formatLoadMore: function (pageNumber) {
return "Emaitza gehiago kargatzen...";
},
formatSearching: function () {
return "Bilatzen...";
}
});
})(jQuery);
/**
* Select2 French translation
*/
(function ($) {
"use strict";
$.extend($.fn.select2.defaults, {
formatNoMatches: function () { return "Aucun r&eacute;sultat trouv&eacute;"; },
formatInputTooShort: function (input, min) { var n = min - input.length; return "Merci de saisir " + n + " caract&egrave;re" + (n == 1? "" : "s") + " de plus"; },
formatInputTooLong: function (input, max) { var n = input.length - max; return "Merci de saisir " + n + " caract&egrave;re" + (n == 1? "" : "s") + " de moins"; },
formatSelectionTooBig: function (limit) { return "Vous pouvez seulement s&eacute;lectionner " + limit + " &eacute;l&eacute;ment" + (limit == 1 ? "" : "s"); },
formatLoadMore: function (pageNumber) { return "Chargement de r&eacute;sultats suppl&eacute;mentaires..."; },
formatSearching: function () { return "Recherche en cours..."; }
});
})(jQuery);
/**
* Select2 Galician translation
*
* Author: Leandro Regueiro <leandro.regueiro@gmail.com>
*/
(function ($) {
"use strict";
$.extend($.fn.select2.defaults, {
formatNoMatches: function () {
return "Non se atoparon resultados";
},
formatInputTooShort: function (input, min) {
var n = min - input.length;
if (n === 1) {
return "Engada un carácter";
} else {
return "Engada " + n + " caracteres";
}
},
formatInputTooLong: function (input, max) {
var n = input.length - max;
if (n === 1) {
return "Elimine un carácter";
} else {
return "Elimine " + n + " caracteres";
}
},
formatSelectionTooBig: function (limit) {
if (limit === 1 ) {
return "Só pode seleccionar un elemento";
} else {
return "Só pode seleccionar " + limit + " elementos";
}
},
formatLoadMore: function (pageNumber) {
return "Cargando máis resultados...";
},
formatSearching: function () {
return "Buscando...";
}
});
})(jQuery);
/**
* Select2 Hebrew translation.
*
* Author: Yakir Sitbon <http://www.yakirs.net/>
*/
(function ($) {
"use strict";
$.extend($.fn.select2.defaults, {
formatNoMatches: function () { return "לא נמצאו התאמות"; },
formatInputTooShort: function (input, min) { var n = min - input.length; return "נא להזין עוד " + n + " תווים נוספים"; },
formatInputTooLong: function (input, max) { var n = input.length - max; return "נא להזין פחות " + n + " תווים"; },
formatSelectionTooBig: function (limit) { return "ניתן לבחור " + limit + " פריטים"; },
formatLoadMore: function (pageNumber) { return "טוען תוצאות נוספות..."; },
formatSearching: function () { return "מחפש..."; }
});
})(jQuery);
/**
* Select2 Croatian translation.
*
* Author: Edi Modrić <edi.modric@gmail.com>
*/
(function ($) {
"use strict";
var specialNumbers = {
1: function(n) { return (n % 100 != 11 ? "znak" : "znakova"); },
2: function(n) { return (n % 100 != 12 ? "znaka" : "znakova"); },
3: function(n) { return (n % 100 != 13 ? "znaka" : "znakova"); },
4: function(n) { return (n % 100 != 14 ? "znaka" : "znakova"); }
};
$.extend($.fn.select2.defaults, {
formatNoMatches: function () { return "Nema rezultata"; },
formatInputTooShort: function (input, min) {
var n = min - input.length;
var nMod10 = n % 10;
if (nMod10 > 0 && nMod10 < 5) {
return "Unesite još " + n + " " + specialNumbers[nMod10](n);
}
return "Unesite još " + n + " znakova";
},
formatInputTooLong: function (input, max) {
var n = input.length - max;
var nMod10 = n % 10;
if (nMod10 > 0 && nMod10 < 5) {
return "Unesite " + n + " " + specialNumbers[nMod10](n) + " manje";
}
return "Unesite " + n + " znakova manje";
},
formatSelectionTooBig: function (limit) { return "Maksimalan broj odabranih stavki je " + limit; },
formatLoadMore: function (pageNumber) { return "Učitavanje rezultata..."; },
formatSearching: function () { return "Pretraga..."; }
});
})(jQuery);
/**
* Select2 Hungarian translation
*/
(function ($) {
"use strict";
$.extend($.fn.select2.defaults, {
formatNoMatches: function () { return "Nincs találat."; },
formatInputTooShort: function (input, min) { var n = min - input.length; return "Túl rövid. Még " + n + " karakter hiányzik."; },
formatInputTooLong: function (input, max) { var n = input.length - max; return "Túl hosszú. " + n + " kerekterrel több mint kellene."; },
formatSelectionTooBig: function (limit) { return "Csak " + limit + " elemet lehet kiválasztani."; },
formatLoadMore: function (pageNumber) { return "Töltés..."; },
formatSearching: function () { return "Keresés..."; }
});
})(jQuery);
/**
* Select2 Icelandic translation.
*
*/
(function ($) {
"use strict";
$.extend($.fn.select2.defaults, {
formatNoMatches: function () { return "Ekkert fannst"; },
formatInputTooShort: function (input, min) { var n = min - input.length; return "Vinsamlegast skrifið " + n + " staf" + (n == 1 ? "" : "i") + " í viðbót"; },
formatInputTooLong: function (input, max) { var n = input.length - max; return "Vinsamlegast styttið texta um " + n + " staf" + (n == 1 ? "" : "i"); },
formatSelectionTooBig: function (limit) { return "Þú getur aðeins valið " + limit + " atriði"; },
formatLoadMore: function (pageNumber) { return "Sæki fleiri niðurstöður..."; },
formatSearching: function () { return "Leita..."; }
});
})(jQuery);
/**
* Select2 Italian translation
*/
(function ($) {
"use strict";
$.extend($.fn.select2.defaults, {
formatNoMatches: function () { return "Nessuna corrispondenza trovata"; },
formatInputTooShort: function (input, min) { var n = min - input.length; return "Inserisci ancora " + n + " caratter" + (n == 1? "e" : "i"); },
formatInputTooLong: function (input, max) { var n = input.length - max; return "Inserisci " + n + " caratter" + (n == 1? "e" : "i") + " in meno"; },
formatSelectionTooBig: function (limit) { return "Puoi selezionare solo " + limit + " element" + (limit == 1 ? "o" : "i"); },
formatLoadMore: function (pageNumber) { return "Caricamento in corso..."; },
formatSearching: function () { return "Ricerca..."; }
});
})(jQuery);
\ No newline at end of file
/**
* Select2 Japanese translation.
*/
(function ($) {
"use strict";
$.extend($.fn.select2.defaults, {
formatNoMatches: function () { return "該当項目なし"; },
formatInputTooShort: function (input, min) { var n = min - input.length; return "後" + n + "文字入れてください"; },
formatInputTooLong: function (input, max) { var n = input.length - max; return "検索文字列が" + n + "文字長すぎます"; },
formatSelectionTooBig: function (limit) { return "最多で" + limit + "項目までしか選択できません"; },
formatLoadMore: function (pageNumber) { return "読込中・・・"; },
formatSearching: function () { return "検索中・・・"; }
});
})(jQuery);
/**
* Select2 lithuanian translation.
*
* Author: CRONUS Karmalakas <cronus dot karmalakas at gmail dot com>
*/
(function ($) {
"use strict";
$.extend($.fn.select2.defaults, {
formatNoMatches: function () { return "Atitikmenų nerasta"; },
formatInputTooShort: function (input, min) {
var n = min - input.length,
suffix = (n % 10 == 1) && (n % 100 != 11) ? 'į' : (((n % 10 >= 2) && ((n % 100 < 10) || (n % 100 >= 20))) ? 'ius' : 'ių');
return "Įrašykite dar " + n + " simbol" + suffix;
},
formatInputTooLong: function (input, max) {
var n = input.length - max,
suffix = (n % 10 == 1) && (n % 100 != 11) ? 'į' : (((n % 10 >= 2) && ((n % 100 < 10) || (n % 100 >= 20))) ? 'ius' : 'ių');
return "Pašalinkite " + n + " simbol" + suffix;
},
formatSelectionTooBig: function (limit) {
var n = limit,
suffix = (n % 10 == 1) && (n % 100 != 11) ? 'ą' : (((n % 10 >= 2) && ((n % 100 < 10) || (n % 100 >= 20))) ? 'us' : 'ų');
return "Jūs galite pasirinkti tik " + limit + " element" + suffix;
},
formatLoadMore: function (pageNumber) { return "Kraunama daugiau rezultatų..."; },
formatSearching: function () { return "Ieškoma..."; }
});
})(jQuery);
/**
* Select2 Latvian translation
*/
(function ($) {
"use strict";
$.extend($.fn.select2.defaults, {
formatNoMatches: function () { return "Sakritību nav"; },
formatInputTooShort: function (input, min) { var n = min - input.length; return "Lūdzu ievadiet vēl " + n + " simbol" + (n == 11 ? "us" : (/^\d*[1]$/im.test(n)? "u" : "us")); },
formatInputTooLong: function (input, max) { var n = input.length - max; return "Lūdzu ievadiet par " + n + " simbol" + (n == 11 ? "iem" : (/^\d*[1]$/im.test(n)? "u" : "iem")) + " mazāk"; },
formatSelectionTooBig: function (limit) { return "Jūs varat izvēlēties ne vairāk kā " + limit + " element" + (limit == 11 ? "us" : (/^\d*[1]$/im.test(limit)? "u" : "us")); },
formatLoadMore: function (pageNumber) { return "Datu ielāde..."; },
formatSearching: function () { return "Meklēšana..."; }
});
})(jQuery);
/**
* Select2 Macedonian translation.
*
* Author: Marko Aleksic <psybaron@gmail.com>
*/
(function ($) {
"use strict";
$.extend($.fn.select2.defaults, {
formatNoMatches: function () { return "Нема пронајдено совпаѓања"; },
formatInputTooShort: function (input, min) { var n = min - input.length; return "Ве молиме внесете уште " + n + " карактер" + (n == 1 ? "" : "и"); },
formatInputTooLong: function (input, max) { var n = input.length - max; return "Ве молиме внесете " + n + " помалку карактер" + (n == 1? "" : "и"); },
formatSelectionTooBig: function (limit) { return "Можете да изберете само " + limit + " ставк" + (limit == 1 ? "а" : "и"); },
formatLoadMore: function (pageNumber) { return "Вчитување резултати..."; },
formatSearching: function () { return "Пребарување..."; }
});
})(jQuery);
\ No newline at end of file
/**
* Select2 Dutch translation
*/
(function ($) {
"use strict";
$.extend($.fn.select2.defaults, {
formatNoMatches: function () { return "Geen resultaten gevonden"; },
formatInputTooShort: function (input, min) { var n = min - input.length; return "Vul " + n + " karakter" + (n == 1? "" : "s") + " meer in"; },
formatInputTooLong: function (input, max) { var n = input.length - max; return "Vul " + n + " karakter" + (n == 1? "" : "s") + " minder in"; },
formatSelectionTooBig: function (limit) { return "Maximaal " + limit + " item" + (limit == 1 ? "" : "s") + " toegestaan"; },
formatLoadMore: function (pageNumber) { return "Meer resultaten laden..."; },
formatSearching: function () { return "Zoeken..."; },
});
})(jQuery);
\ No newline at end of file
/**
* Select2 Norwegian translation.
*
* Author: Torgeir Veimo <torgeir.veimo@gmail.com>
*/
(function ($) {
"use strict";
$.extend($.fn.select2.defaults, {
formatNoMatches: function () { return "Ingen treff"; },
formatInputTooShort: function (input, min) { var n = min - input.length; return "Vennligst skriv inn " + n + (n>1 ? " flere tegn" : " tegn til"); },
formatInputTooLong: function (input, max) { var n = input.length - max; return "Vennligst fjern " + n + " tegn"; },
formatSelectionTooBig: function (limit) { return "Du kan velge maks " + limit + " elementer"; },
formatLoadMore: function (pageNumber) { return "Laster flere resultater..."; },
formatSearching: function () { return "Søker..."; }
});
})(jQuery);
/**
* Select2 Polish translation.
*
* Author: Jan Kondratowicz <jan@kondratowicz.pl>
*/
(function ($) {
"use strict";
var pl_suffix = function(n) {
if(n == 1) return "";
if((n%100 > 1 && n%100 < 5) || (n%100 > 20 && n%10 > 1 && n%10 < 5)) return "i";
return "ów";
};
$.extend($.fn.select2.defaults, {
formatNoMatches: function () {
return "Brak wyników.";
},
formatInputTooShort: function (input, min) {
var n = min - input.length;
return "Wpisz jeszcze " + n + " znak" + pl_suffix(n) + ".";
},
formatInputTooLong: function (input, max) {
var n = input.length - max;
return "Wpisana fraza jest za długa o " + n + " znak" + pl_suffix(n) + ".";
},
formatSelectionTooBig: function (limit) {
return "Możesz zaznaczyć najwyżej " + limit + " element" + pl_suffix(limit) + ".";
},
formatLoadMore: function (pageNumber) {
return "Ładowanie wyników...";
},
formatSearching: function () {
return "Szukanie...";
}
});
})(jQuery);
\ No newline at end of file
/**
* Select2 Brazilian Portuguese translation
*/
(function ($) {
"use strict";
$.extend($.fn.select2.defaults, {
formatNoMatches: function () { return "Nenhum resultado encontrado"; },
formatInputTooShort: function (input, min) { var n = min - input.length; return "Informe " + n + " caracter" + (n == 1? "" : "es"); },
formatInputTooLong: function (input, max) { var n = input.length - max; return "Apague " + n + " caracter" + (n == 1? "" : "es"); },
formatSelectionTooBig: function (limit) { return "Só é possível selecionar " + limit + " elemento" + (limit == 1 ? "" : "s"); },
formatLoadMore: function (pageNumber) { return "Carregando mais resultados..."; },
formatSearching: function () { return "Buscando..."; }
});
})(jQuery);
/**
* Select2 Portuguese (Portugal) translation
*/
(function ($) {
"use strict";
$.extend($.fn.select2.defaults, {
formatNoMatches: function () { return "Nenhum resultado encontrado"; },
formatInputTooShort: function (input, min) { var n = min - input.length; return "Introduza " + n + " caracter" + (n == 1 ? "" : "es"); },
formatInputTooLong: function (input, max) { var n = input.length - max; return "Apague " + n + " caracter" + (n == 1 ? "" : "es"); },
formatSelectionTooBig: function (limit) { return "Só é possível selecionar " + limit + " elemento" + (limit == 1 ? "" : "s"); },
formatLoadMore: function (pageNumber) { return "A carregar mais resultados..."; },
formatSearching: function () { return "A pesquisar..."; }
});
})(jQuery);
/**
* Select2 Romanian translation.
*/
(function ($) {
"use strict";
$.extend($.fn.select2.defaults, {
formatNoMatches: function () { return "Nu a fost găsit nimic"; },
formatInputTooShort: function (input, min) { var n = min - input.length; return "Vă rugăm să introduceți incă " + n + " caracter" + (n == 1 ? "" : "e"); },
formatInputTooLong: function (input, max) { var n = input.length - max; return "Vă rugăm să introduceți mai puțin de " + n + " caracter" + (n == 1? "" : "e"); },
formatSelectionTooBig: function (limit) { return "Aveți voie să selectați cel mult " + limit + " element" + (limit == 1 ? "" : "e"); },
formatLoadMore: function (pageNumber) { return "Se încarcă..."; },
formatSearching: function () { return "Căutare..."; }
});
})(jQuery);
/**
* Select2 Russian translation
*/
(function ($) {
"use strict";
$.extend($.fn.select2.defaults, {
formatNoMatches: function () { return "Совпадений не найдено"; },
formatInputTooShort: function (input, min) { var n = min - input.length; return "Пожалуйста, введите еще " + n + " символ" + (n == 1 ? "" : ((n > 1)&&(n < 5) ? "а" : "ов")); },
formatInputTooLong: function (input, max) { var n = input.length - max; return "Пожалуйста, введите на " + n + " символ" + (n == 1 ? "" : ((n > 1)&&(n < 5)? "а" : "ов")) + " меньше"; },
formatSelectionTooBig: function (limit) { return "Вы можете выбрать не более " + limit + " элемент" + (limit == 1 ? "а" : "ов"); },
formatLoadMore: function (pageNumber) { return "Загрузка данных..."; },
formatSearching: function () { return "Поиск..."; }
});
})(jQuery);
/**
* Select2 Slovak translation.
*
* Author: David Vallner <david@vallner.net>
*/
(function ($) {
"use strict";
// use text for the numbers 2 through 4
var smallNumbers = {
2: function(masc) { return (masc ? "dva" : "dve"); },
3: function() { return "tri"; },
4: function() { return "štyri"; }
}
$.extend($.fn.select2.defaults, {
formatNoMatches: function () { return "Nenašli sa žiadne položky"; },
formatInputTooShort: function (input, min) {
var n = min - input.length;
if (n == 1) {
return "Prosím zadajte ešte jeden znak";
} else if (n <= 4) {
return "Prosím zadajte ešte ďalšie "+smallNumbers[n](true)+" znaky";
} else {
return "Prosím zadajte ešte ďalších "+n+" znakov";
}
},
formatInputTooLong: function (input, max) {
var n = input.length - max;
if (n == 1) {
return "Prosím zadajte o jeden znak menej";
} else if (n <= 4) {
return "Prosím zadajte o "+smallNumbers[n](true)+" znaky menej";
} else {
return "Prosím zadajte o "+n+" znakov menej";
}
},
formatSelectionTooBig: function (limit) {
if (limit == 1) {
return "Môžete zvoliť len jednu položku";
} else if (limit <= 4) {
return "Môžete zvoliť najviac "+smallNumbers[limit](false)+" položky";
} else {
return "Môžete zvoliť najviac "+limit+" položiek";
}
},
formatLoadMore: function (pageNumber) { return "Načítavajú sa ďalšie výsledky..."; },
formatSearching: function () { return "Vyhľadávanie..."; }
});
})(jQuery);
/**
* Select2 Swedish translation.
*
* Author: Jens Rantil <jens.rantil@telavox.com>
*/
(function ($) {
"use strict";
$.extend($.fn.select2.defaults, {
formatNoMatches: function () { return "Inga träffar"; },
formatInputTooShort: function (input, min) { var n = min - input.length; return "Var god skriv in " + n + (n>1 ? " till tecken" : " tecken till"); },
formatInputTooLong: function (input, max) { var n = input.length - max; return "Var god sudda ut " + n + " tecken"; },
formatSelectionTooBig: function (limit) { return "Du kan max välja " + limit + " element"; },
formatLoadMore: function (pageNumber) { return "Laddar fler resultat..."; },
formatSearching: function () { return "Söker..."; }
});
})(jQuery);
/**
* Select2 Turkish translation.
*
* Author: Salim KAYABAŞI <salim.kayabasi@gmail.com>
*/
(function ($) {
"use strict";
$.extend($.fn.select2.defaults, {
formatNoMatches: function () { return "Sonuç bulunamadı"; },
formatInputTooShort: function (input, min) { var n = min - input.length; return "En az " + n + " karakter daha girmelisiniz"; },
formatInputTooLong: function (input, max) { var n = input.length - max; return n + " karakter azaltmalısınız"; },
formatSelectionTooBig: function (limit) { return "Sadece " + limit + " seçim yapabilirsiniz"; },
formatLoadMore: function (pageNumber) { return "Daha fazla..."; },
formatSearching: function () { return "Aranıyor..."; }
});
})(jQuery);
/**
* Select2 <Language> translation.
*
* Author: bigmihail <bigmihail@bigmir.net>
*/
(function ($) {
"use strict";
$.extend($.fn.select2.defaults, {
formatNoMatches: function () { return "Нічого не знайдено"; },
formatInputTooShort: function (input, min) { var n = min - input.length, s = ["", "и", "ів"], p = [2,0,1,1,1,2]; return "Введіть буль ласка ще " + n + " символ" + s[ (n%100>4 && n%100<=20)? 2 : p[Math.min(n%10, 5)] ]; },
formatInputTooLong: function (input, max) { var n = input.length - max, s = ["", "и", "ів"], p = [2,0,1,1,1,2]; return "Введіть буль ласка на " + n + " символ" + s[ (n%100>4 && n%100<=20)? 2 : p[Math.min(n%10, 5)] ] + " менше"; },
formatSelectionTooBig: function (limit) {var s = ["", "и", "ів"], p = [2,0,1,1,1,2]; return "Ви можете вибрати лише " + limit + " елемент" + s[ (limit%100>4 && limit%100<=20)? 2 : p[Math.min(limit%10, 5)] ]; },
formatLoadMore: function (pageNumber) { return "Завантаження даних..."; },
formatSearching: function () { return "Пошук..."; }
});
})(jQuery);
/**
* Select2 Vietnamese translation.
*
* Author: Long Nguyen <olragon@gmail.com>
*/
(function ($) {
"use strict";
$.extend($.fn.select2.defaults, {
formatNoMatches: function () { return "Không tìm thấy kết quả"; },
formatInputTooShort: function (input, min) { var n = min - input.length; return "Vui lòng nhập nhiều hơn " + n + " ký tự" + (n == 1 ? "" : "s"); },
formatInputTooLong: function (input, max) { var n = input.length - max; return "Vui lòng nhập ít hơn " + n + " ký tự" + (n == 1? "" : "s"); },
formatSelectionTooBig: function (limit) { return "Chỉ có thể chọn được " + limit + " tùy chọn" + (limit == 1 ? "" : "s"); },
formatLoadMore: function (pageNumber) { return "Đang lấy thêm kết quả..."; },
formatSearching: function () { return "Đang tìm..."; }
});
})(jQuery);
/**
* Select2 Chinese translation
*/
(function ($) {
"use strict";
$.extend($.fn.select2.defaults, {
formatNoMatches: function () { return "没有找到匹配项"; },
formatInputTooShort: function (input, min) { var n = min - input.length; return "请再输入" + n + "个字符";},
formatInputTooLong: function (input, max) { var n = input.length - max; return "请删掉" + n + "个字符";},
formatSelectionTooBig: function (limit) { return "你只能选择最多" + limit + "项"; },
formatLoadMore: function (pageNumber) { return "加载结果中..."; },
formatSearching: function () { return "搜索中..."; }
});
})(jQuery);
/**
* Select2 Traditional Chinese translation
*/
(function ($) {
"use strict";
$.extend($.fn.select2.defaults, {
formatNoMatches: function () { return "沒有找到相符的項目"; },
formatInputTooShort: function (input, min) { var n = min - input.length; return "請再輸入" + n + "個字元";},
formatInputTooLong: function (input, max) { var n = input.length - max; return "請刪掉" + n + "個字元";},
formatSelectionTooBig: function (limit) { return "你只能選擇最多" + limit + "項"; },
formatLoadMore: function (pageNumber) { return "載入中..."; },
formatSearching: function () { return "搜尋中..."; }
});
})(jQuery);
from django_tables2 import Table, A
from django_tables2.columns import LinkColumn, TemplateColumn
from firewall.models import Host, Vlan, Domain, Group, Record, Rule
class BlacklistTable(Table):
ipv4 = LinkColumn('network.blacklist', args=[A('pk')])
class Meta:
model = Domain
attrs = {'class': 'table table-striped table-condensed'}
fields = ('ipv4', 'host', 'reason', 'type')
order_by = ('ipv4', )
class DomainTable(Table):
name = LinkColumn('network.domain', args=[A('pk')])
class Meta:
model = Domain
attrs = {'class': 'table table-striped table-condensed'}
fields = ('name', 'owner', 'ttl', )
order_by = ('name', )
class GroupTable(Table):
name = LinkColumn('network.group', args=[A('pk')])
class Meta:
model = Group
attrs = {'class': 'table table-striped table-condensed'}
fields = ('name', 'description', 'owner', )
order_by = ('name', )
class HostTable(Table):
hostname = LinkColumn('network.host', args=[A('pk')])
class Meta:
model = Host
attrs = {'class': 'table table-striped table-condensed'}
fields = ('hostname', 'vlan', 'mac', 'ipv4', 'ipv6',
'pub_ipv4', 'created_at', 'owner', )
order_by = ('vlan', 'hostname', )
class SmallRuleTable(Table):
rule = TemplateColumn(
template_name="network/columns/host-rule.html",
attrs={"th": {"style": "display: none;"}}
)
action = TemplateColumn(
template_name="network/columns/host-rule-action.html",
attrs={
"th": {"style": "display: none;"},
"cell": {"style": "text-align: center; vertical-align: middle;"}
}
)
class Meta:
model = Rule
attrs = {'class': 'table table-striped table-bordered table-condensed'}
fields = ('rule', 'action', )
class SmallGroupRuleTable(Table):
rule = TemplateColumn(
template_name="network/columns/host-rule.html",
attrs={"th": {"style": "display: none;"}}
)
class Meta:
model = Rule
attrs = {'class': 'table table-striped table-bordered table-condensed'}
fields = ('rule', )
# inheritance by copy-paste
class SmallHostTable(Table):
hostname = LinkColumn('network.host', args=[A('pk')])
class Meta:
model = Host
attrs = {'class': 'table table-striped table-condensed'}
fields = ('hostname', 'ipv4')
order_by = ('vlan', 'hostname', )
class RecordTable(Table):
fqdn = LinkColumn('network.record', args=[A('pk')], orderable=False)
class Meta:
model = Record
attrs = {'class': 'table table-striped table-condensed'}
fields = ('type', 'fqdn', 'host', 'address', 'ttl', 'host',
'owner', )
sequence = ('type', 'fqdn', )
order_by = 'name'
class SmallRecordTable(Table):
fqdn = LinkColumn('network.record', args=[A('pk')], orderable=False)
class Meta:
model = Record
attrs = {'class': 'table table-striped table-bordered'}
fields = ('type', 'fqdn', 'host', 'address', )
sequence = ('type', 'fqdn', )
order_by = '-type'
orderable = False
class RuleTable(Table):
r_type = LinkColumn('network.rule', args=[A('pk')])
color_desc = TemplateColumn(
template_name="network/columns/color-desc.html"
)
class Meta:
model = Rule
attrs = {'class': 'table table-striped table-hover table-condensed'}
fields = ('r_type', 'color_desc', 'owner', 'extra', 'direction',
'accept', 'proto', 'sport', 'dport', 'nat', 'nat_dport', )
order_by = 'direction'
class VlanTable(Table):
name = LinkColumn('network.vlan', args=[A('vid')])
class Meta:
model = Vlan
attrs = {'class': 'table table-striped table-condensed'}
fields = ('vid', 'name', 'interface', 'ipv4', 'ipv6', 'domain', )
order_by = 'vid'
class VlanGroupTable(Table):
name = LinkColumn('network.vlan_group', args=[A('pk')])
vlans = TemplateColumn(template_name="network/columns/vlan-list.html")
class Meta:
model = Vlan
attrs = {'class': 'table table-striped table-condensed'}
fields = ('name', 'vlans', 'description', 'owner', )
order_by = 'name'
<a href="{{ input.href }}"
id="{% if input.name|wordcount > 1 %}{{ input.name|slugify }}{% else %}{{ input.name }}{% endif %}"
value=""
class="{{ input.field_classes }}"
{{ input.flat_attrs|safe }}
>{{ input.value }}</a>
{% load i18n %}
{% load l10n %}
{% load staticfiles %}
{% get_current_language as lang %}
<!DOCTYPE html>
<html lang="{{lang}}">
<head>
<meta charset="utf-8">
<title>{% block title %}Firewall GUI{% endblock %}</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href='http://fonts.googleapis.com/css?family=Source+Sans+Pro:200,400&amp;subset=latin,latin-ext' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css">
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-theme.min.css">
<link href="//netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.css" rel="stylesheet" />
<style type="text/css">
body {
padding-top:40px;
}
/* note: this doesn't really work */
a i:hover {
text-decoration: none;
}
footer {
margin-top: 45px;
}
.messagelist {
margin-top: 25px;
}
</style>
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<!--<link href="{% static "css/network.css" %}" rel="stylesheet">-->
{% block extra_css %}{% endblock %}
</head>
<body>
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-header">
<a class="navbar-brand" href="{% url "network.index" %}">CIRCLE Network</a>
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div><!-- .navbar-header -->
<div class="collapse navbar-collapse">
<ul class="nav navbar-nav">
{% include "network/menu.html" %}
</ul>
</div><!-- .collapse .navbar-collapse -->
</div><!-- navbar navbar-inverse navbar-fixed-top -->
<div class="container">
{% block messages %}
{% if messages %}
<div class="messagelist">
{% for message in messages %}
<div class="alert
{% if message.tags %} alert-{% if message.tags == "error" %}danger{% else %}{{ message.tags }}{% endif %}{% endif %}">
{{ message }}
</div>
{% endfor %}
</div>
{% endif %}
{% endblock messages %}
{% block content %}
<div class="alert-block">This is an abstract base template.</div>
{% endblock %}
</div><!-- .container -->
<div class="footer-container container">
<footer>
<p class="pull-right"><a href="#">Vissza az oldal tetejére</a></p>
<p>&copy; 2013 BME Közigazgatási Informatikai Központ
</footer>
</div><!-- .footer-container .container -->
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script src="{% url "network.js_catalog" %}"></script>
<script src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
<!--<script src="{% static "js/select2-3.4.0/select2.min.js" %}"></script>-->
<script src="{% static "js/network.js" %}"></script>
<script>
{% block extra_js %}
{% endblock %}
</script>
{% block extra_etc %}
{% endblock %}
</body>
</html>
{% extends "network/base.html" %}
{% load render_table from django_tables2 %}
{% load i18n %}
{% load l10n %}
{% load staticfiles %}
{% load crispy_forms_tags %}
{% block content %}
<div class="page-header">
<h2>{% trans "Create a blacklist" %}</h2>
</div>
<div class="row">
<div class="col-sm-4">
{% crispy form %}
</div>
</div>
{% endblock %}
{% extends "network/base.html" %}
{% load render_table from django_tables2 %}
{% load i18n %}
{% load l10n %}
{% load staticfiles %}
{% load crispy_forms_tags %}
{% block content %}
<div class="page-header">
<a href="{% url network.blacklist_delete pk=blacklist_pk %}" class="btn btn-danger pull-right"><i class="icon-remove-sign"></i> {% trans "Delete this blaclist" %}</a>
<h2>{{ form.ipv4.value }} <small>{{ form.type.value }}</small></h2>
</div>
<div class="row">
<div class="col-sm-4">
{% crispy form %}
</div>
</div>
{% endblock %}
{% extends "network/base.html" %}
{% load render_table from django_tables2 %}
{% load i18n %}
{% load l10n %}
{% load staticfiles %}
{% block content %}
<div class="page-header">
<a href="{% url "network.blacklist_create" %}" class="btn btn-success pull-right"><i class="icon-plus-sign"></i> {% trans "Create a new blacklist" %}</a>
<h1>{% trans "Blacklists" %} <small></small></h1>
</div>
<div class="table-responsive">
{% render_table table %}
</div>
{% endblock %}
{% load i18n %}
{% load l10n %}
{# <span style="color: #FF0000;">[{{ record.r_type }}]</span> #}
{% if record.direction == "1" %}{{ record.foreign_network }}{% else %}{{ record.r_type }}{% endif %}
{#<span style="color: #0000FF;"> ▸ </span>#}
<i class="icon-arrow-right"></i>
{% if record.direction == "0" %}{{ record.foreign_network }}{% else %}{{ record.r_type }}{% endif %}
<span style="color: #00FF00;">
{% if record.proto %}
proto={{ record.proto }}
{% endif %}
{% if record.sport %}
sport={{ record.sport }}
{% endif %}
{% if record.dport %}
dport={{ record.dport }}
{% endif %}
{{ record.description }}
{% load i18n %}
{% load l10n %}
<div style="white-space: nowrap;">
<a href="{% url network.rule_delete pk=record.pk %}?from={{ request.path }}"><i class="icon-remove"></i></a>
<a href="{% url network.rule pk=record.pk %}"><i class="icon-pencil"></i></a>
</div>
{% load i18n %}
{% load l10n %}
{# <span style="color: #FF0000;">[{{ record.r_type }}]</span> #}
{% if record.direction == "1" %}{{ record.foreign_network }}{% else %}{{ record.r_type }}{% endif %}
{#<span style="color: #0000FF;"> ▸ </span>#}
<i class="icon-arrow-right"></i>
{% if record.direction == "0" %}{{ record.foreign_network }}{% else %}{{ record.r_type }}{% endif %}
{% if record.accept %}
<span class="label label-info" style="margin-left: 5px;">ACCEPT</span>
{% endif %}
{% if record.extra %}
<span class="label label-default">{{ record.extra }}</span>
{% endif %}
{% if record.nat %}
<span class="label label-success">NAT
[ {{ record.dport }} <i class="icon-arrow-right"></i> {{record.nat_dport}} ]</span>
{% endif %}
{% load i18n %}
{% load l10n %}
{% for vlan in record.vlans.all %}
{{ vlan }}{% if not forloop.last %},{% endif %}
{% endfor %}
{% extends "network/base.html" %}
{% load i18n %}
{% load l10n %}
{% block content %}
<div class="page-header">
<h2>
{% blocktrans with object=object %}
Are you sure you want to delete
<strong>"{{ object }}"</strong>?
{% endblocktrans %}
</h2>
</div>
<form action="" method="post">{% csrf_token %}
{% if deps %}
<div class="alert alert-warning">
{% trans "This action also <strong>removes</strong> the following" %}
{% for dep in deps %}
<div class="alert">
<strong>{% trans dep.name %}</strong>
<ul class="">
{{ dep.data|unordered_list }}
</ul>
</div>
{% endfor %}
</div>
{% else %}
<div class="alert alert-success">
{% trans 'No dependencies, "safe" to delete!' %}
</div>
{% endif %}
<form action="" method="post">{% csrf_token %}
<input type="hidden" value="{{ request.GET.from }}" name="next" />
{% if confirmation %}
<label><p>
{% trans "If you are really sure, type in the object's name!" %}
<input type="text" name="confirm" class="form-control" placeholder="{{ object }}"/>
</p></label>
{% else %}
{% endif %}
<input type="submit" class="btn btn-danger btn-lg pull-right" value="{% trans "Yes, delete it!" %}"/>
</form>
{% endblock %}
{% extends "network/base.html" %}
{% load i18n %}
{% load l10n %}
{% block content %}
<div class="page-header">
<h1>Remove <small></small></h1>
</div>
<form action="" method="post">{% csrf_token %}
<p>Are you sure you want to remove hostgroup <strong>"{{ group }}"</strong>
from <strong>"{{ host }}"</strong>?</p>
<input type="hidden" value="{{ request.GET.from }}" name="next" />
<a href="{{ request.GET.from }}" class="btn btn-info">Back</a>
<input type="submit" class="btn btn-danger" value="Confirm" />
</form>
{% endblock %}
{% load i18n %}
{% load l10n %}
{% load staticfiles %}
<style>
.thumbnail {
margin-bottom: 30px;
}
.dashboard-text {
text-align: justify;
}
</style>
<div class="row">
<div class="col-sm-3">
<div class="thumbnail">
<div class="caption">
<p class="lead"> <a href="{% url "network.host_list" %}">Hosts</a> are machines on the network.</p>
<p class="dashboard-text">
Proin mattis enim risus. Ut eu enim quis auctor. Duis lobort sollicitudin lacus, scelerisque dictum arcu aliquam nec.
</p>
<p class="text-right">
<a href="{% url "network.host_list" %}" class="btn btn-default">{% trans "List" %}</a>
<a href="{% url "network.host_create" %}" class="btn btn-success">{% trans "Create" %}</a>
</p>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="thumbnail">
<div class="caption">
<p class="lead"> <a href="{% url "network.vlan_list" %}">Vlans</a> are machines on the network.</p>
<p class="dashboard-text">
Proin mattis enim risus. Ut eu enim quis auctor. Duis lobort sollicitudin lacus, scelerisque dictum arcu aliquam nec.
</p>
<p class="text-right">
<a href="{% url "network.vlan_list" %}" class="btn btn-default">{% trans "List" %}</a>
<a href="{% url "network.vlan_create" %}" class="btn btn-success">{% trans "Create" %}</a>
</p>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="thumbnail">
<div class="caption">
<p class="lead"> <a href="{% url "network.domain_list" %}">Domains</a> are machines on the network.</p>
<p class="dashboard-text">
Proin mattis enim risus. Ut eu enim quis auctor. Duis lobort sollicitudin lacus, scelerisque dictum arcu aliquam nec.
</p>
<p class="text-right">
<a href="{% url "network.domain_list" %}" class="btn btn-default">{% trans "List" %}</a>
<a href="{% url "network.domain_create" %}" class="btn btn-success">{% trans "Create" %}</a>
</p>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="thumbnail">
<div class="caption">
<p class="lead"> <a href="{% url "network.record_list" %}">Records</a> are machines on the network.</p>
<p class="dashboard-text">
Proin mattis enim risus. Ut eu enim quis auctor. Duis lobort sollicitudin lacus, scelerisque dictum arcu aliquam nec.
</p>
<p class="text-right">
<a href="{% url "network.record_list" %}" class="btn btn-default">{% trans "List" %}</a>
<a href="{% url "network.record_create" %}" class="btn btn-success">{% trans "Create" %}</a>
</p>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="thumbnail">
<div class="caption">
<p class="lead"> <a href="{% url "network.blacklist_list" %}">Blacklists</a> are machines on the network.</p>
<p class="dashboard-text">
Proin mattis enim risus. Ut eu enim quis auctor. Duis lobort sollicitudin lacus, scelerisque dictum arcu aliquam nec.
</p>
<p class="text-right">
<a href="{% url "network.blacklist_list" %}" class="btn btn-default">{% trans "List" %}</a>
<a href="{% url "network.blacklist_create" %}" class="btn btn-success">{% trans "Create" %}</a>
</p>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="thumbnail">
<div class="caption">
<p class="lead"> <a href="{% url "network.rule_list" %}">Rules</a> are machines on the network.</p>
<p class="dashboard-text">
Proin mattis enim risus. Ut eu enim quis auctor. Duis lobort sollicitudin lacus, scelerisque dictum arcu aliquam nec.
</p>
<p class="text-right">
<a href="{% url "network.rule_list" %}" class="btn btn-default">{% trans "List" %}</a>
<a href="{% url "network.rule_create" %}" class="btn btn-success">{% trans "Create" %}</a>
</p>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="thumbnail">
<div class="caption">
<p class="lead"> <a href="{% url "network.group_list" %}">Host groups</a> are machines on the network.</p>
<p class="dashboard-text">
Proin mattis enim risus. Ut eu enim quis auctor. Duis lobort sollicitudin lacus, scelerisque dictum arcu aliquam nec.
</p>
<p class="text-right">
<a href="{% url "network.group_list" %}" class="btn btn-default">{% trans "List" %}</a>
<a href="{% url "network.group_create" %}" class="btn btn-success">{% trans "Create" %}</a>
</p>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="thumbnail">
<div class="caption">
<p class="lead"> <a href="{% url "network.vlan_group_list" %}">Vlan groups</a> are machines on the network.</p>
<p class="dashboard-text">
Proin mattis enim risus. Ut eu enim quis auctor. Duis lobort sollicitudin lacus, scelerisque dictum arcu aliquam nec.
</p>
<p class="text-right">
<a href="{% url "network.vlan_group_list" %}" class="btn btn-default">{% trans "List" %}</a>
<a href="{% url "network.vlan_group_create" %}" class="btn btn-success">{% trans "Create" %}</a>
</p>
</div>
</div>
</div>
</div>
{% extends "network/base.html" %}
{% load render_table from django_tables2 %}
{% load i18n %}
{% load l10n %}
{% load staticfiles %}
{% load crispy_forms_tags %}
{% block content %}
<div class="page-header">
<h2>{% trans "Create a new domain" %}<small></small></h2>
</div>
<div class="row">
<div class="col-sm-4">
{% crispy form %}
</div>
</div>
{% endblock %}
{% extends "network/base.html" %}
{% load render_table from django_tables2 %}
{% load i18n %}
{% load l10n %}
{% load staticfiles %}
{% load crispy_forms_tags %}
{% block content %}
<div class="page-header">
<a href="{% url network.domain_delete pk=domain_pk %}" class="btn btn-danger pull-right"><i class="icon-remove-sign"></i>{% trans "Delete this domain" %}</a>
<h2>{{ form.name.value }} <small></small></h2>
</div>
<div class="row">
<div class="col-sm-4">
{% crispy form %}
</div>
<div class="col-sm-5 col-sm-offset-1">
<h3>
{% trans "List of this domain's records" %}
</h3>
<hr />
<div class="table-responsive">
{% render_table record_list %}
</div>
</div>
</div>
{% endblock %}
{% extends "network/base.html" %}
{% load render_table from django_tables2 %}
{% load i18n %}
{% load l10n %}
{% load staticfiles %}
{% block content %}
<div class="page-header">
<a href="{% url "network.domain_create" %}" class="btn btn-success pull-right"><i class="icon-plus-sign"></i> {% trans "Create a new domain" %}</a>
<h1>{% trans "Domains" %}</h1>
</div>
<div class="table-responsive">
{% render_table table %}
</div>
{% endblock %}
{% extends "network/base.html" %}
{% load render_table from django_tables2 %}
{% load i18n %}
{% load l10n %}
{% load staticfiles %}
{% load crispy_forms_tags %}
{% block content %}
<div class="page-header">
<h2>{% trans "Create a new host group" %}</h2>
</div>
<div class="row">
<div class="col-sm-6">
{% crispy form %}
</div>
</div>
{% endblock %}
{% extends "network/base.html" %}
{% load render_table from django_tables2 %}
{% load i18n %}
{% load l10n %}
{% load staticfiles %}
{% load crispy_forms_tags %}
{% block content %}
<div class="page-header">
<a href="{% url network.group_delete pk=group.pk %}" class="btn btn-danger pull-right"><i class="icon-remove-sign"></i> {% trans "Delete this group" %}</a>
<h2>{{ form.name.value }}</h2>
</div>
<div class="row">
<div class="col-sm-6">
{% crispy form %}
</div>
</div>
{% endblock %}
{% extends "network/base.html" %}
{% load render_table from django_tables2 %}
{% load i18n %}
{% load l10n %}
{% load staticfiles %}
{% block content %}
<div class="page-header">
<a href="{% url "network.group_create" %}" class="btn btn-success pull-right"><i class="icon-plus-sign"></i> {% trans "Create a new host group" %}</a>
<h1>{% trans "Host groups" %}</h1>
</div>
{% render_table table %}
{% endblock %}
{% extends "network/base.html" %}
{% load render_table from django_tables2 %}
{% load i18n %}
{% load l10n %}
{% load staticfiles %}
{% load crispy_forms_tags %}
{% block content %}
<div class="page-header">
<h2>{% trans "Create a new host" %}</h2>
</div>
<div class="row">
<div class="col-sm-8">
{% crispy form %}
</div>
<div class="col-sm-4">
Maybe some help text here?
</div><!-- col-sm-4 -->
</div><!-- row -->
{% endblock %}
{% extends "network/base.html" %}
{% load render_table from django_tables2 %}
{% load i18n %}
{% load l10n %}
{% load staticfiles %}
{% load crispy_forms_tags %}
{% block content %}
<div class="page-header">
<a href="{% url network.host_delete pk=host_pk%}" class="btn btn-danger pull-right"><i class="icon-remove-sign"></i> {% trans "Delete this host" %}</a>
<h2>{{ form.hostname.value }}</h2>
</div>
<div class="row">
<div class="col-sm-8">
{% crispy form %}
</div>
<div class="col-sm-4">
<div class="page-header">
<h3>{% trans "Rules" %}</h3>
</div>
{% if rule_list.data.data.count > 0 %}
{% render_table rule_list %}
{% else %}
{% trans "No rules associated with this host!" %}
{% endif %}
<div class="page-header">
<h3>{% trans "Groups" %}</h3>
</div>
{% for group in group_rule_list %}
<div>
<h4 id="{{ group.pk }}_group_pk">{{ group.name }}
<a href="{% url network.remove_host_group pk=host_pk group_pk=group.pk %}?from={{ request.path }}">
<i class="icon-remove" style="vertical-align: middle;"></i></a>
<a href="{% url network.group group.pk %}">
<i class="icon-pencil" style="vertical-align: middle;"></i></a>
</h4>
{% render_table group.table %}
</div>
{% endfor %}
<div class="page-header">
<h3>Add host group</h3>
</div>
{% if not_used_groups|length == 0 %}
No more groups to add!
{% else %}
<form action="{% url network.add_host_group pk=host_pk %}" method="POST">
{% csrf_token %}
<div class="input-group">
<select name="group" id="add_group" class="form-control">
{% for rest in not_used_groups %}
<option value="{{ rest.pk }}">{{ rest }}</option>
{% endfor %}
</select>
<div class="input-group-btn">
<input type="submit" value="{% trans "Add group" %}" class="btn btn-default"></input>
</div>
</div><!-- input-group -->
</form>
{% endif %}
</div><!-- col-sm-4 -->
</div><!-- row -->
{% endblock %}
{% extends "network/base.html" %}
{% load render_table from django_tables2 %}
{% load i18n %}
{% load l10n %}
{% load staticfiles %}
{% block content %}
<div class="page-header">
<a href="{% url "network.host_create" %}" class="btn btn-success pull-right"><i class="icon-plus-sign"></i> {% trans "Create a new host" %}</a>
<h1>
{% trans "Hosts" %}
<small>
{% trans "list of all hosts" %}
</small>
</h1>
</div>
<ul class="nav nav-pills" style="margin: 5px 0 20px 0;">
<li class="disabled"><a href="#">{% trans "Filter by vlans" %}</a></li>
<li {% if not request.GET.vlan %} class="active"{% endif %}><a href="{{ request.path }}">{% trans "ALL" %}</a></li>
{% for vlan in vlans %}
<li{% if request.GET.vlan|add:"0" == vlan.id %} class="active"{% endif %}><a href="?vlan={{ vlan.id }}">{{ vlan.name }}</a></li>
{% endfor %}
</ul>
<div class="table-responsive">
{% render_table table %}
</div>
{% endblock %}
{% extends "network/base.html" %}
{% load i18n %}
{% load l10n %}
{% load staticfiles %}
{% block content %}
<div class="page-header">
<h1>{% trans "Dashboard" %}</h1>
</div>
{% include "network/dashboard.html" %}
<div class="page-header">
<h1>{% trans "Latest modifications" %}</h1>
</div>
<table class="table table-striped table-bordered">
<tr>
<th>{% trans "Action" %}</th>
<th>{% trans "Model" %}</th>
<th>{% trans "Name" %}</th>
<th>{% trans "Time elapsed" %}</th>
</tr>
{% for l in latest %}
<tr>
<td>{% if l.modified_at == l.created_at %}{% trans "created" %}{% else %}{% trans "modified" %}{% endif %}</td>
<td>{{ l.class_name }}</td>
<td><a href="{{ l.link }}">{{ l.name }}</a></td>
<td>{{ l.modified_at|timesince }}</td>
</tr>
{% endfor %}
</table>
<div class="page-header">
<h1>{% trans "Latest blacklists" %}</h1>
</div>
<table class="table table-striped table-bordered">
<tr>
<th>{% trans "IP" %}</th>
<th>{% trans "Reason" %}</th>
<th>{% trans "Type" %}</th>
<th>{% trans "Time elapsed" %}</th>
</tr>
{% for b in latest_blacklists %}
<tr>
<td><a href="{{ b.get_absolute_url }}">{{ b.ipv4 }}</a></td>
<td>{{ b.reason }}</td>
<td>{{ b.type }}</td>
<td>{{ b.modified_at|timesince }}</td>
</tr>
{% endfor %}
</table>
{% endblock %}
{% load i18n %}
{% load l10n %}
<li{% if href in request.path %} class="active"{% endif %}><a href="{{ href }}">{% trans text %}</a></li>
{% load i18n %}
{% load l10n %}
{% url "network.host_list" as u %}
{% trans "Hosts" as t %}
{% include "network/menu-item.html" with href=u text=t %}
{% url "network.vlan_list" as u %}
{% trans "Vlans" as t %}
{% include "network/menu-item.html" with href=u text=t %}
{% url "network.domain_list" as u %}
{% trans "Domains" as t %}
{% include "network/menu-item.html" with href=u text=t %}
{% url "network.record_list" as u %}
{% trans "Records" as t %}
{% include "network/menu-item.html" with href=u text=t %}
{% url "network.blacklist_list" as u %}
{% trans "Blacklists" as t %}
{% include "network/menu-item.html" with href=u text=t %}
{% url "network.rule_list" as u %}
{% trans "Rules" as t %}
{% include "network/menu-item.html" with href=u text=t %}
<li class="dropdown{% if "groups" in request.path %} active{% endif %}">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Groups <b class="caret"></b></a>
<ul class="dropdown-menu">
{% url "network.vlan_group_list" as u %}
{% trans "Vlan groups" as t %}
{% include "network/menu-item.html" with href=u text=t %}
{% url "network.group_list" as u %}
{% trans "Host groups" as t %}
{% include "network/menu-item.html" with href=u text=t %}
</ul>
</li>
{# <li><a href="/vlans/">{% trans "Vlans" %}</a></li> #}
{# <li><a href="/vlangroups/">{% trans "Vlan groups" %}</a></li> #}
{# <li><a href="/hostgroups/">{% trans "Host groups" %}</a></li> #}
{# <li><a href="/hosts/">{% trans "Hosts" %}</a></li> #}
{# <li><a href="/firewalls/">{% trans "Firewalls" %}</a></li> #}
{# <li><a href="/domains/">{% trans "Domains" %}</a></li> #}
{# <li><a href="/records/">{% trans "DNS records" %}</a></li> #}
{# <li><a href="/blacklists/">{% trans "Blacklists" %}</a></li> #}
{% extends "network/base.html" %}
{% load render_table from django_tables2 %}
{% load i18n %}
{% load l10n %}
{% load staticfiles %}
{% load crispy_forms_tags %}
{% block content %}
<div class="page-header">
<h2>{% trans "Create a new record" %}</h2>
</div>
<div class="row">
<div class="col-sm-6">
{% crispy form %}
</div>
<div class="col-sm-4">
</div><!-- col-sm-4 -->
</div><!-- row -->
{% endblock %}
{% block extra_etc %}
<script src="{% static "js/record.js" %}"></script>
{% endblock %}
~
{% extends "network/base.html" %}
{% load render_table from django_tables2 %}
{% load i18n %}
{% load l10n %}
{% load staticfiles %}
{% load crispy_forms_tags %}
{% block content %}
<div class="page-header">
<a href="{% url network.record_delete pk=record_pk %}" class="btn btn-danger pull-right"><i class="icon-remove-sign"></i> {% trans "Delete this record" %}</a>
<h2>{{ fqdn }}</h2>
</div>
<div class="row">
<div class="col-sm-6">
{% crispy form %}
</div>
</div>
{% endblock %}
{% block extra_etc %}
<script src="{% static "js/record.js" %}"></script>
{% endblock %}
{% extends "network/base.html" %}
{% load render_table from django_tables2 %}
{% load i18n %}
{% load l10n %}
{% load staticfiles %}
{% block content %}
<div class="page-header">
<a href="{% url "network.record_create" %}" class="btn btn-success pull-right"><i class="icon-plus-sign"></i> {% trans "Create a new record" %}</a>
<h1>
{% trans "Records" %}
<small>
{% trans "list of all records" %}
</small>
</h1>
</div>
<div class="table-responsive">
{% render_table table %}
</div>
{% endblock %}
{% extends "network/base.html" %}
{% load render_table from django_tables2 %}
{% load i18n %}
{% load l10n %}
{% load staticfiles %}
{% load crispy_forms_tags %}
{% block content %}
<div class="page-header">
<h2>{% trans "Create a new rule" %}</h2>
</div>
<div class="row">
<div class="col-sm-7">
{% crispy form %}
</div>
</div>
{% endblock %}
{% extends "network/base.html" %}
{% load render_table from django_tables2 %}
{% load i18n %}
{% load l10n %}
{% load staticfiles %}
{% load crispy_forms_tags %}
{% block content %}
<div class="page-header">
<a href="{% url network.rule_delete pk=rule.pk %}" class="btn btn-danger pull-right"><i class="icon-remove-sign"></i> {% trans "Delete this rule" %}</a>
<h3>
{% with rule as record %}
{% include "network/columns/host-rule.html" %}
{% endwith %}
</h3>
</div>
<div class="row">
<div class="col-sm-7">
{% crispy form %}
</div>
</div>
{% endblock %}
{% extends "network/base.html" %}
{% load render_table from django_tables2 %}
{% load i18n %}
{% load l10n %}
{% load staticfiles %}
{% block content %}
<div class="page-header">
<a href="{% url "network.rule_create" %}" class="btn btn-success pull-right"><i class="icon-plus-sign"></i> {% trans "Create a new rule" %}</a>
<h1>{% trans "Rules" %} <small>{% trans "list of all rules" %}</small></h1>
</div>
<div class="table-responsive">
{% render_table table %}
</div>
{% endblock %}
{% extends "network/base.html" %}
{% load render_table from django_tables2 %}
{% load i18n %}
{% load l10n %}
{% load staticfiles %}
{% load crispy_forms_tags %}
{% block content %}
<div class="page-header">
<h2>{% trans "Create a new vlan" %}</h2>
</div>
<div class="row">
<div class="col-sm-8">
{% crispy form %}
</div>
<div class="col-sm-4">
Halp
</div>
</div>
{% endblock %}
{% extends "network/base.html" %}
{% load render_table from django_tables2 %}
{% load i18n %}
{% load l10n %}
{% load staticfiles %}
{% load crispy_forms_tags %}
{% block content %}
<div class="page-header">
<a href="{% url network.vlan_delete vid=vlan_vid %}" class="btn btn-danger pull-right"><i class="icon-remove-sign"></i> {% trans "Delete this vlan" %}</a>
<h2>{{ form.name.value }} <small>{% trans "details of vlan" %}</small></h2>
</div>
<div class="row">
<div class="col-sm-8">
{% crispy form %}
</div>
<div class="col-sm-4">
{% render_table host_list %}
</div>
</div>
{% endblock %}
{% extends "network/base.html" %}
{% load render_table from django_tables2 %}
{% load i18n %}
{% load l10n %}
{% load staticfiles %}
{% load crispy_forms_tags %}
{% block content %}
<div class="page-header">
<h2>{% trans "Create a new vlan group" %}</h2>
</div>
<div class="row">
<div class="col-sm-6">
{% crispy form %}
</div>
</div>
{% endblock %}
{% extends "network/base.html" %}
{% load render_table from django_tables2 %}
{% load i18n %}
{% load l10n %}
{% load staticfiles %}
{% load crispy_forms_tags %}
{% block content %}
<div class="page-header">
<a href="{% url network.vlan_group_delete pk=vlangroup_pk %}" class="btn btn-danger pull-right"><i class="icon-remove-sign"></i> {% trans "Delete this group" %}</a>
<h1>{{ form.name.value }}</h1>
</div>
<div class="row">
<div class="col-sm-6">
{% crispy form %}
</div>
</div>
{% endblock %}
{% extends "network/base.html" %}
{% load render_table from django_tables2 %}
{% load i18n %}
{% load l10n %}
{% load staticfiles %}
{% block content %}
<div class="page-header">
<a href="{% url "network.vlan_group_create" %}" class="btn btn-success pull-right"><i class="icon-plus-sign"></i> {% trans "Create a new vlan group" %}</a>
<h1>{% trans "Vlan groups" %}</h1>
</div>
{% render_table table %}
{% endblock %}
{% extends "network/base.html" %}
{% load render_table from django_tables2 %}
{% load i18n %}
{% load l10n %}
{% load staticfiles %}
{% block content %}
<div class="page-header">
<a href="{% url "network.vlan_create" %}" class="btn btn-success pull-right"><i class="icon-plus-sign"></i> {% trans "Create a new vlan" %}</a>
<h1>Vlans <small>{% trans "list of all vlans" %}</small></h1>
</div>
<div class="table-responsive">
{% render_table table %}
</div>
{% endblock %}
"""
This file demonstrates writing tests using the unittest module. These will pass
when you run "manage.py test".
Replace this with more appropriate tests for your application.
"""
from django.test import TestCase
class SimpleTest(TestCase):
def test_basic_addition(self):
"""
Tests that 1 + 1 always equals 2.
"""
self.assertEqual(1 + 1, 2)
from django.conf.urls import patterns, url
from .views import (IndexView,
HostList, HostDetail, HostCreate, HostDelete,
VlanList, VlanDetail, VlanDelete, VlanCreate,
DomainList, DomainDetail, DomainDelete, DomainCreate,
GroupList, GroupDetail, GroupDelete, GroupCreate,
RecordList, RecordDetail, RecordCreate, RecordDelete,
BlacklistList, BlacklistDetail, BlacklistDelete,
BlacklistCreate,
RuleList, RuleDetail, RuleDelete, RuleCreate,
VlanGroupList, VlanGroupDetail, VlanGroupDelete,
VlanGroupCreate,
remove_host_group, add_host_group)
js_info_dict = {
'packages': ('network', ),
}
urlpatterns = patterns(
'',
url('^$', IndexView.as_view(), name='network.index'),
url('^blacklists/$', BlacklistList.as_view(),
name='network.blacklist_list'),
url('^blacklists/create$', BlacklistCreate.as_view(),
name='network.blacklist_create'),
url('^blacklists/(?P<pk>\d+)/$', BlacklistDetail.as_view(),
name='network.blacklist'),
url('^blacklists/delete/(?P<pk>\d+)/$', BlacklistDelete.as_view(),
name="network.blacklist_delete"),
url('^domains/$', DomainList.as_view(), name='network.domain_list'),
url('^domains/create$', DomainCreate.as_view(),
name='network.domain_create'),
url('^domains/(?P<pk>\d+)/$', DomainDetail.as_view(),
name='network.domain'),
url('^domains/delete/(?P<pk>\d+)/$', DomainDelete.as_view(),
name="network.domain_delete"),
url('^groups/$', GroupList.as_view(), name='network.group_list'),
url('^groups/create$', GroupCreate.as_view(),
name='network.group_create'),
url('^groups/(?P<pk>\d+)/$', GroupDetail.as_view(), name='network.group'),
url('^groups/delete/(?P<pk>\d+)/$', GroupDelete.as_view(),
name="network.group_delete"),
url('^hosts/$', HostList.as_view(), name='network.host_list'),
url('^hosts/create$', HostCreate.as_view(), name='network.host_create'),
url('^hosts/(?P<pk>\d+)/$', HostDetail.as_view(), name='network.host'),
url('^hosts/delete/(?P<pk>\d+)/$', HostDelete.as_view(),
name="network.host_delete"),
url('^records/$', RecordList.as_view(), name='network.record_list'),
url('^records/create$', RecordCreate.as_view(),
name='network.record_create'),
url('^records/(?P<pk>\d+)/$', RecordDetail.as_view(),
name='network.record'),
url('^records/delete/(?P<pk>\d+)/$', RecordDelete.as_view(),
name="network.record_delete"),
url('^rules/$', RuleList.as_view(), name='network.rule_list'),
url('^rules/create$', RuleCreate.as_view(), name='network.rule_create'),
url('^rules/(?P<pk>\d+)/$', RuleDetail.as_view(),
name='network.rule'),
url('^vlans/$', VlanList.as_view(), name='network.vlan_list'),
url('^vlans/create$', VlanCreate.as_view(), name='network.vlan_create'),
url('^vlans/(?P<vid>\d+)/$', VlanDetail.as_view(), name='network.vlan'),
url('^vlans/delete/(?P<vid>\d+)/$', VlanDelete.as_view(),
name="network.vlan_delete"),
url('^vlangroups/$', VlanGroupList.as_view(),
name='network.vlan_group_list'),
url('^vlangroups/create$', VlanGroupCreate.as_view(),
name='network.vlan_group_create'),
url('^vlangroups/(?P<pk>\d+)/$', VlanGroupDetail.as_view(),
name='network.vlan_group'),
url('^vlangroups/delete/(?P<pk>\d+)/$', VlanGroupDelete.as_view(),
name="network.vlan_group_delete"),
url('^rules/delete/(?P<pk>\d+)/$', RuleDelete.as_view(),
name="network.rule_delete"),
url('^hosts/(?P<pk>\d+)/remove/(?P<group_pk>\d+)/$', remove_host_group,
name='network.remove_host_group'),
url('^hosts/(?P<pk>\d+)/add/$', add_host_group,
name='network.add_host_group'),
url(r'^jsi18n/$', 'django.views.i18n.javascript_catalog', js_info_dict,
name="network.js_catalog"),
)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment