diff --git a/dynamicweb/settings/base.py b/dynamicweb/settings/base.py index 755969c8..de339f86 100644 --- a/dynamicweb/settings/base.py +++ b/dynamicweb/settings/base.py @@ -443,6 +443,12 @@ PARLER_LANGUAGES = {1: ({'code': 'en-us'}, {'code': 'de'},)} AUTH_USER_MODEL = 'membership.CustomUser' + +ALLOWED_HOSTS = [ + "*" + ] + + # PAYMENT STRIPE_DESCRIPTION_ON_PAYMENT = "Payment for ungleich GmbH services" @@ -455,7 +461,7 @@ REGISTRATION_MESSAGE = {'subject': "Validation mail", STRIPE_API_PRIVATE_KEY = env('STRIPE_API_PRIVATE_KEY') STRIPE_API_PUBLIC_KEY = env('STRIPE_API_PUBLIC_KEY') -DEBUG = False +DEBUG = True if DEBUG: from .local import * diff --git a/hosting/management/commands/create_vm_types.py b/hosting/management/commands/create_vm_types.py index 44995634..493e9e82 100644 --- a/hosting/management/commands/create_vm_types.py +++ b/hosting/management/commands/create_vm_types.py @@ -12,39 +12,41 @@ class Command(BaseCommand): 'core_price': 10, 'memory_price': 5, 'disk_size_price': 1, - 'description': 'VM auf einzelner HW, Raid1, kein HA' + 'description': 'VM auf einzelner HW, Raid1, kein HA', + 'location':'DE' } return { - 'hetzner_nug': { - 'base_price': 5, - 'memory_price': 2, - 'core_price': 2, - 'disk_size_price': 0.5, - 'description': 'VM ohne Uptime Garantie' - }, + # 'hetzner_nug': { + # 'base_price': 5, + # 'memory_price': 2, + # 'core_price': 2, + # 'disk_size_price': 0.5, + # 'description': 'VM ohne Uptime Garantie' + # }, 'hetzner': hetzner, - 'hetzner_raid6': { - 'base_price': hetzner['base_price']*1.2, - 'core_price': hetzner['core_price']*1.2, - 'memory_price': hetzner['memory_price']*1.2, - 'disk_size_price': hetzner['disk_size_price']*1.2, - 'description': 'VM auf einzelner HW, Raid1, kein HA' + # 'hetzner_raid6': { + # 'base_price': hetzner['base_price']*1.2, + # 'core_price': hetzner['core_price']*1.2, + # 'memory_price': hetzner['memory_price']*1.2, + # 'disk_size_price': hetzner['disk_size_price']*1.2, + # 'description': 'VM auf einzelner HW, Raid1, kein HA' - }, - 'hetzner_glusterfs': { - 'base_price': hetzner['base_price']*1.4, - 'core_price': hetzner['core_price']*1.4, - 'memory_price': hetzner['memory_price']*1.4, - 'disk_size_price': hetzner['disk_size_price']*1.4, - 'description': 'VM auf einzelner HW, Raid1, kein HA' - }, + # }, + # 'hetzner_glusterfs': { + # 'base_price': hetzner['base_price']*1.4, + # 'core_price': hetzner['core_price']*1.4, + # 'memory_price': hetzner['memory_price']*1.4, + # 'disk_size_price': hetzner['disk_size_price']*1.4, + # 'description': 'VM auf einzelner HW, Raid1, kein HA' + # }, 'bern': { 'base_price': 12, 'core_price': 25, 'memory_price': 7, 'disk_size_price': 0.70, 'description': "VM in Bern, HA Setup ohne HA Garantie", + 'location':'CH', } } diff --git a/hosting/migrations/0017_virtualmachinetype_location.py b/hosting/migrations/0017_virtualmachinetype_location.py new file mode 100644 index 00000000..445ff4f0 --- /dev/null +++ b/hosting/migrations/0017_virtualmachinetype_location.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.4 on 2016-05-19 04:14 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('hosting', '0016_delete_railsbetauser'), + ] + + operations = [ + migrations.AddField( + model_name='virtualmachinetype', + name='location', + field=models.CharField(choices=[('DE', 'Germany'), ('CH', 'Switzerland')], default='DE', max_length=3), + preserve_default=False, + ), + ] diff --git a/hosting/models.py b/hosting/models.py index 8b26189a..e2775fc4 100644 --- a/hosting/models.py +++ b/hosting/models.py @@ -17,6 +17,8 @@ class VirtualMachineType(models.Model): HETZNER_R6 = 'hetzner_raid6' HETZNER_G = 'hetzner_glusterfs' BERN = 'bern' + DE_LOCATION = 'DE' + CH_LOCATION = 'CH' HOSTING_TYPES = ( (HETZNER_NUG, 'Hetzner No Uptime Guarantee'), @@ -26,12 +28,17 @@ class VirtualMachineType(models.Model): (BERN, 'Bern'), ) + LOCATIONS_CHOICES = ( + (DE_LOCATION, 'Germany'), + (CH_LOCATION, 'Switzerland'), + ) description = models.TextField() base_price = models.FloatField() memory_price = models.FloatField() core_price = models.FloatField() disk_size_price = models.FloatField() hosting_company = models.CharField(max_length=30, choices=HOSTING_TYPES) + location = models.CharField(max_length=3, choices=LOCATIONS_CHOICES) def __str__(self): return "%s" % (self.get_hosting_company_display()) @@ -65,6 +72,8 @@ class VirtualMachineType(models.Model): 'hosting_company_name': self.get_hosting_company_display(), 'hosting_company': self.hosting_company, 'default_price': self.defeault_price(), + 'location_code': self.location, + 'location': self.get_location_display(), 'id': self.id, } diff --git a/hosting/static/hosting/css/pricing.css b/hosting/static/hosting/css/pricing.css index 7fb6f51f..227be49d 100644 --- a/hosting/static/hosting/css/pricing.css +++ b/hosting/static/hosting/css/pricing.css @@ -33,7 +33,7 @@ .pricing li.type { list-style: none; padding: 13px; - height: 200px; + height: 150px; } .pricing big { @@ -72,6 +72,16 @@ box-shadow: inset 0px 2px 2px rgba(0, 0, 0, 0.1); } /* pricing color */ + +.p-black big, +.p-black h3 { + color: black; +} + +.p-black button { + background: black; +} + .p-green big, .p-green h3 { color: #4c7737; diff --git a/hosting/static/hosting/img/CH_flag.png b/hosting/static/hosting/img/CH_flag.png new file mode 100644 index 00000000..340a398a Binary files /dev/null and b/hosting/static/hosting/img/CH_flag.png differ diff --git a/hosting/static/hosting/img/DE_flag.png b/hosting/static/hosting/img/DE_flag.png new file mode 100644 index 00000000..d4f4526e Binary files /dev/null and b/hosting/static/hosting/img/DE_flag.png differ diff --git a/hosting/static/hosting/js/pricing.js b/hosting/static/hosting/js/pricing.js index 814b4aa9..113439a6 100644 --- a/hosting/static/hosting/js/pricing.js +++ b/hosting/static/hosting/js/pricing.js @@ -49,5 +49,9 @@ $( document ).ready(function() { $('.disk-space-selector').on('change',change_attribute); + //Disable input + $('.disk-space-selector').keypress(function(event){ + event.preventDefault(); + }); }); \ No newline at end of file diff --git a/hosting/templates/hosting/base_short.html b/hosting/templates/hosting/base_short.html index 339020de..8b3f0dbb 100644 --- a/hosting/templates/hosting/base_short.html +++ b/hosting/templates/hosting/base_short.html @@ -81,23 +81,23 @@ {% else %}
  • - How it works + How it works
  • - Your infrastructure + Your infrastructure
  • - Our inftrastructure + Our inftrastructure
  • - Pricing + Pricing
  • - Contact + Contact
  • Login -
  • + {% endif %} @@ -123,21 +123,22 @@
  • - How it works + How it works
  • - Your infrastructure
  • + Your infrastructure
  • - Our infrastructure
  • + Our infrastructure
  • - Pricing + Pricing
  • - Contact + Contact
  • + diff --git a/hosting/templates/hosting/includes/_pricing.html b/hosting/templates/hosting/includes/_pricing.html index 98e90196..1f4e308e 100644 --- a/hosting/templates/hosting/includes/_pricing.html +++ b/hosting/templates/hosting/includes/_pricing.html @@ -1,3 +1,4 @@ +{% load staticfiles %}
    @@ -6,7 +7,6 @@

    Hosting Price

    -

    Here are samples of our {{ hosting_long }} hosting offers, suited for different projects. Our offer examples come in different size, speed, and storage.

    @@ -17,17 +17,31 @@
    -
    +
    {% for vm in vm_types %} -
    +
    {% csrf_token %} -
      + + +
      • {{vm.hosting_company_name}}

        +
        + + +
      • +
      • + +
        +
        + + {{vm.location}} +
        +
      • @@ -64,7 +78,7 @@
        - + GiB
        @@ -75,7 +89,7 @@ per month
      • - +
      diff --git a/hosting/templates/hosting/login.html b/hosting/templates/hosting/login.html index 4521553c..0c772da6 100644 --- a/hosting/templates/hosting/login.html +++ b/hosting/templates/hosting/login.html @@ -5,6 +5,17 @@