From 3218b2b802b040b6110780eb95cf84a9f3101505 Mon Sep 17 00:00:00 2001 From: lombardofr Date: Mon, 29 Oct 2018 13:41:08 +0100 Subject: [PATCH] new django app descriptionhandler Change-Id: I0d7bdece62413ad1a9aa30c64fbd9f785705dc8e Signed-off-by: lombardofr --- .gitignore | 1 + descriptorhandler/__init__.py | 0 descriptorhandler/apps.py | 23 + descriptorhandler/models.py | 21 + descriptorhandler/template/composer.html | 80 +++ .../template}/descriptor_new.html | 6 +- .../template}/descriptor_view.html | 6 +- .../template}/descriptor_view_base.html | 0 .../template}/descriptorlist.html | 6 +- .../template}/modal/choose_node_id.html | 0 .../template}/modal/create_link_chooser.html | 0 descriptorhandler/urls.py | 30 ++ descriptorhandler/views.py | 458 ++++++++++++++++++ .../template/instance_list_ns.html | 2 +- .../descriptor/modal/choose_node_id.html | 27 -- .../project/osm/osm_project_descriptors.html | 6 +- .../project/osm/osm_project_details.html | 4 +- .../project/osm/osm_project_left_sidebar.html | 4 +- .../template/project/osm/project_graph.html | 5 +- .../template/project/project_graph_base.html | 5 +- projecthandler/urls/project.py | 20 +- projecthandler/views.py | 414 ---------------- sdnctrlhandler/admin.py | 3 - sdnctrlhandler/apps.py | 16 + sdnctrlhandler/models.py | 16 + sdnctrlhandler/tests.py | 3 - sf_t3d/context_processor.py | 16 + sf_t3d/settings.py | 28 +- sf_t3d/urls.py | 31 +- sf_t3d/views.py | 20 +- sf_t3d/wsgi.py | 16 + static/TopologyComposer/css/composer.css | 10 + userhandler/admin.py | 3 - userhandler/apps.py | 16 + userhandler/tests.py | 3 - userhandler/views.py | 16 + 36 files changed, 790 insertions(+), 525 deletions(-) create mode 100644 descriptorhandler/__init__.py create mode 100644 descriptorhandler/apps.py create mode 100644 descriptorhandler/models.py create mode 100644 descriptorhandler/template/composer.html rename {projecthandler/template/project/osm/descriptor => descriptorhandler/template}/descriptor_new.html (85%) rename {projecthandler/template/project/osm/descriptor => descriptorhandler/template}/descriptor_view.html (95%) rename {projecthandler/template/project/descriptor => descriptorhandler/template}/descriptor_view_base.html (100%) rename {projecthandler/template/project/osm/descriptor => descriptorhandler/template}/descriptorlist.html (82%) rename {projecthandler/template/project/osm/descriptor => descriptorhandler/template}/modal/choose_node_id.html (100%) rename {projecthandler/template/project/osm/descriptor => descriptorhandler/template}/modal/create_link_chooser.html (100%) create mode 100644 descriptorhandler/urls.py create mode 100644 descriptorhandler/views.py delete mode 100644 projecthandler/template/project/descriptor/modal/choose_node_id.html delete mode 100644 sdnctrlhandler/admin.py delete mode 100644 sdnctrlhandler/tests.py delete mode 100644 userhandler/admin.py delete mode 100644 userhandler/tests.py diff --git a/.gitignore b/.gitignore index da69467..6672790 100644 --- a/.gitignore +++ b/.gitignore @@ -46,6 +46,7 @@ static/bower_components #migrations projecthandler/migrations/ +descriptorhandler/migrations/ instancehandler/migrations sdnctrlhandler/migrations authosm/migrations diff --git a/descriptorhandler/__init__.py b/descriptorhandler/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/descriptorhandler/apps.py b/descriptorhandler/apps.py new file mode 100644 index 0000000..9d952fc --- /dev/null +++ b/descriptorhandler/apps.py @@ -0,0 +1,23 @@ +# +# Copyright 2018 EveryUP Srl +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +from __future__ import unicode_literals + +from django.apps import AppConfig + + +class DescriptorhandlerConfig(AppConfig): + name = 'descriptorhandler' diff --git a/descriptorhandler/models.py b/descriptorhandler/models.py new file mode 100644 index 0000000..ed2a5ae --- /dev/null +++ b/descriptorhandler/models.py @@ -0,0 +1,21 @@ +# +# Copyright 2018 EveryUP Srl +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +from __future__ import unicode_literals + +from django.db import models + +# Create your models here. diff --git a/descriptorhandler/template/composer.html b/descriptorhandler/template/composer.html new file mode 100644 index 0000000..cad68fa --- /dev/null +++ b/descriptorhandler/template/composer.html @@ -0,0 +1,80 @@ +{% extends "base.html" %} +{% load get %} +{% load staticfiles %} + + + +{% block head_block %} + {{ block.super }} + + + + + + +{% endblock %} +{% block title_header_big %} + {{ block.super }} +{% endblock %} +{% block left_sidebar %} + {% include 'osm/osm_project_left_sidebar.html' %} +{% endblock %} + + +{% block breadcrumb_body %} + {{ block.super }} + {% comment %}
  • {{ type|upper }} Descriptors
  • +
  • {{ type|upper }} Topology
  • {% endcomment %} +{% endblock %} + +{% block content_body %} + {{ block.super }} + {% csrf_token %} +
    +
    +
    + +
    +
    +
    + + +
    +
    +
    +
    +
    + +
    +
    +
    + +{% endblock %} + +{% block resource_block %} + {{ block.super }} + + + + + + + + + + + + + +{# #} + +{% endblock %} + +{% block footer %} + {% include "footer.html" %} +{% endblock %} diff --git a/projecthandler/template/project/osm/descriptor/descriptor_new.html b/descriptorhandler/template/descriptor_new.html similarity index 85% rename from projecthandler/template/project/osm/descriptor/descriptor_new.html rename to descriptorhandler/template/descriptor_new.html index 7711b57..2551f30 100644 --- a/projecthandler/template/project/osm/descriptor/descriptor_new.html +++ b/descriptorhandler/template/descriptor_new.html @@ -1,4 +1,4 @@ -{% extends "descriptor/descriptor_view_base.html" %} +{% extends "/descriptor_view_base.html" %} {% load staticfiles %} @@ -50,9 +50,9 @@ Onboard new {{ descriptor_type }} package {{ block.super }}