From 258728e6e9fd155d7c5c42d8b66aef598af8a204 Mon Sep 17 00:00:00 2001 From: Levi Date: Sun, 26 Jun 2016 14:54:01 -0500 Subject: [PATCH 1/9] fixed hosting emails --- hosting/templates/emails/new_booked_vm.html | 1 + hosting/templates/emails/new_booked_vm.txt | 1 + hosting/templates/emails/vm_charged.html | 1 + hosting/templates/emails/vm_charged.txt | 1 + hosting/templates/emails/vm_status_changed.html | 1 - hosting/templates/emails/vm_status_changed.txt | 1 - 6 files changed, 4 insertions(+), 2 deletions(-) diff --git a/hosting/templates/emails/new_booked_vm.html b/hosting/templates/emails/new_booked_vm.html index 0a3d2742..0f9b4f6e 100644 --- a/hosting/templates/emails/new_booked_vm.html +++ b/hosting/templates/emails/new_booked_vm.html @@ -1,3 +1,4 @@ +{% load static from staticfiles %} diff --git a/hosting/templates/emails/new_booked_vm.txt b/hosting/templates/emails/new_booked_vm.txt index 0a3d2742..0f9b4f6e 100644 --- a/hosting/templates/emails/new_booked_vm.txt +++ b/hosting/templates/emails/new_booked_vm.txt @@ -1,3 +1,4 @@ +{% load static from staticfiles %} diff --git a/hosting/templates/emails/vm_charged.html b/hosting/templates/emails/vm_charged.html index b8837645..33568d05 100644 --- a/hosting/templates/emails/vm_charged.html +++ b/hosting/templates/emails/vm_charged.html @@ -1,3 +1,4 @@ +{% load static from staticfiles %} diff --git a/hosting/templates/emails/vm_charged.txt b/hosting/templates/emails/vm_charged.txt index b8837645..33568d05 100644 --- a/hosting/templates/emails/vm_charged.txt +++ b/hosting/templates/emails/vm_charged.txt @@ -1,3 +1,4 @@ +{% load static from staticfiles %} diff --git a/hosting/templates/emails/vm_status_changed.html b/hosting/templates/emails/vm_status_changed.html index 691c42a3..c60ba661 100644 --- a/hosting/templates/emails/vm_status_changed.html +++ b/hosting/templates/emails/vm_status_changed.html @@ -1,4 +1,3 @@ - {% load static from staticfiles %} diff --git a/hosting/templates/emails/vm_status_changed.txt b/hosting/templates/emails/vm_status_changed.txt index 691c42a3..c60ba661 100644 --- a/hosting/templates/emails/vm_status_changed.txt +++ b/hosting/templates/emails/vm_status_changed.txt @@ -1,4 +1,3 @@ - {% load static from staticfiles %} From 4dc6ab1d847c778698dfc10ccd051e39cd0529de Mon Sep 17 00:00:00 2001 From: Levi Date: Thu, 30 Jun 2016 01:23:14 -0500 Subject: [PATCH 2/9] Created generic view for vm pricing widget, Added VM configuration info on VM detail view, Fixed template bugs. Fixed Blog urls bugs --- dynamicweb/urls.py | 8 ++-- hosting/mixins.py | 7 ++- .../templates/hosting/hosting_pricing.html | 44 +++++++++++++++++++ .../templates/hosting/includes/_pricing.html | 26 +++++++---- .../hosting/virtual_machine_detail.html | 5 +++ hosting/urls.py | 3 +- hosting/views.py | 20 +++++++++ 7 files changed, 99 insertions(+), 14 deletions(-) create mode 100644 hosting/templates/hosting/hosting_pricing.html diff --git a/dynamicweb/urls.py b/dynamicweb/urls.py index a732934e..f0fc25bb 100644 --- a/dynamicweb/urls.py +++ b/dynamicweb/urls.py @@ -7,9 +7,10 @@ from django.conf.urls.static import static from django.conf import settings from hosting.views import RailsHostingView, DjangoHostingView, NodeJSHostingView from membership import urls as membership_urls +from ungleich_page.views import LandingView import debug_toolbar -urlpatterns = [ +urlpatterns = [ url(r'^index.html$', LandingView.as_view()), url(r'^hosting/', include('hosting.urls', namespace="hosting")), url(r'^railshosting/', RailsHostingView.as_view(), name="rails.hosting"), url(r'^nodehosting/', NodeJSHostingView.as_view(), name="node.hosting"), @@ -21,12 +22,13 @@ urlpatterns = [ # note the django CMS URLs included via i18n_patterns urlpatterns += i18n_patterns('', + url(r'^/?$', LandingView.as_view()), url(r'^admin/', include(admin.site.urls)), url(r'^digitalglarus/login/', include(membership_urls)), url(r'^digitalglarus/', include('digitalglarus.urls', namespace="digitalglarus")), - # url(r'^blog/', include('ungleich.urls', namespace='ungleich')), - url(r'^ungleich_page/', + #url(r'^blog/', include('ungleich.urls', namespace='ungleich')), + url(r'^', include('ungleich_page.urls', namespace='ungleich_page'), name='ungleich_page'), url(r'^blog/', include('ungleich.urls', namespace='ungleich')), diff --git a/hosting/mixins.py b/hosting/mixins.py index e8a2b7b4..2f8de3a5 100644 --- a/hosting/mixins.py +++ b/hosting/mixins.py @@ -1,18 +1,21 @@ from django.shortcuts import redirect from django.core.urlresolvers import reverse +from .models import VirtualMachinePlan class ProcessVMSelectionMixin(object): def post(self, request, *args, **kwargs): + hosting = request.POST.get('configuration') + configuration_detail = dict(VirtualMachinePlan.VM_CONFIGURATION).get(hosting) vm_specs = { 'cores': request.POST.get('cores'), 'memory': request.POST.get('memory'), 'disk_size': request.POST.get('disk_space'), 'hosting_company': request.POST.get('hosting_company'), 'location_code': request.POST.get('location_code'), - 'configuration': request.POST.get('configuration'), - 'configuration_detail': request.POST.get('configuration_detail'), + 'configuration': hosting, + 'configuration_detail': configuration_detail, 'final_price': request.POST.get('final_price') } request.session['vm_specs'] = vm_specs diff --git a/hosting/templates/hosting/hosting_pricing.html b/hosting/templates/hosting/hosting_pricing.html new file mode 100644 index 00000000..c6ae33d0 --- /dev/null +++ b/hosting/templates/hosting/hosting_pricing.html @@ -0,0 +1,44 @@ +{% load staticfiles %} + + + + + Hosting + + + + + + + + + + + + + + + + + + + {% include "hosting/includes/_pricing.html" with select_configuration=True%} + + + + {% if vm_types %} + + {%endif%} + + + + + + + + + + + \ No newline at end of file diff --git a/hosting/templates/hosting/includes/_pricing.html b/hosting/templates/hosting/includes/_pricing.html index 3a9138b4..92033be8 100644 --- a/hosting/templates/hosting/includes/_pricing.html +++ b/hosting/templates/hosting/includes/_pricing.html @@ -24,8 +24,7 @@ {% csrf_token %} - - +