Commit 154f8fdb by Kálmán Viktor

network: object creation

parent f80cbaf7
{% 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">
<h1>Create a blacklist</h1>
</div>
<div class="row">
<div class="col-sm-4">
{% crispy form %}
</div>
</div>
{% endblock %}
......@@ -6,6 +6,7 @@
{% block content %}
<div class="page-header">
<a href="{% url network.blacklist_create %}" class="btn btn-success pull-right"><i class="icon-plus-sign"></i> Create a new blacklist</a>
<h1>Blacklist <small></small></h1>
</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">
<h1>Create a new domain <small></small></h1>
</div>
<div class="row">
<div class="col-sm-4">
{% crispy form %}
</div>
</div>
{% endblock %}
......@@ -6,6 +6,7 @@
{% block content %}
<div class="page-header">
<a href="{% url network.domain_create %}" class="btn btn-success pull-right"><i class="icon-plus-sign"></i> Create a new domain</a>
<h1>Domains <small>list of all domains</small></h1>
</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">
<h1>Create a new host group</small></h1>
</div>
<div class="row">
<div class="col-sm-6">
{% crispy form %}
</div>
</div>
{% endblock %}
......@@ -6,6 +6,7 @@
{% block content %}
<div class="page-header">
<a href="{% url network.group_create %}" class="btn btn-success pull-right"><i class="icon-plus-sign"></i> Create a new host group</a>
<h1>Host groups <small>list of all host groups</small></h1>
</div>
......
......@@ -5,15 +5,12 @@
{% load staticfiles %}
{% block content %}
<style>
</style>
<div class="page-header">
<a href="{% url network.host_create %}" class="btn btn-success pull-right"><i class="icon-plus-sign"></i> Create a new host</a>
<h1>
Hosts
<small>
list of all hosts
<a href="{% url network.host_create %}"><i class="icon-plus"></i></a>
</small>
</h1>
</div>
......
......@@ -6,11 +6,11 @@
{% block content %}
<div class="page-header">
<a href="{% url network.record_create %}" class="btn btn-success pull-right"><i class="icon-plus-sign"></i> Create a new record</a>
<h1>
Records
<small>
list of all records
<a href="{% url network.record_create %}"><i class="icon-plus"></i></a>
</small>
</h1>
</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">
<h3>Create a new rule</h3>
</div>
<div class="row">
<div class="col-sm-7">
{% crispy form %}
</div>
</div>
{% endblock %}
......@@ -6,6 +6,7 @@
{% block content %}
<div class="page-header">
<a href="{% url network.rule_create %}" class="btn btn-success pull-right"><i class="icon-plus-sign"></i> Create a new rule</a>
<h1>Rules <small>list of all rules</small></h1>
</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">
<h1>Create a new Vlan</h1>
</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">
<h1>Create a new vlan group</h1>
</div>
<div class="row">
<div class="col-sm-6">
{% crispy form %}
</div>
</div>
{% endblock %}
......@@ -7,7 +7,7 @@
{% block content %}
<div class="page-header">
<a href="{% url network.vlangroup_delete pk=vlangroup_pk %}" class="btn btn-danger pull-right"><i class="icon-remove-sign"></i> Delete this group</a>
<a href="{% url network.vlan_group_delete pk=vlangroup_pk %}" class="btn btn-danger pull-right"><i class="icon-remove-sign"></i> Delete this group</a>
<h1>{{ form.name.value }} <small>details of vlan group</small></h1>
</div>
......
......@@ -6,6 +6,7 @@
{% 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> Create a new vlan group</a>
<h1>Vlan groups <small>list of all vlan groups</small></h1>
</div>
......
......@@ -6,7 +6,8 @@
{% block content %}
<div class="page-header">
<h1>Vlans <small>list of all vlans</small></h1>
<a href="{% url network.vlan_create %}" class="btn btn-success pull-right"><i class="icon-plus-sign"></i> Create a new vlan</a>
<h1>Vlans <small>list of all vlans</small></h1>
</div>
{% render_table table %}
......
......@@ -2,13 +2,15 @@ from django.conf.urls import patterns, url
from .views import (IndexView,
HostList, HostDetail, HostCreate, HostDelete,
VlanList, VlanDetail, VlanDelete,
DomainList, DomainDetail, DomainDelete,
GroupList, GroupDetail, GroupDelete,
VlanList, VlanDetail, VlanDelete, VlanCreate,
DomainList, DomainDetail, DomainDelete, DomainCreate,
GroupList, GroupDetail, GroupDelete, GroupCreate,
RecordList, RecordDetail, RecordCreate, RecordDelete,
BlacklistList, BlacklistDetail, BlacklistDelete,
RuleList, RuleDetail, RuleDelete,
BlacklistCreate,
RuleList, RuleDetail, RuleDelete, RuleCreate,
VlanGroupList, VlanGroupDetail, VlanGroupDelete,
VlanGroupCreate,
remove_host_group, add_host_group)
js_info_dict = {
......@@ -20,16 +22,22 @@ 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"),
......@@ -46,18 +54,22 @@ urlpatterns = patterns(
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.vlangroup_delete"),
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,
......
......@@ -76,6 +76,12 @@ class BlacklistDetail(UpdateView):
return context
class BlacklistCreate(CreateView):
model = Blacklist
template_name = "network/blacklist-create.html"
form_class = BlacklistForm
class BlacklistDelete(DeleteView):
model = Blacklist
template_name = "network/confirm/base_delete.html"
......@@ -120,6 +126,12 @@ class DomainDetail(UpdateView):
return context
class DomainCreate(CreateView):
model = Domain
template_name = "network/domain-create.html"
form_class = DomainForm
class DomainDelete(DeleteView):
model = Domain
template_name = "network/confirm/base_delete.html"
......@@ -139,6 +151,12 @@ class GroupList(SingleTableView):
table_pagination = False
class GroupCreate(CreateView):
model = Group
template_name = "network/group-create.html"
form_class = GroupForm
class GroupDetail(UpdateView):
model = Group
template_name = "network/group-edit.html"
......@@ -360,6 +378,12 @@ class RuleDetail(UpdateView):
return context
class RuleCreate(CreateView):
model = Rule
template_name = "network/rule-create.html"
form_class = RuleForm
class RuleDelete(DeleteView):
model = Rule
template_name = "network/confirm/base_delete.html"
......@@ -396,6 +420,12 @@ class VlanDetail(UpdateView):
success_url = reverse_lazy('network.vlan_list')
class VlanCreate(CreateView):
model = Vlan
template_name = "network/vlan-create.html"
form_class = VlanForm
class VlanDelete(DeleteView):
model = Vlan
template_name = "network/confirm/base_delete.html"
......@@ -466,6 +496,12 @@ class VlanGroupDetail(UpdateView):
return context
class VlanGroupCreate(CreateView):
model = VlanGroup
template_name = "network/vlan-group-create.html"
form_class = VlanGroupForm
class VlanGroupDelete(DeleteView):
model = VlanGroup
template_name = "network/confirm/base_delete.html"
......
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