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 %}
...@@ -5,8 +5,9 @@ ...@@ -5,8 +5,9 @@
{% load staticfiles %} {% load staticfiles %}
{% block content %} {% block content %}
<div class="page-header"> <div class="page-header">
<h1>Blacklist <small></small></h1> <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> </div>
{% render_table table %} {% render_table table %}
......
{% 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 %}
...@@ -5,8 +5,9 @@ ...@@ -5,8 +5,9 @@
{% load staticfiles %} {% load staticfiles %}
{% block content %} {% block content %}
<div class="page-header"> <div class="page-header">
<h1>Domains <small>list of all domains</small></h1> <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> </div>
{% render_table table %} {% render_table table %}
......
{% 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 %}
...@@ -5,8 +5,9 @@ ...@@ -5,8 +5,9 @@
{% load staticfiles %} {% load staticfiles %}
{% block content %} {% block content %}
<div class="page-header"> <div class="page-header">
<h1>Host groups <small>list of all host groups</small></h1> <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> </div>
{% render_table table %} {% render_table table %}
......
...@@ -5,15 +5,12 @@ ...@@ -5,15 +5,12 @@
{% load staticfiles %} {% load staticfiles %}
{% block content %} {% block content %}
<style>
</style>
<div class="page-header"> <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> <h1>
Hosts Hosts
<small> <small>
list of all hosts list of all hosts
<a href="{% url network.host_create %}"><i class="icon-plus"></i></a>
</small> </small>
</h1> </h1>
</div> </div>
......
...@@ -6,11 +6,11 @@ ...@@ -6,11 +6,11 @@
{% block content %} {% block content %}
<div class="page-header"> <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> <h1>
Records Records
<small> <small>
list of all records list of all records
<a href="{% url network.record_create %}"><i class="icon-plus"></i></a>
</small> </small>
</h1> </h1>
</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">
<h3>Create a new rule</h3>
</div>
<div class="row">
<div class="col-sm-7">
{% crispy form %}
</div>
</div>
{% endblock %}
...@@ -6,7 +6,8 @@ ...@@ -6,7 +6,8 @@
{% block content %} {% block content %}
<div class="page-header"> <div class="page-header">
<h1>Rules <small>list of all rules</small></h1> <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> </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 @@ ...@@ -7,7 +7,7 @@
{% block content %} {% block content %}
<div class="page-header"> <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> <h1>{{ form.name.value }} <small>details of vlan group</small></h1>
</div> </div>
......
...@@ -6,7 +6,8 @@ ...@@ -6,7 +6,8 @@
{% block content %} {% block content %}
<div class="page-header"> <div class="page-header">
<h1>Vlan groups <small>list of all vlan groups</small></h1> <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> </div>
{% render_table table %} {% render_table table %}
......
...@@ -5,8 +5,9 @@ ...@@ -5,8 +5,9 @@
{% load staticfiles %} {% load staticfiles %}
{% block content %} {% block content %}
<div class="page-header"> <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> </div>
{% render_table table %} {% render_table table %}
......
...@@ -2,13 +2,15 @@ from django.conf.urls import patterns, url ...@@ -2,13 +2,15 @@ from django.conf.urls import patterns, url
from .views import (IndexView, from .views import (IndexView,
HostList, HostDetail, HostCreate, HostDelete, HostList, HostDetail, HostCreate, HostDelete,
VlanList, VlanDetail, VlanDelete, VlanList, VlanDetail, VlanDelete, VlanCreate,
DomainList, DomainDetail, DomainDelete, DomainList, DomainDetail, DomainDelete, DomainCreate,
GroupList, GroupDetail, GroupDelete, GroupList, GroupDetail, GroupDelete, GroupCreate,
RecordList, RecordDetail, RecordCreate, RecordDelete, RecordList, RecordDetail, RecordCreate, RecordDelete,
BlacklistList, BlacklistDetail, BlacklistDelete, BlacklistList, BlacklistDetail, BlacklistDelete,
RuleList, RuleDetail, RuleDelete, BlacklistCreate,
RuleList, RuleDetail, RuleDelete, RuleCreate,
VlanGroupList, VlanGroupDetail, VlanGroupDelete, VlanGroupList, VlanGroupDetail, VlanGroupDelete,
VlanGroupCreate,
remove_host_group, add_host_group) remove_host_group, add_host_group)
js_info_dict = { js_info_dict = {
...@@ -20,16 +22,22 @@ urlpatterns = patterns( ...@@ -20,16 +22,22 @@ urlpatterns = patterns(
url('^$', IndexView.as_view(), name='network.index'), url('^$', IndexView.as_view(), name='network.index'),
url('^blacklists/$', BlacklistList.as_view(), url('^blacklists/$', BlacklistList.as_view(),
name='network.blacklist_list'), name='network.blacklist_list'),
url('^blacklists/create$', BlacklistCreate.as_view(),
name='network.blacklist_create'),
url('^blacklists/(?P<pk>\d+)/$', BlacklistDetail.as_view(), url('^blacklists/(?P<pk>\d+)/$', BlacklistDetail.as_view(),
name='network.blacklist'), name='network.blacklist'),
url('^blacklists/delete/(?P<pk>\d+)/$', BlacklistDelete.as_view(), url('^blacklists/delete/(?P<pk>\d+)/$', BlacklistDelete.as_view(),
name="network.blacklist_delete"), name="network.blacklist_delete"),
url('^domains/$', DomainList.as_view(), name='network.domain_list'), 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(), url('^domains/(?P<pk>\d+)/$', DomainDetail.as_view(),
name='network.domain'), name='network.domain'),
url('^domains/delete/(?P<pk>\d+)/$', DomainDelete.as_view(), url('^domains/delete/(?P<pk>\d+)/$', DomainDelete.as_view(),
name="network.domain_delete"), name="network.domain_delete"),
url('^groups/$', GroupList.as_view(), name='network.group_list'), 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/(?P<pk>\d+)/$', GroupDetail.as_view(), name='network.group'),
url('^groups/delete/(?P<pk>\d+)/$', GroupDelete.as_view(), url('^groups/delete/(?P<pk>\d+)/$', GroupDelete.as_view(),
name="network.group_delete"), name="network.group_delete"),
...@@ -46,18 +54,22 @@ urlpatterns = patterns( ...@@ -46,18 +54,22 @@ urlpatterns = patterns(
url('^records/delete/(?P<pk>\d+)/$', RecordDelete.as_view(), url('^records/delete/(?P<pk>\d+)/$', RecordDelete.as_view(),
name="network.record_delete"), name="network.record_delete"),
url('^rules/$', RuleList.as_view(), name='network.rule_list'), 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(), url('^rules/(?P<pk>\d+)/$', RuleDetail.as_view(),
name='network.rule'), name='network.rule'),
url('^vlans/$', VlanList.as_view(), name='network.vlan_list'), 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/(?P<vid>\d+)/$', VlanDetail.as_view(), name='network.vlan'),
url('^vlans/delete/(?P<vid>\d+)/$', VlanDelete.as_view(), url('^vlans/delete/(?P<vid>\d+)/$', VlanDelete.as_view(),
name="network.vlan_delete"), name="network.vlan_delete"),
url('^vlangroups/$', VlanGroupList.as_view(), url('^vlangroups/$', VlanGroupList.as_view(),
name='network.vlan_group_list'), name='network.vlan_group_list'),
url('^vlangroups/create$', VlanGroupCreate.as_view(),
name='network.vlan_group_create'),
url('^vlangroups/(?P<pk>\d+)/$', VlanGroupDetail.as_view(), url('^vlangroups/(?P<pk>\d+)/$', VlanGroupDetail.as_view(),
name='network.vlan_group'), name='network.vlan_group'),
url('^vlangroups/delete/(?P<pk>\d+)/$', VlanGroupDelete.as_view(), 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(), url('^rules/delete/(?P<pk>\d+)/$', RuleDelete.as_view(),
name="network.rule_delete"), name="network.rule_delete"),
url('^hosts/(?P<pk>\d+)/remove/(?P<group_pk>\d+)/$', remove_host_group, url('^hosts/(?P<pk>\d+)/remove/(?P<group_pk>\d+)/$', remove_host_group,
......
...@@ -76,6 +76,12 @@ class BlacklistDetail(UpdateView): ...@@ -76,6 +76,12 @@ class BlacklistDetail(UpdateView):
return context return context
class BlacklistCreate(CreateView):
model = Blacklist
template_name = "network/blacklist-create.html"
form_class = BlacklistForm
class BlacklistDelete(DeleteView): class BlacklistDelete(DeleteView):
model = Blacklist model = Blacklist
template_name = "network/confirm/base_delete.html" template_name = "network/confirm/base_delete.html"
...@@ -120,6 +126,12 @@ class DomainDetail(UpdateView): ...@@ -120,6 +126,12 @@ class DomainDetail(UpdateView):
return context return context
class DomainCreate(CreateView):
model = Domain
template_name = "network/domain-create.html"
form_class = DomainForm
class DomainDelete(DeleteView): class DomainDelete(DeleteView):
model = Domain model = Domain
template_name = "network/confirm/base_delete.html" template_name = "network/confirm/base_delete.html"
...@@ -139,6 +151,12 @@ class GroupList(SingleTableView): ...@@ -139,6 +151,12 @@ class GroupList(SingleTableView):
table_pagination = False table_pagination = False
class GroupCreate(CreateView):
model = Group
template_name = "network/group-create.html"
form_class = GroupForm
class GroupDetail(UpdateView): class GroupDetail(UpdateView):
model = Group model = Group
template_name = "network/group-edit.html" template_name = "network/group-edit.html"
...@@ -360,6 +378,12 @@ class RuleDetail(UpdateView): ...@@ -360,6 +378,12 @@ class RuleDetail(UpdateView):
return context return context
class RuleCreate(CreateView):
model = Rule
template_name = "network/rule-create.html"
form_class = RuleForm
class RuleDelete(DeleteView): class RuleDelete(DeleteView):
model = Rule model = Rule
template_name = "network/confirm/base_delete.html" template_name = "network/confirm/base_delete.html"
...@@ -396,6 +420,12 @@ class VlanDetail(UpdateView): ...@@ -396,6 +420,12 @@ class VlanDetail(UpdateView):
success_url = reverse_lazy('network.vlan_list') success_url = reverse_lazy('network.vlan_list')
class VlanCreate(CreateView):
model = Vlan
template_name = "network/vlan-create.html"
form_class = VlanForm
class VlanDelete(DeleteView): class VlanDelete(DeleteView):
model = Vlan model = Vlan
template_name = "network/confirm/base_delete.html" template_name = "network/confirm/base_delete.html"
...@@ -466,6 +496,12 @@ class VlanGroupDetail(UpdateView): ...@@ -466,6 +496,12 @@ class VlanGroupDetail(UpdateView):
return context return context
class VlanGroupCreate(CreateView):
model = VlanGroup
template_name = "network/vlan-group-create.html"
form_class = VlanGroupForm
class VlanGroupDelete(DeleteView): class VlanGroupDelete(DeleteView):
model = VlanGroup model = VlanGroup
template_name = "network/confirm/base_delete.html" 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