diff --git a/hosting/static/hosting/css/dashboard.css b/hosting/static/hosting/css/dashboard.css new file mode 100644 index 00000000..82332e23 --- /dev/null +++ b/hosting/static/hosting/css/dashboard.css @@ -0,0 +1,21 @@ +.hosting-dashboard:after { + content: ''; + position: absolute; + top: 0; + bottom: 0; + left: 0; + right: 0; + background-color: rgba(41, 66, 122, 0.59); + z-index: -1; +} +.hosting-dashboard:before { + content: ''; + position: absolute; + top: 0; + bottom: 0; + left: 0; + right: 0; + background: url(../../datacenterlight/img/pattern.jpg) no-repeat center center; + background-size: cover; + z-index: -2; +} \ No newline at end of file diff --git a/hosting/static/hosting/img/24-hours-support.svg b/hosting/static/hosting/img/24-hours-support.svg new file mode 100644 index 00000000..4db05be3 --- /dev/null +++ b/hosting/static/hosting/img/24-hours-support.svg @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/hosting/static/hosting/img/billing.svg b/hosting/static/hosting/img/billing.svg new file mode 100644 index 00000000..d002fa6c --- /dev/null +++ b/hosting/static/hosting/img/billing.svg @@ -0,0 +1 @@ +billing icon \ No newline at end of file diff --git a/hosting/static/hosting/img/dashboard_settings.svg b/hosting/static/hosting/img/dashboard_settings.svg new file mode 100644 index 00000000..4044e93a --- /dev/null +++ b/hosting/static/hosting/img/dashboard_settings.svg @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/hosting/static/hosting/img/key.svg b/hosting/static/hosting/img/key.svg new file mode 100644 index 00000000..b2bd7bc3 --- /dev/null +++ b/hosting/static/hosting/img/key.svg @@ -0,0 +1,7 @@ + + + + + Svg Vector Icons : http://www.onlinewebfonts.com/icon + + \ No newline at end of file diff --git a/hosting/static/hosting/img/plusVM.svg b/hosting/static/hosting/img/plusVM.svg new file mode 100644 index 00000000..c6c49316 --- /dev/null +++ b/hosting/static/hosting/img/plusVM.svg @@ -0,0 +1,19 @@ + + + + +VM + Created with Sketch. + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/hosting/templates/hosting/base_short.html b/hosting/templates/hosting/base_short.html index 847daa37..4dcf5074 100644 --- a/hosting/templates/hosting/base_short.html +++ b/hosting/templates/hosting/base_short.html @@ -24,6 +24,7 @@ + diff --git a/hosting/templates/hosting/dashboard.html b/hosting/templates/hosting/dashboard.html new file mode 100644 index 00000000..4c06f19b --- /dev/null +++ b/hosting/templates/hosting/dashboard.html @@ -0,0 +1,10 @@ +{% extends "hosting/base_short.html" %} +{% load staticfiles bootstrap3 i18n %} + +{% block content %} +
+
+ +
+
+{%endblock%} diff --git a/hosting/urls.py b/hosting/urls.py index ea96af77..e6b6fee3 100644 --- a/hosting/urls.py +++ b/hosting/urls.py @@ -1,17 +1,20 @@ from django.conf.urls import url from django.contrib.auth import views as auth_views -from .views import DjangoHostingView, RailsHostingView, PaymentVMView,\ - NodeJSHostingView, LoginView, SignupView, SignupValidateView, SignupValidatedView, IndexView, \ - OrdersHostingListView, OrdersHostingDetailView, VirtualMachinesPlanListView,\ - VirtualMachineView, OrdersHostingDeleteView, NotificationsView, \ - MarkAsReadNotificationView, PasswordResetView, PasswordResetConfirmView, HostingPricingView,\ - CreateVirtualMachinesView, HostingBillListView, HostingBillDetailView, \ - SSHKeyDeleteView, SSHKeyCreateView, SSHKeyListView, SSHKeyChoiceView +from .views import ( + DjangoHostingView, RailsHostingView, PaymentVMView, NodeJSHostingView, + LoginView, SignupView, SignupValidateView, SignupValidatedView, IndexView, + NotificationsView, OrdersHostingListView, OrdersHostingDetailView, + VirtualMachinesPlanListView, VirtualMachineView, OrdersHostingDeleteView, + MarkAsReadNotificationView, PasswordResetView, PasswordResetConfirmView, + HostingPricingView, CreateVirtualMachinesView, HostingBillListView, + HostingBillDetailView, SSHKeyDeleteView, SSHKeyCreateView, SSHKeyListView, + SSHKeyChoiceView, DashboardView) urlpatterns = [ url(r'index/?$', IndexView.as_view(), name='index'), url(r'django/?$', DjangoHostingView.as_view(), name='djangohosting'), + url(r'dashboard/?$', DashboardView.as_view(), name='dashboard'), url(r'nodejs/?$', NodeJSHostingView.as_view(), name='nodejshosting'), url(r'rails/?$', RailsHostingView.as_view(), name='railshosting'), url(r'pricing/?$', HostingPricingView.as_view(), name='pricing'), @@ -20,9 +23,12 @@ urlpatterns = [ url(r'orders/(?P\d+)/?$', OrdersHostingDetailView.as_view(), name='orders'), url(r'bills/?$', HostingBillListView.as_view(), name='bills'), url(r'bills/(?P\d+)/?$', HostingBillDetailView.as_view(), name='bills'), - url(r'cancel_order/(?P\d+)/?$', OrdersHostingDeleteView.as_view(), name='delete_order'), - url(r'create_virtual_machine/?$', CreateVirtualMachinesView.as_view(), name='create_virtual_machine'), - url(r'my-virtual-machines/?$', VirtualMachinesPlanListView.as_view(), name='virtual_machines'), + url(r'cancel_order/(?P\d+)/?$', + OrdersHostingDeleteView.as_view(), name='delete_order'), + url(r'create_virtual_machine/?$', CreateVirtualMachinesView.as_view(), + name='create_virtual_machine'), + url(r'my-virtual-machines/?$', + VirtualMachinesPlanListView.as_view(), name='virtual_machines'), url(r'my-virtual-machines/(?P\d+)/?$', VirtualMachineView.as_view(), name='virtual_machines'), url(r'ssh_keys/?$', SSHKeyListView.as_view(), @@ -44,5 +50,6 @@ urlpatterns = [ PasswordResetConfirmView.as_view(), name='reset_password_confirm'), url(r'^logout/?$', auth_views.logout, {'next_page': '/hosting/login?logged_out=true'}, name='logout'), - url(r'^validate/(?P.*)/$', SignupValidatedView.as_view(), name='validate') + url(r'^validate/(?P.*)/$', + SignupValidatedView.as_view(), name='validate') ] diff --git a/hosting/views.py b/hosting/views.py index 2b4c8d21..394fd04c 100644 --- a/hosting/views.py +++ b/hosting/views.py @@ -40,6 +40,18 @@ CONNECTION_ERROR = "Your VMs cannot be displayed at the moment due to a backend connection error. please try again in a few minutes." +class DashboardView(View): + template_name = "hosting/dashboard.html" + + def get_context_data(self, **kwargs): + context = {} + return context + + def get(self, request, *args, **kwargs): + context = self.get_context_data() + return render(request, self.template_name, context) + + class DjangoHostingView(ProcessVMSelectionMixin, View): template_name = "hosting/django.html" @@ -244,7 +256,8 @@ class SignupValidatedView(SignupValidateView): lurl=login_url) else: home_url = 'Data Center Light' + reverse('datacenterlight:index') + \ + '">Data Center Light' message = '{sorry_message}
{go_back_to} {hurl}'.format( sorry_message=_("Sorry. Your request is invalid."), go_back_to=_('Go back to'), @@ -557,7 +570,8 @@ class PaymentVMView(LoginRequiredMixin, FormView): token=token) if not customer: msg = _("Invalid credit card") - messages.add_message(self.request, messages.ERROR, msg, extra_tags='make_charge_error') + messages.add_message( + self.request, messages.ERROR, msg, extra_tags='make_charge_error') return HttpResponseRedirect(reverse('hosting:payment') + '#payment_error') # Create Billing Address @@ -571,7 +585,8 @@ class PaymentVMView(LoginRequiredMixin, FormView): # Check if the payment was approved if not charge_response.get('response_object') and not charge_response.get('paid'): msg = charge_response.get('error') - messages.add_message(self.request, messages.ERROR, msg, extra_tags='make_charge_error') + messages.add_message( + self.request, messages.ERROR, msg, extra_tags='make_charge_error') return HttpResponseRedirect(reverse('hosting:payment') + '#payment_error') charge = charge_response.get('response_object')