From 86e1915a49bd7e743ecfa3b7db12080361d73dd0 Mon Sep 17 00:00:00 2001 From: Retspen Date: Tue, 21 Apr 2015 14:46:58 +0300 Subject: [PATCH] Fixed some bugs and redesigned html --- computes/templates/overview.html | 6 +- computes/views.py | 4 +- instances/templates/instance.html | 40 +++--- instances/templates/instances.html | 10 +- static/css/sb-admin.css | 224 ----------------------------- static/css/webvirtcloud.css | 53 +------ storages/templates/storage.html | 2 +- templates/base.html | 38 ++--- templates/navbar.html | 72 ++++++---- templates/sidebar.html | 21 --- 10 files changed, 93 insertions(+), 377 deletions(-) delete mode 100755 static/css/sb-admin.css delete mode 100644 templates/sidebar.html diff --git a/computes/templates/overview.html b/computes/templates/overview.html index abdb2cd..f251a8f 100644 --- a/computes/templates/overview.html +++ b/computes/templates/overview.html @@ -51,7 +51,7 @@

{{ uri_conn }}

-
+
@@ -61,7 +61,7 @@
- +
@@ -73,7 +73,7 @@
- +
diff --git a/computes/views.py b/computes/views.py index b72aeb9..39af4d0 100644 --- a/computes/views.py +++ b/computes/views.py @@ -48,8 +48,8 @@ def computes(request): if 'host_del' in request.POST: compute_id = request.POST.get('host_id', '') try: - del_user_inst_on_host = UserInstance.objects.filter(compute_id=compute_id) - del_user_inst_on_host.save() + del_user_inst_on_host = UserInstance.objects.filter(instance__compute_id=compute_id) + del_user_inst_on_host.delete() finally: try: del_inst_on_host = Instance.objects.filter(compute_id=compute_id) diff --git a/instances/templates/instance.html b/instances/templates/instance.html index 00f698e..abd429b 100644 --- a/instances/templates/instance.html +++ b/instances/templates/instance.html @@ -3,12 +3,12 @@ {% block title %}{% trans "Instance" %} - {{ vname }}{% endblock %} {% block content %} +
+ +
+ {% include 'errors_block.html' %} @@ -328,7 +336,7 @@

{% trans "This may take more than an hour, depending on how much content is on your droplet and how large the disk is." %}

{% csrf_token %}
-
+
@@ -716,7 +724,7 @@
- +
@@ -729,7 +737,7 @@
- + {% trans "In" %} {% trans "Out" %}
@@ -745,7 +753,7 @@
- + {% trans "Read" %} {% trans "Write" %}
diff --git a/instances/templates/instances.html b/instances/templates/instances.html index c3d8161..c707c35 100644 --- a/instances/templates/instances.html +++ b/instances/templates/instances.html @@ -9,10 +9,12 @@
- {% include 'create_inst_block.html' %} - + {% if all_host_vms %} + {% include 'create_inst_block.html' %} + + {% endif %}

{% trans "Instances" %}

diff --git a/static/css/sb-admin.css b/static/css/sb-admin.css deleted file mode 100755 index a625e6e..0000000 --- a/static/css/sb-admin.css +++ /dev/null @@ -1,224 +0,0 @@ -/*! - * Start Bootstrap - SB Admin Bootstrap Admin Template (http://startbootstrap.com) - * Code licensed under the Apache License v2.0. - * For details, see http://www.apache.org/licenses/LICENSE-2.0. - */ - -/* Global Styles */ - -body { - margin-top: 100px; - background-color: #222; -} - -@media(min-width:768px) { - body { - margin-top: 50px; - } -} - -#wrapper { - padding-left: 0; -} - -#page-wrapper { - width: 100%; - padding: 0; - background-color: #fff; -} - -.huge { - font-size: 50px; - line-height: normal; -} - -@media(min-width:768px) { - #wrapper { - padding-left: 225px; - } - - #page-wrapper { - padding: 10px; - } -} - -/* Top Navigation */ - -.top-nav { - padding: 0 15px; -} - -.top-nav>li { - display: inline-block; - float: left; -} - -.top-nav>li>a { - padding-top: 15px; - padding-bottom: 15px; - line-height: 20px; - color: #999; -} - -.top-nav>li>a:hover, -.top-nav>li>a:focus, -.top-nav>.open>a, -.top-nav>.open>a:hover, -.top-nav>.open>a:focus { - color: #fff; - background-color: #000; -} - -.top-nav>.open>.dropdown-menu { - float: left; - position: absolute; - margin-top: 0; - border: 1px solid rgba(0,0,0,.15); - border-top-left-radius: 0; - border-top-right-radius: 0; - background-color: #fff; - -webkit-box-shadow: 0 6px 12px rgba(0,0,0,.175); - box-shadow: 0 6px 12px rgba(0,0,0,.175); -} - -.top-nav>.open>.dropdown-menu>li>a { - white-space: normal; -} - -ul.message-dropdown { - padding: 0; - max-height: 250px; - overflow-x: hidden; - overflow-y: auto; -} - -li.message-preview { - width: 275px; - border-bottom: 1px solid rgba(0,0,0,.15); -} - -li.message-preview>a { - padding-top: 15px; - padding-bottom: 15px; -} - -li.message-footer { - margin: 5px 0; -} - -ul.alert-dropdown { - width: 200px; -} - -/* Side Navigation */ - -@media(min-width:768px) { - .side-nav { - position: fixed; - top: 51px; - left: 225px; - width: 225px; - margin-left: -225px; - border: none; - border-radius: 0; - overflow-y: auto; - background-color: #222; - } - - .side-nav>li>a { - width: 225px; - } - - .side-nav li a:hover, - .side-nav li a:focus { - outline: none; - background-color: #000 !important; - } -} - -.side-nav>li>ul { - padding: 0; -} - -.side-nav>li>ul>li>a { - display: block; - padding: 10px 15px 10px 38px; - text-decoration: none; - color: #999; -} - -.side-nav>li>ul>li>a:hover { - color: #fff; -} - -/* Flot Chart Containers */ - -.flot-chart { - display: block; - height: 400px; -} - -.flot-chart-content { - width: 100%; - height: 100%; -} - -/* Custom Colored Panels */ - -.huge { - font-size: 40px; -} - -.panel-green { - border-color: #5cb85c; -} - -.panel-green .panel-heading { - border-color: #5cb85c; - color: #fff; - background-color: #5cb85c; -} - -.panel-green a { - color: #5cb85c; -} - -.panel-green a:hover { - color: #3d8b3d; -} - -.panel-red { - border-color: #d9534f; -} - -.panel-red .panel-heading { - border-color: #d9534f; - color: #fff; - background-color: #d9534f; -} - -.panel-red a { - color: #d9534f; -} - -.panel-red a:hover { - color: #b52b27; -} - -.panel-yellow { - border-color: #f0ad4e; -} - -.panel-yellow .panel-heading { - border-color: #f0ad4e; - color: #fff; - background-color: #f0ad4e; -} - -.panel-yellow a { - color: #f0ad4e; -} - -.panel-yellow a:hover { - color: #df8a13; -} \ No newline at end of file diff --git a/static/css/webvirtcloud.css b/static/css/webvirtcloud.css index 7591863..863ea54 100644 --- a/static/css/webvirtcloud.css +++ b/static/css/webvirtcloud.css @@ -7,63 +7,14 @@ /* Global Styles */ body { + padding-top: 70px; background-color: #FFF; } -#max-width-page { +.container { max-width: 768px; } -.side-nav { - background-color: #FFF; - font-size: 1.2em; -} - -.side-nav li a:hover, -.side-nav li a:focus { - color: #FFF; - background-color: #5CD062 !important; -} - -.navbar-inverse { - background-color: #6F5499; - border-color: #6F5499; -} - -.navbar-inverse .navbar-brand { - color: #FFF; - font-size: 2em; -} - -.navbar-inverse .navbar-nav>li>a { - color: #767676; -} - -.navbar-inverse .navbar-nav>li>a:focus, -.navbar-inverse .navbar-nav>li>a:hover { - color: #FFF; - background-color: #5CD062; -} - -.navbar-inverse .navbar-nav>.active>a, -.navbar-inverse .navbar-nav>.active>a:focus, -.navbar-inverse .navbar-nav>.active>a:hover { - color: #FFF; - background-color: #5CD062; -} - -.top-nav>li>a { - color: #FFF6F6; -} - -.top-nav>li>a:hover, -.top-nav>li>a:focus, -.top-nav>.open>a, -.top-nav>.open>a:hover, -.top-nav>.open>a:focus { - background-color: #5CD062; -} - .page-header { margin: 5px 5px 20px 20px; } diff --git a/storages/templates/storage.html b/storages/templates/storage.html index 9f61253..1456631 100644 --- a/storages/templates/storage.html +++ b/storages/templates/storage.html @@ -79,7 +79,7 @@
{% if state %}
- \ No newline at end of file diff --git a/templates/sidebar.html b/templates/sidebar.html deleted file mode 100644 index 869f19c..0000000 --- a/templates/sidebar.html +++ /dev/null @@ -1,21 +0,0 @@ -{% load i18n %} -{% load tags_active %} - - \ No newline at end of file