diff --git a/.gitignore b/.gitignore index 2bfa8cdf..46bfbf54 100644 --- a/.gitignore +++ b/.gitignore @@ -35,3 +35,4 @@ secret-key .env *.mo +*.log diff --git a/Changelog b/Changelog index 5ab95416..e342aec6 100644 --- a/Changelog +++ b/Changelog @@ -1,3 +1,26 @@ +1.0.24: 2017-08-15 + * #3699: [datacenterlight] Added oneadmin ssh key by default to the created VM via DCL landing + * #3687: [datacenterlight] Added the name of the customer as description field of the stripe metadata + [all] Added CustomUser as a parameter in get_anonymous_user function to resolve issues with tests +1.0.23: 2017-08-11 + * #3629: [datacentlight] Fixed navbar changing language from DE to EN between menus bug + * #3623: [hosting] Fixed “Confirm Order” text appearing in “Invoice” place + * #3633: [datacenterlight, hosting] Translated “All Rights Reserved” for German pages + * #3627: [datacenterlight, hosting] Added border for payment warning message when the user has already submitted card information + * #3620: [hosting] Updated SSH Key page with new style: new key choice page, upload key page, added icons for downloading and deleting key on mobile + * [hosting] bug fix: added modal icon and translation back for delete SSH Key + * #3660: [datacenterlight] Rearranged desktop and mobile view for “Why Data Centre Light?” IPv6/SSD section + * #3646: Added file with VM Template hosting migration + * #3617: [hosting] Fixed Password reset confirmation page style bug + * #3408: [hosting] Changed background image of signup/login background into smaller size + * #3621: [hosting] Fixed signup/login/password reset page navbar logo overlapping with form + * #3354: [hosting] Restyled modal + * #3638: [hosting] Added “download” btn on generated key list for generated keys from upload your key page + * #3655: [hosting] Disabled deleting SSH keys from other users + * #3619: [datacenterlight, hosting] Replaced 'Lato-Light' and 'Lato-Regular' with only ‘Lato’ with appropriate font-weights + * #3677: [hosting] Added wrapping for show SSH key modal text + * #3683: [hosting] Fixed footer floating bug on VM creating page + * #3676: [datacenterlight, hosting] Added missing card holder's name field migration 1.0.22: 2017-07-30 * #3593: [datacenterlight] Removed underbars between social icons in index * #3509: [datacenterlight, hosting] Made navbar transparent and removed mobile navbar bug in login/signup/reset-password diff --git a/datacenterlight/static/datacenterlight/css/landing-page.css b/datacenterlight/static/datacenterlight/css/landing-page.css index 6c813661..c693247c 100755 --- a/datacenterlight/static/datacenterlight/css/landing-page.css +++ b/datacenterlight/static/datacenterlight/css/landing-page.css @@ -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; } diff --git a/datacenterlight/views.py b/datacenterlight/views.py index 2bae5c77..dec5add6 100644 --- a/datacenterlight/views.py +++ b/datacenterlight/views.py @@ -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, diff --git a/dynamicweb/settings/base.py b/dynamicweb/settings/base.py index a0d31592..a724b38e 100644 --- a/dynamicweb/settings/base.py +++ b/dynamicweb/settings/base.py @@ -523,6 +523,9 @@ OPENNEBULA_PORT = env('OPENNEBULA_PORT') # default value is /RPC2 OPENNEBULA_ENDPOINT = env('OPENNEBULA_ENDPOINT') +# The public ssh key of the oneadmin user +ONEADMIN_USER_SSH_PUBLIC_KEY = env('ONEADMIN_USER_SSH_PUBLIC_KEY') + # dcl email configurations DCL_TEXT = env('DCL_TEXT') DCL_SUPPORT_FROM_ADDRESS = env('DCL_SUPPORT_FROM_ADDRESS') diff --git a/hosting/forms.py b/hosting/forms.py index 5435ff8f..288a8caf 100644 --- a/hosting/forms.py +++ b/hosting/forms.py @@ -14,7 +14,6 @@ def generate_ssh_key_name(): class HostingUserLoginForm(forms.Form): - email = forms.CharField(widget=forms.EmailInput()) password = forms.CharField(widget=forms.PasswordInput()) @@ -45,7 +44,6 @@ class HostingUserLoginForm(forms.Form): class HostingUserSignupForm(forms.ModelForm): - confirm_password = forms.CharField(widget=forms.PasswordInput()) password = forms.CharField(widget=forms.PasswordInput()) @@ -88,9 +86,8 @@ class UserHostingKeyForm(forms.ModelForm): def clean(self): cleaned_data = self.cleaned_data - if not self.cleaned_data.get('name', ''): + if 'generate' in self.request.POST: self.cleaned_data['name'] = generate_ssh_key_name() - if not cleaned_data.get('public_key'): private_key, public_key = UserHostingKey.generate_keys() cleaned_data.update({ 'private_key': private_key, diff --git a/hosting/locale/de/LC_MESSAGES/django.po b/hosting/locale/de/LC_MESSAGES/django.po index 0e777a19..39bc4adc 100644 --- a/hosting/locale/de/LC_MESSAGES/django.po +++ b/hosting/locale/de/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-08-04 18:25+0000\n" +"POT-Creation-Date: 2017-08-11 01:16+0530\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -393,14 +393,14 @@ msgstr "" msgid "Delete SSH Key" msgstr "SSH Key löschen" -msgid "Do You want to delete this key?" +msgid "Do you want to delete this key?" msgstr "Möchtest Du den Schlüssel löschen?" msgid "Show" msgstr "Anzeigen" -msgid "Public ssh key" -msgstr "" +msgid "Public SSH Key" +msgstr "Public SSH Key" msgid "Download" msgstr "" diff --git a/hosting/static/hosting/css/commons.css b/hosting/static/hosting/css/commons.css index 79053e4e..156e1974 100644 --- a/hosting/static/hosting/css/commons.css +++ b/hosting/static/hosting/css/commons.css @@ -7,7 +7,7 @@ } .content-dashboard{ - min-height: calc(100vh - 120px); + min-height: calc(100vh - 70px); width: 80%; margin: 0 auto; max-width: 1120px; @@ -110,12 +110,16 @@ font-weight: 100; color: #999; } +.modal-body .modal-icon { + margin-bottom: 10px; +} .modal-title { margin: 0; line-height: 1.42857143; font-size: 25px; padding: 0; - font-family: 'Lato', sans-serif; + /*font-family: 'Lato', sans-serif;*/ + font-weight: 300; } .modal-text { padding-top: 15px; diff --git a/hosting/static/hosting/css/landing-page.css b/hosting/static/hosting/css/landing-page.css index d17ef8f2..b2d673d7 100644 --- a/hosting/static/hosting/css/landing-page.css +++ b/hosting/static/hosting/css/landing-page.css @@ -4,7 +4,7 @@ * For details, see http://www.apache.org/licenses/LICENSE-2.0. */ -@font-face { +/*@font-face { font-family: 'Lato-Regular'; src: url('../fonts/Lato/Lato-Regular.ttf'); } @@ -16,7 +16,7 @@ @font-face { font-family: 'Lato-Light'; src: url('../fonts/Lato/Lato-Light.ttf'); -} +}*/ body, html { @@ -31,8 +31,9 @@ h3, h4, h5, h6 { - font-family: 'Lato-Regular', sans-serif; - font-weight: 300; + /*font-family: 'Lato-Regular', sans-serif;*/ + font-family: 'Lato', sans-serif; + /*font-weight: 300;*/ } .topnav { @@ -53,7 +54,8 @@ h6 { .navbar-transparent .navbar-nav>li>a { color: #fff; cursor: pointer; - font-family: 'Lato-Regular', sans-serif; + /*font-family: 'Lato-Regular', sans-serif;*/ + font-weight: normal; } .navbar-transparent .navbar-nav>li>a:hover { color: #fff; @@ -376,7 +378,8 @@ h6 { text-align: center; font-size: 18px; line-height: 30px; - font-family: 'Lato' !important; + /*font-family: 'Lato' !important;*/ + font-weight: 300 !important; } .sign-up-message a { @@ -454,16 +457,16 @@ h6 { } footer { - padding: 2%; + padding: 20px; background-color: #f8f8f8; - #position: absolute; +/* position: absolute */ right: 0; bottom: 0; left: 0; } p.copyright { - margin: 15px 0 0; + margin: 14px 0 0; } a#forgotpassword { @@ -488,7 +491,8 @@ a.unlink:hover { /***** DCL payment page **********/ .dcl-order-container { - font-family: Lato; + /*font-family: Lato;*/ + font-weight: 300; } .dcl-order-table-header { @@ -547,11 +551,16 @@ a.unlink:hover { } .card-warning-content { - font-family: Lato; + /*font-family: Lato;*/ + font-weight: 300; border: 1px solid #a1a1a1; border-radius: 3px; padding: 5px; } +.card-warning-error { + border: 1px solid #EB4D5C; + color: #EB4D5C; +} .card-warning-addtional-margin { margin-top: 15px; diff --git a/hosting/static/hosting/css/pricing.css b/hosting/static/hosting/css/pricing.css index 8eba7ffa..3c952209 100644 --- a/hosting/static/hosting/css/pricing.css +++ b/hosting/static/hosting/css/pricing.css @@ -9,7 +9,7 @@ font-size: 14px; padding-left: 0; margin-bottom: 30px; - font-family: 'Lato'; + font-family: Lato, sans-serif; } diff --git a/hosting/static/hosting/css/user_keys.css b/hosting/static/hosting/css/user_keys.css index 77a12155..7935344f 100644 --- a/hosting/static/hosting/css/user_keys.css +++ b/hosting/static/hosting/css/user_keys.css @@ -1,6 +1,6 @@ /* ssh_keys_choice */ .h1-thin { - font-family: Lato, sans-serif; + /*font-family: Lato, sans-serif;*/ font-weight: 300; font-size: 32px; } @@ -10,12 +10,12 @@ } .dashboard-choice-container .page-header p { font-size: 16px; - font-family: Lato, sans-serif; + /*font-family: Lato, sans-serif;*/ font-weight: 300; } .dashboard-choice-container h2 { - font-family: Lato, sans-serif; - font-weight: 400; + /*font-family: Lato, sans-serif; + font-weight: 400;*/ font-size: 22px; margin-top: 0; } @@ -26,7 +26,7 @@ } .choice-container p{ font-size: 18px; - font-family: Lato, sans-serif; + /*font-family: Lato, sans-serif;*/ font-weight: 300; } .choice-container-top { @@ -119,7 +119,7 @@ color: #717274; font-size: 16px; font-weight: 300; - font-family: 'Lato'; + /*font-family: 'Lato';*/ } .borderless tbody:before { @@ -195,7 +195,8 @@ border-bottom: 1px solid grey; box-shadow: none; border-radius: 0; - font-family: 'Lato-Light', sans-serif; + /*font-family: 'Lato-Light', sans-serif;*/ + font-weight: 300; font-size: 20px; padding-left: 0; } @@ -203,57 +204,58 @@ .form_key_name::-webkit-input-placeholder{ font-size: 20px; font-weight:100; - font-family: 'Lato-Light', sans-serif; + /*font-family: 'Lato-Light', sans-serif;*/ + font-weight: 300; } .form_key_name::-moz-input-placeholder{ font-size: 20px; - font-weight:200; - font-family: 'Lato-Light', sans-serif; + /*font-family: 'Lato-Light', sans-serif;*/ + font-weight: 300; } .form_key_name:-moz-input-placeholder{ - font-family: 'Lato-Light', sans-serif; + /*font-family: 'Lato-Light', sans-serif;*/ + font-weight: 300; font-size: 20px; - font-weight:200; } .form_key_name:-ms-input-placeholder { font-size: 20px; - font-family: 'Lato-Light', sans-serif; - font-weight:200; + /*font-family: 'Lato-Light', sans-serif;*/ + font-weight: 300; } .form_public_key::-webkit-input-placeholder{ position: relative; top: 110px; font-size: 20px; - font-weight: 200; - font-family: 'Lato-Light', sans-serif; + /*font-family: 'Lato-Light', sans-serif;*/ + font-weight: 300; } .form_public_key::-moz-input-placeholder{ position: relative; top: 110px; font-size: 20px; - font-family: 'Lato-Light', sans-serif; - font-weight:200; + /*font-family: 'Lato-Light', sans-serif;*/ + font-weight: 300; } .form_public_key:-moz-input-placeholder{ position: relative; top: 110px; font-size: 20px; - font-weight:200; - font-family: 'Lato-Light', sans-serif; + /*font-family: 'Lato-Light', sans-serif;*/ + font-weight: 300; } .form_public_key:-ms-input-placeholder { position: relative; top: 110px; font-size: 20px; - font-weight:200; - font-family: 'Lato-Light', sans-serif; + /*font-family: 'Lato-Light', sans-serif;*/ + font-weight: 300; } .underform-contaner{ margin-bottom: 20px; @@ -273,7 +275,8 @@ } } .underform-contaner h4{ - font-family: 'Lato-Light', sans-serif; + /*font-family: 'Lato-Light', sans-serif;*/ + font-weight: 300; } .underform-contaner button{ /* font-family: Lato; */ @@ -287,13 +290,16 @@ color: #fff; } .control-label{ - font-family: 'Lato-Light', sans-serif; + /*font-family: 'Lato-Light', sans-serif;*/ + font-weight: 300; font-size: 20px; - font-weight:200; } .form-ssh h3{ margin-bottom: 40px; } +.key_contain { + word-break: break-all; +} .custom_form_button{ border-radius: 0; } diff --git a/hosting/templates/hosting/payment.html b/hosting/templates/hosting/payment.html index 237dffd1..7bf84645 100644 --- a/hosting/templates/hosting/payment.html +++ b/hosting/templates/hosting/payment.html @@ -59,7 +59,6 @@ {% csrf_token %} {% bootstrap_field field show_label=False type='fields'%} {% endfor %} - {% bootstrap_form_errors form type='non_fields'%}
@@ -86,13 +85,29 @@
-

- {% blocktrans %} - You are not making any payment yet. After submitting your card - information, you will be taken to the Confirm Order Page. - {% endblocktrans %} -

-
+ {% if not messages and not form.non_field_errors %} +

+ {% blocktrans %} + You are not making any payment yet. After submitting your card + information, you will be taken to the Confirm Order Page. + {% endblocktrans %} +

+ {% endif %} +
+ {% for message in messages %} + {% if 'failed_payment' or 'make_charge_error' in message.tags %} +
  • +

    {{ message|safe }}

    +
+ {% endif %} + {% endfor %} + {% for error in form.non_field_errors %} +

+ {{ error|escape }} +

+ {% endfor %} +
+
-

- {% blocktrans %} - You are not making any payment yet. After submitting your card - information, you will be taken to the Confirm Order Page. - {% endblocktrans %} -

+ {% if not messages and not form.non_field_errors %} +

+ {% blocktrans %} + You are not making any payment yet. After submitting your card + information, you will be taken to the Confirm Order Page. + {% endblocktrans %} +

+ {% endif %} +
+ {% for message in messages %} + {% if 'failed_payment' or 'make_charge_error' in message.tags %} +
  • +

    {{ message|safe }}

    +
+ {% endif %} + {% endfor %} + + {% for error in form.non_field_errors %} +

+ {{ error|escape }} +

+ {% endfor %} +
@@ -150,15 +182,6 @@

- {% if paymentError %} -
-
-

- {% bootstrap_alert paymentError alert_type='danger' %} -

-
-
- {% endif %} {% endif %} diff --git a/hosting/templates/hosting/user_keys.html b/hosting/templates/hosting/user_keys.html index 2125bd9f..b66a1f6f 100644 --- a/hosting/templates/hosting/user_keys.html +++ b/hosting/templates/hosting/user_keys.html @@ -50,7 +50,7 @@