diff --git a/.travis.yml b/.travis.yml index a1d0aacc..c306c1f9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,13 +1,14 @@ language: python python: - - "3.5" - - "3.6" + - "3.4.2" +# - "3.6" env: - # Set a dummy secret key - - DJANGO_SECRET_KEY=0 + - DJANGO_SECRET_KEY=0 OPENNEBULA_USERNAME='test' OPENNEBULA_PASSWORD='test' OPENNEBULA_PROTOCOL='http' OPENNEBULA_DOMAIN='test_domain' OPENNEBULA_PORT='2633' OPENNEBULA_ENDPOINT='/RPC2' DCL_TEXT='Data Center Light' CELERY_MAX_RETRIES=0 # install dependencies install: "pip install -r requirements.txt" script: - flake8 -- python manage.py test +- python manage.py test -v 3 +# - coverage run --source='.' manage.py test dynamicweb -v 3 +# - coverage report diff --git a/Changelog b/Changelog index fdcb6053..ad39c20d 100644 --- a/Changelog +++ b/Changelog @@ -1,5 +1,36 @@ -Next release: +1.2.13: 2017-12-09 + * [cms] Introduce UngleichHeaderBackgroundImageAndTextSliderPlugin that allows to have scrolling images and texts + * [cms] Remove

tag for ungleich cms customer item template +1.2.12: 2017-12-09 + * #3594: [digitalglarus] Remove white scroll bar on the right in mobile + * #3905: [ungleich] Update ungleich.ch header into a slider + * [all] Enable logging custom modules +1.2.11: 2017-11-30 + * [all] TravisCI: Test against python 3.4.2 only + * [ungleich] Remove data-replaced image in ungleich CMS services item plugin template +1.2.10: 2017-11-26 + * #3843: [ungleich] Add generic ungleich CMS template + * #3672: [all] Clean existing automated tests +1.2.9: 2017-11-13 + * #3848: [ungleich] Optimize ungleich.ch landing page + * #3360: [ungleich] Ungleich.ch landing page animation fix + * #3421: [hosting] Signup form placeholder translations + * #3856: [ungleich] Glasfaser text modified + * bugfix: [blog] Redirect user to ungleich home on ungleich logo click + * #3858: [dcl] Change "affordable vm ..." text to "Ready in 30 seconds ..." +1.2.8: 2017-10-21 + * Remove ALLOWED_HOST alplora.ch + * Add ALLOWED_HOST hack4glarus.ch + * Fetch page_title and meta_description dynamically in glasfaser CMS template +1.2.7: 2017-10-20 * Bugfix: [dcl, hosting] Fix Stripe js error in confirm payment page + * #3847: [ungleich] change text 'hosting products' -> 'our products' + * #3829: [dcl] Handle landing login fail in payment page itself + * #3794: [dcl, hosting] Update email styles + * #3828: [dcl, hosting] invoice period set to show monthly subscription + * #3838: [hosting] restyle signup/login/password reset/password pages + * Bugfix: [dg] Remove validate email link in the registration email + * Feature: [ungleich_page] Add new glasfaser CMS template 1.2.6: 2017-10-10 * Bugfix: [dcl] Refactor and optimize images, links in glasfaser page * Bugfix: [dcl] Fix email not being sent issue @@ -8,7 +39,6 @@ Next release: * Bugfix: [hosting] card details input form alignment fix * #3823: [hosting] favicon link fixed * #3844: [dcl] Add Glasfaser page for advertisement - 1.2.4: 2017-10-02 * #3780: [hosting] Store VM details locally * #3764: [hosting] Show cancelled VMs' invoices diff --git a/README.rst b/README.rst index 8c8c8ddb..f297018c 100644 --- a/README.rst +++ b/README.rst @@ -3,6 +3,10 @@ ungleich dynamicweb ---------- + +.. image:: https://travis-ci.org/ungleich/dynamicweb.svg?branch=master + :target: https://travis-ci.org/ungleich/dynamicweb + Website for ungleich GmbH ======= diff --git a/datacenterlight/locale/de/LC_MESSAGES/django.po b/datacenterlight/locale/de/LC_MESSAGES/django.po index d5035912..c69f83d1 100644 --- a/datacenterlight/locale/de/LC_MESSAGES/django.po +++ b/datacenterlight/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-10-10 21:35+0530\n" +"POT-Creation-Date: 2017-11-13 17:59+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -126,56 +126,57 @@ msgstr "" msgid "Thank you!" msgstr "Vielen Dank!" -msgid "Account Activation" -msgstr "Account Aktivierung" +msgid "Data Center Light Account Activation" +msgstr "Data Center Light Account Aktivierung" #, python-format msgid "" -"\n" -"You can activate your Data Center Light account by clicking here.
\n" +"You can activate your Data Center Light account by clicking here." +msgstr "" +"Klicke here um deinen Data Center " +"Light Account zu aktivieren." + +msgid "" "You can also copy and paste the following link into the address bar of your " -"browser
\n" -"to activate your Data Center Light account.
\n" -"%(base_url)s%(activation_link)s\n" -msgstr "" -"\n" -"Klicke hier um deinen Data " -"Center Light Account zu aktivieren oder kopiere den folgenden Link in die " -"Adressleiste deines Browsers.
\n" -"%(base_url)s%(activation_link)s\n" +"browser to activate your Data Center Light account." +msgstr "Kopiere den folgenden Link in die Adressleiste deines Browsers." -#, python-format -msgid "" -"Your account details are as follows:

\n" -"Username : Your email address
\n" -"Password : %(account_details)s

\n" -"You can reset your password here:\n" -"%(base_url)s%(reset_password_url)s\n" -msgstr "" +msgid "Your account details are as follows" +msgstr "Deine Account Details sind unten aufgelistet" -#, python-format -msgid "" -"You can activate your Data Center Light account by clicking here.\n" -"You can also copy and paste the following link into the address bar of your " -"browser\n" -"to activate your Data Center Light account.\n" -"%(base_url)s%(activation_link)s\n" -msgstr "" -"Klicke hier, um deinen Data Center Light Account zu aktivieren oder kopiere " -"den folgenden Link in die Adressleiste deines Browsers.\n" -"%(base_url)s%(activation_link)s\n" +msgid "Username" +msgstr "Username" + +msgid "Your email address" +msgstr "Deine E-Mail-Adresse" + +msgid "Password" +msgstr "Passwort" + +msgid "You can reset your password here" +msgstr "Du kannst dein Passwort hier zurück setzen" -#, python-format msgid "" -"Your account details are as follows:\n" -"\n" -"Username : Your email address\n" -"Password : %(account_details)s\n" -"\n" -"You can reset your password here:\n" -"%(base_url)s%(reset_password_url)s\n" -msgstr "" +"You can copy and paste the following link into the address bar of your " +"browser to activate your Data Center Light account." +msgstr "Kopiere den folgenden Link in die Adressleiste deines Browsers." + +msgid "Welcome to Data Center Light!" +msgstr "Willkommen beim Data Center Light!" + +msgid "" +"Thanks for joining us! We provide the most affordable virtual machines from " +"the heart of Switzerland." +msgstr "Bei uns findest Du die günstiges VMs aus der Schweiz." + +msgid "Try now, order a VM. VM price starts from only 15CHF per month." +msgstr "Unser Angebot beginnt bei 15 CHF pro Monat. Probier's jetzt aus!" + +msgid "ORDER VM" +msgstr "VM BESTELLEN" msgid "Home" msgstr "Home" @@ -269,8 +270,12 @@ msgstr "" "Einfach und bezahlbar: Teste nun unsere virtuellen Maschinen mit " "federleichten Preisen." -msgid "Affordable VM hosting based in Switzerland" -msgstr "Bezahlbares VM Hosting in der Schweiz" +msgid "" +"Ready in 30 seconds.
Experience the unbeatable speed from Data Center " +"Light." +msgstr "" +"Fertig in 30 Sekunden.
Erlebe die unschlagbare Geschwindigkeit von Data " +"Center Light." msgid "Contact us" msgstr "Kontaktiere uns" @@ -512,6 +517,18 @@ msgstr "" "Deine VM ist gleich bereit. Wir senden Dir eine Bestätigungsemail, sobald Du " "auf sie zugreifen kannst." +#~ msgid "Affordable VM hosting based in Switzerland" +#~ msgstr "Bezahlbares VM Hosting in der Schweiz" + +#~ msgid "Processing..." +#~ msgstr "Abarbeitung..." + +#~ msgid "Hold tight, we are processing your request" +#~ msgstr "Bitte warten - wir verbeiten Deine Anfrage gerade" + +#~ msgid "Some problem encountered. Please try again later." +#~ msgstr "Ein Problem ist aufgetreten. Bitte versuche es später noch einmal." + #~ msgid "Submit" #~ msgstr "Absenden" @@ -530,15 +547,6 @@ msgstr "" #~ msgid "Order summary" #~ msgstr "Bestellungsübersicht" -#~ msgid "Processing..." -#~ msgstr "Abarbeitung..." - -#~ msgid "Hold tight, we are processing your request" -#~ msgstr "Bitte warten - wir verbeiten Deine Anfrage gerade" - -#~ msgid "Some problem encountered. Please try again later." -#~ msgstr "Ein Problem ist aufgetreten. Bitte versuche es später noch einmal." - #~ msgid "We are cutting down the costs significantly!" #~ msgstr "Wir sorgen dafür, dass die Kosten für Dich signifikant abnehmen" @@ -560,9 +568,6 @@ msgstr "" #~ "kontaktiere uns unter support@datacenterlight.ch. Unser Team wird sich " #~ "umgehend um dein Anliegen kümmern!" -#~ msgid "Email Address" -#~ msgstr "E-Mail-Adresse" - #~ msgid "is not a proper name" #~ msgstr "ist kein gültiger Name" diff --git a/datacenterlight/static/datacenterlight/css/landing-page.css b/datacenterlight/static/datacenterlight/css/landing-page.css index 97599738..196dcda4 100755 --- a/datacenterlight/static/datacenterlight/css/landing-page.css +++ b/datacenterlight/static/datacenterlight/css/landing-page.css @@ -7,7 +7,7 @@ body, html { width: 100%; - height: 100%; + min-height: 100%; } body, @@ -182,7 +182,11 @@ button, input, optgroup, select, textarea { .navbar-brand { padding: 10px 15px; - cursor: pointer; +} +@media (max-width: 767px) { + .navbar-brand { + padding: 10px 10px; + } } .navbar-right { @@ -1544,7 +1548,7 @@ tech-sub-sec h2 { } footer { - padding: 50px 0; + padding: 50px 20px; background-color: #f8f8f8; } diff --git a/datacenterlight/static/datacenterlight/img/logo_black.png b/datacenterlight/static/datacenterlight/img/logo_black.png new file mode 100644 index 00000000..5dfd0eaa Binary files /dev/null and b/datacenterlight/static/datacenterlight/img/logo_black.png differ diff --git a/datacenterlight/static/datacenterlight/img/pattern.jpg b/datacenterlight/static/datacenterlight/img/pattern.jpg index 8ae4c0f2..7c66e007 100755 Binary files a/datacenterlight/static/datacenterlight/img/pattern.jpg and b/datacenterlight/static/datacenterlight/img/pattern.jpg differ diff --git a/datacenterlight/tasks.py b/datacenterlight/tasks.py index 1f34c3fe..3db6eb54 100644 --- a/datacenterlight/tasks.py +++ b/datacenterlight/tasks.py @@ -5,6 +5,7 @@ from celery.utils.log import get_task_logger from celery import current_task from django.conf import settings from django.core.mail import EmailMessage +from django.core.urlresolvers import reverse from django.utils import translation from django.utils.translation import ugettext_lazy as _ @@ -131,9 +132,9 @@ def create_vm_task(self, vm_template_id, user, specs, template, 'storage': specs.get('disk_size'), 'price': specs.get('price'), 'template': template.get('name'), - 'vm.name': vm['name'], - 'vm.id': vm['vm_id'], - 'order.id': order.id + 'vm_name': vm.get('name'), + 'vm_id': vm['vm_id'], + 'order_id': order.id } email_data = { 'subject': settings.DCL_TEXT + " Order from %s" % context['email'], @@ -155,13 +156,14 @@ def create_vm_task(self, vm_template_id, user, specs, template, translation.activate(lang) # Send notification to the user as soon as VM has been booked context = { - 'vm': vm, - 'order': order, 'base_url': "{0}://{1}".format(user.get('request_scheme'), user.get('request_host')), + 'order_url': reverse('hosting:orders', + kwargs={'pk': order.id}), 'page_header': _( 'Your New VM %(vm_name)s at Data Center Light') % { - 'vm_name': vm.get('name')} + 'vm_name': vm.get('name')}, + 'vm_name': vm.get('name') } email_data = { 'subject': context.get('page_header'), diff --git a/datacenterlight/templates/datacenterlight/emails/user_activation.html b/datacenterlight/templates/datacenterlight/emails/user_activation.html index 3c7fae74..8f270a3f 100644 --- a/datacenterlight/templates/datacenterlight/emails/user_activation.html +++ b/datacenterlight/templates/datacenterlight/emails/user_activation.html @@ -1,24 +1,58 @@ -{% extends "datacenterlight/emails/base_email_datacenterlight.html" %} -{% load static from staticfiles %} -{% load i18n %} -{% block email_head %} -{{dcl_text}} {% trans 'Account Activation' %} -{% endblock %} -{% block email_body %} -{% blocktrans %} -You can activate your Data Center Light account by clicking here.
-You can also copy and paste the following link into the address bar of your browser
-to activate your Data Center Light account.
-{{base_url}}{{activation_link}} -{% endblocktrans %} -{% if account_details %} -{% url 'hosting:reset_password' as reset_password_url %} -

-{% blocktrans %}Your account details are as follows:

-Username : Your email address
-Password : {{account_details}}

-You can reset your password here: -{{base_url}}{{reset_password_url}} -{% endblocktrans %} -{% endif %} -{% endblock %} +{% load static i18n %} + + + + + + + {% trans "Data Center Light Account Activation" %} + + + + + + + + + + + + + + + + + + +
+ +
+

{% trans "Data Center Light Account Activation" %}

+
+

+ {% blocktrans %}You can activate your Data Center Light account by clicking here.{% endblocktrans %} +

+

+ {% blocktrans %}You can also copy and paste the following link into the address bar of your browser to activate your Data Center Light account.{% endblocktrans %} +

+

+ {{base_url}}{{activation_link}} +

+

+ {% if account_details %} + {% url 'hosting:reset_password' as reset_password_url %} + {% trans "Your account details are as follows" %}: + + {% trans "Username" %} : {% trans "Your email address" %} + {% trans "Password" %} : {{account_details}} + + {% trans "You can reset your password here" %}: + {{base_url}}{{reset_password_url}} + {% endif %} +

+
+

{% trans "Your Data Center Light Team" %}

+
+ + + diff --git a/datacenterlight/templates/datacenterlight/emails/user_activation.txt b/datacenterlight/templates/datacenterlight/emails/user_activation.txt index 7c833256..4f66e239 100644 --- a/datacenterlight/templates/datacenterlight/emails/user_activation.txt +++ b/datacenterlight/templates/datacenterlight/emails/user_activation.txt @@ -1,21 +1,20 @@ -{% extends "datacenterlight/emails/base_email_datacenterlight.txt" %} {% load i18n %} -{% block email_head %}{{dcl_text}} {% trans 'Account Activation' %}{% endblock %} -{% block email_body %} -{% blocktrans %}You can activate your Data Center Light account by clicking here. -You can also copy and paste the following link into the address bar of your browser -to activate your Data Center Light account. + +{% trans "Data Center Light Account Activation" %} + +{% blocktrans %}You can copy and paste the following link into the address bar of your browser to activate your Data Center Light account.{% endblocktrans %} + {{base_url}}{{activation_link}} -{% endblocktrans %} + {% if account_details %} -{% url 'hosting:reset_password' as reset_password_url %} -{% blocktrans %}Your account details are as follows: + {% url 'hosting:reset_password' as reset_password_url %} + {% trans "Your account details are as follows" %}: -Username : Your email address -Password : {{account_details}} + {% trans "Username" %} : {% trans "Your email address" %} + {% trans "Password" %} : {{account_details}} -You can reset your password here: -{{base_url}}{{reset_password_url}} -{% endblocktrans %} + {% trans "You can reset your password here" %}: + {{base_url}}{{reset_password_url}} {% endif %} -{% endblock %} + +{% trans "Your Data Center Light Team" %} \ No newline at end of file diff --git a/datacenterlight/templates/datacenterlight/emails/welcome_user.html b/datacenterlight/templates/datacenterlight/emails/welcome_user.html new file mode 100644 index 00000000..e947ac97 --- /dev/null +++ b/datacenterlight/templates/datacenterlight/emails/welcome_user.html @@ -0,0 +1,48 @@ +{% load static i18n %} + + + + + + + {% trans "Welcome to Data Center Light!" %} + + + + + + + + + + + + + + + + + + + + + +
+ +
+

{% trans "Welcome to Data Center Light!" %}

+
+

+ {% blocktrans %}Thanks for joining us! We provide the most affordable virtual machines from the heart of Switzerland.{% endblocktrans %} +

+

+ {% blocktrans %}Try now, order a VM. VM price starts from only 15CHF per month.{% endblocktrans %} +

+
+ {% trans "ORDER VM" %} +
+

{% trans "Your Data Center Light Team" %}

+
+ + + \ No newline at end of file diff --git a/datacenterlight/templates/datacenterlight/emails/welcome_user.txt b/datacenterlight/templates/datacenterlight/emails/welcome_user.txt new file mode 100644 index 00000000..0e7820e6 --- /dev/null +++ b/datacenterlight/templates/datacenterlight/emails/welcome_user.txt @@ -0,0 +1,10 @@ +{% load i18n %} + +{% trans "Welcome to Data Center Light!" %} + +{% blocktrans %}Thanks for joining us! We provide the most affordable virtual machines from the heart of Switzerland.{% endblocktrans %} +{% blocktrans %}Try now, order a VM. VM price starts from only 15CHF per month.{% endblocktrans %} + +{{ base_url }}{% url 'hosting:create_virtual_machine' %} + +{% trans "Your Data Center Light Team" %} \ No newline at end of file diff --git a/datacenterlight/templates/datacenterlight/includes/_footer.html b/datacenterlight/templates/datacenterlight/includes/_footer.html index 76c2c16e..edb7f8aa 100644 --- a/datacenterlight/templates/datacenterlight/includes/_footer.html +++ b/datacenterlight/templates/datacenterlight/includes/_footer.html @@ -1,38 +1,39 @@ - {% load staticfiles i18n%} +{% load staticfiles i18n%} {% get_current_language as LANGUAGE_CODE %} -

+ diff --git a/datacenterlight/templates/datacenterlight/index.html b/datacenterlight/templates/datacenterlight/index.html index 85e66571..cc3597ec 100755 --- a/datacenterlight/templates/datacenterlight/index.html +++ b/datacenterlight/templates/datacenterlight/index.html @@ -130,7 +130,7 @@

{% trans "Simple and affordable: Try our virtual machine with featherlight price." %}

-

{% trans "Affordable VM hosting based in Switzerland" %}

+

{% blocktrans %}Ready in 30 seconds.
Experience the unbeatable speed from Data Center Light.{% endblocktrans %}

diff --git a/datacenterlight/templates/datacenterlight/landing_payment.html b/datacenterlight/templates/datacenterlight/landing_payment.html index fa638d77..d195690b 100644 --- a/datacenterlight/templates/datacenterlight/landing_payment.html +++ b/datacenterlight/templates/datacenterlight/landing_payment.html @@ -25,14 +25,15 @@

{%trans "Log in" %}


{% blocktrans %}Already signed up?
By logging in you can retrieve saved billing information.{% endblocktrans %}

-
+ {% for field in login_form %} {% csrf_token %} {% bootstrap_field field show_label=False type='fields'%} {% endfor %} +

{{login_form.non_field_errors|striptags}}

- +

@@ -58,7 +59,7 @@ {% endfor %}

{% csrf_token %} - {% for field in form %} + {% for field in billing_address_form %} {% bootstrap_field field show_label=False type='fields'%} {% endfor %}
@@ -153,22 +154,12 @@ {% endif %}
{% for message in messages %} - {% if 'failed_payment' in message.tags or 'make_charge_error' in message.tags %} + {% if 'failed_payment' in message.tags or 'make_charge_error' in message.tags or 'error' in message.tags %}
  • {{ message|safe }}

- {% elif not form.non_field_errors %} -

- {% trans "You are not making any payment yet. After placing your order, you will be taken to the Submit Payment Page." %} -

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

- {{ error|escape }} -

- {% endfor %}
diff --git a/datacenterlight/templatetags/custom_tags.py b/datacenterlight/templatetags/custom_tags.py index ce6e6724..908b1f89 100644 --- a/datacenterlight/templatetags/custom_tags.py +++ b/datacenterlight/templatetags/custom_tags.py @@ -31,3 +31,14 @@ def get_value_from_dict(dict_data, key): return dict_data.get(key) else: return "" + + +@register.filter('multiply') +def multiply(value, arg): + """ + usage: {{ quantity|multiply:price }} + :param value: + :param arg: + :return: + """ + return value*arg diff --git a/datacenterlight/tests.py b/datacenterlight/tests.py index 3405cfb6..d1ce9785 100644 --- a/datacenterlight/tests.py +++ b/datacenterlight/tests.py @@ -8,6 +8,8 @@ from django.conf import settings from django.core.management import call_command from django.test import TestCase, override_settings from model_mommy import mommy +from unittest import skipIf + from datacenterlight.models import VMTemplate from datacenterlight.tasks import create_vm_task from membership.models import StripeCustomer @@ -16,6 +18,11 @@ from utils.hosting_utils import get_vm_price from utils.stripe_utils import StripeUtils +@skipIf( + settings.STRIPE_API_PRIVATE_KEY_TEST is None or + settings.STRIPE_API_PRIVATE_KEY_TEST is "", + """Stripe details unavailable, so skipping CeleryTaskTestCase""" + ) class CeleryTaskTestCase(TestCase): @override_settings( task_eager_propagates=True, @@ -47,6 +54,11 @@ class CeleryTaskTestCase(TestCase): # OpenNebula call_command('fetchvmtemplates') + @skipIf( + settings.OPENNEBULA_DOMAIN is None or settings.OPENNEBULA_DOMAIN is + "test_domain", + """OpenNebula details unavailable, so skipping test_create_vm_task""" + ) def test_create_vm_task(self): """Tests the create vm task for monthly subscription @@ -110,13 +122,11 @@ class CeleryTaskTestCase(TestCase): msg = subscription_result.get('error') raise Exception("Creating subscription failed: {}".format(msg)) - async_task = create_vm_task.delay(vm_template_id, self.user, - specs, - template_data, - stripe_customer.id, - billing_address_data, - stripe_subscription_obj.id, - card_details_dict) + async_task = create_vm_task.delay( + vm_template_id, self.user, specs, template_data, + stripe_customer.id, billing_address_data, + stripe_subscription_obj.id, card_details_dict + ) new_vm_id = 0 res = None for i in range(0, 10): diff --git a/datacenterlight/views.py b/datacenterlight/views.py index 81c83685..bd1a7f51 100644 --- a/datacenterlight/views.py +++ b/datacenterlight/views.py @@ -345,26 +345,45 @@ class PaymentOrderView(FormView): else: return BillingAddressFormSignup - def get_form_kwargs(self): - form_kwargs = super(PaymentOrderView, self).get_form_kwargs() - # if user is signed in, get billing address - if self.request.user.is_authenticated(): - form_kwargs.update({ - 'instance': self.request.user.billing_addresses.first() - }) - if 'billing_address_data' in self.request.session: - billing_address_data = self.request.session['billing_address_data'] - form_kwargs.update({ - 'initial': billing_address_data - }) - return form_kwargs - def get_context_data(self, **kwargs): context = super(PaymentOrderView, self).get_context_data(**kwargs) + if 'billing_address_data' in self.request.session: + billing_address_data = self.request.session['billing_address_data'] + else: + billing_address_data = {} + + if self.request.user.is_authenticated(): + if billing_address_data: + billing_address_form = BillingAddressForm( + initial=billing_address_data + ) + else: + billing_address_form = BillingAddressForm( + instance=self.request.user.billing_addresses.first() + ) + # Get user last order + last_hosting_order = HostingOrder.objects.filter( + customer__user=self.request.user + ).last() + + # If user has already an hosting order, get the credit card + # data from it + if last_hosting_order: + credit_card_data = last_hosting_order.get_cc_data() + if credit_card_data: + context['credit_card_data'] = credit_card_data + else: + context['credit_card_data'] = None + else: + billing_address_form = BillingAddressFormSignup( + initial=billing_address_data + ) + context.update({ 'stripe_key': settings.STRIPE_API_PUBLIC_KEY, 'site_url': reverse('datacenterlight:index'), - 'login_form': HostingUserLoginForm() + 'login_form': HostingUserLoginForm(prefix='login_form'), + 'billing_address_form': billing_address_form }) return context @@ -376,9 +395,32 @@ class PaymentOrderView(FormView): return self.render_to_response(self.get_context_data()) def post(self, request, *args, **kwargs): - form = self.get_form() - if form.is_valid(): - token = form.cleaned_data.get('token') + if 'login_form' in request.POST: + login_form = HostingUserLoginForm(data=request.POST, + prefix='login_form') + if login_form.is_valid(): + email = login_form.cleaned_data.get('email') + password = login_form.cleaned_data.get('password') + auth_user = authenticate(email=email, password=password) + if auth_user: + login(self.request, auth_user) + return HttpResponseRedirect( + reverse('datacenterlight:payment') + ) + else: + context = self.get_context_data() + context['login_form'] = login_form + return self.render_to_response(context) + if request.user.is_authenticated(): + address_form = BillingAddressForm( + data=request.POST, + ) + else: + address_form = BillingAddressFormSignup( + data=request.POST, + ) + if address_form.is_valid(): + token = address_form.cleaned_data.get('token') if request.user.is_authenticated(): this_user = { 'email': request.user.email, @@ -388,8 +430,8 @@ class PaymentOrderView(FormView): email=this_user.get('email'), token=token) else: - user_email = form.cleaned_data.get('email') - user_name = form.cleaned_data.get('name') + user_email = address_form.cleaned_data.get('email') + user_name = address_form.cleaned_data.get('name') this_user = { 'email': user_email, 'name': user_name @@ -422,13 +464,18 @@ class PaymentOrderView(FormView): token=token, customer_name=user_name) - request.session['billing_address_data'] = form.cleaned_data + request.session['billing_address_data'] = address_form.cleaned_data request.session['user'] = this_user # Get or create stripe customer if not customer: - form.add_error("__all__", "Invalid credit card") + address_form.add_error( + "__all__", "Invalid credit card" + ) return self.render_to_response( - self.get_context_data(form=form)) + self.get_context_data( + billing_address_form=address_form + ) + ) request.session['token'] = token if type(customer) is StripeCustomer: request.session['customer'] = customer.stripe_id @@ -437,7 +484,9 @@ class PaymentOrderView(FormView): return HttpResponseRedirect( reverse('datacenterlight:order_confirmation')) else: - return self.form_invalid(form) + context = self.get_context_data() + context['billing_address_form'] = address_form + return self.render_to_response(context) class OrderConfirmationView(DetailView): @@ -548,9 +597,13 @@ class OrderConfirmationView(DetailView): try: custom_user = CustomUser.objects.get( email=user.get('email')) - customer = StripeCustomer.objects.filter( + stripe_customer = StripeCustomer.objects.filter( user_id=custom_user.id).first() - stripe_customer_id = customer.id + if stripe_customer is None: + stripe_customer = StripeCustomer.objects.create( + user=custom_user, stripe_id=stripe_api_cus_id + ) + stripe_customer_id = stripe_customer.id except CustomUser.DoesNotExist: logger.debug( "Customer {} does not exist.".format(user.get('email'))) diff --git a/digitalglarus/locale/de/LC_MESSAGES/django.po b/digitalglarus/locale/de/LC_MESSAGES/django.po index 6ae6a6bb..23c0ecab 100644 --- a/digitalglarus/locale/de/LC_MESSAGES/django.po +++ b/digitalglarus/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-10-10 21:35+0530\n" +"POT-Creation-Date: 2017-11-06 00:24+0530\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -95,6 +95,9 @@ msgstr "Seite" msgid "Data Center Light" msgstr "" +msgid "Glasfaser" +msgstr "" + msgid "English" msgstr "" diff --git a/digitalglarus/static/digitalglarus/css/agency.css b/digitalglarus/static/digitalglarus/css/agency.css index f66ce70c..4ac531c2 100755 --- a/digitalglarus/static/digitalglarus/css/agency.css +++ b/digitalglarus/static/digitalglarus/css/agency.css @@ -67,7 +67,7 @@ h6 { font-size: 18px; } -@media only screen and (max-width: 400px){ +@media only screen and (max-width: 400px){ h1, h2 { font-size: 20px; } @@ -404,8 +404,8 @@ section h3.section-subheading { @media(min-width:768px) { section { padding: 50px 0; - } -} + } +} */ .service-heading { margin: 15px 0; @@ -416,7 +416,7 @@ section h3.section-subheading { .no-padding { padding:0; -} +} .no-gutter > [class*='col-'] { padding-top:0; @@ -964,40 +964,6 @@ section h3.section-comment { color: #494949; } -small-comment { - font-family: "Open Sans", "Droid Serif", "Helvetica Neue", Helvetica, Arial, sans-serif; - margin-bottom: none; - font-transform: none; - font-size:10px; - font-weight:400; - color: #777 -} - -logo-image { - z-index: 100; - position: absolute; - left: 0; - width: 80px; - height: 80px; - margin-left: 0; - border: 7px solid #f1f1f1; - border-radius: 100%; - text-align: center; - color: #fff; - background-color: #a1cfd7; -} - - -intro-cap { - margin-bottom: 25px; - text-transform: uppercase; - font-family: 'Raleway', "Helvetica Neue", "Helvetica Neue", Helvetica,Arial,sans-serif; - font-size: 24px; - font-weight: 400; - line-height: 50px; - color:#fff - background-color: #a1cfd7; -} .intro-small { font-family: 'Montserrat' ,'Raleway', "Open Sans Bold", Helvetica, Arial, "Arial Bold", sans-serif; font-size: 20px; @@ -1006,26 +972,7 @@ intro-cap { text-transform: uppercase; color: #FFF; } -intro-headline { - margin-bottom: 25px; - text-transform: uppercase; - font-family: 'Raleway', "Helvetica Neue", "Helvetica Neue", Helvetica,Arial,sans-serif; - font-size: 24px; - font-weight: 400; - line-height: 100px; - color:#fff - background-color: #a1cfd7; -} -h6 intro-smallcap { - margin-bottom: 25px; - text-transform: none; - font-family:'Raleway' , Montserrat,"Helvetica Neue",Helvetica,Arial,sans-serif; - font-size: 18px; - font-weight: 400; - line-height: 50px; - color:#fff - background-color: #a1cfd7; -} + .darkened-container { /* Fallback for web browsers that doesn't support RGBa */ background: rgb(0, 0, 0); @@ -1043,7 +990,7 @@ h6 intro-smallcap { font-size: 14px; line-height: 1.43; height: 86px; /* this is wrong */ - /*color: #484848;*/ + /*color: #484848;*/ } .carousel-indicators li { @@ -1143,7 +1090,7 @@ body { .carousel-control { height: 100%; - + } /* Background images are set within the HTML using inline CSS, not here */ @@ -1231,7 +1178,7 @@ hr { padding-top: 2em; } -.donate { +.donate { font-weight: 600; font-size: 24px; } diff --git a/digitalglarus/static/digitalglarus/css/agency1.css b/digitalglarus/static/digitalglarus/css/agency1.css index 67154295..6178630c 100755 --- a/digitalglarus/static/digitalglarus/css/agency1.css +++ b/digitalglarus/static/digitalglarus/css/agency1.css @@ -400,8 +400,8 @@ section h3.section-subheading { @media(min-width:768px) { section { padding: 50px 0; - } -} + } +} */ .service-heading { margin: 15px 0; @@ -412,7 +412,7 @@ section h3.section-subheading { .no-padding { padding:0; -} +} .no-gutter > [class*='col-'] { padding-top:0; @@ -960,40 +960,6 @@ section h3.section-comment { color: #494949; } -small-comment { - font-family: "Open Sans", "Droid Serif", "Helvetica Neue", Helvetica, Arial, sans-serif; - margin-bottom: none; - font-transform: none; - font-size:10px; - font-weight:400; - color: #777 -} - -logo-image { - z-index: 100; - position: absolute; - left: 0; - width: 80px; - height: 80px; - margin-left: 0; - border: 7px solid #f1f1f1; - border-radius: 100%; - text-align: center; - color: #fff; - background-color: #a1cfd7; -} - - -intro-cap { - margin-bottom: 25px; - text-transform: uppercase; - font-family: 'Raleway', "Helvetica Neue", "Helvetica Neue", Helvetica,Arial,sans-serif; - font-size: 24px; - font-weight: 400; - line-height: 50px; - color:#fff - background-color: #a1cfd7; -} .intro-small { font-family: 'Montserrat' ,'Raleway', "Open Sans Bold", Helvetica, Arial, "Arial Bold", sans-serif; font-size: 20px; @@ -1002,26 +968,7 @@ intro-cap { text-transform: uppercase; color: #FFF; } -intro-headline { - margin-bottom: 25px; - text-transform: uppercase; - font-family: 'Raleway', "Helvetica Neue", "Helvetica Neue", Helvetica,Arial,sans-serif; - font-size: 24px; - font-weight: 400; - line-height: 100px; - color:#fff - background-color: #a1cfd7; -} -h6 intro-smallcap { - margin-bottom: 25px; - text-transform: none; - font-family:'Raleway' , Montserrat,"Helvetica Neue",Helvetica,Arial,sans-serif; - font-size: 18px; - font-weight: 400; - line-height: 50px; - color:#fff - background-color: #a1cfd7; -} + .darkened-container { /* Fallback for web browsers that doesn't support RGBa */ background: rgb(0, 0, 0); @@ -1039,7 +986,7 @@ h6 intro-smallcap { font-size: 14px; line-height: 1.43; height: 86px; /* this is wrong */ - /*color: #484848;*/ + /*color: #484848;*/ } .carousel-indicators li { @@ -1139,7 +1086,7 @@ body { .carousel-control { height: 100%; - + } /* Background images are set within the HTML using inline CSS, not here */ diff --git a/digitalglarus/static/digitalglarus/css/history.css b/digitalglarus/static/digitalglarus/css/history.css index 91de1abf..fd32f198 100644 --- a/digitalglarus/static/digitalglarus/css/history.css +++ b/digitalglarus/static/digitalglarus/css/history.css @@ -88,7 +88,7 @@ header.history { line-height: 75px; } .supportus .intro-headline-big { - font-family: 'Raleway', "Open Sans Bold", Helvetica, Arial, "Arial Bold", + font-family: 'Raleway', "Open Sans Bold", Helvetica, Arial, "Arial Bold", font-size: 2.6em; font-style: normal; font-weight: 800; @@ -96,7 +96,7 @@ header.history { color: #ffffff; line-height: 1; opacity: 0.85; - + } .supportus-box { @@ -114,7 +114,7 @@ header.history { margin: 0; text-align: center; display: block; - max-width: 650px; + max-width: 650px; border: 1px; border-color: #ddd; } @@ -250,6 +250,7 @@ header.history { text-align:center; line-height: 2.5; color: #fff; + margin-bottom: 100px; } .supporter-intro { @@ -269,7 +270,7 @@ header.history { @media (max-width: 979px) .supporter-black{ - width: 100%; + width: 100%; } .supporter-headline { @@ -291,7 +292,7 @@ header.history { background-size: cover; -o-background-size: cover; } - + .glyphicon-star { font-size: 44px; display: block; @@ -339,7 +340,7 @@ header.history { -moz-transition: all .3s; transition: all .3s; }*/ - + #hr.grey { border-color: #ddd; border-width: 1px; diff --git a/digitalglarus/static/digitalglarus/css/ungleich.css b/digitalglarus/static/digitalglarus/css/ungleich.css index 03a2b47c..5d36c26b 100644 --- a/digitalglarus/static/digitalglarus/css/ungleich.css +++ b/digitalglarus/static/digitalglarus/css/ungleich.css @@ -1,4 +1,4 @@ -#page-top #services .container .row .col-lg-12.text-center .section-heading { +#page-top #services .section-heading { font-style: normal; color: #494949; padding-top: 50px; @@ -10,17 +10,13 @@ .intro-cap { font-family: 'Raleway', 'Helvetica Neue', 'Open Sans Bold', Helvetica, Arial, 'Arial Bold', sans-serif; - font-size: 26px; + font-size: 24px; font-style: normal; font-weight: 200; text-transform: uppercase; color: #FFF; } -.intro-cap { - font-size: 24px; -} - .intro-smallcap { font-family: 'Raleway' , "Open Sans Bold", Helvetica, Arial, "Arial Bold", sans-serif; font-size: 22px; diff --git a/digitalglarus/templates/digitalglarus/history.html b/digitalglarus/templates/digitalglarus/history.html index c54a4a72..760f8472 100755 --- a/digitalglarus/templates/digitalglarus/history.html +++ b/digitalglarus/templates/digitalglarus/history.html @@ -4,150 +4,148 @@ {% block content %} - -
-
-
-

-

-
- - Where great minds work - -
+
+
+
+
+ + Where great minds work +
-
-
-
+
+
+
- -
-
-
-
- -

the story of Digital Glarus

- - - -

we fell in love

- - - -

Our crowdfunding success

- - + +
+
+
+ +

the story of Digital Glarus

+ + -
- -

And the story continues..!

- -
-
+

we fell in love

+ + + +

Our crowdfunding success

+ + +
+ +
+ + +

And the story continues..!

+ +
+
+
+
+ + +
+
+ +
+
+ + +
+
+
+
+

Our Supporters

+
+ +

+ {% for supporter in supporters %} + {{ supporter.name }} +
+ {% endfor %} +
+ Become a supporter +

-
+
+ - -
-
- -
- -
- -
-
-
-
-

Our Supporters

-
- -

- - {% for supporter in supporters %} - {{ supporter.name }} -
- {% endfor %} -
- Become a supporter -
-
-
-
-

-
-
-
- - -
-
-
-
-
- +
+
+
+
+

Contact Us

+
+
-
- Digital Glarus
- In der Au 7 Schwanden 8762 Switzerland +
+
+
+ Digital Glarus
+ + In der Au 7 Schwanden 8762 Switzerland
info@digitalglarus.ch
(044) 534-66-22 -

 

-
-
-

 

+
+ +

 

-
- - +
+
{% endblock %} \ No newline at end of file diff --git a/digitalglarus/templates/digitalglarus/index.html b/digitalglarus/templates/digitalglarus/index.html index b57e54b5..03cb2bc0 100644 --- a/digitalglarus/templates/digitalglarus/index.html +++ b/digitalglarus/templates/digitalglarus/index.html @@ -3,251 +3,254 @@ {% block content %} - -
-
-
-

-

-
- - Where great minds work - -
-
-
- -
-

- Book a date today and dive in

- Join now - - -
+ - - -
- - -
-
-
-
-
-
-
Partner of
-
-
-
+ +
+
+
+
+ + Where great minds work + +
-
+
+ +
+

Book a date today and dive in

+ Join now + + {% comment %} +
+
+ + +
+ + +
+
+ +
+ {% endcomment %} +
+ +
+ + + +
+
+
+
Partner of
+
+ + + +
+
+

In Digital Glarus you can..


-
- -
-
-
- + + +
+
+
+ +
-
-
-
- +
+
+ +
-
-
-
- +
+
+ +
-
-
-
- -
-
-
-
-
- +
+
+ +
-
-
-
- -
-
-
-
- -
-
-
-
- +
+
+
+ +
+
+
+
+ +
+
+
+
+ +
+
+
+
+ +
+
- -
-
+
+
+ +
- - -
+ +
-
- - -
-
    -
  • - -
    -
    - -
    -
  • -
-
cultural events
-
- -
-
    -
  • - -
    -
    - -
    -
  • -
-
be inspired
-
- - - -
-
    -
  • - +
    +
      +
    • +
      -
    • -
    -
    workshops
    -
    +
  • +
+
cultural events
+
-
-
    -
  • - +
    +
      +
    • +
      -
      -
    • -
    -
    recharge
    +
    +
  • +
+
be inspired
+
+ +
+
    +
  • + +
    +
    +
    +
  • +
+
workshops
+
+ +
+
    +
  • + +
    +
    +
    +
  • +
+
recharge
+
- - - -
+ - - - - - - - - -
-
-
-
-

Contact Us

-
-
-
- Digital Glarus
- In der Au 7 Schwanden 8762 Switzerland -
info@digitalglarus.ch + +
+ + + + +
+ +
+ +
+
+ +
+ +
+
+ +
+ +
+
+ + + + + + + + +
+ +
+
+
+
+
+

Contact Us

+
+ +
+
+ Digital Glarus
+ In der Au 7 Schwanden 8762 Switzerland +
info@digitalglarus.ch +
+ (044) 534-66-22 +

 

+
+
+

 

+
+
+
+
+
- - - - - {% if request.user.is_authenticated %} - + {% else %}