|
@@ -11,7 +11,7 @@ from django.shortcuts import render_to_r
|
|
|
from django.views.generic import TemplateView, DetailView, CreateView, UpdateView, DeleteView
|
|
|
|
|
|
# Third-party application imports.
|
|
|
from braces.views import MultiplePermissionsRequiredMixin
|
|
|
from braces.views import MultiplePermissionsRequiredMixin, SetHeadlineMixin
|
|
|
|
|
|
# Application imports.
|
|
|
from .forms import ProjectForm, LocationForm, EntityForm, InterfaceForm, CommunicationForm
|
|
@@ -247,14 +247,15 @@ def project_iptables(request, project_id
|
|
|
return response
|
|
|
|
|
|
|
|
|
class ProjectCreateView(MultiplePermissionsRequiredMixin, CreateView):
|
|
|
class ProjectCreateView(SetHeadlineMixin, MultiplePermissionsRequiredMixin, CreateView):
|
|
|
"""
|
|
|
View for creating a new project.
|
|
|
"""
|
|
|
|
|
|
model = Project
|
|
|
form_class = ProjectForm
|
|
|
template_name_suffix = "_create_form"
|
|
|
headline = "Add new project"
|
|
|
template_name = "conntrackt/create_form.html"
|
|
|
|
|
|
# Required permissions.
|
|
|
permissions = {
|
|
@@ -311,14 +312,15 @@ class ProjectDeleteView(MultiplePermissi
|
|
|
return super(ProjectDeleteView, self).post(*args, **kwargs)
|
|
|
|
|
|
|
|
|
class LocationCreateView(MultiplePermissionsRequiredMixin, CreateView):
|
|
|
class LocationCreateView(SetHeadlineMixin, MultiplePermissionsRequiredMixin, CreateView):
|
|
|
"""
|
|
|
View for creating a new location.
|
|
|
"""
|
|
|
|
|
|
model = Location
|
|
|
form_class = LocationForm
|
|
|
template_name_suffix = "_create_form"
|
|
|
headline = "Add new location"
|
|
|
template_name = "conntrackt/create_form.html"
|
|
|
|
|
|
# Required permissions.
|
|
|
permissions = {
|
|
@@ -379,14 +381,15 @@ class LocationDeleteView(MultiplePermiss
|
|
|
return super(LocationDeleteView, self).post(*args, **kwargs)
|
|
|
|
|
|
|
|
|
class EntityCreateView(MultiplePermissionsRequiredMixin, CreateView):
|
|
|
class EntityCreateView(SetHeadlineMixin, MultiplePermissionsRequiredMixin, CreateView):
|
|
|
"""
|
|
|
View for creating a new entity.
|
|
|
"""
|
|
|
|
|
|
model = Entity
|
|
|
form_class = EntityForm
|
|
|
template_name_suffix = "_create_form"
|
|
|
headline = "Add new entity"
|
|
|
template_name = "conntrackt/create_form.html"
|
|
|
|
|
|
# Required permissions.
|
|
|
permissions = {
|
|
@@ -490,14 +493,15 @@ class EntityDeleteView(MultiplePermissio
|
|
|
return super(EntityDeleteView, self).delete(*args, **kwargs)
|
|
|
|
|
|
|
|
|
class InterfaceCreateView(MultiplePermissionsRequiredMixin, CreateView):
|
|
|
class InterfaceCreateView(SetHeadlineMixin, MultiplePermissionsRequiredMixin, CreateView):
|
|
|
"""
|
|
|
View for creating a new interface.
|
|
|
"""
|
|
|
|
|
|
model = Interface
|
|
|
form_class = InterfaceForm
|
|
|
template_name_suffix = "_create_form"
|
|
|
headline = "Add new interface"
|
|
|
template_name = "conntrackt/create_form.html"
|
|
|
|
|
|
# Required permissions
|
|
|
permissions = {
|
|
@@ -630,14 +634,15 @@ class InterfaceDeleteView(MultiplePermis
|
|
|
return super(InterfaceDeleteView, self).delete(*args, **kwargs)
|
|
|
|
|
|
|
|
|
class CommunicationCreateView(MultiplePermissionsRequiredMixin, CreateView):
|
|
|
class CommunicationCreateView(SetHeadlineMixin, MultiplePermissionsRequiredMixin, CreateView):
|
|
|
"""
|
|
|
View for creating a new communication.
|
|
|
"""
|
|
|
|
|
|
model = Communication
|
|
|
form_class = CommunicationForm
|
|
|
template_name_suffix = "_create_form"
|
|
|
headline = "Add new communication"
|
|
|
template_name = "conntrackt/create_form.html"
|
|
|
|
|
|
# Required permissions
|
|
|
permissions = {
|