From ea41412aac6565637bb768f4df7a8542019a3f3e Mon Sep 17 00:00:00 2001 From: Retspen Date: Thu, 2 Apr 2015 11:48:40 +0300 Subject: [PATCH] Move tempates --- accounts/urls.py | 6 +++--- accounts/views.py | 6 +++--- computes/urls.py | 4 ++-- computes/views.py | 4 ++-- create/views.py | 2 +- db.sqlite3 | Bin 0 -> 3072 bytes instances/urls.py | 6 +++--- instances/views.py | 4 ++-- interfaces/views.py | 4 ++-- logs/views.py | 2 +- networks/views.py | 4 ++-- secrets/views.py | 2 +- storages/views.py | 4 ++-- templates/{ => accounts}/account.html | 2 +- templates/{ => accounts}/accounts.html | 2 +- templates/{ => accounts}/base_auth.html | 0 templates/{ => accounts}/create_user_block.html | 0 .../{ => accounts}/create_user_inst_block.html | 0 templates/{ => accounts}/login.html | 2 +- templates/{ => accounts}/logout.html | 2 +- templates/{ => accounts}/profile.html | 0 templates/{ => computes}/computes.html | 2 +- templates/{ => computes}/create_comp_block.html | 0 templates/{ => computes}/overview.html | 0 templates/{ => console}/console-spice.html | 0 templates/{ => console}/console-vnc.html | 0 templates/{ => create}/create_flav_block.html | 0 templates/{ => create}/create_instance.html | 2 +- .../{ => instances}/create_inst_block.html | 0 templates/{ => instances}/instance.html | 0 templates/{ => instances}/instances.html | 2 +- .../{ => interfaces}/create_iface_block.html | 0 templates/{ => interfaces}/interface.html | 0 templates/{ => interfaces}/interfaces.html | 2 +- templates/{ => logs}/showlogs.html | 0 templates/{ => networks}/create_net_block.html | 0 templates/{ => networks}/network.html | 0 templates/{ => networks}/networks.html | 2 +- .../{ => secrets}/create_secret_block.html | 0 templates/{ => secrets}/secrets.html | 2 +- templates/{ => storages}/create_stg_block.html | 0 .../{ => storages}/create_stg_vol_block.html | 0 templates/{ => storages}/storage.html | 4 ++-- templates/{ => storages}/storages.html | 2 +- webvirtcloud/settings.py | 5 ++--- webvirtcloud/urls.py | 16 ++++++++-------- 46 files changed, 47 insertions(+), 48 deletions(-) create mode 100644 db.sqlite3 rename templates/{ => accounts}/account.html (98%) rename templates/{ => accounts}/accounts.html (98%) rename templates/{ => accounts}/base_auth.html (100%) rename templates/{ => accounts}/create_user_block.html (100%) rename templates/{ => accounts}/create_user_inst_block.html (100%) rename templates/{ => accounts}/login.html (95%) rename templates/{ => accounts}/logout.html (88%) rename templates/{ => accounts}/profile.html (100%) rename templates/{ => computes}/computes.html (99%) rename templates/{ => computes}/create_comp_block.html (100%) rename templates/{ => computes}/overview.html (100%) rename templates/{ => console}/console-spice.html (100%) rename templates/{ => console}/console-vnc.html (100%) rename templates/{ => create}/create_flav_block.html (100%) rename templates/{ => create}/create_instance.html (99%) rename templates/{ => instances}/create_inst_block.html (100%) rename templates/{ => instances}/instance.html (100%) rename templates/{ => instances}/instances.html (99%) rename templates/{ => interfaces}/create_iface_block.html (100%) rename templates/{ => interfaces}/interface.html (100%) rename templates/{ => interfaces}/interfaces.html (98%) rename templates/{ => logs}/showlogs.html (100%) rename templates/{ => networks}/create_net_block.html (100%) rename templates/{ => networks}/network.html (100%) rename templates/{ => networks}/networks.html (97%) rename templates/{ => secrets}/create_secret_block.html (100%) rename templates/{ => secrets}/secrets.html (98%) rename templates/{ => storages}/create_stg_block.html (100%) rename templates/{ => storages}/create_stg_vol_block.html (100%) rename templates/{ => storages}/storage.html (98%) rename templates/{ => storages}/storages.html (97%) diff --git a/accounts/urls.py b/accounts/urls.py index 52052ee..c7359f9 100644 --- a/accounts/urls.py +++ b/accounts/urls.py @@ -2,9 +2,9 @@ from django.conf.urls import url from . import views urlpatterns =[ - url(r'^login/$', 'django.contrib.auth.views.login', {'template_name': 'login.html'}, name='login'), - url(r'^logout/$', 'django.contrib.auth.views.logout', {'template_name': 'logout.html'}, name='logout'), + url(r'^login/$', 'django.contrib.auth.views.login', {'template_name': 'accounts/login.html'}, name='login'), + url(r'^logout/$', 'django.contrib.auth.views.logout', {'template_name': 'accounts/logout.html'}, name='logout'), url(r'^profile/$', views.profile, name='profile'), url(r'^$', views.accounts, name='accounts'), - url(r'^profile/(\d+)/$', views.account, name='account'), + url(r'^profile/(?P[0-9]+)/$', views.account, name='account'), ] diff --git a/accounts/views.py b/accounts/views.py index c237350..f40d80f 100644 --- a/accounts/views.py +++ b/accounts/views.py @@ -42,7 +42,7 @@ def profile(request): user.save() return HttpResponseRedirect(request.get_full_path()) - return render(request, 'profile.html', locals()) + return render(request, 'accounts/profile.html', locals()) def accounts(request): @@ -101,7 +101,7 @@ def accounts(request): user_delete.delete() return HttpResponseRedirect(request.get_full_path()) - return render(request, 'accounts.html', locals()) + return render(request, 'accounts/accounts.html', locals()) def account(request, user_id): @@ -150,4 +150,4 @@ def account(request, user_id): add_user_inst.save() return HttpResponseRedirect(request.get_full_path()) - return render(request, 'account.html', locals()) + return render(request, 'accounts/account.html', locals()) diff --git a/computes/urls.py b/computes/urls.py index 9e4da9f..1a1c65a 100644 --- a/computes/urls.py +++ b/computes/urls.py @@ -3,6 +3,6 @@ from . import views urlpatterns =[ url(r'^$', views.computes, name='computes'), - url(r'^overview/(\d+)/$', views.overview, name='overview'), - url(r'^statistics/(\d+)/$', views.compute_graph, name='compute_graph'), + url(r'^overview/(?P[0-9]+)/$', views.overview, name='overview'), + url(r'^statistics/(?P[0-9]+)/$', views.compute_graph, name='compute_graph'), ] diff --git a/computes/views.py b/computes/views.py index d7f14e9..2b6d36d 100644 --- a/computes/views.py +++ b/computes/views.py @@ -127,7 +127,7 @@ def computes(request): else: for msg_err in form.errors.values(): error_messages.append(msg_err.as_text()) - return render(request, 'computes.html', locals()) + return render(request, 'computes/computes.html', locals()) def overview(request, compute_id): @@ -157,7 +157,7 @@ def overview(request, compute_id): except libvirtError as lib_err: error_messages.append(lib_err) - return render(request, 'overview.html', locals()) + return render(request, 'computes/overview.html', locals()) def compute_graph(request, compute_id): diff --git a/create/views.py b/create/views.py index d3c07ca..3b99328 100644 --- a/create/views.py +++ b/create/views.py @@ -137,4 +137,4 @@ def create_instance(request, compute_id): error_messages.append(lib_err) conn.close() - return render(request, 'create_instance.html', locals()) + return render(request, 'create/create_instance.html', locals()) diff --git a/db.sqlite3 b/db.sqlite3 new file mode 100644 index 0000000000000000000000000000000000000000..a1a057f31873cfe630782f76ceb39e731503e292 GIT binary patch literal 3072 zcmeHGJx{|h5VeyECg!duiy={qDuKEaP=<;$Ex{c!Ri-h)C?Bn3*x@JgBlsO$kXos& z5K~bHpLDjK@80?J?0dM6l#%dM>rxoFA{|00xdtGFP;?i4Z7uGs0q!mS%P6_{a?UWz zaXyKAj*B&`z(Ez5Iw##;kETXE7P46t_`TbJAG dHPr`w8(Z8eU==tf1?>DE(`(pXtOEb5z&F+HYXblP literal 0 HcmV?d00001 diff --git a/instances/urls.py b/instances/urls.py index 2963d3d..99839c0 100644 --- a/instances/urls.py +++ b/instances/urls.py @@ -2,7 +2,7 @@ from django.conf.urls import url from . import views urlpatterns =[ - url(r'^(\d+)/([\w\-\.]+)/$', views.instance, name='instance'), - url(r'^statistics/(\d+)/([\w\-\.]+)/$', views.inst_graph, name='inst_graph'), - url(r'^status/(\d+)/([\w\-\.]+)/$', views.inst_status, name='inst_status'), + url(r'^(?P[0-9]+)/(?P[\w\-\.]+)/$', views.instance, name='instance'), + url(r'^statistics/(?P[0-9]+)/(?P[\w\-\.]+)/$', views.inst_graph, name='inst_graph'), + url(r'^status/(?P[0-9]+)/(?P[\w\-\.]+)/$', views.inst_status, name='inst_status'), ] diff --git a/instances/views.py b/instances/views.py index 7323bf3..42722ac 100644 --- a/instances/views.py +++ b/instances/views.py @@ -120,7 +120,7 @@ def instances(request): error_messages.append(lib_err) addlogmsg(request.user.id, instance.id, lib_err.message) - return render(request, 'instances.html', locals()) + return render(request, 'instances/instances.html', locals()) def instance(request, compute_id, vname): @@ -421,7 +421,7 @@ def instance(request, compute_id, vname): error_messages.append(lib_err.message) addlogmsg(request.user.id, instance.id, lib_err.message) - return render(request, 'instance.html', locals()) + return render(request, 'instances/instance.html', locals()) def inst_status(request, host_id, vname): diff --git a/interfaces/views.py b/interfaces/views.py index c3711cf..a438dab 100644 --- a/interfaces/views.py +++ b/interfaces/views.py @@ -54,7 +54,7 @@ def interfaces(request, compute_id): except libvirtError as lib_err: error_messages.append(lib_err) - return render(request, 'interfaces.html', locals()) + return render(request, 'interfaces/interfaces.html', locals()) def interface(request, compute_id, iface): @@ -103,4 +103,4 @@ def interface(request, compute_id, iface): except libvirtError as lib_err: error_messages.append(lib_err) - return render(request, 'interface.html', locals()) + return render(request, 'interfaces/interface.html', locals()) diff --git a/logs/views.py b/logs/views.py index 70ee1f3..9baadfe 100644 --- a/logs/views.py +++ b/logs/views.py @@ -27,4 +27,4 @@ def showlogs(request): logs = Logs.objects.all() - return render(request, 'showlogs.html', locals()) \ No newline at end of file + return render(request, 'logs/showlogs.html', locals()) diff --git a/networks/views.py b/networks/views.py index aad45e2..a70c6c0 100644 --- a/networks/views.py +++ b/networks/views.py @@ -57,7 +57,7 @@ def networks(request, compute_id): except libvirtError as lib_err: error_messages.append(lib_err) - return render(request, 'networks.html', locals()) + return render(request, 'networks/networks.html', locals()) def network(request, compute_id, pool): @@ -127,4 +127,4 @@ def network(request, compute_id, pool): conn.close() - return render(request, 'network.html', locals()) + return render(request, 'networks/network.html', locals()) diff --git a/secrets/views.py b/secrets/views.py index 5aa510e..85bc671 100644 --- a/secrets/views.py +++ b/secrets/views.py @@ -62,4 +62,4 @@ def secrets(request, compute_id): except libvirtError as err: error_messages.append(err) - return render(request, 'secrets.html', locals()) + return render(request, 'secrets/secrets.html', locals()) diff --git a/storages/views.py b/storages/views.py index 66f5e26..0f6389b 100644 --- a/storages/views.py +++ b/storages/views.py @@ -65,7 +65,7 @@ def storages(request, compute_id): except libvirtError as lib_err: error_messages.append(lib_err) - return render(request, 'storages.html', locals()) + return render(request, 'storages/storages.html', locals()) def storage(request, compute_id, pool): @@ -202,4 +202,4 @@ def storage(request, compute_id, pool): error_messages.append(msg_err.as_text()) conn.close() - return render(request, 'storage.html', locals()) + return render(request, 'storages/storage.html', locals()) diff --git a/templates/account.html b/templates/accounts/account.html similarity index 98% rename from templates/account.html rename to templates/accounts/account.html index b6a8b6c..7b0b5da 100644 --- a/templates/account.html +++ b/templates/accounts/account.html @@ -5,7 +5,7 @@
- {% include 'create_user_inst_block.html' %} + {% include 'accounts/create_user_inst_block.html' %}

{{ user }}

diff --git a/templates/accounts.html b/templates/accounts/accounts.html similarity index 98% rename from templates/accounts.html rename to templates/accounts/accounts.html index 9ebff0b..6b56cde 100644 --- a/templates/accounts.html +++ b/templates/accounts/accounts.html @@ -5,7 +5,7 @@
- {% include 'create_user_block.html' %} + {% include 'accounts/create_user_block.html' %}

{% trans "Users" %}

diff --git a/templates/base_auth.html b/templates/accounts/base_auth.html similarity index 100% rename from templates/base_auth.html rename to templates/accounts/base_auth.html diff --git a/templates/create_user_block.html b/templates/accounts/create_user_block.html similarity index 100% rename from templates/create_user_block.html rename to templates/accounts/create_user_block.html diff --git a/templates/create_user_inst_block.html b/templates/accounts/create_user_inst_block.html similarity index 100% rename from templates/create_user_inst_block.html rename to templates/accounts/create_user_inst_block.html diff --git a/templates/login.html b/templates/accounts/login.html similarity index 95% rename from templates/login.html rename to templates/accounts/login.html index 362fdf7..0e7464c 100644 --- a/templates/login.html +++ b/templates/accounts/login.html @@ -1,4 +1,4 @@ -{% extends "base_auth.html" %} +{% extends "accounts/base_auth.html" %} {% load i18n %} {% block title %}{% trans "WebVirtCloud - Sign In" %}{% endblock %} {% block content %} diff --git a/templates/logout.html b/templates/accounts/logout.html similarity index 88% rename from templates/logout.html rename to templates/accounts/logout.html index 83161d3..0cd7569 100644 --- a/templates/logout.html +++ b/templates/accounts/logout.html @@ -1,4 +1,4 @@ -{% extends "base_auth.html" %} +{% extends "accounts/base_auth.html" %} {% load i18n %} {% block title %}{% trans "WebVirtCloud - Sign Out" %}{% endblock %} {% block content %} diff --git a/templates/profile.html b/templates/accounts/profile.html similarity index 100% rename from templates/profile.html rename to templates/accounts/profile.html diff --git a/templates/computes.html b/templates/computes/computes.html similarity index 99% rename from templates/computes.html rename to templates/computes/computes.html index 399afd5..f56601e 100644 --- a/templates/computes.html +++ b/templates/computes/computes.html @@ -5,7 +5,7 @@
- {% include 'create_comp_block.html' %} + {% include 'computes/create_comp_block.html' %}

{% trans "Computes" %}

diff --git a/templates/create_comp_block.html b/templates/computes/create_comp_block.html similarity index 100% rename from templates/create_comp_block.html rename to templates/computes/create_comp_block.html diff --git a/templates/overview.html b/templates/computes/overview.html similarity index 100% rename from templates/overview.html rename to templates/computes/overview.html diff --git a/templates/console-spice.html b/templates/console/console-spice.html similarity index 100% rename from templates/console-spice.html rename to templates/console/console-spice.html diff --git a/templates/console-vnc.html b/templates/console/console-vnc.html similarity index 100% rename from templates/console-vnc.html rename to templates/console/console-vnc.html diff --git a/templates/create_flav_block.html b/templates/create/create_flav_block.html similarity index 100% rename from templates/create_flav_block.html rename to templates/create/create_flav_block.html diff --git a/templates/create_instance.html b/templates/create/create_instance.html similarity index 99% rename from templates/create_instance.html rename to templates/create/create_instance.html index 9447418..456cbf5 100644 --- a/templates/create_instance.html +++ b/templates/create/create_instance.html @@ -9,7 +9,7 @@
- {% include 'create_flav_block.html' %} + {% include 'create/create_flav_block.html' %}

{% trans "New instance on" %} {{ compute.name }}

diff --git a/templates/create_inst_block.html b/templates/instances/create_inst_block.html similarity index 100% rename from templates/create_inst_block.html rename to templates/instances/create_inst_block.html diff --git a/templates/instance.html b/templates/instances/instance.html similarity index 100% rename from templates/instance.html rename to templates/instances/instance.html diff --git a/templates/instances.html b/templates/instances/instances.html similarity index 99% rename from templates/instances.html rename to templates/instances/instances.html index a8283df..7c1474e 100644 --- a/templates/instances.html +++ b/templates/instances/instances.html @@ -8,7 +8,7 @@
- {% include 'create_inst_block.html' %} + {% include 'instances/create_inst_block.html' %} diff --git a/templates/create_iface_block.html b/templates/interfaces/create_iface_block.html similarity index 100% rename from templates/create_iface_block.html rename to templates/interfaces/create_iface_block.html diff --git a/templates/interface.html b/templates/interfaces/interface.html similarity index 100% rename from templates/interface.html rename to templates/interfaces/interface.html diff --git a/templates/interfaces.html b/templates/interfaces/interfaces.html similarity index 98% rename from templates/interfaces.html rename to templates/interfaces/interfaces.html index c8b0546..2be1118 100644 --- a/templates/interfaces.html +++ b/templates/interfaces/interfaces.html @@ -5,7 +5,7 @@
- {% include 'create_iface_block.html' %} + {% include 'interfaces/create_iface_block.html' %}

{{ compute.name }}