From a16dbb50d8e1f9b2705c9f91bfa0b0d881046d86 Mon Sep 17 00:00:00 2001 From: Arvind Tiwari Date: Thu, 21 Sep 2017 19:17:10 +0530 Subject: [PATCH] design fixes --- hosting/static/hosting/css/order.css | 22 ++++++++++++++++----- hosting/templates/hosting/order_detail.html | 10 +++++++--- hosting/urls.py | 2 +- hosting/views.py | 14 ++++++------- 4 files changed, 32 insertions(+), 16 deletions(-) diff --git a/hosting/static/hosting/css/order.css b/hosting/static/hosting/css/order.css index 8213610e..383b23f4 100644 --- a/hosting/static/hosting/css/order.css +++ b/hosting/static/hosting/css/order.css @@ -2,6 +2,10 @@ max-width: 600px; margin: 100px auto 40px; border: 1px solid #ccc; + padding: 15px; +} + +@media(min-width: 768px) { padding: 30px; } @@ -42,9 +46,8 @@ right: 0; } .order-detail-container .dashboard-container-options .svg-img { - height: 20px; - /* margin-right: 5px; */ - width: 20px; + height: 22px; + width: 22px; } .order-detail-container .order-details { @@ -52,7 +55,7 @@ } .order-detail-container .order-details strong { - color: #777; + color: #595959; } .order-detail-container h4 { @@ -75,4 +78,13 @@ text-align: center; margin-top: 10px; } -} \ No newline at end of file + .order-detail-container .dashboard-container-options { + position: absolute; + top: 4px; + right: -4px; + } + .order-detail-container .dashboard-container-options .svg-img { + height: 16px; + width: 16px; + } +} diff --git a/hosting/templates/hosting/order_detail.html b/hosting/templates/hosting/order_detail.html index d5599fbe..c4cf5892 100644 --- a/hosting/templates/hosting/order_detail.html +++ b/hosting/templates/hosting/order_detail.html @@ -81,7 +81,11 @@ {% else %} {{cc_brand}} {% trans "ending in" %} **** {{cc_last4}}
- {{request.session.user.email}} + {% if request.user.is_authenticated %} + {{request.user.email}} + {% else %} + {{request.session.user.email}} + {% endif %} {% endif %}

@@ -101,7 +105,7 @@ {% endcomment %}

{% trans "Cores" %} - {{vm.cores}} + {{vm.cores|floatformat}}

{% trans "Memory" %} @@ -140,10 +144,10 @@ {% endif %} +{% if order %}

{% trans "BACK TO LIST" %}
-{% if order %} {% endif %} {% if not order %} diff --git a/hosting/urls.py b/hosting/urls.py index bc14c3a6..a946fee1 100644 --- a/hosting/urls.py +++ b/hosting/urls.py @@ -12,7 +12,7 @@ from .views import ( from django.views.generic import TemplateView urlpatterns = [ - url(r'test/?$', TemplateView.as_view(template_name='hosting/order_detail.html')), + url(r'test/?$', TemplateView.as_view(template_name='hosting/order_detail.html'), name='test'), url(r'index/?$', IndexView.as_view(), name='index'), url(r'django/?$', DjangoHostingView.as_view(), name='djangohosting'), url(r'dashboard/?$', DashboardView.as_view(), name='dashboard'), diff --git a/hosting/views.py b/hosting/views.py index 0458464d..95304212 100644 --- a/hosting/views.py +++ b/hosting/views.py @@ -661,7 +661,7 @@ class OrdersHostingDetailView(LoginRequiredMixin, self.request.session.get('token') ) else: - card_details = None + card_details = {} if self.request.GET.get('page') == 'payment': context['page_header_text'] = _('Confirm Order') @@ -704,12 +704,12 @@ class OrdersHostingDetailView(LoginRequiredMixin, return context def get(self, request, *args, **kwargs): - # if 'specs' not in self.request.session: - # return HttpResponseRedirect( - # reverse('hosting:create_virtual_machine') - # ) - # if 'token' not in self.request.session: - # return HttpResponseRedirect(reverse('hosting:payment')) + if 'specs' not in self.request.session: + return HttpResponseRedirect( + reverse('hosting:create_virtual_machine') + ) + if 'token' not in self.request.session: + return HttpResponseRedirect(reverse('hosting:payment')) self.object = self.get_object() context = self.get_context_data(object=self.object) if 'failed_payment' in context: