Merged master into task/3622/decouple_opennebula_dcl_flow
This commit is contained in:
commit
6b7ae88f74
19 changed files with 296 additions and 142 deletions
|
|
@ -4,10 +4,10 @@
|
|||
* For details, see http://www.apache.org/licenses/LICENSE-2.0.
|
||||
*/
|
||||
|
||||
@font-face {
|
||||
/*@font-face {
|
||||
font-family: 'Lato-Light';
|
||||
src: url('../fonts/Lato/Lato-Light.ttf');
|
||||
}
|
||||
}*/
|
||||
|
||||
body,
|
||||
html {
|
||||
|
|
@ -22,7 +22,12 @@ h3,
|
|||
h4,
|
||||
h5,
|
||||
h6 {
|
||||
font-family: 'Lato-Light', sans-serif;
|
||||
/*font-family: 'Lato-Light', sans-serif;*/
|
||||
font-family: 'Lato', sans-serif;
|
||||
font-weight: 300;
|
||||
}
|
||||
|
||||
button, input, optgroup, select, textarea {
|
||||
font-weight: 300;
|
||||
}
|
||||
|
||||
|
|
@ -143,13 +148,15 @@ h6 {
|
|||
|
||||
.navbar-default .navbar-nav>li>a {
|
||||
cursor: pointer;
|
||||
font-family: 'Lato-Light', sans-serif;
|
||||
/*font-family: 'Lato-Light', sans-serif;*/
|
||||
font-weight: 300;
|
||||
}
|
||||
|
||||
.navbar-transparent .navbar-nav>li>a {
|
||||
color: #fff;
|
||||
cursor: pointer;
|
||||
font-family: 'Lato-Light', sans-serif;
|
||||
/*font-family: 'Lato-Light', sans-serif;*/
|
||||
font-weight: 300;
|
||||
}
|
||||
|
||||
.navbar-transparent .navbar-nav>li>a:hover {
|
||||
|
|
@ -202,13 +209,15 @@ h6 {
|
|||
|
||||
.navbar-transparent .nav-language .select-language {
|
||||
color: #fff;
|
||||
font-family: 'Lato-Light', sans-serif;
|
||||
/*font-family: 'Lato-Light', sans-serif;*/
|
||||
font-weight: 300;
|
||||
}
|
||||
|
||||
.nav-language .select-language span {
|
||||
margin-left: 5px;
|
||||
margin-right: 5px;
|
||||
font-family: 'Lato', sans-serif;
|
||||
/*font-family: 'Lato', sans-serif;*/
|
||||
font-weight: normal;
|
||||
}
|
||||
.nav-language .drop-language{
|
||||
/*position: absolute;*/
|
||||
|
|
@ -237,7 +246,8 @@ h6 {
|
|||
.nav-language .drop-language a{
|
||||
cursor: pointer;
|
||||
padding: 5px 10px !important;
|
||||
font-family: 'Lato-Light', sans-serif;
|
||||
/*font-family: 'Lato-Light', sans-serif;*/
|
||||
font-weight: 300;
|
||||
}
|
||||
|
||||
/* Show the dropdown menu on hover */
|
||||
|
|
@ -260,7 +270,8 @@ h6 {
|
|||
.navbar-transparent .nav-language .drop-language a {
|
||||
color: #fff;
|
||||
padding: 5px 10px !important;
|
||||
font-family: 'Lato-Light', sans-serif;
|
||||
/*font-family: 'Lato-Light', sans-serif;*/
|
||||
font-weight: 300;
|
||||
}
|
||||
/* .nav-language:hover .drop-language{
|
||||
display: block;
|
||||
|
|
@ -343,7 +354,7 @@ h6 {
|
|||
|
||||
.intro-message>h1 {
|
||||
margin: 0;
|
||||
font-weight: 400;
|
||||
font-weight: 300;
|
||||
font-size: 6em;
|
||||
}
|
||||
|
||||
|
|
@ -792,7 +803,8 @@ tech-sub-sec h2 {
|
|||
}
|
||||
|
||||
.percent-text {
|
||||
font-family: 'Lato', sans-serif;
|
||||
/*font-family: 'Lato', sans-serif;*/
|
||||
/* font-weight: normal; */
|
||||
font-size: 50px;
|
||||
color: #999;
|
||||
}
|
||||
|
|
@ -879,7 +891,7 @@ tech-sub-sec h2 {
|
|||
.dropdown-menu>li>a {
|
||||
font-size: 13px;
|
||||
font-weight: 300;
|
||||
font-family: 'Lato-Light', sans-serif;
|
||||
/*font-family: 'Lato-Light', sans-serif;*/
|
||||
}
|
||||
|
||||
.navbar-default .navbar-nav>.active>a,
|
||||
|
|
@ -898,7 +910,8 @@ tech-sub-sec h2 {
|
|||
background: -webkit-linear-gradient(top, #f0f4f7, #fff) no-repeat;
|
||||
background: linear-gradient(to bottom, #f0f4f7, #fff) no-repeat;
|
||||
display: flex;
|
||||
font-family: 'Lato', sans-serif;
|
||||
/*font-family: 'Lato', sans-serif;*/
|
||||
/* font-weight: normal; */
|
||||
}
|
||||
|
||||
.price-calc-section .text {
|
||||
|
|
@ -963,7 +976,8 @@ tech-sub-sec h2 {
|
|||
}
|
||||
|
||||
.price-calc-section .card .title h3 {
|
||||
font-family: 'Lato', sans-serif;
|
||||
/*font-family: 'Lato', sans-serif;*/
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.price-calc-section .card .price {
|
||||
|
|
@ -1050,8 +1064,9 @@ tech-sub-sec h2 {
|
|||
|
||||
.price-calc-section .card .description.input label {
|
||||
font-size: 15px;
|
||||
font-weight: 800;
|
||||
font-family: 'Lato';
|
||||
font-weight: 700;
|
||||
/*font-weight: 800;*/
|
||||
/*font-family: 'Lato';*/
|
||||
margin-bottom: 0;
|
||||
width: 40px;
|
||||
}
|
||||
|
|
@ -1364,7 +1379,8 @@ tech-sub-sec h2 {
|
|||
padding: 30px;
|
||||
}
|
||||
.percent-text {
|
||||
font-family: 'Lato';
|
||||
/*font-family: 'Lato';*/
|
||||
font-weight: normal;
|
||||
font-size: 37px;
|
||||
/* text-align: center; */
|
||||
}
|
||||
|
|
@ -1402,7 +1418,7 @@ tech-sub-sec h2 {
|
|||
.network-name {
|
||||
text-transform: uppercase;
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
font-weight: 300;
|
||||
letter-spacing: 2px;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ from .forms import BetaAccessForm
|
|||
from .models import BetaAccess, BetaAccessVMType, BetaAccessVM, VMTemplate
|
||||
from django.contrib import messages
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.core.mail import EmailMessage
|
||||
from utils.mailer import BaseEmail
|
||||
from django.shortcuts import render
|
||||
from django.shortcuts import redirect
|
||||
|
|
@ -12,12 +13,14 @@ from django.core.exceptions import ValidationError
|
|||
from django.views.decorators.cache import cache_control
|
||||
from django.conf import settings
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from utils.forms import BillingAddressForm
|
||||
from hosting.models import HostingOrder
|
||||
from utils.forms import BillingAddressForm, UserBillingAddressForm
|
||||
from utils.models import BillingAddress
|
||||
from hosting.models import HostingOrder, HostingBill
|
||||
from utils.stripe_utils import StripeUtils
|
||||
from datetime import datetime
|
||||
from membership.models import CustomUser, StripeCustomer
|
||||
from opennebula_api.models import OpenNebulaManager
|
||||
from opennebula_api.serializers import VirtualMachineTemplateSerializer, VMTemplateSerializer
|
||||
from opennebula_api.serializers import VirtualMachineTemplateSerializer, VirtualMachineSerializer, VMTemplateSerializer
|
||||
from datacenterlight.tasks import create_vm_task
|
||||
|
||||
|
||||
|
|
@ -423,6 +426,10 @@ class OrderConfirmationView(DetailView):
|
|||
customer = StripeCustomer.objects.filter(id=stripe_customer_id).first()
|
||||
stripe_utils = StripeUtils()
|
||||
card_details = stripe_utils.get_card_details(customer.stripe_id, request.session.get('token'))
|
||||
if not card_details.get('response_object') and not card_details.get('paid'):
|
||||
msg = card_details.get('error')
|
||||
messages.add_message(self.request, messages.ERROR, msg, extra_tags='failed_payment')
|
||||
return HttpResponseRedirect(reverse('datacenterlight:payment') + '#payment_error')
|
||||
context = {
|
||||
'site_url': reverse('datacenterlight:index'),
|
||||
'cc_last4': card_details.get('response_object').get('last4'),
|
||||
|
|
@ -438,6 +445,8 @@ class OrderConfirmationView(DetailView):
|
|||
customer = StripeCustomer.objects.filter(id=stripe_customer_id).first()
|
||||
billing_address_data = request.session.get('billing_address_data')
|
||||
billing_address_id = request.session.get('billing_address')
|
||||
billing_address = BillingAddress.objects.filter(
|
||||
id=billing_address_id).first()
|
||||
vm_template_id = template.get('id', 1)
|
||||
final_price = specs.get('price')
|
||||
|
||||
|
|
@ -445,15 +454,12 @@ class OrderConfirmationView(DetailView):
|
|||
stripe_utils = StripeUtils()
|
||||
charge_response = stripe_utils.make_charge(amount=final_price,
|
||||
customer=customer.stripe_id)
|
||||
charge = charge_response.get('response_object')
|
||||
|
||||
# Check if the payment was approved
|
||||
if not charge:
|
||||
context = {}
|
||||
context.update({
|
||||
'paymentError': charge_response.get('error')
|
||||
})
|
||||
return render(request, self.payment_template_name, context)
|
||||
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')
|
||||
return HttpResponseRedirect(reverse('datacenterlight:payment') + '#payment_error')
|
||||
|
||||
charge = charge_response.get('response_object')
|
||||
create_vm_task.delay(vm_template_id, user, specs, template, stripe_customer_id, billing_address_data,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue